For AssistGPT, what are the best prompt practices learned so far? With customers turning on AssistGPT for the trial, it would be important to be aware of best practices so that we can better guide customers to a successful implementation and a better first impression of the product.
Thank you!
Apart from the best practices mentioned by OpenAI in their help docs,
I usually get the need to get the output response in a specific format. You can adopt the below strategies to ensure the output is in a specific format, whether standard (like HTML, Markdown, or CSV) or customized.
Standard Output Format (HTML or Markdown)
Use-case: Improve article structure
Solution: Specify the desired format at the end of the instruction.
Prompt:
Your task is to improve the article's structure so that it is concise and easy to read.
###
Article content:
{{article.content}}
Your output in HTML:
This approach ensures the output is formatted in HTML, making it easy to integrate into web pages or other applications requiring HTML content.
Specific Format Example
Use-case: Summarize a chat transcript
Solution: Provide a detailed format template within the instruction.
Prompt:
Create the summary of the below 'Chat transcript'. Your output should follow this format:
<b>Summary:</b> Provide a brief summary of the conversation.
<b>Problem of the customer:</b> State the main issue(s) raised by the customer.
<b>Agent Outstanding Action Items:</b> List in detail any tasks the agent has committed to doing. Be specific about what the agent promised to do.
###
Chat transcript:
{{chat.transcript}}
###
Your output:
This prompt ensures the summary is structured and comprehensive, covering key aspects like the summary, customer issues, and agent action items.
Tips for Creating Effective Prompts
- Clarity: Be clear and specific about what you want the output to include. Ambiguity can lead to unexpected results.
- Structure: Use headings, bullet points, and numbered lists to define the format. This helps in organizing the response.
- Context: Provide sufficient context for the task. If the model understands the background, it can generate more relevant outputs.
- Examples: Including examples of the expected output can guide the model to produce similar results.
- Iterate: Experiment with different phrasing and structures to find what works best for your specific use case.
By incorporating these practices, you can enhance the effectiveness of your prompts and achieve outputs that meet your exact needs.
For more complex use cases we can use two techniques, Chain of Though Prompting and Few-Shot Prompting.
Chain of Thought Prompting asks the model to describe the intermediate steps used to reason its way to a final answer within one response. This is useful because asking the model to generate an output this way will show you it’s reasoning behind its generated output.
Along with this it’s useful to provide examples in the instructions so that the model can learn exactly what it needs to do. This technique is called Few-Shot Prompting. Depending on the use-case and output you may need to add more than one example.
Chain of Thought Prompting and Few-Shot Prompting
Use-case: Classifying a Chat Transcript
Solution: Provide the model steps to take before generating an output. These steps are used for reasoning in order to justify it’s output (Second paragraph of prompt). Provide examples of an output so that the model learns how the output is expected and how it should reason (Example 1).
Prompt:
You are a classifier based on given chat transcripts you tag classifications from a given list of 'classifications'. The classifications are actually a tree but it will be given to you in the flat format. For example, one branch of the classification tree can be 'credit card' as a parent with 'cancel', 'fraud' as children and 'fraud' can have further 'online', 'offline' which are grandchildren then the classification tree will be given to you as: 'credit card', 'credit card - cancel', 'credit card - fraud', 'credit card - fraud - online', 'credit card - fraud - offline'. I want you to carefully analyze the 'chat transcript' provided between an agent and a customer and determine the relevant classification categories.
For this task, First, list CLUES (i.e., keywords, phrases, contextual information, semantic relations, semantic meaning, references) that support the classification determination of the 'chat transcript'.
Second, deduce the diagnostic REASONING process from the premises (i.e., clues, 'chat transcript:') that supports the 'chat transcript' classification determination.
Third, based on clues, reasoning, check and 'chat transcript', begin with the primary parent category classification, followed by any child or grandchild categories if relevant.
###
Below are some example chat transcripts with CLUES, REASONING and the final output CLASSIFICATION. The transcripts are instructed to be tagged from the following list of classifications: order, order - refund, order - status, order - exchange, product, product - damaged, product - info, order - shipping, product - financing options, None
Example 1:
Chat Transcript:
User: Hi, I ordered a tablet from you, and I have a couple of questions.
Agent: Of course! Please go ahead with your questions.
User: First, can you provide some information about the tablets specifications?
Agent: Absolutely! The tablet features a 10-inch HD display, 4GB RAM, 64GB internal storage, and runs on the latest Android OS. It also has a dual camera setup: 8MP rear and 5MP front.
User: Sounds good. Also, the tablet arrived with a minor scratch on the back. Is it possible to exchange it?
Agent: Im truly sorry about that. We can definitely arrange an exchange for you. Once you return the scratched tablet, well ship a new one to you.
User: Lastly, Id also like to know about the financing options if I decide to buy another tablet for my sister. Can we do it online?
Agent: Yes, we do offer online financing. You can apply through our website for instant approval. The interest rate is 0% APR if paid within 12 months.
CLUES:
• "information about the tablet's specifications"
• "tablet arrived with a minor scratch"
• "financing options"
• "buy another tablet"
• "do it online"
REASONING:
• The user seeks specific product details, which points to a need for product information.
• Mention of a damaged product (scratch) and the discussion about exchange indicates a product damage context.
• The conversation shifts to purchasing another product with financing, specifically through online means, leading to the online financing classification
CLASSIFICATION:
product - info, product - damaged, product - financing – online
This prompt ensure that the model breaks down this complex task into separate steps in order to ensure better reasoning when generating the classifications. It also learns how to use the steps and provide it’s reasoning through the example which was given to it.