Zero Labs
Industry News / AI

Intent Classification Isn’t Enough: Failure Modes in a WhatsApp LLM Pipeline That Had to Ask Before…

Source · Towards AI By Hernan M

From the publisher’s feed, collected in the ZeroLabs newsroom.

Intent Classification Isn’t Enough: Failure Modes in a WhatsApp LLM Pipeline That Had to Ask Before It Could AnswerThe first version of our WhatsApp “which solar water heater do I need?” bot had a deceptively simple job: recommend a SKU from a catalog. In production, it turned into something else entirely — an information-gathering system that had to ask the right questions before it could safely answer. And when it didn’t, the failure wasn’t a bad UX moment; it was a silent confident failure that could plausibly damage equipment in high-pressure plumbing.Nexum is a small solar energy retailer in Buenos Aires handling roughly ~70 WhatsApp messages/day. The most common question — “which solar water heater do I need?” — can’t be answered from the catalog alone; it requires a two-step diagnostic (water source, then pressure configuration). V1 was a single LLM call with the full catalog in context. It failed in the worst possible way: when pressure info was missing, the model confidently recommended the standard (cheapest) unit — exactly the kind of “everything looks healthy” failure PromptLayer warns about (HTTP 200, normal latency, fluent output) while being semantically wrong (PromptLayer).V2 split the system into intent routing plus explicit conversational state: an intent classifier and a tiny 2-node/4-leaf state machine with externally stored state. Based on internal logs (not a controlled study), escalations dropped from ~38% → ~17% over ~6 weeks, and about ~62% of diagnostic sessions completed end-to-end without a human. But three failure modes survived: mid-flow intent switching, users collapsing multiple answers into one message, and ambiguous plumbing edge cases.V1 was one big bet on the model behaving. V2 adds routing + explicit state so the system can’t “forget” what it still needs to ask.The Catalog That Required a Diagnostic Before It Could Recommend AnythingA customer would message, “Necesito un termotanque solar, ¿cuál me corresponde?” and then… wait. Not because we were slow, but because the question is underspecified by default: the catalog can list SKUs all day, but it can’t infer plumbing constraints from a one-liner.This is the problem nobody mentions in WhatsApp chatbot tutorials: some bots don’t primarily answer questions. They have to ask them — carefully — before answering anything useful. In our case, the bot’s real job was structured information gathering under conversational noise.Nexum (Buenos Aires, solar products, ~70 WhatsApp messages/day) sells solar water heaters where the “right” SKU depends on two variables:Water source: municipal vs. wellPressure type: gravity tank vs. direct high-pressure connectionAnd step 2 depends on step 1, because the follow-up question and the risk profile change based on the first branch.What I didn’t expect, when I built this, was how often users assumed we could infer these details from vibes. They’d send a photo of a bathroom, or “es para casa normal,” and expect a safe recommendation anyway.This also isn’t rare behavior; underspecified instructions are common in real conversational logs, and multi-turn reliability drops hard compared to single-turn tasks (Laban et al., “LLMs Get Lost In Multi-Turn Conversation”). That paper measured an average 39% performance drop in multi-turn settings across tasks — less “aptitude” loss than “unreliability” growth, which is exactly the flavor of pain you feel in production.Here’s the minimal decision tree we shipped and why it reduced unsafe recommendations.This is the tiny tree doing the heavy lifting: two questions, four leaves, and fewer chances to hallucinate a “helpful” but unsafe answer.V1: When the Model Didn’t Know What It Didn’t KnowV1 was the obvious design — and in a controlled test chat, it looked fine. One LLM call per inbound message, the whole product catalog stuffed into context, and a prompt that asked for a recommendation plus a short explanation.The trouble is that this setup makes it easy for the model to sound “done” even when the user hasn’t provided the minimum viable inputs. That’s the failure mode that matters here: fluent completion in the presence of missing constraints.It worked on happy-path prompts. It even handled slang pretty well. Then the first real failure showed up — quietly.Here’s the critical failure mode: when users didn’t mention pressure configuration, the model tended to recommend the standard/cheapest unit anyway. Confidently. No “I need more info,” no warning, no escalation.That’s not a UX issue. It’s a physical risk.If someone has a direct pump connection or otherwise high-pressure plumbing and we recommend a unit intended for gravity-fed systems, you’re flirting with damage. The model didn’t know that it didn’t know.And this is where LLMs break traditional ops intuition. PromptLayer nails it: “The key insight is that many LLM failures are silent. The system returns a http 200, latency looks normal, and the response reads fluently” (PromptLayer). That was exactly our situation — Grafana looked green while the bot was giving unsafe advice.I tried the usual prompt tweaks. Add stronger instructions: “If pressure is unknown, ask a question.” Add examples. Add bold warnings. It helped in the lab.In practice, what I found is that prompt stability isn’t system stability. Production inputs are messier, and failures show up at boundaries: context length variance, ambiguous user phrasing, and the model’s habit of “helpfully” completing the task anyway — echoing Kotalla’s point that reliability issues often come from interfaces and constraints, not raw model capability (Kotalla).So we stopped trying to make the model “more responsible” via wording.We changed the shape of the system.If you’re going to claim the new architecture helped, you should make it visible — this is the “did it actually reduce escalations?” picture.The Approach/Strategy: V2 Split Routing (Intent) from Memory (Explicit State)Escalations dropped from ~38% to ~17% after introducing intent routing plus explicit state (internal logs, ~6 weeks).V2 had two layers, and the separation mattered more than any model choice.Layer 1: an intent classifier that routes each inbound message into one of four buckets: price inquiry / product diagnosis / complaint / out of scope.Layer 2: if (diagnosis) then enter a deterministic state machine — the decision tree — where state is stored externally and advanced explicitly, not inferred from chat history.The pipeline was deployed via Atiendia, a no-code WhatsApp automation platform built for LATAM small businesses — one of several tools in this space that abstract away the WhatsApp Business API layer.Why go explicit? Because I wanted auditability.If the bot is at “pressure question pending,” that should be a database field, not an emergent property of a 40-message transcript. Kotalla’s framing helped me articulate it: constraints reduce variance more than endless prompt edits (Kotalla).Layer 1 — Intent classifier: what it did well, and what I didn’t expectWe kept the taxonomy small on purpose. Fewer intents meant fewer ambiguous boundaries, which reduced misroutes.What I didn’t expect was how often “diagnosis” and “price inquiry” co-occurred in one message — something ML6 calls out as common in customer support: people bundle intents or switch midstream (ML6). Even with four buckets, real users don’t respect your ontology.Still, routing helped. It prevented the model from free-form recommending a heater when the user was just asking “¿cuánto sale el de 200 litros?”But here’s the rub: intent classification is necessary, not sufficient. It tells you where to go, not how to safely get there.Layer 2 — The 2-node / 4-leaf decision tree (and where state lives)The diagnostic tree was intentionally tiny:Decision node 1: water source (municipal vs. well)Decision node 2: pressure type (gravity tank vs. direct/high pressure)Terminal nodes (4): the four combinations, each mapping to a recommended model class or an escalation ruleState lived outside the LLM in a simple session store keyed by WhatsApp user ID: current_node, water_source, pressure_type, last_updated, plus a locked flag to avoid out-of-order processing.That “lock” pattern isn’t exotic; AWS recommends a processing lock mechanism for WhatsApp assistants to prevent duplicate/out-of-sync responses when messages arrive quickly (AWS Messaging Blog). We didn’t copy their architecture wholesale, but the principle held.The LLM’s job changed: not “recommend a heater,” but “ask the next question” or “confirm extracted values” or “explain why we need this info.”That shift made the system easier to reason about — and easier to debug when it broke.Even with a state machine, real users still find the cracks — these are the three that kept showing up in the logs.The Three Failure Modes That Survived the RedesignV2 eliminated the catastrophic default-to-cheapest behavior and made the system’s “unknowns” explicit. But it also surfaced three recurring edge patterns — places where real conversational behavior collides with a tidy diagnostic tree.Multi-turn conversations are where models get unreliable — Laban et al. describe how LLMs make early assumptions and then don’t recover when corrected (arXiv:2505.06120).We constrained the space. The users still found the edges.Failure A — Intent switching mid-diagnosis (pause vs abandon vs reroute)Scenario: the user answers node 1 (municipal), we ask node 2 (pressure), and they reply: “Antes, ¿tenés luces solares para jardín?”So what do you do?We implemented a “soft pause” policy: answer the new intent if it’s clearly a price inquiry, then offer a one-line resume prompt: “¿Seguimos con el termotanque? Me falta saber si tenés tanque elevado o bomba directa.”Tradeoff: you respect user autonomy, but you risk never completing the diagnostic. If you hard-abandon, you reduce state complexity but increase frustration.ML6 frames this as a multiple-intent conversation problem: fragmentation and poor routing can make users feel ignored (ML6). In practice, what I found is that “pause and resume” works — until the user sends three more unrelated questions and the diagnostic state goes stale.We added a TTL: if no diagnostic progress happens within ~12 hours, we reset and start over. That’s defensible operationally, but it’s still a rough edge.Failure B — Collapsed multi-step answers (the bot asks what was already answered)Scenario: user replies, “Tengo agua de red y va directo a las cañerías.”That single message answers both nodes: municipal + direct/high pressure. But our state machine expected one bit per turn.Without mitigation, the bot would ask the pressure question anyway — immediately breaking trust. Users notice that kind of glitch fast.We mitigated this with a lightweight extraction step: when in diagnosis mode, we run a parser (LLM or rules) to extract both variables from any inbound message, not just the “expected” one. If both are present, we jump the state machine forward and respond with a confirmation:“Perfecto: agua de red + conexión directa. Para evitar daños por presión, te recomiendo X. ¿Confirmás que no hay tanque elevado?”This is where the “lost in conversation” paper felt uncomfortably relevant: models often try to finish early, and systems that assume strict turn-taking get brittle (arXiv:2505.06120). Here, the user is more informative than your design expects — and you can still fail.In our case, the “bot asked what was already answered” bug was spotted after 3 days of live traffic — specifically, after 11 diagnosis sessions where the user provided both variables in one message and the flow still asked the second question. The signal wasn’t a customer complaint; it was a manual review of “repeat-question” patterns in the transcript logs (same question template sent within one turn of a message containing both “red/pozo” and “directo/tanque”).Failure C — Ambiguous plumbing edge cases (when escalation is correct but hard to detect)Some installs don’t map cleanly to the tree.Example: a mixed system where there’s a tank, but also a pump that sometimes bypasses it. Or a well with a pressure tank that behaves like municipal pressure. Users describe these in messy, local terms — “tengo cisterna y bomba, pero también tanque arriba.”We had an escalation terminal in the decision matrix: “If ambiguous, hand to human.” The hard part was detecting ambiguity.Ambiguity isn’t a keyword. It’s a semantic mismatch between the user’s description and the tree’s assumptions.We tried heuristics: if the message contains both “tanque” and “bomba” or mentions “cisterna,” escalate. It caught some cases and missed others.We also tried an LLM-based ambiguity detector that outputs CLEAR_BRANCH | AMBIGUOUS | NEEDS_PHOTO. It helped, but it introduced a new failure mode: false ambiguity, which increases escalations and cost.Kotalla’s point about boundary failures applies here too: the model isn’t just reasoning; it’s interpreting loosely formatted human descriptions at the interface between the world and your schema (Kotalla).So we landed on a conservative rule: if ambiguity detector says AMBIGUOUS or heuristics trigger, escalate. Safety over automation.Based on a spot-check audit of 50 diagnosis transcripts from a two-week window (manually labeled for “would a cautious installer call this ambiguous?”), our ambiguity detection still appears to miss roughly ~10–15% of high-risk ambiguous cases — mostly the ones described without the obvious lexical triggers (“tanque,” “bomba,” “cisterna”) and without enough detail for the LLM detector to confidently flag. That estimate is crude, but it’s grounded in the only thing we had: a small human review loop on real conversations.Results with Data: What Improved, What Stayed Fuzzy, and What I’m Seeing This NowWe processed ~70 messages/day, so even a “small” percentage change matters because it directly affects a human’s inbox.Escalation rate: ~38% (V1) → ~17% (V2) over ~6 weeks (Δ ≈ -21 points). These are estimates from internal logs, not a randomized evaluation.Diagnostic completion without human: about ~62% of diagnosis sessions completed end-to-end in V2 (same caveat: log-derived, and “completion” means the flow reached a terminal leaf, not that the install was later verified).Median time-to-first-response: ~55 seconds → ~8 seconds after decoupling routing from diagnosis (mostly because the bot stopped waiting for a human to notice the message).Cost proxy (tokens/day): roughly ~65k → ~18k after removing “full catalog in every prompt” and limiting generation to “ask/confirm/route.” (Token counts are approximate; we sampled a week of traffic before/after.)I’m seeing this now: the biggest “win” wasn’t lower latency or lower cost. It was fewer silent failures — fewer cases where the system sounded confident while skipping required variables.But the analysis has a glaring limitation: we couldn’t measure whether the final recommendation was actually correct for the user’s real installation. There was no feedback loop from installation outcomes back into the system.PromptLayer suggests tracking downstream business metrics and user signals (rephrasing, abandonment, escalation) because semantic failures won’t show up in standard dashboards (PromptLayer). We did that.What we didn’t have was ground truth.So the metrics are about process quality, not physical correctness. Take this with a grain of salt — it’s just my perspective.Lessons Learned: What Generalizes (and What We’d Do Differently)Three principles generalize beyond Nexum.First: when the correct response requires information extraction before recommendation, intent classification is necessary but not sufficient — you need explicit state management. Otherwise you’re just routing users into a probabilistic fog.Second: silent confident failures are the most dangerous failure mode in production LLM systems. A fluent wrong recommendation is worse than “I need more information,” because it looks healthy to monitoring and persuasive to users (PromptLayer).Third: explicit decision trees are more auditable than implicit prompt logic when failure has real-world consequences beyond UX. Constraints beat cleverness more often than we like to admit (Kotalla).The catch, however, is that you’re trading flexibility for auditability. For open-ended conversations, state machines don’t scale; you end up with spaghetti code and edge-case tax.That’s the trade.What We’d Do DifferentlyIf I were rebuilding this (and, honestly, I probably will), I’d do four things.I’d formalize “jump-ahead” extraction so collapsed multi-step answers become a first-class path, not a patch. I’d make pause/resume explicit in the UX — users should see that a diagnostic is paused, not silently parked.I’d invest in a better ambiguity trigger by building a small labeled library of real edge cases and regression-testing it, aligning with PromptLayer’s “failure flywheel” idea of turning incidents into test cases (PromptLayer). And I’d tighten human handoff so escalation is fast and context-rich, because multi-intent conversations don’t magically become single-intent just because you want them to (ML6).Conclusion & Recommendations: Build for Abstention, Not Just AnswersThe win here wasn’t “smarter prompts.” It was making uncertainty explicit, and making state auditable.If your chatbot can cause real harm — physical, financial, or legal — treat “abstain and ask” as a core feature. Require explicit variable capture. Add escalation paths that trigger before the model starts guessing.And remember the uncomfortable bit from multi-turn research: even strong models get unreliable when information is revealed gradually (arXiv:2505.06120). That’s not a moral failing of the model; it’s a design constraint for the system you’re building around it.If you’re building something similar, I’m curious: where are your silent failures hiding — routing, state, retrieval, or handoff?Full disclosure: I don’t know if our ambiguity detection is “good enough” yet; I just know V1’s confident guessing wasn’t acceptable, and V2 gave us levers we could actually pull.SourcesPromptLayer — How do teams identify failure cases in production LLM systems?Lorenzo Kotalla — Practical Failure Modes in LLM Systems (and Where They Usually Come From)AWS Messaging Blog — Best practices for building high-performance WhatsApp AI assistant using AWSInfobip — How to design and build a WhatsApp chatbot in 2026ML6 — Handling Multiple Intent Conversations in Customer Support ChatbotsarXiv — LLMs Get Lost In Multi-Turn ConversationIntent Classification Isn’t Enough: Failure Modes in a WhatsApp LLM Pipeline That Had to Ask Before… was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.