Small language models (SLMs) are increasingly attractive for efficient, specialized deployment, and are typically trained on reasoning trajectories distilled from a larger teacher LLM. Generating this synthetic data is a major cost of the pipeline, especially when the teacher is a frontier model. Existing collection methods, however, are largely cost-unaware, or at best spread a fixed sampling budget uniformly across queries. Such allocation ignores the wide variation in problem difficulty and the strategic over- or under-sampling it invites. Thus, we propose THRIFTY, a Thompson-sampling bandit controller that spends a fixed generation-token budget to collect diverse correct reasoning trajectories, casting the task as a bandits-with-knapsacks problem with a novel diversity-aware objective. It tracks each problem's success probability with an online Beta posterior and spends each token where it expects the most new distinct correct solutions. Because repeated solutions add progressively less value, THRIFTY adaptively stops resampling saturated problems, concentrates budget on under-covered ones, and retires the unsolvable at the budget's opportunity cost. On math (AIME, MATH-500) and code (LiveCodeBench) benchmarks, THRIFTY gathers up to 22% more diverse correct trajectories per generation token than both the standard uniform-sampling recipe and the strongest adaptive baseline, with the largest gains in the scarce-budget and hard-problem regimes.
Figures & tables
Figure 1: The THRIFTY pipeline. Stage 1 (Calibration) probes a small subset (5–10%) of the dataset to derive sensible presets (generation length, query difficulty, diversity threshold etc.) from data rather than hand-tuning them. Stage 2 (Sampling) each round samples the problems of highest expected value per token, trading off solvability, solution novelty, diminishing returns, and cost. The net policy undersamples easy problems, oversamples the hard-but-solvable, and retires the hopeless. The run yields the distinct correct traces together with a per-query difficulty model at no extra cost. The greyed student SFT block illustrates a downstream use of this data (curriculum training a student) that is outside the scope of this paper.
Budget regime
Budget B
Calib. tokens
% of B
AIME ( M=300 ; probe =30 queries, 10% )
scarce ( K=2 )
540 k
52.5 k
9.7%
medium ( K=4 )
1.09 M
109.3 k
10.0%
ample ( K=8 )
2.18 M
218.7 k
10.0%
MATH-500 ( M=500 ; probe =50 queries, 10% )
scarce ( K=2 )
570 k
61.3 k
10.8%
Table 1: Calibration cost. Tokens spent by the calibration stage (Stage 1, incurred only by THRIFTY; the baselines run without calibration) and its share of the total budget B , per dataset and budget regime. Calibration probes a random 10% subset of the pool at K pulls per query and consistently consumes only 9 – 12% of B ; this probe cost is consumed from the same total budget.
AIME ( M=300 )
MATH-500 ( M=500 )
LiveCodeBench ( M=183 )
Allocator
K=2
K=4
K=8
K=2
K=4
K=8
K=2
K=4
K=8
Static allocation (baselines)
Random
0.160 ±0.007
0.123 ±0.003
0.095 ±0.005
0.589 ±0.010
0.387 ±0.012
0.254 ±0.013
0.463 ±0.001
0.349 ±0.005
0.148 ±0.011
Uniform
0.179 ±0.004
0.126 ±0.002
0.089 ±0.003
0.676 ±0.001
0.397 ±0.009
0.233 ±0.008
0.535 ±0.029
0.348 ±0.028
0.160 ±0.021
Dynamic allocation (baselines)
Difficulty-aware Bandit ( Graves et al., 2017 )
0.170 ±0.003
0.122 ±0.004
0.088 ±0.004
0.632 ±0.007
0.403 ±0.013
0.257 ±0.012
0.527 ±0.025
0.340 ±0.015
0.150 ±0.016
Table 2: Main results: per-token efficiency (dv/1k). Diverse value per 1000 budget tokens, dv/1k=1000∑qln(1+v(q))/∑qc(q) (higher is better). Cells are mean ±std over 3 seeds; budgets follow B=K⋅M⋅cˉ completion tokens ( K=2,4,8 are the scarce/medium/ample regimes, i.e. 25/50/100% of the ample budget). Best per column in bold.
AIME
MATH-500
LiveCodeBench
cov@1
#dist
dv/1k
cov@1
#dist
dv/1k
cov@1
#dist
dv/1k
Scarce (25%)
Uniform
120 ±4
168 ±6
0.179 ±0.004
438 ±7
671 ±4
0.676 ±0.001
74 ±6
128 ±6
0.535 ±0.029
Entropy
113 ±1
162 ±5
0.172 ±0.002
434 ±2
665 ±8
0.671 ±0.007
76 ±3
128 ±0
0.547 ±0.000
THRIFTY
120 ±0
141 ±4
0.177 ±0.002
440 ±4
649 ±0
0.747 ±0.006
73 ±0
146 ±1
0.633 ±0.011
Medium (50%)
Table 3: All three metrics across budget regimes , for the standard recipe (Uniform), the closest prior bandit (Entropy, Zuo and Zhu, 2025 ), and THRIFTY: coverage@1 (problems solved ≥1× ), distinct correct trajectories ( # dist =∑qv(q) ), and per-token efficiency (dv/1k). Cells are mean ±std over 3 seeds; dv/1k best per cell (among these three) in bold. Table 2 gives dv/1k for all five allocators.