Federate the Router: Learning Language Model Routers with Sparse and Decentralized Evaluations
Baris Askin, Shivam Patel, Anupam Nayak, Andrea Vigano, Jiin Woo, Gauri Joshi, Carlee Joe-Wong
TL;DR
This work tackles the problem of routing queries among multiple remotely hosted LLMs when client data and evaluations are privacy-sensitive and sparsely distributed. It introduces a federated learning framework for LLM routing and develops two router families: a parametric Federated MLP-Router and a nonparametric Federated K-Means-Router, both trained with FedAvg to predict per-model accuracy $\text{acc}(\mathbf{x},m)$ and cost $\text{cost}(\mathbf{x},m)$ and to maximize the utility $U_{\lambda}(\mathbf{x},m)=\text{acc}(\mathbf{x},m)-\lambda\text{cost}(\mathbf{x},m)$. Theoretical results establish convergence and suboptimality bounds for both routers, showing that federated training improves data coverage and reduces routing errors compared to client-local training. Empirically, across RouterBench-Data and ProxRouter-Data, federated routers achieve better accuracy-cost frontiers, with adaptive personalization enhancing robustness under extreme heterogeneity and new-model adaptation enabling lightweight, scalable extension. The findings highlight the practical impact of privacy-preserving, cross-client routing signals for efficient, high-quality LLM deployment in edge and enterprise settings, even as model pools evolve.
Abstract
Large language models (LLMs) are increasingly accessed as remotely hosted services by edge and enterprise clients that cannot run frontier models locally. Since models vary widely in capability and price, routing queries to models that balance quality and inference cost is essential. Existing router approaches assume access to centralized query-model evaluation data. However, these data are often fragmented across clients, such as end users and organizations, and are privacy-sensitive, which makes centralizing data infeasible. Additionally, per-client router training is ineffective since local evaluation data is limited and covers only a restricted query distribution and a biased subset of model evaluations. We introduce the first federated framework for LLM routing, enabling clients to learn a shared routing policy from local offline query-model evaluation data. Our framework supports both parametric multilayer perceptron router and nonparametric K-means router under heterogeneous client query distributions and non-uniform model coverage. Across two benchmarks, federated collaboration improves the accuracy-cost frontier over client-local routers, both via increased effective model coverage and better query generalization. Our theoretical results also validate that federated training reduces routing suboptimality.
