Beyond Query Memorization: Large Language Model Routing with Query Decomposition and Historical Matching

Bo Lv, Jingbo Sun
5/25/2026
1 citation
cs.AI

Official code: lvbotenbest/DecoR (101 stars, Python, MIT, last commit 2026-07-23).

Abstract

Optimizing the trade-off among predictive performance and computational cost is a central focus in the deployment of Large Language Models (LLMs). Current routing methods primarily rely on direct mapping from queries to models based on surface-level features, making them susceptible to the memorization trap and leading to poor generalizability on out-of-distribution (OOD) data.

Show full abstract

In this paper, we propose DecoR, a novel routing framework that recasts the routing task as a matching process of sifting similar queries from historical logs, effectively mitigating the memorization trap. To enhance matching accuracy, we introduce a query capability deconstruction method that decouples linguistic surface forms from task-intrinsic requirements, directing matching toward capability dimensions to ground decisions in essential task attributes. Furthermore, we develop CodaSet, a comprehensive benchmark for assessing routing generalization, where experimental results demonstrate that DecoR maintains superior accuracy while substantially lowering inference costs across both in-distribution and OOD settings. All the codes and data are available at https://github.com/lvbotenbest/DecoR.

View on arXivView PDF

Code Implementations(1)

lvbotenbest/DecoROfficial100%
MIT
1010Python, ShellApr 18, 20264 months agoMIT

Similar Papers

Cite this paper

@article{lv2026beyond,
  title  = {Beyond Query Memorization: Large Language Model Routing with Query Decomposition and Historical Matching},
  author = {Bo Lv and Jingbo Sun},
  year   = {2026},
  eprint = {2605.25558},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2605.25558v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2605.25558.svg)](https://codeofpaper.com/paper/2605.25558)

Discussion