Embedding Geometry Shapes LLM Routing: Tracing Failure Modes and Improving Generalization
cs.AI, cs.LG, stat.ML
Submitted: 2026-10-13
Updated: 2026-10-13
Comments: 50 pages, 7 figure, 45 tables
License: http://creativecommons.org/licenses/by/4.0/
The gist: With the growing number of LLMs available, selecting which one to use for a prompt has become a key question.
Terminology
Abstract
With the growing number of LLMs available, selecting which one to use for a prompt has become a key question. A large part of the routing literature relies on semantically embedding prompts into a vector space and then applying a lightweight classifier to the embedded representations. These methods perform robustly in-distribution but they struggle to generalize to unseen tasks. By studying the geometry of semantic embeddings, we trace a clear failure mode: features that determine the neighbors of unseen prompts are an unreliable proxy for LLM selection. We therefore replace the semantic embedding with the following map: we run a partial forward pass of Qwen2.5-7B-Instruct on the prompt and use the hidden state of its last token at a deep layer as the representation. When applying kNN and other simple classifiers to this new representation, we obtain a clear result in generalization: on average across cost penalties, their performance improves. Moreover, kNN and another simple classifier that we propose outperform every evaluated semantic-embedding baseline. Our two simple methods also beat a recent SoTA hidden-states based router on RouterBench.
Sources
- Rethinking Predictive Modeling for LLM Routing: When Simple kNN Beats Complex Learned Routers
- The Routing Plateau: Understanding the Accuracy Limits of LLM Routers
- LLM Router: Rethinking Routing with Prefill Activations
- Towards General Text Embeddings with Multi-stage Contrastive Learning
- Qwen2.5 Technical Report
- RouterBench: A Benchmark for Multi-LLM Routing System
- CARROT: A Cost Aware Rate Optimal Router
- LLMRouterBench: A Massive Benchmark and Unified Framework for LLM Routing
- Most of the LLM Routing Gap Is Task Type
- Large Language Model Routing with Benchmark Datasets
- ProxRouter: Proximity-Weighted LLM Query Routing for Improved Robustness to Outliers
- Universal Model Routing for Efficient LLM Inference
- No Answer Needed: Predicting LLM Answer Accuracy from Question-Only Linear Probes
- LLMs Encode Their Failures: Predicting Success from Pre-Generation Activations
- Training-Free versus Training-Based Intent Classification in LLMs: Accuracy, Robustness, and Failure Modes
- Towards Fair and Comprehensive Evaluation of Routers in Collaborative LLM Systems
- Measuring Massive Multitask Language Understanding
- Training Verifiers to Solve Math Word Problems
- Think you have Solved Question Answering? Try ARC, the AI2 Reasoning Challenge
- WinoGrande: An Adversarial Winograd Schema Challenge at Scale
Related papers
- MAVEN-T: Reinforced Heterogeneous Distillation for Real-Time Multi-Agent Trajectory Prediction
- Model Discovery Agent: LLM-assisted Bayesian experiment design for data-efficient discovery of mechanistic world models
- Agents' Last Exam
- The Clinician's Veto: Navigating Trust, Liability, and Uncertainty in Autonomous AI Prescribing
- MindHelper: Closed-Loop Embodied Mental-State Reasoning for Precision Intervention
- Incumbent Advantage: Brand Bias and Cognitive Manipulation Dynamics in LLM Recommendation Systems