Writing best prompts is essential in the AI age, but our laziness always gets in the way: we only write some generic instructions without thoroughly studying or researching how different prompts lead to different levels of quality in the answers given by ChatGPT.
Referencing from OpenAI’s own website, here are the Six strategies for getting better results, the key is “The less the model has to guess at what you want, the more likely you’ll get it.”
For example, when I type in generic instruction “provide reviews in bullet points for …. ” versus “provide reviews again but with below requirements:
You will be presented with user reviews and your job is to provide a set of tags from the following list. Provide your answer in bullet point form. Choose ONLY from the list of tags provided here (choose either the positive or the negative tag but NOT both):
- Provides good value for the price OR Costs too much
- Works better than expected OR Did not work as well as expected
- Includes essential features OR Lacks essential features
- Easy to use OR Difficult to use
- High quality and durability OR Poor quality and durability
- Easy and affordable to maintain or repair OR Difficult or costly to maintain or repair
- Easy to transport OR Difficult to transport
- Easy to store OR Difficult to store
- Compatible with other devices or systems OR Not compatible with other devices or systems
- Safe and user-friendly OR Unsafe or hazardous to use
- Excellent customer support OR Poor customer support
- Generous and comprehensive warranty OR Limited or insufficient warranty"
The output is drastically different.
- clear, with specifics
- adopt a persona, could be SYSTEM: When I ask for help to write something, you will reply with a document that contains at least one joke or playful comment in every paragraph.
- use delimiters, Delimiters like triple quotation marks, XML tags, section titles, etc. can help demarcate sections
<article> insert first article here </article>
Abstract: insert abstract here Title: insert title here - specify steps for complex task, Use the following step-by-step instructions to respond to user inputs. Step 1 – The user will provide you with text in triple quotes. Summarize this text in one sentence with a prefix that says “Summary: “. Step 2 – Translate the summary from Step 1 into Spanish, with a prefix that says “Translation: “.
- provide examples, SYSTEM: Answer in a consistent style. USER: Teach me about patience. ASSISTANT: The river that carves the deepest valley flows from a modest spring; the grandest symphony originates from a single note; the most intricate tapestry begins with a solitary thread. USER: Teach me about the ocean.
- specify the desired length
- use reference text
Use the provided articles delimited by triple quotes to answer questions. If the answer cannot be found in the articles, write “I could not find an answer.” - instruct it to answer citation from reference text, You will be provided with a document delimited by triple quotes and a question. Your task is to answer the question using only the provided document and to cite the passage(s) of the document used to answer the question. If the document does not contain the information needed to answer this question then simply write: “Insufficient information.” If an answer to the question is provided, it must be annotated with a citation. Use the following format for to cite relevant passages ({“citation”: …}).
- use intent classification, common in customer service


10. Give model time to think

11. Inner monologue



12. use embeddings-based search to implement knowledge retrieval
13. use code execution

14. give model access to function calling: The Chat Completions API allows passing a list of function descriptions in requests. This enables models to generate function arguments according to the provided schemas. Generated function arguments are returned by the API in JSON format and can be used to execute function calls. Output provided by function calls can then be fed back into a model in the following request to close the loop. This is the recommended way of using OpenAI models to call external functions. To learn more see the function calling section in our introductory text generation guide and more function calling examples in the OpenAI Cookbook.
15. Systematic evals: Evaluation of outputs can be done by computers, humans, or a mix. Computers can automate evals with objective criteria (e.g., questions with single correct answers) as well as some subjective or fuzzy criteria, in which model outputs are evaluated by other model queries. OpenAI Evals is an open-source software framework that provides tools for creating automated evals.
16. evaluate model with reference to gold standard answer


in the end do know when to use system, user and assistant: In ChatGPT, system, user, and assistant roles define how different components of the conversation operate.
The system role is used to set the behavior, tone, and guidelines for the assistant. It provides background instructions that the assistant should follow throughout the conversation. example system: “You are a helpful, concise assistant. Always prioritize user satisfaction, and keep responses brief.”
The user role is the input from the person interacting with ChatGPT. It represents the questions or commands given by the user. it could be shown up as examples in instructions
The assistant role represents ChatGPT’s response. It is the assistant’s output based on the user’s input and system instructions. assistant: “Recursion is a programming technique where a function calls itself in order to solve a problem. It typically has a base case to stop the recursive calls.”
in API, we could feed in system and user as following:
# Construct the full prompt
full_prompt = f"""Question: {prompt}
Relevant information:
{combined_relevant_content}
Please answer the question based on the relevant information provided above. If the information is not sufficient to answer the question, please state that clearly and explain why."""
messages=[
{
"role": "system",
"content": "You are an AI assistant specialized in helping users find and analyze information. When providing responses, format them with bullet points for clarity and separate lines for readability. Always base your answers on the provided relevant information. If the information is not sufficient to answer the question, state that clearly and explain why. Do not make up or infer information not present in the provided content."
},
{
"role": "user",
"content": full_prompt
}
],
In “Prompt Engineering’s recent blog, he demoed the idea I had in mind, which is that chatGPT-O1 seems magical but actually a lengthy, step-by-step, or chain of thoughts prompt can realize. Hence, I guess the OpenAI employees there work every day to optimize the prompts, woven into the black box and then push this to the market, calling it a new version O1.
https://www.youtube.com/watch?v=Oasl9rSJNds
It involves multiple agents, each agent has a thorough detailed workflow: analyze problem, planning, solve problem, reflection, critique…
and he use gemini-1.5-flash-exp-0827 model as it can do the coding to implement complex task

there are more complex poem writing challenges, with such prompting, GPT-O can solve :






