---
title: 'GMTRouter: Personalized LLM Routing Framework'
url: https://www.emergentmind.com/topics/gmtrouter
type: topic
---

# GMTRouter: Personalized LLM Routing Framework

GMTRouter is a personalized large language model (LLM) routing framework that formulates multi-turn user-LLM interactions as a heterogeneous graph and employs a tailored message-passing mechanism for effective few-shot user modeling and routing. GMTRouter addresses the challenges of idiosyncratic user preferences, data sparsity, feedback noise, and the limitations of existing LLM routing solutions by generalizing to new users and evolving preferences without costly retraining or fine-tuning [2511.08590].

## 1. LLM Routing: Motivation, Formalization, and Challenges

LLM routing is the task of selecting, for each user query \( q \), an appropriate model \( m \) from a candidate set \( \mathcal{M} = \{m_1, \dots, m_n\} \) with the goal of maximizing user satisfaction under computational constraints. In the personalized, multi-turn setting, a user's full interaction history is represented by
\[
\mathcal{H}_u = \bigl\{(q^{(t)},\, r^{(t)},\, f^{(t)})\bigr\}_{t=1}^{T_u},
\]
where \( f^{(t)} \) is the user's structured or unstructured feedback after each LLM response \( r^{(t)} \). The personalized routing problem is thus to learn
\[
\pi(u, q) = \arg\max_{m\in\mathcal{M}}\; \mathbb{E}[f(u, q, m)],
\]
where \( \pi \) is a routing function optimizing user-specific, query-conditioned satisfaction.

Empirical analyses show that inter-user Spearman correlations of LLM rankings are only 44–65% of intra-user consistency, confirming a high degree of user-level idiosyncrasy. Existing routing strategies, including FrugalGPT, C2MAB-V, and GraphRouter, do not capture this complexity: they either ignore longitudinal dialogue structure or cannot reliably encode sparse and noisy feedback into personal user profiles, especially under conditions of missing and inconsistent data.

## 2. Heterogeneous Graph Representation of Multi-turn Interactions

GMTRouter introduces a novel heterogeneous graph construction to preserve relational structure among users, LLMs, queries, responses, and interaction turns. Specifically, the graph is defined as
\[
\mathcal{G} = (\mathcal{V},\, \mathcal{E},\, \mathcal{X}),
\]
with node set decomposition
\[
\mathcal{V} = \mathcal{U} \cup \mathcal{M} \cup \mathcal{Q} \cup \mathcal{R} \cup \mathcal{T},
\]
where \( \mathcal{U} \) (users), \( \mathcal{M} \) (models), \( \mathcal{Q} \) (queries), \( \mathcal{R} \) (responses), and \( \mathcal{T} \) (turns) are node types. Edges include user–turn, turn–model, turn–query, turn–response, and sequential turn–turn temporal links.

Feature matrices for nodes are as follows:

| Node Type      | Feature Construction         | Dimension                |
|----------------|-----------------------------|--------------------------|
| User (\(u\))   | Initialized as all zeros    | \( |\mathcal{U}| \times d \) |
| Model (\(m\))  | PLM-embedded overview       | \( |\mathcal{M}| \times d \) |
| Query (\(q\))  | PLM-encoded (\( h_q \))     | \( |\mathcal{Q}| \times d \) |
| Response (\(r\))| PLM-encoded (\( h_r \))    | \( |\mathcal{R}| \times d \) |
| Turn (\(t\))   | Initialized as all zeros    | \( |\mathcal{T}| \times d \) |

User feedback \( f \) is discretized and projected to \( h_p \), a scalar feature attached to response nodes. The adjacency structure can be encoded either as relation-specific adjacency tensors or as neighbor-type lists \( \mathcal{N}_r(v) \), reflecting edge heterogeneity and temporal ordering.

## 3. Message Passing with a Heterogeneous Graph Transformer

GMTRouter leverages a Heterogeneous Graph Transformer (HGT) to propagate information across typed nodes and edges. For any node \( v \) at layer \( l \), the update rule is:
\[
h_v^{(l)} = \mathrm{LayerNorm}\Bigl(\mathrm{Dropout}\bigl(\mathrm{HGTConv}^{(l)}(h_v^{(l-1)},\,\mathcal{G})\bigr)\Bigr)
\]
with
\[
\mathrm{HGTConv}^{(l)}(h_v) = \sum_{r=1}^R \sum_{v'\in \mathcal{N}_r(v)} \alpha_{v,v'}^{(r)} W_{r}^{(l)} h_{v'}^{(l-1)}.
\]
The relation-specific attention score for edge type \( r \) is
\[
\alpha_{v,v'}^{(r)} = \frac{\exp\bigl((W^{Q}h_{v})^\top (W^K_r h_{v'})/\sqrt{d}\bigr)}{\sum_{u'\in \mathcal{N}_r(v)} \exp\bigl((W^{Q}h_{v})^\top (W^K_r h_{u'})/\sqrt{d}\bigr)}.
\]
This architecture facilitates the flow of feedback \( h_p \) from response nodes to user embeddings through turns and incorporates different edge semantics via dedicated weights \( W_r \). This framework allows effective integration of sparse feedback and captures nuanced, multi-relational dependencies needed for robust user modeling.

