TL;DR
Test-time scaling (TTS) boosts Large Language Model (LLM) performance by allocating more compute during inference, but finding the optimal budget allocation for multi-stage, interdependent workflows is a massive combinatorial challenge. This paper introduces AgentTTS, an LLM-agent framework that autonomously discovers the compute-optimal model selection and sample budget for each subtask in a complex pipeline. Guided by key empirical insights, AgentTTS drastically reduces search time while matching or exceeding state-of-the-art performance across diverse complex tasks.
What Problem Does This Paper Address?
Large language models can perform significantly better if given more "thinking time" or compute at inference—a technique known as Test-Time Scaling (TTS). Usually, this involves generating multiple candidate answers (repeated sampling) and using a verifier or fusion prompt to select or aggregate the best response.
However, prior research has almost exclusively focused on single-stage tasks like solving a standalone math problem or writing a single block of code. Real-world applications are rarely this simple; they are multi-stage pipelines (e.g., a Retrieval-Augmented Generation (RAG) system that first retrieves documents and then generates an answer, or an automated software development pipeline spanning coding, static testing, and dynamic testing).
Scaling compute in multi-stage tasks introduces two major hurdles:
- Combinatorial Search Space: For each subtask, you must choose which model size to use (e.g., 3B vs. 70B parameters) and how many samples to generate. The number of possible configurations grows exponentially.
- Subtask Interdependence: The compute allocated to an upstream task directly changes the difficulty of downstream tasks. For instance, if a large model performs high-quality retrieval, a small, cheap model can easily generate the final answer. Conversely, poor retrieval requires a larger downstream model or massive repeated sampling to compensate for the bad input.
Methods
To find the compute-optimal strategy without resorting to an expensive brute-force search, the authors designed AgentTTS, an autonomous LLM-agent-based optimization framework.
The method relies on three core pillars:
- Repeated Sampling with Fusion: Instead of relying on separate reward models, AgentTTS uses parallel sampling and leverages the LLM itself to fuse candidate responses into a final answer.
- Unified Budget Conversion: To compare configurations fairly, the authors derived a normalized budget function based on inference FLOPs (Floating-Point Operations). This formula translates any combination of model size, prompt length, generation length, and sample count into a single metric: how many passes of a standard 3B model on a base task would this cost?
- The AgentTTS Loop: The framework consists of an Agent (powered by an LLM like GPT-o3-mini), an Archive (storing historical trials and natural language guidelines), and an Environment (the actual execution platform).
The Agent doesn't search blindly. It begins by evaluating model preferences for each subtask. It then iteratively refines its strategy by generating natural language "exploration guidelines" based on performance feedback, focusing subsequent search rounds on the most promising budget boundaries.
Datasets
The authors evaluated AgentTTS across four distinct complex task categories using six open-source datasets:
- Retrieval-based QA:
2WikiMultiHopQAandHotpotQA - Knowledge Graph QA:
CWQ(ComplexWebQuestions) andWebQSP - Task Automation:
TaskBench(evaluating task decomposition, tool selection, and parameter prediction) - Automated Software Development:
ChatDev(evaluating coding, static testing, and dynamic testing phases)
Key Insights and Ideas
Through extensive pilot experiments, the authors uncovered three fundamental behaviors of LLMs in multi-stage environments that directly motivated AgentTTS's design:
- Subtasks have distinct model preferences: Upstream context-heavy tasks (like retrieval) strongly benefit from larger, high-capacity models. Downstream processing tasks (like QA) can often achieve peak performance using smaller models scaled up via repeated sampling.
- Test-time scaling saturates: Generating more samples initially boosts accuracy, but eventually plateaus or even degrades performance because the fusion process becomes a bottleneck for the model.
- Upstream quality shifts downstream dynamics: High-quality upstream outputs allow downstream subtasks to reach their optimal performance much earlier and with smaller models, saving massive amounts of compute.
Key Results
AgentTTS was compared against traditional optimization techniques like Bayesian Optimization (BO) and Random Search, as well as other LLM-based hyperparameter optimizers (AgentHPO, MLCopilot).
- Superior Search Efficiency: AgentTTS converged to optimal configurations significantly faster than all baselines. For example, on the
2WikiMultiHopQAdataset, AgentTTS found the optimal allocation in just 2.5 hours, compared to 8.3 hours for AgentHPO and over 12.5 hours for other methods. - Robustness to Data Constraints: When the search space landscape became noisy or non-smooth due to small training set sizes (e.g., searching on only 50 samples), traditional methods like BO failed or got stuck in local optima. AgentTTS maintained strong efficiency due to its built-in empirical insights.
- Interpretability: Because the agent generates explicit natural language guidelines at each step, developers can inspect why the agent chose to shift budget from one subtask to another.
Limitations and Future Work
The primary limitation acknowledged by the authors is that AgentTTS currently assumes static multi-stage tasks, meaning the sequence of subtasks is fixed and predetermined.
In many real-world applications (such as dynamic voice assistants), the workflow changes on the fly based on user input—the system must dynamically decide whether to retrieve a document, ask a clarifying question, or generate an immediate response. Extending this compute-optimal scaling framework to dynamic, evolving multi-stage architectures remains an open and promising direction for future research.
Summary updated