Intent classification is a key component in conversational AI systems. For smooth user experience, production systems require very low latency, specifically under 100ms. Relying only on resource-intensive Large Language Models (LLMs) for every user query leads to high latency and high operational costs. Conversely, using only a small, monolithic distilled model risks lower accuracy, particularly for edge cases. A practical strategy is the Hybrid Multi-Stage Routing paradigm: compact, specialized models manage the high volume of routine requests, while the computational resources of LLMs are used only when necessary.

How it works

This architecture is often called Hierarchical Inference (HI) or Uncertainty-Based Routing. It specifies a pipeline for processing user input.

Stage 1 — The Specialized Classifier (Shallow Language Model, SLM). Despite the rise of LLMs, compact encoder-based models remain highly effective for high-throughput scenarios. These include optimized BERT-variants, contrastive learning models, and other distilled architectures. These compact SLMs (typically 5–20MB) perform the initial classification. They can achieve inference speeds significantly below 100ms, even on CPU-only infrastructure.

Stage 2 — Confidence and Escalation Gating. The SLM output includes a confidence score for its top prediction. This score is checked against an escalation threshold (typically between 0.7 and 0.9). If the predicted confidence is too low — meaning it falls below the threshold — the query is sent to the next processing stage.

Stage 3 — LLM Fallback and Refinement. Low-confidence queries are routed to a robust LLM. These models are used to resolve ambiguity present in low-confidence queries. This process, which engages the LLM for only 10–30% of total requests, is crucial for maintaining system accuracy while keeping high LLM costs under control.

Production performance

The deployment of this hybrid architecture shows significant performance improvements:

For instance, in a Natural Language Understanding (NLU) system for a complex domain, using a specialized, contrastive encoder model in Stage 1 yielded an accuracy of 90–94% for routine intents. The costly LLM fallback was invoked for only approximately 15% of the total query volume.

When to use this pattern

The decision to adopt this pattern depends on specific constraints and application requirements.

This hybrid routing pattern is recommended when:

Adoption is not recommended for:

Implementation best practices

Several implementation details matter for optimal performance.

Optimization of the Specialized Classifier (SLM). It is effective to use knowledge distillation techniques, where the compact SLM is trained to replicate the predictions of the larger LLM. This helps transfer the LLM’s generalization capability to the compact model. Further efficiency is gained through quantization (e.g., INT8 or INT4), which reduces memory usage and increases inference speed.

Threshold Calibration. The selection of the confidence threshold is a critical hyperparameter. A threshold that is too low (e.g., 0.5) leads to unnecessary use of the costly LLM. A threshold that is too high (e.g., 0.95) results in lower accuracy because necessary escalations are blocked. An initial starting point of 0.75 is often used, followed by tuning based on the trade-off between accuracy and cost.

Drift Monitoring. User language and intent distribution change over time (concept and data drift). Monitoring the SLM average confidence scores is essential. A downward trend in average confidence indicates that the model requires retraining on recent data or that the threshold needs adjustment.


The Hybrid Intent Classification pattern represents a standard production approach. It combines the speed and efficiency of specialized encoder-based models — often overlooked in the LLM era — with the reasoning capacity of Large Language Models, using each component only when necessary.