In the deployment of Large Language Models (LLMs), balancing inference quality with computational cost is a central challenge. Traditionally, practitioners have relied on two independent strategies to manage this trade-off: Model Routing and Test-Time Scaling (TTS). A new framework, UniScale, introduces a paradigm shift by unifying these approaches into a single, adaptive system, achieving a superior balance of performance and efficiency.
The Problem: Siloed Inference Optimization
Currently, LLM inference optimization suffers from a siloed design that limits its effectiveness:
- Model Routing is Coarse-Grained: Routing switches between models of different scales (e.g., from a 7B to a 70B parameter model) to match request complexity. However, this yields discrete, massive jumps in both cost and accuracy, leaving large efficiency gaps.
- Test-Time Scaling Hits Capacity Ceilings: TTS adjusts inference-time compute within a fixed model (e.g., via Best-of-N sampling or tree search). While it offers fine-grained control, a smaller model can only improve so much by "thinking longer" before it hits its inherent capacity limit, leading to diminishing returns.
Treating these mechanisms separately restricts adaptability, especially in dynamic environments where hardware availability or query distributions shift over time. Manual tuning across both dimensions for every possible query is practically impossible.
The Solution: Unified Inference Scaling (UIS)
The authors of UniScale propose Unified Inference Scaling (UIS), which recognizes the inherent synergy between routing and TTS. TTS can "fill the gaps" between discrete model sizes, while routing to a larger model can break through the capacity ceilings of smaller ones.
UniScale is an online framework that jointly optimizes which LLM to use and how much search compute to allocate for a specific query. Instead of merely selecting a model, the system selects a configuration tuple: (Model, Question Parallelism, Candidate Parallelism, Beam Size).
Methodology: How UniScale Works
To navigate this massive, high-dimensional optimization space, UniScale models adaptive UIS as a contextual multi-armed bandit problem. Key innovations include:
- Contextual Bandits (LinUCB): The system treats each configuration as an "arm." By evaluating query features (the context), it predicts the configuration that maximizes the reward—a delicate balance of accuracy and cost.
- Action Semantic Representations: UniScale uses a Transformer encoder to map model specifications and search parameters into a continuous vector space. This allows the system to recognize semantic similarities between configurations (e.g., "Model A with heavy search" vs. "Model B with light search"), significantly accelerating the learning process.
- Dense Verification Feedback: Instead of relying on sparse binary (Correct/Incorrect) labels, UniScale utilizes dense internal scores from a Process Reward Model (PRM) to provide richer learning signals, helping the bandit learn which configurations are "getting warmer."
- Path-Aware Early Exiting: Leveraging verifier scores during the search process, UniScale terminates unpromising reasoning paths early. This saves compute without degrading accuracy.
- eFLOPs Cost Modeling: To ensure stable optimization, the framework employs "equivalent FLOPs" to standardize cost comparisons across different hardware and architectures, accounting for both raw computation and memory access overhead.
Evaluation and Results
Evaluated on challenging reasoning and coding benchmarks—MATH-500, AIME ’24 & ’25, and LiveCodeBench—UniScale demonstrated significant improvements over existing methods:
- Superior Pareto Frontier: UniScale consistently identified configurations that delivered higher accuracy at lower costs compared to baselines like MLP-based routers or standard Thompson Sampling. It effectively smoothed the accuracy-cost frontier, turning disconnected routing "dots" into a continuous curve.
- Massive Efficiency Gains: In cost-sensitive scenarios, UniScale matched the accuracy of much larger models while reducing computational load by over 75% compared to strong baselines like k-NN routers.
- Robustness to Environmental Drift: When subjected to simulated environmental changes (e.g., the sudden removal of efficient small models from a server), UniScale's regret spiked only briefly. It quickly recovered by identifying the next-best configurations in the semantic space.
Limitations and Future Directions
UniScale’s current performance heavily depends on the quality of Process Reward Models (PRMs) for dense feedback and early exiting. If the verifier is inaccurate, the system's efficiency and learning stability drop.
Future research will focus on developing more generalizable verification mechanisms that do not rely on task-specific reward models. Additionally, the authors plan to expand the framework to open-ended creative tasks where "correctness" is subjective, and explore federated optimization to share learned policies across multiple nodes while preserving data privacy.
Summary updated