Intent Recognition and Multi-turn Dialogue Design for Complex Scenarios
A user sends "this one isn't like the last one right? then if I return it who pays shipping?"—mixed languages, three intents, plus a pronoun reference. A keyword-matching bot would answer in three different directions; a fully free-form LLM blows the latency and cost budget. Ambiguous phrasing, mixed intents, multi-turn follow-ups, and code-switching are the four problems that surface first after an AI support system goes live.
This post is part of an experience-sharing series on "AI customer service product and engineering practice", drawn from hands-on practice at a global fast-fashion cross-border e-commerce platform. In this post I want to share how to design intent recognition, entity extraction, context understanding, and multi-turn dialogue mechanisms for ambiguous expressions, mixed intents, multi-turn follow-ups, and multilingual mixing, and how to keep lifting recognition accuracy in complex consultation scenarios.

Four Key Points in Intent and Multi-turn Design
- Choose the NLU mix deliberately: intent classification and entity extraction call for small-model plus LLM combinations rather than a single silver bullet.
- Track the dialogue state: DST, slot filling, and clarification strategies carry the multi-turn experience.
- Handle ambiguity by design: confidence thresholds and clarification scripts decide what happens when understanding is uncertain.
- Iterate on badcases: a badcase analysis and continuous optimization loop is what actually moves accuracy.
The Overall Design
I would tackle this on three levels: recognition, management, and fallback.
Step 1: Intent recognition design
- Layered intent taxonomy: level-1 intents (logistics, refunds, product, account) → level-2 intents (delivery delay, refund progress, sizing questions). Keep granularity reasonable—too many intents confuse each other.
- Technical mix: use an LLM with few-shot examples for intent understanding; give high-frequency core intents a fast lane via small models or rules, balancing accuracy, latency, and cost.
- Multi-intent handling: detect multiple intents in one utterance—say "I want to return it, and who pays shipping?"—decompose them into a task queue and handle them one by one instead of answering only the first.
Step 2: Entity extraction and linking
- Key entities: order number, product name, tracking number, time, amount, return reason.
- Entity linking validation: an extracted order number must be verified as belonging to the current user to prevent unauthorized access; product names get fuzzy-matched against the catalog to align with standard SKUs.
- Slot filling: proactively ask follow-up questions to fill missing key entities, such as "which order do you want to check?"
Step 3: Context understanding and multi-turn management
- Dialogue state tracking: maintain current intent, filled slots, and a summary of past turns.
- Coreference resolution: when the user says "when will it arrive", resolve "it" to the specific package from earlier context.
- Intent switching and resuming: when the user changes topics mid-flow, suspend the original task and allow returning to it later.
- Long-dialogue compression: summarize context after many turns to control token cost instead of accumulating history forever.
Step 4: Confidence tiers and clarification
- High confidence: answer directly.
- Medium confidence: offer candidate options for confirmation—“are you asking about delivery status or starting a return?"
- Low confidence: transfer to a human; never guess blindly.
- Mixed languages: run language identification first, then hand off to a multilingual model; maintain a multilingual glossary for business terms to prevent mistranslating key vocabulary.
Step 5: Continuous optimization loop
Build an annotated evaluation set specifically covering hard cases: ambiguous phrasing, multiple intents, and language mixing. Review badcases weekly and classify errors into intent confusion, missed entities, or lost context, then optimize prompts, few-shot examples, and glossaries accordingly. Recognition accuracy is not designed once—it is iterated out through evaluation sets and badcase loops.
Practice in Bytedesk
In the open-source Bytedesk customer service system (GitHub, website https://www.weiyuai.cn ), bots support LLM-based intent understanding with FAQ/knowledge base matching and configurable human-transfer rules; the conversation module maintains thread-level context for multi-turn follow-ups; the knowledge base and RAG retrieval back intent matching with content; and unrecognized or low-confidence conversations transfer seamlessly to humans with full history—matching the tiered "auto-answer when confident, transfer when not" philosophy.
Key Takeaways
- The intent taxonomy must be layered: too coarse misses accuracy, too fine causes confusion.
- LLM understanding plus a small-model/rule fast lane is the balance point between accuracy and cost.
- Entity extraction requires ownership validation—an unvalidated order number is an authorization hole.
- Confidence tiers: answer when high, clarify when medium, transfer when low—never guess.
- Accuracy is iterated through evaluation sets and badcase loops, not designed in one shot.