## 4. Inductive Few-shot Graph Learning and Preference Prediction

GMTRouter eschews full-graph transductive training in favor of inductive, subgraph-sampling learning. For each user \( u \) and epoch, a subgraph \( \mathcal{G}_\text{sub} \) covering \( k \) recent turns is sampled. A small supervision set of tuples \( \{(u, q, m)\} \) is held out.

After applying \( L \) HGT layers, preference scores are computed via a cross-attention prediction head:
\[
s_{u,q,m} = f_\mathrm{pred}(h_u^{(L)},\, h_q^{(0)},\, h_m^{(L)}).
\]
A ranking-oriented entropy loss is used:
\[
\mathcal{L} = -\sum_{(u,q,m)} y_{u,q,m}\,\log \sigma(s_{u,q,m}) + (1-y_{u,q,m})\,\log(1-\sigma(s_{u,q,m})),
\]
where \( y_{u,q,m} \) is the normalized ground-truth rating, and only GNN and prediction head parameters are updated—node features from PLM encodings remain fixed. This approach yields effective generalization from few-shot supervision and is robust to feedback sparsity and noise.

## 5. Adaptation to New Users and Evolving Preferences

GMTRouter supports rapid adaptation to previously unseen users or users whose preferences change. For a new user \( u^* \) with \( k \ll T_{u^*} \) past turns, the framework builds a minimal \( \mathcal{G}_\text{sub}^* \), initializes \( h_{u^*}^{(0)} = 0 \), and, after encoding new queries, responses, and models, infers \( h_{u^*}^{(L)} \) via the HGT. For routing, it selects the model maximizing the predicted user preference score:
\[
m^* = \arg\max_{m \in \mathcal{M}} s_{u^*, q, m}.
\]
No gradient updates or parameter fine-tuning are necessary at inference, enabling efficient deployment in dynamic, user-facing scenarios. As preferences evolve, inference can be re-applied to newly appended turns in the user's ongoing graph, facilitating continual user modeling.

## 6. Experimental Evaluation: Datasets, Baselines, and Results

GMTRouter's empirical efficacy is established via experiments on four datasets: Chatbot-Arena (11 users, 16 LLMs, human pairwise preferences), MT-Bench (10 users, 2 LLMs, multi-turn reasoning), GSM8K (10 users, 2 LLMs, math problems), and MMLU (5 users, 2 LLMs, multi-domain queries). Evaluation metrics include top-1 model accuracy and AUC-ROC.

Comparative baselines:

| Router             | Personalization | Graph Structure | Cost Awareness |
|--------------------|----------------|-----------------|---------------|
| Vanilla LLM        | No             | No              | No            |
| Personalized LLM   | Yes            | No              | No            |
| GraphRouter        | No             | Yes             | No            |
| FrugalGPT          | No             | No              | Yes           |

On average splits, GMTRouter achieves 0.9–21.6 percentage-point gains in accuracy and 0.006–0.309 higher AUC than any baseline. Performance drop under 30% cold-start users is less than 1%. Ablations show that removing explicit preference features, the tailored prediction head, heterogeneous message passing, or user nodes each degrades accuracy by 2–20 percentage points.

## 7. Contributions, Insights, and Practical Considerations

The central contribution of GMTRouter is the formalization of personalized, multi-turn LLM routing as a node classification and ranking task on a user–turn–query–response–model heterogeneous graph reinforced with a relation-aware transformer architecture. The tailored HGT message-passing framework enables explicit propagation of sparse and noisy feedback across relational structures, supported by inductive, few-shot subgraph-based learning. This enables generalization to new users and evolving preferences without retraining.

Empirical results indicate that GMTRouter substantially outperforms both non-personalized and prompt-based approaches, offering improvements of up to 21.6% in accuracy and 0.309 in AUC. The model is lightweight (approximately 27M parameters, 109 MB, requiring 4.3 GB GPU memory) and hence suitable for production deployment. Potential limitations include dependency on accurate entity extraction and pre-trained language models for node initialization. Future directions include dynamic graph updates, richer feedback types, and integration with retrieval-augmented generation [2511.08590].

Source: https://www.emergentmind.com/topics/gmtrouter