This prompt serves as the first stage in a structured correction-handling pipeline, specifically designed to classify a user's correction of a prior assistant turn into one of six distinct intent types: factual, logical, procedural, format, slot-value, or intent-misclassification. The primary job-to-be-done is to provide a reliable, structured signal that downstream routing logic can use to select the appropriate repair strategy. For example, a factual correction might trigger a claim reversal and evidence re-retrieval, while a format correction might only require output restructuring without invalidating the underlying data. The ideal user is an AI engineer or dialogue system architect building a multi-turn assistant product where user trust depends on graceful error recovery.
Prompt
Correction Intent Classification Prompt Template

When to Use This Prompt
Defines the operational boundaries and prerequisites for the Correction Intent Classification prompt to prevent misapplication in production pipelines.
This prompt assumes strict prerequisites: an upstream detection module has already flagged the user turn as a potential correction, and a prior assistant turn exists in the session context. It is not designed for general intent classification, new topic detection, or single-turn Q&A where no assistant output exists to correct. Using it without a prior assistant turn will produce meaningless classifications. The prompt requires two inputs at minimum: the prior assistant output that is being corrected and the user's correction turn. Optionally, you can include session context or tool call history to improve accuracy on procedural and slot-value corrections. The output is a structured JSON object containing a classification label and a confidence score between 0.0 and 1.0, enabling threshold-based routing decisions.
Do not use this prompt when the user is asking a clarifying question, providing new information unrelated to prior assistant output, or shifting topics entirely. These cases should be filtered out by the upstream correction detection module. If your system lacks a separate detection step, you risk false positives where normal user turns are incorrectly classified as corrections, leading to unnecessary state rollbacks or confusing acknowledgments. For high-stakes domains such as healthcare or legal applications, always route low-confidence classifications (below your defined threshold) to a human reviewer rather than automatically executing state changes. The next step after classification is to route the labeled correction to a specialized repair prompt matched to the intent type, such as a claim reversal prompt for factual corrections or a state rollback prompt for slot-value corrections.
Use Case Fit
Where this prompt works and where it does not. Use these cards to decide if correction intent classification is the right tool for your dialogue state manager.
Good Fit: Explicit User Corrections
Use when: Users directly state the assistant is wrong, such as 'That's not right,' 'You misunderstood,' or 'Actually, it's X not Y.' The prompt reliably detects explicit correction signals and classifies the type. Guardrail: Pair with a confidence threshold; route low-confidence classifications to a clarification prompt instead of assuming correction intent.
Bad Fit: Ambiguous or Implicit Pushback
Avoid when: Users express doubt without clear correction language, such as 'Hmm, are you sure?' or 'I thought it was different.' These turns often blend clarification requests with corrections. Guardrail: Use a separate implicit correction recognition prompt for these cases; this classifier is tuned for explicit correction signals and will produce low-confidence or incorrect labels on ambiguous input.
Required Inputs: Prior Turn and Current Turn
Risk: Classifying a user turn in isolation produces false positives—many statements look like corrections without the assistant's prior claim as context. Guardrail: Always provide the assistant's immediately preceding response and the current user turn. For multi-turn corrections, include the specific assistant claim being challenged, not the full history.
Operational Risk: Correction Type Overlap
Risk: User corrections frequently span multiple types—a factual error may also involve a slot-value mistake, or a procedural correction may contain a logical disagreement. Single-label classification forces false precision. Guardrail: Allow multi-label output or a primary type with secondary flags. Test with the confusion matrix across overlapping categories and monitor for cases where the primary label misses the operational action needed.
Operational Risk: Correction Cascades
Risk: Accepting a correction without checking downstream state dependencies can leave the dialogue in an inconsistent state—later turns may still reference the incorrect claim. Guardrail: After classification, trigger a state rollback check before acting on the correction. The classification prompt should not decide what to do; it should only label the correction type for the state manager to consume.
Bad Fit: Non-Correction User Turns
Risk: New questions, topic shifts, or follow-up requests can contain words that superficially resemble corrections, producing false positives that trigger unnecessary repair workflows. Guardrail: Route through a correction-vs-new-topic detector before this classifier. If the turn is not a correction, skip classification entirely to avoid polluting state with spurious correction events.
Copy-Ready Prompt Template
A reusable prompt template with square-bracket placeholders for classifying user correction intent in dialogue systems.
This prompt template is designed to be copied directly into your prompt management system, IDE, or orchestration layer. It classifies a user turn that has been flagged as a correction into one of six intent types: factual, logical, procedural, format, slot-value, or intent-misclassification. The template expects you to supply the prior assistant output, the current user turn, and any relevant conversation context. Replace every square-bracket placeholder before sending the prompt to the model. The output is a JSON object with a classification label and a confidence score, suitable for routing to the appropriate correction handler.
textYou are a dialogue state classifier for an AI assistant. Your task is to classify the user's correction intent based on the assistant's prior output and the user's current turn. ## INPUT - Assistant's prior output: [ASSISTANT_PRIOR_OUTPUT] - User's current turn: [USER_CURRENT_TURN] - Conversation context (last 3 turns): [CONVERSATION_CONTEXT] ## CLASSIFICATION TAXONOMY Choose exactly one label from the following: - `factual`: The user is correcting a specific fact, claim, date, name, number, or piece of information the assistant stated. - `logical`: The user is correcting flawed reasoning, a contradiction, an invalid inference, or a causal error in the assistant's response. - `procedural`: The user is correcting the sequence of steps, workflow order, or process the assistant described. - `format`: The user is correcting the output structure, such as JSON shape, markdown formatting, list style, or schema compliance. - `slot-value`: The user is correcting a specific field, parameter, or slot value in a structured output or form the assistant produced. - `intent-misclassification`: The user is indicating the assistant misunderstood their original request or goal entirely. ## CONSTRAINTS - If the user's turn contains multiple correction types, choose the primary (most impactful) type. - If the correction is ambiguous between two types, prefer the more specific type (e.g., `slot-value` over `factual` when a specific field is named). - If the user's turn does not contain a correction, output `none` with confidence 0.0. - Do not invent a label outside the taxonomy. ## OUTPUT SCHEMA Return ONLY a valid JSON object with no additional text, markdown fences, or commentary: { "correction_type": "<label>", "confidence": <float between 0.0 and 1.0>, "rationale": "<one-sentence explanation of why this label was chosen>" } ## EXAMPLES Example 1: Assistant: "The meeting is scheduled for Tuesday at 3 PM." User: "No, it's Wednesday at 2 PM." Output: {"correction_type": "factual", "confidence": 0.97, "rationale": "User directly corrects a specific date and time claim."} Example 2: Assistant: "First, deploy the backend, then run database migrations." User: "You have to run migrations before deploying." Output: {"correction_type": "procedural", "confidence": 0.95, "rationale": "User corrects the order of operational steps."} Example 3: Assistant: "That's not what I asked for. I wanted a summary, not a list." User: (turn after assistant produced a bullet list) Output: {"correction_type": "format", "confidence": 0.92, "rationale": "User explicitly requests a different output structure."}
Adaptation guidance: Replace [ASSISTANT_PRIOR_OUTPUT] with the exact text the assistant last produced. [USER_CURRENT_TURN] should be the raw user message that triggered correction detection. [CONVERSATION_CONTEXT] should include the last 2-3 turns for disambiguation, especially when the correction references earlier statements. If your system uses a different taxonomy, replace the six labels and their descriptions while keeping the output schema consistent. For high-stakes domains like healthcare or finance, add a [RISK_LEVEL] placeholder and a constraint that low-confidence classifications (below 0.7) must route to human review rather than automated correction handlers.
Validation and testing: Before deploying this prompt, run it against a confusion matrix test set covering all six correction types plus none cases. Pay special attention to overlapping types—for example, a user correcting a date inside a structured form could be factual or slot-value. Your eval harness should measure precision and recall per label, not just overall accuracy. Flag any classification where confidence exceeds 0.8 but the label is wrong; these are the failures that will silently route corrections to the wrong handler in production.
Prompt Variables
Inputs the prompt needs to work reliably. Validate each before sending.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[USER_TURN] | The current user message to classify for correction intent | Actually, the API endpoint is /v2/orders not /v1/orders | Non-empty string. Must be the raw user input. Check for null, empty, or whitespace-only strings before sending. |
[ASSISTANT_PRIOR_TURN] | The assistant's immediately preceding response that the user may be correcting | The API endpoint for order creation is POST /v1/orders with the following parameters... | Non-empty string. Must be the last assistant message. If no prior assistant turn exists, set to null and skip classification. |
[CONVERSATION_HISTORY] | Up to N prior turns for context when the correction references earlier messages | [{"role": "user", "content": "..."}, {"role": "assistant", "content": "..."}] | Array of turn objects with role and content. Truncate to last 5 turns. Validate each turn has non-empty content. Null allowed if no history. |
[CORRECTION_CATEGORIES] | The set of correction types the classifier must choose from | ["factual", "logical", "procedural", "format", "slot-value", "intent-misclassification"] | Non-empty array of strings. Must match the downstream routing logic. Validate against allowed enum values before prompt assembly. |
[CONFIDENCE_THRESHOLD] | Minimum confidence score required to accept a classification without escalation | 0.75 | Float between 0.0 and 1.0. If model confidence is below this value, route to human review or clarification. Validate as numeric and in range. |
[OUTPUT_SCHEMA] | The expected JSON structure for the classification result | {"correction_type": "factual", "confidence": 0.92, "target_span": "POST /v1/orders", "rationale": "User provided corrected endpoint"} | Valid JSON schema object. Must include correction_type, confidence, target_span, and rationale fields. Validate schema completeness before prompt assembly. |
[MAX_OUTPUT_TOKENS] | Token budget for the classification response to prevent runaway generation | 256 | Integer greater than 0. Set conservatively since classification outputs are short. Validate as positive integer. Typical range: 128-512. |
[TEMPERATURE] | Sampling temperature for classification determinism | 0.0 | Float between 0.0 and 1.0. Use 0.0 for deterministic classification. Validate as numeric and in range. Higher values risk inconsistent category assignment. |
Implementation Harness Notes
How to wire the Correction Intent Classification prompt into a production dialogue system with validation, routing, and monitoring.
The Correction Intent Classification prompt is designed to operate as a lightweight, pre-processing step within a larger dialogue management pipeline. Its primary job is to inspect an incoming user turn and the assistant's prior output to produce a structured classification label and confidence score. This classification then drives downstream routing: a factual correction might trigger a claim reversal and state rollback, while a format correction might only require re-rendering the last response. The prompt should be called synchronously before any new assistant generation begins, ensuring the system understands the user's corrective intent before committing to a new response or tool call. This is not a standalone chat prompt; it is a classification microservice that returns JSON to be consumed by application logic.
To wire this into an application, wrap the prompt call in a function that accepts user_turn, assistant_prior_turn, and optional conversation_summary as inputs. The function should enforce a strict JSON output schema using your model provider's structured output mode (e.g., response_format with a JSON schema in OpenAI, or constrained generation in other providers). Implement a validation layer that checks: (1) the correction_type field is one of the allowed enum values (factual, logical, procedural, format, slot_value, intent_misclassification, none), (2) the confidence score is a float between 0.0 and 1.0, and (3) if correction_type is not none, the target_span field contains a non-empty string referencing the assistant's prior output. If validation fails, retry once with the validation error message appended to the prompt as a [PREVIOUS_ERROR] constraint. After a second failure, log the raw output and default to correction_type: "none" to avoid blocking the conversation. For high-stakes domains like healthcare or legal workflows, route any classification with confidence below 0.85 to a human review queue before acting on the correction.
Model choice matters for latency and accuracy. Use a fast, instruction-tuned model (e.g., GPT-4o-mini, Claude Haiku) for this classification task, as it runs on every user turn and must return in under 500ms to avoid perceptible lag. Avoid routing this through a large, expensive model unless your eval suite shows a significant accuracy gap on your specific correction distribution. Implement a confusion matrix eval harness that tests the classifier against a golden dataset of labeled correction examples, including edge cases like implicit corrections, sarcasm, multi-type corrections, and corrections that span multiple prior turns. Track precision and recall per correction type, and set an alert if the none classification rate drops below expected baselines, which may indicate the classifier is over-triggering on clarifying questions. Log every classification result with a correlation ID that ties the user turn, classification output, downstream action taken, and eventual user feedback into a single trace for debugging correction failures in production.
Expected Output Contract
Schema contract for the Correction Intent Classification prompt. Every field must be validated before the classification result is used for routing or state updates.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
correction_detected | boolean | Must be true or false. If false, all other fields except confidence must be null. | |
correction_type | enum string | true if correction_detected is true | Must be one of: factual, logical, procedural, format, slot_value, intent_misclassification. Reject any value outside this set. |
target_span | object | true if correction_detected is true | Must contain turn_index (integer >= 0) and content_snippet (non-empty string). Snippet must be a verbatim substring of the referenced assistant turn. |
confidence | number | Float between 0.0 and 1.0 inclusive. Values outside range trigger a retry or fallback. Confidence below [CONFIDENCE_THRESHOLD] routes to clarification, not correction. | |
rationale | string | Non-empty string explaining why the classification was chosen. Must reference specific user language. Max 300 characters. | |
secondary_type | enum string or null | If present, must be from the same enum as correction_type and must differ from the primary type. Null allowed. | |
requires_clarification | boolean | True if confidence is below [CONFIDENCE_THRESHOLD] or if correction spans multiple incompatible types. Triggers clarification flow instead of direct correction. | |
correction_target_turn | integer or null | If the user is correcting a specific prior assistant turn, the zero-based turn index. Null if correction is general or turn cannot be identified. Must be < current turn index. |
Common Failure Modes
Correction intent classifiers break in predictable ways. These cards cover the most common production failure modes and how to guard against them before they erode user trust.
Implicit Correction Miss
What to watch: Users correct the assistant without explicit correction language (e.g., 'Actually, I meant the Q3 report' becomes a new topic instead of a correction). The classifier labels it as a new intent rather than a correction, so the assistant proceeds with stale state. Guardrail: Add few-shot examples of implicit corrections using hedging, topic reframing, and passive contradiction. Test with a dedicated eval set of disguised corrections and set a minimum recall threshold of 0.90 for the correction class before shipping.
Correction Type Confusion
What to watch: The classifier correctly detects a correction but assigns the wrong type (e.g., labeling a factual correction as a format correction). Downstream handlers apply the wrong repair strategy, leaving the original error partially or fully unaddressed. Guardrail: Build a confusion matrix across all correction types using a labeled test set. Identify which type pairs have high confusion rates and add targeted contrastive examples. Set a per-type precision floor of 0.85 before routing decisions depend on the type label.
Over-Classification of Clarifying Questions
What to watch: The classifier flags user clarification questions ('Can you explain that?', 'What did you mean by X?') as corrections. The assistant apologizes and reverses claims that were actually correct, creating a false-error loop that confuses users. Guardrail: Include a dedicated 'clarification' vs 'correction' contrastive example set. Test false-positive rate on a held-out clarification dataset and require a false-positive rate below 0.05 before enabling automatic correction handling.
Multi-Type Correction Collapse
What to watch: A user turn contains multiple correction types (e.g., correcting both a factual claim and a slot value in the same message). The classifier picks only the highest-confidence type and drops the others, so the repair handler fixes only part of the error. Guardrail: Allow multi-label output with a confidence threshold per type rather than forcing single-label classification. Test with synthetic multi-correction turns and measure recall@k for k equal to the number of ground-truth correction types present.
Confidence Score Miscalibration
What to watch: The classifier outputs high confidence (0.95+) on ambiguous or borderline correction cases, causing downstream systems to auto-accept corrections that should have triggered confirmation. Users learn they can override the assistant with low-effort pushback. Guardrail: Calibrate confidence scores against a labeled calibration set. Plot reliability diagrams and compute expected calibration error (ECE). If ECE exceeds 0.05, apply temperature scaling or add explicit uncertainty language to low-confidence outputs before routing decisions.
Correction vs. New Topic Boundary Blur
What to watch: A user introduces a new topic that incidentally contradicts prior context (e.g., switching from Q2 to Q3 analysis). The classifier treats the topic shift as a correction and triggers unnecessary state rollback. Guardrail: Add a pre-classification step that checks whether the user turn explicitly references prior assistant output. If no reference exists, route to topic-shift detection before correction classification. Test boundary cases where topic shift and correction overlap and measure the false-correction rate on topic-shift-only examples.
Evaluation Rubric
Build a test set with at least 20 examples per correction type. Use this rubric to evaluate the prompt's classification accuracy before production deployment.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Correction type classification accuracy |
| Confusion matrix shows >10% misclassification between factual and slot-value types | Run 20+ labeled examples per correction type through the prompt; compute per-class precision/recall |
Confidence score calibration | Mean confidence for correct predictions >= 0.80; mean confidence for incorrect predictions <= 0.50 | High-confidence misclassifications (confidence > 0.85 on wrong label) exceed 5% of test set | Bin predictions by confidence decile; plot accuracy per bin; check for overconfidence in errors |
Multi-type correction handling | When input contains two correction types, the top predicted label matches the primary type in >= 80% of cases | Prompt consistently picks the less impactful correction type as primary | Create 10 examples with dual correction types; compare primary label against human-annotated ground truth |
Non-correction rejection | False positive rate < 5% on clarifying questions, topic shifts, and new requests |
| Curate 30 non-correction turns (clarifications, new topics, affirmations); measure false positive rate |
Implicit correction detection | Recall >= 75% on corrections phrased as new questions or topic shifts without explicit correction language | Missed implicit corrections exceed 25% of implicit test cases | Test with 20 implicit correction examples (sarcasm, hedging, passive voice); measure recall |
Edge case: correction with new evidence | Correctly classifies as factual or logical correction type when user provides counter-evidence in >= 85% of cases | Prompt misclassifies evidence-backed corrections as intent-misclassification or new topic | Create 15 examples where user provides a source link or document excerpt contradicting assistant; verify type label |
Latency and token budget | Classification completes in < 500ms median latency; prompt + response tokens < 300 total | Median latency exceeds 1s or token count exceeds 500 for single-turn classification | Benchmark 100 classification calls; measure p50/p95 latency and token usage |
Cross-model consistency | Same label assigned by >= 90% of test cases when run across target models (e.g., GPT-4o, Claude 3.5 Sonnet) | Model-switch causes >15% label disagreement on identical inputs | Run full test set on each target model; compute pairwise agreement rate and Cohen's kappa |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Use the base prompt with a frontier model and lightweight validation. Focus on getting the classification labels right before adding confidence thresholds or multi-type handling.
codeClassify the user correction into one of these types: - factual - logical - procedural - format - slot-value - intent-misclassification User turn: [USER_TURN] Prior assistant output: [PRIOR_OUTPUT] Return JSON: {"type": "<type>", "confidence": 0.0-1.0}
Watch for
- Missing confidence scores on ambiguous corrections
- Overly broad
factualclassification whenslot-valueis more precise - No handling of corrections that span multiple types

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us