Scaling large language model (LLM) performance often involves "throwing more compute" at inference through repeated sampling. This paper introduces OSCA (Optimized Sample Compute Allocation), an algorithm that demonstrates that mixing different sampling configurations—such as varying temperatures, models, or programming languages—can achieve the same accuracy as standard methods with up to 128x less compute.
The Inference-Time Scaling Problem
As LLMs hit diminishing returns in pre-training, researchers are turning to "inference-time scaling." The idea is that a model can solve harder problems if allowed to "think" longer by generating many candidate answers (e.g., Best-of-N sampling or self-consistency).
The standard approach is "pure allocation": picking one "best" configuration (like GPT-4o at temperature 0.7) and sampling from it $N$ times. However, different problems are often "unlocked" by different settings. A logic puzzle might require a low temperature for precision, while a creative coding task might benefit from a high temperature for diversity. Using a single configuration is inefficient because it wastes compute on settings that are sub-optimal for a large portion of the problem set.
Methodology: The OSCA Algorithm
The authors propose OSCA, which treats compute allocation as a learning problem to find a portfolio of settings that complement each other.
The process involves three main steps:
- Estimation: Using a small training set, each problem is sampled using various configurations (different models, temperatures, etc.) to estimate the probability $p_{ij}$ that configuration $i$ solves problem $j$.
- Optimization: An objective function is formulated to maximize the expected
pass@C(the probability that at least one sample in a total budget $C$ is correct). - Hill-Climbing: While the discrete optimization problem is NP-hard, the relaxed version is convex. The authors use a hill-climbing algorithm to find the optimal "mix" of configurations, deciding exactly how many samples to draw from each setting.
Evaluation and Key Insights
The researchers evaluated OSCA across several rigorous benchmarks, including LiveCodeBench (LCB) for programming, LiveBench (LB) for general reasoning, BigCodeBench (BCB) for complex code generation, and SWE-Bench for agentic workflows.
- The Power of Diversity: A Uniform Mixed allocation (sampling equally from all settings) often beats the "Optimal Pure" configuration. This suggests that sample pool diversity is more important than the peak performance of any single setting.
- Complementary Configurations: OSCA learns to pair configurations, such as combining a high-reasoning model at low temperature with a more creative model at high temperature to cover edge cases.
- Generalization: The optimal mix calculated on a training set generalizes well to unseen problems, requiring only a small training set to find an effective mix.
Key Results
- Massive Efficiency Gains: On LiveCodeBench, OSCA achieved the same accuracy as the best single configuration while using 128x less compute.
- Reasoning Speedup: On reasoning tasks, it achieved a 25x compute reduction.
- Agentic Boost: On SWE-Bench, OSCA helped the "Agentless" framework achieve better accuracy with 3x less compute than the default configuration.
- Scaling: As the compute budget increases, the performance gap between the optimized mix and standard pure allocation continues to widen.
Conclusion
While the study focused on four main hyperparameters (model, temperature, language, and prompt), OSCA provides a foundation for making inference-time scaling significantly more accessible and cost-effective. By moving away from "pure" sampling strategies toward optimized portfolios, developers can achieve state-of-the-art performance with a fraction of the traditional compute cost.
Summary updated