Agentic AI
New Framework Unites LLM Selection and Parameter Tuning for Better Task Performance
A hierarchical routing system jointly optimizes which language model to use and how to fine-tune it for each task.
When handling diverse tasks, different large language models excel in different areas. Rather than choosing a single model upfront, LLM routing tries to match tasks to the models best suited for them. However, prior routing methods have treated candidate models as static entities—picking architecture A or B without accounting for how those models might adapt to individual inputs.
A new approach called HAPS (Hierarchical LLM Routing with Joint Architecture and Parameter Search) goes further by combining architectural selection with real-time parameter adaptation. The framework operates in two layers: a high-level router selects which LLM architecture fits a given prompt, while a low-level router then generates custom LoRA parameters—lightweight, input-specific adaptations—for the chosen model. This two-tier design transforms each fixed architecture into a flexible zone of possible behaviors, rather than a single predetermined response pattern.
How It Works#
Both routing layers share a common representation of the prompt, allowing architectural choices and parameter generation to inform each other. The entire system is trained using a reinforcement learning objective, continuously refining which models to pick and how to tune them based on task outcomes.
Testing the Gains#
Across reasoning-intensive and knowledge-heavy benchmarks, HAPS consistently beats existing routing baselines. The authors also provide detailed analysis of individual components, design trade-offs, computational costs, and real-world deployment with a mix of open-source and closed-source models, demonstrating the method's practical robustness.
Code for HAPS is publicly available, enabling further research and adoption.

