This prompt is designed for a single, programmatic job: classifying the communicative intent of one turn in a conversation. Use it as a feature extraction step within a larger dialogue analytics pipeline, a state tracking system, or a conversation auditing tool. The ideal user is an AI/ML engineer or backend developer who needs to convert raw text into a structured signal that downstream systems can consume. You should use this prompt when you need to answer questions like 'Did the user just ask a question, confirm something, or issue a command?' for every turn in a log. It is not a prompt for generating conversational responses, and it should not be used as a standalone chatbot. Its value is realized when its structured output is fed into a state machine, a database, or an analytics dashboard.
Prompt
Dialogue Act Classification Per Turn Prompt

When to Use This Prompt
Understand the ideal use cases, required inputs, and critical limitations of the Dialogue Act Classification Per Turn Prompt before integrating it into your pipeline.
To use this prompt effectively, you must provide three concrete inputs per call: the text of the current turn, the speaker's role (e.g., user or assistant), and a predefined taxonomy of dialogue acts. The taxonomy is a critical configuration point; a generic set like inform, request, confirm, reject, and greet is a common starting point, but you should tailor it to your application's specific needs. The prompt returns a structured JSON object containing the predicted act, a confidence score, and evidence spans from the input text that support the classification. This evidence is essential for debugging and building trust in the pipeline. The prompt is stateless by design, meaning it classifies each turn in isolation. If your use case requires understanding a turn in the context of prior turns, you must manage that context externally and inject the relevant history into the prompt's [CONTEXT] placeholder.
There are clear situations where this prompt is the wrong tool. Do not use it for generating the next assistant response, for open-ended conversation summarization, or for tasks that require deep semantic understanding of a user's goal beyond a single turn's surface intent. It is also unsuitable for real-time, low-latency applications if you are using a large, slow model; in such cases, consider a smaller, fine-tuned classifier model instead of a general-purpose LLM. Finally, this prompt is a classification tool, not a policy enforcer. It will label a turn as a request but will not decide if that request is allowed. That decision must be made by a separate policy layer in your application. Before integrating, ensure your pipeline has a clear schema for the output and a validation step to handle malformed JSON or low-confidence predictions, which are the most common failure modes.
Use Case Fit
Where dialogue act classification works as a prompt-based feature and where it introduces risk that requires product code, fine-tuning, or architectural change.
Good Fit: Structured Analytics Pipelines
Use when: you need per-turn act labels as features for downstream state tracking, routing, or analytics dashboards. The prompt classifies each utterance into a fixed taxonomy and outputs structured JSON. Guardrail: validate output against the allowed act label set and reject unknown labels before ingestion.
Bad Fit: Real-Time Conversation Steering
Avoid when: the classification result must drive immediate branching logic inside a latency-sensitive chat loop. Per-turn LLM calls add cost and delay. Guardrail: use a fast classifier model or cached heuristic for real-time steering; reserve this prompt for offline or async pipelines.
Required Inputs: Turn History with Speaker Labels
What to watch: classification accuracy degrades when turns lack speaker attribution or when history is truncated mid-exchange. Guardrail: always include at least the current turn plus the preceding assistant turn for context. Validate that each turn has a role field before calling the prompt.
Operational Risk: Taxonomy Drift
What to watch: the model may invent act labels outside your defined taxonomy, especially for ambiguous or mixed-intent turns. Guardrail: enforce a strict enum in the output schema and log any turn where the model attempts an out-of-taxonomy label for human review.
Operational Risk: Multi-Label Confusion
What to watch: user turns often carry multiple dialogue acts (e.g., inform + request). A single-label prompt forces the model to choose, losing information. Guardrail: design the output schema to support an array of act labels with confidence scores. Test boundary cases where users combine acts.
Scale Limit: Cost Per Turn
What to watch: running a full LLM call for every turn in high-volume chat products multiplies cost and latency. Guardrail: batch classify turns in a single prompt where possible, or use this prompt for sampling and evaluation while a distilled classifier handles production volume.
Copy-Ready Prompt Template
A copy-ready system prompt for classifying each turn in a conversation into a dialogue act taxonomy.
This template provides a complete system prompt for dialogue act classification. It is designed to be pasted directly into your model's system message field. The prompt instructs the model to analyze a single turn within its conversation history and output a structured classification object. Before using this prompt, you must define your dialogue act taxonomy and prepare your turn history format.
textYou are a dialogue act classifier. Your task is to analyze the provided conversation turn and classify it according to the [TAXONOMY] taxonomy. # TAXONOMY [TAXONOMY] # INPUT You will receive the following inputs: - **Turn History:** The preceding conversation turns for context. - **Target Turn:** The specific turn to classify, identified by its role and content. # INSTRUCTIONS 1. Analyze the Target Turn within the context of the Turn History. 2. Identify the primary communicative function of the Target Turn. 3. Select the most appropriate dialogue act label from the [TAXONOMY] provided above. If multiple acts are present, you may output a primary act and a list of secondary acts. 4. Provide a brief, evidence-based rationale for your classification, quoting the specific text from the Target Turn that supports your decision. 5. Output your classification in the strict JSON format specified in [OUTPUT_SCHEMA]. # CONSTRAINTS [CONSTRAINTS] # OUTPUT SCHEMA You must output a single JSON object conforming to the following structure: [OUTPUT_SCHEMA] # EXAMPLES [EXAMPLES]
To adapt this template, replace the square-bracket placeholders with your specific requirements. The [TAXONOMY] should be a clear, bulleted list of your dialogue acts with definitions (e.g., inform, request, confirm, reject, greet). The [OUTPUT_SCHEMA] should be a concrete JSON schema or a clear description of the expected fields, such as {"primary_act": "string", "secondary_acts": ["string"], "rationale": "string"}. Use the [CONSTRAINTS] section to enforce rules like "Do not hallucinate acts not in the taxonomy" or "If the turn is ambiguous, set primary_act to 'other'." Finally, provide a few high-quality [EXAMPLES] that demonstrate the desired mapping from a turn to its JSON output, including tricky edge cases. After deploying, validate the model's output against your schema and taxonomy to catch drift or hallucinations.
Prompt Variables
Required inputs for the Dialogue Act Classification Per Turn prompt. Each placeholder must be populated before the prompt is sent to the model. Validation notes describe how to verify the input is well-formed before classification runs.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[TURN_TEXT] | The raw text of the single conversation turn to classify. Must be exactly one turn, not the full history. | "Can you confirm the delivery address is 123 Main St?" | Non-empty string. Length > 0. Must not contain multiple speaker labels or turn delimiters. Reject if empty or contains newline-separated multi-turn text. |
[TURN_ROLE] | The speaker role for the turn being classified. Determines which act taxonomy subset applies. | "user" | Must be one of: "user", "assistant", "system". Enum check before prompt assembly. Reject unknown values. |
[TAXONOMY] | The dialogue act taxonomy definition. A structured list of act labels with definitions and examples. | ["inform", "request", "confirm", "reject", "greet", "clarify", "acknowledge", "other"] | Must be a non-empty array of strings or a structured object with label and definition fields. Validate that each label is unique and no label is an empty string. Minimum 2 labels required. |
[CONTEXT_TURNS] | Optional preceding turns for disambiguation. Helps resolve acts that depend on prior dialogue context. | [{"role": "assistant", "text": "Your order is scheduled for Tuesday."}, {"role": "user", "text": "Can you confirm the delivery address?"}] | If provided, must be an array of objects with role and text fields. Role must be user or assistant. Text must be non-empty. Null allowed if classification is single-turn only. Max 10 context turns recommended to avoid context pollution. |
[OUTPUT_SCHEMA] | The expected JSON output format specification. Defines the structure the model must return. | {"primary_act": "string", "secondary_acts": ["string"], "confidence": 0.0-1.0, "evidence_span": "string"} | Must be a valid JSON Schema or example object. Validate parseable JSON before prompt assembly. Must include primary_act field at minimum. Reject if schema is malformed or missing required fields. |
[CONSTRAINTS] | Additional classification rules, edge-case handling instructions, and output constraints. | "If the turn contains both a greeting and a request, classify primary_act as 'request' and include 'greet' in secondary_acts. Return confidence below 0.5 if the turn is ambiguous." | String or null. If provided, must be non-empty. Check for contradictory rules against taxonomy labels. Null allowed when no special constraints are needed. |
[FEW_SHOT_EXAMPLES] | Optional demonstration examples showing correct classification for representative turns. | [{"turn": "Hi there", "role": "user", "output": {"primary_act": "greet", "secondary_acts": [], "confidence": 0.98, "evidence_span": "Hi there"}}] | If provided, must be an array of objects with turn, role, and output fields. Output must conform to OUTPUT_SCHEMA. Validate each example's primary_act exists in TAXONOMY. Null allowed. Max 5 examples recommended to avoid overfitting. |
Implementation Harness Notes
How to wire the dialogue act classification prompt into a production pipeline with validation, retries, and state tracking.
This prompt is designed to be called once per turn (user or assistant utterance) in a streaming or batch processing pipeline. It should not be called on the entire conversation history at once; instead, feed it the target utterance and a sliding window of prior turns as context. The output is a structured JSON object containing the predicted dialogue act label, confidence score, and evidence spans. This classification feeds downstream state tracking, analytics dashboards, or routing logic.
Wire the prompt into your application as a stateless function that accepts a turn object and returns a classification result. Implement a thin wrapper that: (1) extracts the target utterance and preceding N turns from your conversation store, (2) populates the [TURN_TEXT], [PREVIOUS_TURNS], and [ACT_TAXONOMY] placeholders, (3) calls the model with a strict JSON mode or structured output constraint, (4) validates the response against your expected schema, and (5) logs the result with a trace ID linking it to the conversation and turn. For high-throughput pipelines, batch multiple turn classifications into a single request if your provider supports it, but keep each classification independent to avoid cross-turn contamination.
Validation is critical because downstream state machines will break on malformed act labels. After receiving the model response, check that the act_label field matches one of your allowed taxonomy values exactly (use an enum check, not fuzzy matching). Verify that confidence is a float between 0.0 and 1.0. Confirm that evidence_spans contains valid offsets within the turn text. If validation fails, retry once with a repair prompt that includes the validation error message and the original turn. If the retry also fails, log the failure, assign a fallback label of UNCLASSIFIED, and route to a human review queue if the downstream use case requires high accuracy. For analytics pipelines, UNCLASSIFIED with a low confidence flag is often acceptable; for real-time routing, escalate.
Choose a model that supports structured output (JSON mode or function calling) to reduce parsing errors. Smaller, faster models (e.g., GPT-4o-mini, Claude Haiku, or fine-tuned open-weight models) are usually sufficient for single-turn dialogue act classification and keep per-turn costs low. If your taxonomy is large (20+ acts) or includes subtle distinctions (e.g., request_clarification vs request_confirmation), test with a stronger model first, then evaluate whether a smaller model maintains acceptable accuracy. Store classification results in your conversation state store alongside the turn data, not just in logs, so downstream components can query act sequences without re-processing.
Before shipping, build an evaluation harness that runs this prompt against a labeled dataset of at least 200 turns covering your full act taxonomy. Measure per-act precision and recall, not just overall accuracy, because rare acts like reject or correct are often the most important for downstream behavior. Set a minimum confidence threshold below which classifications are treated as uncertain; route uncertain classifications to a human review queue or a secondary classifier. Monitor production drift by sampling classified turns weekly and comparing model labels against human annotator labels. If act distribution shifts significantly (e.g., a sudden increase in complaint acts), investigate whether the model is misclassifying or user behavior has genuinely changed.
Expected Output Contract
Defines the exact JSON structure, field types, and validation rules for the dialogue act classification output. Use this contract to build a parser and validator before integrating the prompt into a production pipeline.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
turn_id | string | Must match the [TURN_ID] input exactly. Parse check: non-empty, no extra whitespace. | |
speaker_role | enum: user | assistant | Must be one of the two allowed values. Schema check: case-sensitive enum match. | |
primary_act | string from [ACT_TAXONOMY] | Must be a value present in the provided [ACT_TAXONOMY] list. Schema check: exact string match against taxonomy keys. | |
secondary_acts | array of strings from [ACT_TAXONOMY] | If present, each element must be a valid taxonomy value. Null allowed. Schema check: array items match taxonomy. | |
confidence | number | Must be a float between 0.0 and 1.0 inclusive. Range check: 0 <= value <= 1. | |
evidence_spans | array of objects with 'text' and 'turn_index' keys | Each object must contain a non-empty 'text' string and an integer 'turn_index' referencing a turn in [HISTORY]. Parse check: array length >= 1. | |
rationale | string | If present, must be a non-empty string explaining the classification. Null allowed. No format constraints beyond string type. |
Common Failure Modes
Dialogue act classification fails silently in production when the taxonomy is ambiguous, the context window is polluted, or the model defaults to a safe majority class. These cards cover the most common failure patterns and the specific guardrails that prevent them.
Majority Class Collapse
What to watch: The model classifies every turn as inform or statement because those acts dominate the training distribution. This masks all other dialogue acts and destroys downstream state tracking. Guardrail: Add a calibration check that measures act distribution entropy per session. If entropy drops below a threshold, flag the session for review and inject a few-shot example of the underrepresented act into the prompt.
Context Window Pollution
What to watch: When too many prior turns are included, the model confuses the current turn's act with acts from earlier in the conversation. A request three turns ago bleeds into the classification of the current confirm. Guardrail: Restrict the input to the target turn plus a compact summary of the prior dialogue state, not raw history. Validate that the classified act is supported by the target turn's text alone.
Taxonomy Boundary Blur
What to watch: Adjacent acts like inform vs suggest or request vs command are consistently confused because the taxonomy definitions overlap. This produces noisy features for downstream state tracking. Guardrail: Add a disambiguation rule block to the prompt that explicitly contrasts each confusable pair with decision boundaries. Run pairwise confusion matrix analysis on a labeled eval set and add few-shot examples for the top confused pairs.
Multi-Label Suppression
What to watch: Turns that genuinely carry multiple acts (e.g., confirm + inform) are classified as single-label because the model defaults to the most salient act. The secondary act is lost. Guardrail: Require the model to output a confidence score for every act in the taxonomy, not just the top label. Set a low threshold for secondary act inclusion and validate against multi-label ground truth.
Assistant Turn Projection
What to watch: The model applies user-turn act definitions to assistant turns, or vice versa, because the prompt does not clearly separate the two taxonomies. An assistant offer_help is misclassified as a user request. Guardrail: Use separate act taxonomies for user and assistant turns, or prefix each act label with the speaker role. Validate that the predicted act is legal for the speaker role before accepting the output.
Surface Form Overfitting
What to watch: The model classifies based on lexical cues ('can you', 'please') rather than the underlying dialogue function. A polite inform that starts with 'could you note that...' is misclassified as a request. Guardrail: Include counterexamples in the prompt where surface form and dialogue act diverge. Add a validation step that checks whether the predicted act is consistent with the turn's semantic content, not just its phrasing.
Evaluation Rubric
How to test output quality before shipping the Dialogue Act Classification Per Turn Prompt.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Act Taxonomy Adherence | All predicted acts are from the defined [ACT_TAXONOMY] list | Output contains hallucinated or out-of-schema act labels | Schema validation: check predicted labels against allowed enum values |
Multi-Label Precision | Precision >= [PRECISION_THRESHOLD] across all predicted acts per turn | Predicted act not supported by evidence in the turn text | Human-annotated golden set: compare predicted acts to ground-truth labels |
Multi-Label Recall | Recall >= [RECALL_THRESHOLD] for each act category in the taxonomy | Ground-truth act missing from prediction for a given turn | Human-annotated golden set: check for false negatives per act category |
Turn Boundary Respect | Classification uses only the text from the target [TURN_INDEX] turn | Predicted acts reference content from adjacent turns or future turns | Input isolation test: provide turn with surrounding noise and verify no leakage |
Evidence Span Grounding | Each predicted act includes a quoted [EVIDENCE_SPAN] from the turn text | Evidence span is missing, paraphrased, or pulled from wrong turn | Span extraction check: verify quoted text is an exact substring of the target turn |
Low-Confidence Flagging | Acts with confidence below [CONFIDENCE_THRESHOLD] are flagged for review | Low-confidence predictions emitted without uncertainty signal | Confidence threshold test: inject ambiguous turns and verify flag presence |
Empty Turn Handling | Turns with no discernible dialogue act return empty list with confidence 0 | Hallucinated acts assigned to empty, noise-only, or unintelligible turns | Edge case suite: feed empty strings, whitespace, and non-speech tokens |
Turn Role Discrimination | User and assistant turns are classified using correct role-specific act subsets | Assistant-only acts predicted for user turns or vice versa | Role swap test: provide same text with different [TURN_ROLE] and verify act set changes |
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 smaller taxonomy (5-8 acts) and relaxed output validation. Accept raw text labels instead of structured JSON. Run on a sample of 50-100 turns to calibrate act definitions before expanding the taxonomy.
Prompt modification
- Replace the full taxonomy list with a short subset:
[GREET, INFORM, REQUEST, CONFIRM, CLOSE] - Remove the
[OUTPUT_SCHEMA]block and ask for a simple comma-separated list - Add:
If uncertain, label as OTHER and include a brief reason.
Watch for
- Overly broad act definitions causing inconsistent labels
- Model inventing acts not in the taxonomy
- No baseline accuracy measurement before expanding

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