This is a solid start, but to get consistent, high-quality results from an LLM, we need to tighten the definitions, remove logical contradictions, and enforce stricter formatting.Here is a breakdown of the issues in the original draft and three improved versions depending on your specific needs.What needed improvement?Logical Contradiction: You stated the patterns are "subsequent to errors," but UR5 is "Positive Feedback." If the feedback is positive, there likely wasn't an error. I have broadened the scope to "User Feedback Analysis."Ambiguity between UR1 and UR2: "Repeating" (UR1) and "Correcting" (UR2) often overlap. I have sharpened the definitions to distinguish between restating intent vs. explicitly correcting a specific mistake.Scope: The prompt didn't specify which part of the dialogue to analyze (the whole thing? just the last line?).Output Hygiene: To ensure the output doesn't include "Here is your JSON," I added constraints to output only JSON.Option 1: The "Robust & Strict" VersionBest for automated systems or API use where you need clean JSON and strict adherence to rules.Prompt:PlaintextYou are an expert dialogue analyst. Your task is to classify the User's latest response in a conversation based on their reaction to the Assistant's previous turn.
Classify the response into exactly one of the following categories:
- Repeat or Rephrase (UR1): The user restates their original intent or rephrases their request because the assistant missed it. They do not explicitly point out why the assistant was wrong, they just try again.
- Make Aware with Correction (UR2): The user explicitly points out the error AND provides the correct information to fix it (e.g., "No, I said Tuesday, not Thursday").
- Make Aware without Correction (UR3): The user points out the error or expresses dissatisfaction but does not provide the correct information (e.g., "That is incorrect," "You are not listening").
- Ask for Clarification (UR4): The user questions the assistant's output or asks for verification (e.g., "Are you sure that's right?").
- Positive Feedback (UR5): The user confirms the assistant succeeded, offers thanks, or indicates satisfaction.
- No Feedback: The user response contains no feedback regarding the assistant's performance (e.g., simply continuing the conversation naturally).
Input Data:
[Insert Dialogue Here]
Instructions:
- Analyze only the last user utterance in the provided dialogue.
- Output valid JSON only. Do not add markdown formatting (like ```json).
Output Format:
{
"User Response Pattern": "UR1" | "UR2" | "UR3" | "UR4" | "UR5" | "No Feedback",
"User Response Text": "The exact text of the user response"
}
Option 2: The "Few-Shot" Version (Highly Recommended)LLMs learn best by example. This version includes examples ("shots") to clarify the tricky distinction between rephrasing (UR1) and correcting (UR2).Prompt:PlaintextAnalyze the final user response in the following dialogue to determine the user's feedback pattern.
Categories:
- UR1 (Repeat/Rephrase): User simply repeats/rephrases intent.
- UR2 (Correction): User explicitly notes the error and fixes it.
- UR3 (Negative/Error Flag): User notes the error but gives no fix.
- UR4 (Clarification): User asks if the bot is sure.
- UR5 (Positive): User thanks or confirms success.
- No Feedback: User continues conversation normally or provides neutral input.
Examples:
Example 1 (UR1):
User: I need a flight to London.
Assistant: Booking a flight to Lisbon.
User: I want to go to London.
-> {"User Response Pattern": "UR1", "User Response Text": "I want to go to London."}
Example 2 (UR2):
User: I need a flight to London.
Assistant: Booking a flight to Lisbon.
User: No, you misunderstood. I said London, not Lisbon.
-> {"User Response Pattern": "UR2", "User Response Text": "No, you misunderstood. I said London, not Lisbon."}
Example 3 (UR5):
User: Set an alarm for 7 AM.
Assistant: Alarm set.
User: Thanks, that's great.
-> {"User Response Pattern": "UR5", "User Response Text": "Thanks, that's great."}
Task:
Analyze the following dialogue and output the result in JSON format.
Dialogue:
[Insert Dialogue Here]
Option 3: The "Chain of Thought" VersionBest for difficult or ambiguous dialogues. It asks the AI to explain its reasoning before assigning a label, which usually results in higher accuracy.Prompt:PlaintextReview the conversation below and identify the pattern of the user's final response regarding the assistant's performance.
Definitions:
- UR1: Repeat or Rephrase (Restating intent).
- UR2: Make Aware with Correction (Pointing out error + fixing it).
- UR3: Make Aware without Correction (Pointing out error only).
- UR4: Ask for Clarification (Doubting the output).
- UR5: Positive Feedback (Praise/Thanks).
- No Feedback: Neutral continuation.
Dialogue to Analyze:
[Insert Dialogue Here]
Response Instruction:
- First, explain your reasoning. Briefly analyze the relationship between the Assistant's last turn and the User's response.
- Then, provide the final JSON output.
Format:
Reasoning: [Your analysis]
JSON:
{
"User Response Pattern": "[Insert Pattern Code]",
"User Response Text": "[Insert Text]"
}
Next StepWould you like me to test one of these prompts against a specific sample dialogue to see if it categorizes it correctly?