Skip to main content
how to get better prompt results

Optimizing Prompts for Better Results from LLMs

I recently came across an insightful research paper titled “Principled Instructions Are All You Need for Questioning LLaMA-1/2, GPT-3.5/4.” This paper sheds light on the most effective ways to interact with AI like ChatGPT.

The document is a research paper that discusses methods for optimizing the interaction (writing better prompts) with large language models (LLMs) like GPT-3.5 and GPT-4 by improving the way prompts (questions or commands) are structured. The paper presents 26 principles for creating prompts that lead to better, more accurate responses from these models. Here's a simplified summary along with examples from the document:

How to get better prompt results!

Purpose of the Study:
  • The study aims to make it easier for both developers and general users to interact with LLMs by improving the quality of the prompts given to these models.
Principles for Better Prompts:
  • The researchers identified 26 principles to help users create better prompts. These principles are divided into categories like Prompt Structure, Specificity, User Interaction, Content Style, and Handling Complex Tasks.
  • For example, one principle suggests being direct and avoiding overly polite language like "please" or "thank you" for more concise answers. 
  • Another principle advises breaking down complex tasks into a sequence of simpler prompts.
Experiment and Get better Prompt Results:
  • The researchers conducted experiments to test these prompt principles using models like GPT-3.5 and GPT-4. They found that applying these prompt principles improved the quality and accuracy of the results from these models. 
  • For instance, when the principle of providing an unbiased viewpoint was applied to a prompt about climate change, the LLM gave a more comprehensive response, acknowledging different perspectives on the issue.
Examples of Prompts and Responses:
  • The document includes examples showing how the application of these principles changes the responses of the LLMs.
  •  Example 1: Without the principle, a prompt about climate change received a straightforward response from the model. With the principle applied, the model's response included a broader range of perspectives on the topic.
  • Example 2: In logical reasoning, a simple question about roses and flowers received a clear, logical answer. The model carefully analyzed the statement and correctly concluded that it cannot be inferred that some roses fade quickly based on the information given.
Conclusions:
  • The study concludes that by carefully crafting prompts according to these principles, users can significantly improve the performance of LLMs, making them more effective tools for various tasks. In essence, the paper provides a guide on how to interact with sophisticated language models more effectively by structuring prompts in a way that elicits the best possible responses.

Get better Prompt Results

The document lists 26 principles for structuring prompts to optimize interaction with large language models. Here are the principles along with a brief explanation of each as well as links to examples I added. Here are the prompt principles grouped by function.

1. Be Direct:

Avoid polite phrases like "please" or "thank you" to get straight to the point.

Here's an example illustrating Principle 1, which emphasizes being direct in the prompts: Get better prompt results using these Examples!

2. Audience Awareness:

Include the intended audience in the prompt, like "the audience is an expert in the field." Example for Principle 2. Get better prompt results using these Examples!

3. Task Breakdown: 

Split complex tasks into a sequence of simpler, interactive prompts. Get better prompt results using these Examples!

4. Affirmative Directives: 

Use affirmative language such as 'do' and avoid negative language like 'don’t'.  Get better prompt results using these Examples!

5. Clarity in Explanation: 

When clarity or a deep understanding is needed, use prompts like "Explain [specific topic] in simple terms" or "Explain to me like I’m 11 years old." Get better prompt results using these Examples!

6. Incentive Mention: 

Add a phrase like "I’m going to tip $xxx for a better solution!" to encourage better responses. Get better prompt results using these Examples!

7. Example-Driven Prompting: 

Use few-shot prompting by starting your prompt with ‘###Instruction###’ followed by ‘###Example###’ or ‘###Question###’, then separate the content with line breaks. Get better prompt results using these Examples!

8. Organize clearly:

Separate instructions, examples, questions and answers with lines or headings. Get better prompt results using these Examples!

9. Explicit Instructions: 

Incorporate phrases like "Your task is" and "You MUST." Get better prompt results using these Examples!

10. Penalty Mention: 

Use phrases like "You will be penalized" to guide the model's response. Get better prompt results using these Examples!

11. Natural Response:

Request a response in a natural, human-like manner. Get better prompt results using these Examples!

12. Step-by-Step Thinking: 

Encourage step-by-step reasoning by using leading words like "think step by step." Get better prompt results using these Examples!

13. Unbiased Response: 

Ask for an unbiased answer and avoid relying on stereotypes. Get better prompt results using these Examples!

14. Interactive Questioning: 

Allow the model to ask questions to gather enough information for the needed output. Get better prompt results using these Examples!

15. Teaching Request: 

Use phrases like "Teach me any [theorem/topic/rule name]" and include a test at the end to check your understanding. Get better prompt results using these Examples!

16. Role Assignment:

 Assign a specific role to the language model. Get better prompt results using these Examples!

17. Use of Delimiters: 

Structure your prompts with clear delimiters. Get better prompt results using these Examples!

18. Repetition for Emphasis: 

Repeat a specific word or phrase within a prompt. Get better prompt results using these Examples!

19. Combined Approach: 

Merge Chain-of-Thought with few-shot prompts. Example!

20. Output Priming: 

Conclude your prompt with the beginning of the desired output. Get better prompt results using these Examples!

21. Detailed Writing: 

Request detailed writing on a topic, ensuring all necessary information is included. Get better prompt results using these Examples!

22. Text Revision: 

Ask the model to revise text, improving grammar and vocabulary while maintaining the original style. Get better prompt results using these Examples!

23. Complex Coding Tasks:

For coding across multiple files, instruct the model to generate a script for file creation or code insertion. Get better prompt results using these Examples!

24. Text Continuation: 

Provide the beginning of a text and ask the model to continue it, maintaining a consistent flow. Get better prompt results using these Examples!

25. Requirement Clarity: 

Clearly state the requirements for content production in terms of keywords, regulations, hints, or instructions. Get better prompt results using these Examples!

26. Style Matching: 

For writing similar to a provided sample, instruct the model to use the same language style. Get better prompt results using these Examples!

Using these prompt principles will help you get better prompt results.