As artificial intelligence systems grow more complex, relying on a single monolithic model is often inefficient and costly. Instead, modern architectures increasingly employ a routing strategy known as Learning to Defer (L2D). In this paradigm, simple tasks are handled by lightweight models, while complex or uncertain inputs are deferred to specialized, often more expensive, experts—such as a massive Large Language Model (LLM) or a human specialist. While highly promising, two-stage L2D systems face a critical bottleneck: expert imbalance.
The "Lazy Router" Trap
In real-world scenarios, a single "generalist" expert often performs adequately across a vast majority of tasks. Standard routing algorithms quickly learn this distribution and fall into what can be described as the "lazy router" trap. They begin defaulting to the majority expert almost exclusively, ignoring specialized or smaller experts that might be perfectly capable of handling specific niche tasks at a fraction of the computational cost.
Traditional imbalance techniques fail to solve this because they focus on class labels (e.g., adjusting for the fact that there are more cats than dogs in a dataset). In deferral systems, however, the imbalance exists in the input-expert domain—it is about identifying who is best suited for the job, which might be entirely independent of the label itself.
Introducing MILD: Margin-Based Imbalanced Learning to Defer
To address this systemic flaw, researchers have introduced MILD (Margin-based Imbalanced Learning to Defer). MILD reframes the routing challenge as a cost-sensitive learning problem over the input-expert domain.
Unlike standard methods that rely solely on error rates, MILD incorporates a margin parameter ($\rho_k$) for each expert. Intuitively, MILD applies a "tax" to over-selected dominant experts through dynamic thresholding. It forces the router to achieve exponentially higher confidence before it is allowed to select the majority expert. This mechanism effectively makes it "cheaper" for the router to trust an underutilized or specialized expert, restoring balance to the system.
Theoretical Foundations
A major contribution of MILD is its strong theoretical backing. The authors prove $\mathcal{F}$-consistency bounds for their approach, ensuring that minimizing their surrogate margin-based loss function mathematically guarantees the minimization of the real-world deferral loss. This is a significant advancement over the weaker Bayes-consistency typically seen in the literature. Furthermore, MILD is designed for two-stage flexibility: it optimizes the router without requiring the retraining of the underlying experts, a crucial feature when dealing with proprietary, black-box LLMs or human professionals.
Empirical Validation: Vision and Language
The researchers evaluated MILD across both computer vision and natural language processing domains:
- Image Classification: Using CIFAR-10, CIFAR-100, SVHN, and Tiny ImageNet, the team created synthetic experts with perfect knowledge over specific label subsets to simulate severe imbalance (e.g., one expert covering 90% of the data).
- Real-World LLM Routing: Utilizing the MMLU (Massive Multitask Language Understanding) benchmark, they employed a lightweight DeBERTa-v3-xsmall model to route queries among the Qwen 2.5 family—a 7B "Strong" expert, a 1.5B "Medium" expert, and a 0.5B "Tiny" expert.
Key Results and Insights
The results demonstrate clear improvements in both accuracy and cost-efficiency:
- Preventing LLM Collapse: On the MMLU routing task, the state-of-the-art baseline (TDEF) suffered a complete collapse, routing queries to the most expensive 7B model 99.6% of the time. MILD successfully identified when smaller models were sufficient, routing only 83.3% of queries to the 7B model and achieving a distribution much closer to the theoretical optimum.
- Cost Reduction: In settings optimizing for both error and cost, MILD achieved significantly lower total loss than all other tested baselines, including Standard Cross-Entropy (CE), Class-Weighted CE, and LDAM.
- Robustness to Hallucinations: An intriguing finding was MILD's robustness to unpredictable errors. When researchers injected 20% noise into the cost estimates—simulating erratic LLM hallucinations—baseline performance plummeted. MILD remained stable, as its margin-based boundaries acted as a buffer against estimation errors.
Limitations and Future Directions
Despite its success, MILD has a few limitations. It requires an initial offline phase to estimate the performance and cost matrix of the experts. While computationally negligible, it necessitates a representative validation set. Additionally, the current framework assumes static experts; adapting MILD to "online" settings where expert capabilities evolve over time remains an open challenge. Finally, extending this margin-based theory to complex structured prediction tasks, such as translation or protein folding, represents an exciting frontier for future research.
Summary updated