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-WongNeurIPS 2026

TL;DR

Sending every user prompt to a massive frontier LLM is like commuting to the grocery store in a Formula 1 car: effective, yet ruinously expensive. "LLM routers" solve this by directing queries to the cheapest model capable of answering them well, but training a good router normally requires pooling everyone's private prompts and model evaluations in one place. This paper introduces the first federated framework for LLM routing, allowing isolated clients to collaboratively learn an optimal routing policy without ever exposing their local data.

What Problem Does This Paper Address?

When organizations or edge devices access LLMs via APIs, they face a vast menu of models varying wildly in intelligence and token cost. Language query routing optimizes the accuracy–cost trade-off by predicting which model will maximize utility—defined as expected accuracy minus a cost penalty weighted by a user-chosen budget parameter ($\lambda$).

Standard routers assume you have a massive, centralized dataset where diverse prompts have been exhaustively tested across all candidate models. Reality looks very different:

  1. Privacy: Prompts contain proprietary code, personal queries, or customer chats that cannot be centralized.
  2. Narrow local views: A single client only sees queries from its specific domain (e.g., biology or coding).
  3. Sparse evaluations: In the wild, a client typically sends a prompt to just one model, leaving the capabilities of other models on that prompt completely unknown.

If a client trains a router solely on its own sparse, skewed logs, the router overfits and makes noisy decisions.

Methods

The authors apply Federated Learning (FL)—where clients train models locally and a central server aggregates only the learned parameters or statistics—to two canonical router architectures, both operating on fixed text embeddings of the queries. Rather than hardcoding a single budget preference, both routers predict per-model accuracy and cost, letting each client dial in its own $\lambda$ at inference time.

Figure 1: Federated LLM Router System Description. (i) Clients possess queries from different tasks, and each query is evaluated only on some LMs (in our experiments, we consider the extreme case of one LM per query, where the choice of LM is client-specific and can be highly non-uniform). (ii) Federated Learning setup where clients train their local router on local data, and central server aggregates these local models and returns global model to clients. (iii) Functioning of router, where modelwise accuracy and cost is calculated for the given query, which is routed to the most suitable model that maximizes the objective value.
  • Federated MLP-Router (Parametric): Uses a shared Multilayer Perceptron (MLP) trunk with model-specific linear heads to predict accuracy and cost. It is trained across clients via standard Federated Averaging (FedAvg) using Mean Squared Error loss on whatever single-model evaluations each client possesses.
  • Federated K-Means-Router (Nonparametric): Exploits geometry in the embedding space without neural network training. Clients run local K-means clustering on their query embeddings and send cluster centroids and sizes to the server. The server runs a size-weighted K-means to establish global centroids and broadcasts them back. Clients then tally average accuracy and cost per model within each global cluster, which the server aggregates via weighted averaging.
  • Adaptive Personalization: For extreme data heterogeneity (where a global router might struggle on a client's niche domain), the authors introduce a lightweight inference-time mixture. Clients measure the mean absolute error of both the federated router and their local router on their own training data (requiring zero new LLM calls) and blend their predictions inversely proportional to those errors.

Datasets

No new datasets were introduced. Instead, the authors simulate fragmented, non-IID federated environments (partitioning tasks via a Dirichlet distribution and restricting each training query to a single evaluated model) across three existing multi-LLM evaluation benchmarks:

  • RouterBench-Data: 11 public and proprietary LLMs across 8 datasets (primary focus of the main text).
  • ProxRouter-Data: 14 public LLMs across 12 datasets.
  • SPROUT: 13 public and proprietary LLMs across 6 datasets (featuring graded response quality).

Key Insights and Ideas

  • Collaboration fixes local blind spots, not just out-of-distribution generalization: You would expect FL to help a client handle unfamiliar query types. More surprisingly, FL substantially improves routing on a client's own local test distribution. Because each client only evaluates a skewed subset of LLMs, cross-client aggregation fills in the missing "model coverage," teaching the client about strong or cheap models it rarely sampled locally.
  • Plug-and-play model expansion: With millions of models emerging, retraining routers from scratch is impractical. Both federated designs onboard new LLMs cheaply: K-Means simply computes new cluster averages, while the MLP freezes its trunk and trains a new linear head—requiring clients to evaluate the new models on just a 10% calibration slice of prompts.
  • Theoretical backing for collective coverage: The authors prove mathematically that federated routing shrinks suboptimality bounds compared to local routing—scaling with total pooled dataset coverage for MLPs and increasing the minimum cluster-model sample counts ($n_{\text{min}}$) for K-Means.

Key Results

Performance is measured by sweeping the cost-preference $\lambda$ and calculating the normalized Area Under the accuracy–cost Curve (AUC, where higher means a better frontier).

Global test accuracy-cost curves showing federated routers outperforming isolated client-local routers.
  • Global Generalization: On RouterBench global tests, Federated MLP achieves 0.750 AUC vs. 0.683 for client-local routers. Federated K-Means jumps to 0.747 AUC vs. 0.655 locally (local clustering suffers badly from sparse, unstable centers).
  • Parity with Centralized Training: Both federated routers achieve an AUC of 0.75, matching centralized oracle routers trained on pooled raw data (0.75).
  • In-Distribution Gains: On local client test sets, federated routers consistently beat isolated local routers (e.g., jumping from 0.64 to 0.77 AUC on Client 8 for K-Means).
Figure 3: Federated vs. client-local routers eval- uated on local test sets. Representative clients for MLP-Router and K-Means-Router are shown. Fed- erated training improves the in-distribution accuracy– cost frontier via better effective model coverage.
  • Cheap Onboarding & Personalization: Adding three withheld models via 10% calibration lifts global AUC from 0.732 to ~0.749 for both methods. Under extreme heterogeneity (Dirichlet $\alpha = 0.03$), adaptive personalization rescues MLP performance when the global model lags locally (e.g., lifting Client 4 to 0.72 AUC over 0.69 federated and 0.70 local).

Limitations and Future Work

  • Offline static logs: The framework assumes clients learn from static, offline historical datasets. Updating routers dynamically in an online bandit-like setting—where routing decisions actively gather new evaluations after deployment—is left for future work.
  • Global misalignment in extreme niches: Under severe statistical heterogeneity, a pure federated MLP router can underperform a local router on niche client distributions, requiring the heuristic local-error calibration step to recover performance.

Summary updated

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 three 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.
BibTeX
@inproceedings{askin2026federate,
  author = {Baris Askin and Shivam Patel and Anupam Nayak and Andrea Vigano and Jiin Woo and Gauri Joshi and Carlee Joe-Wong},
  title = {{Federate the Router: Learning Language Model Routers with Sparse and Decentralized Evaluations}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=MABQINnqfs},
}
Figure