Adaptive LLM Routing for Scientific Workflows: Predicting Query Complexity to Optimize Cost
Abstract
Scientific workflows increasingly incorporate large-language-model (LLM) services for tasks such as metadata curation, code generation, and interactive analysis. However, inference cost in terms of resource usage varies widely with query complexity, both for service-based or self-hosted setups. Current “always-XL” deployments tend to over-provision: they safeguard response quality but squander compute usage. We introduce a routing framework based on query complexity estimations that trains a lightweight classifier on past multi-model performance data to predict the smallest model likely to satisfy a target quality threshold and then routes queries accordingly. Evaluated on $\text{4 0, 0 0 4}$ Mix-Instruct prompts, our method matches an XL-only baseline ($+0.27 \%$ quality) while reducing floating-point operations by 12.9 %, achieving competitive performance at a fraction of the cost. The method thus enables scalable, complexity-aware routing for LLM services within data- and compute-intensive scientific workflows.
BibTeX
@inproceedings{thierfeldt2025adaptive,
author = {Jonas Thierfeldt and Dominik Scheinert and Thorsten Wittkopp and Odej Kao},
title = {{Adaptive LLM Routing for Scientific Workflows: Predicting Query Complexity to Optimize Cost}},
booktitle = {IPCCC},
year = {2025},
url = {https://openreview.net/forum?id=Kx3VbOgRoh},
}Ask Althea to put this paper to the test.
Loading related content...