Thought-Level Beam Search for Reasoning
Gambit在推理模型生成多条答案的过程中,实时把算力集中投给最有希望的那条
大型推理模型常靠并行生成多条推理路径再多数投票(Self-Consistency)来提高准确率,但大部分路径最终都是错的,浪费了大量算力。Gambit在生成过程中定期用轻量打分器读取隐藏状态给各条推理路径打分,砍掉分数最低的几条,同时立刻从分数最高的前缀分支出新的路径,让GPU利用率始终维持在高位。在相同硬件预算下,相比纯剪枝方法,它在HMMT-24上准确率最多提高6.7个百分点、在AIME-25上提高3.3个百分点,完成路径的吞吐量提高一倍以上,相比标准并行采样总token消耗最多减少68.5%。
METAL MEDIA 解读图
Gambit如何主动重新分配算力
证据状态已报告实测结果
- 固定容量启动针对一个问题,C条推理路径同时开始生成,填满固定的硬件容量
- 周期性打分每隔Δ步,轻量打分器读取每条路径的隐藏状态,对所有活跃路径排序
- 零和式剪枝与分支终止分数最低的K条路径,同时通过KV-cache继承从分数最高的K条前缀分支出新路径,活跃路径数始终保持为C
- 完成与加权投票完成的路径按各自分数加权,参与多数投票决定最终答案
- 实测效果相比STEP准确率最多提升6.7个百分点,相比并行采样token消耗最多减少68.5%,吞吐量提升一倍以上
他们做了什么
- 把大型推理模型的推理时算力扩展问题重新定义为一个分配问题:不是要花多少算力,而是要把算力投向哪条部分推理路径。
- 指出现有两种范式的两难困境:并行采样(Self-Consistency)把每条路径独立对待,导致显存(KV-cache)迅速耗尽;而只做剪枝的方法虽然释放了显存,却让GPU闲置,没有真正改变输出分布。
- Gambit每隔Δ步用一个读取隐藏状态的轻量打分模型给所有在跑的推理路径打分,砍掉分数最低的K条,同时立刻从分数最高的K条前缀分支出新的续写,让活跃路径数量始终保持恒定(零和式重新分配)。
- 新分支的路径通过前缀缓存直接继承父路径的KV-cache,不用从头重新计算,因此能大幅节省token和显存开销。
- 在Qwen3-4B、DeepSeek-R1-8B、Phi-4-14B等多个模型以及AIME、HMMT、GPQA-Diamond等基准上的实测显示,Gambit在准确率、吞吐量、token效率三方面同时全面优于对比方法。
| Method | AIME-25 | AIME-26 | HMMT-24 | HMMT-25 | GPQA | |||||
|---|---|---|---|---|---|---|---|---|---|---|
| Tok. (Δ) | Acc | Tok. (Δ) | Acc | Tok. (Δ) | Acc | Tok. (Δ) | Acc | Tok. (Δ) | Acc | |
| Qwen3-4B-Thinking | ||||||||||
| SC@256 | 6.02 | 86.7 | 5.82 | 86.7 | 7.62 | 50.8 | 6.86 | 65.0 | 2.28 | 68.2 |
| Slim-SC | 3.93 (-34.7) | 86.7 | 3.83 (-34.2) | 85.0 | 4.01 (-47.4) | 51.7 | 3.72 (-45.8) | 65.8 | 1.66 (-27.2) | 65.6 |
| DeepConf | 3.27 (-45.7) | 90.0 | 3.19 (-45.2) | 86.7 | 4.28 (-43.8) | 58.3 | 4.15 (-39.5) | 66.7 | 1.52 (-33.3) | 67.6 |
| STEP | 3.96 (-34.2) | 86.7 | 3.51 (-39.7) | 87.5 | 4.02 (-47.2) | 61.7 | 3.88 (-43.4) | 66.7 | 2.09 (-8.3) | 66.9 |
| Gambit (Ours) | 3.07 (-49.0) | 90.0 | 3.45 (-40.7) | 88.3 | 3.00 (-60.6) | 65.0 | 3.49 (-49.1) | 67.5 | 1.83 (-19.7) | 70.2 |
| DeepSeek-R1-8B | ||||||||||
| SC@256 | 6.76 | 83.3 | 6.85 | 83.3 | 8.47 | 55.8 | 7.65 | 70.0 | 2.92 | 67.1 |
| Slim-SC | 5.87 (-13.2) | 83.3 | 6.08 (-11.2) | 83.3 | 7.32 (-13.6) | 55.8 | 6.93 (-9.4) | 70.7 | 2.26 (-22.6) | 67.1 |
| DeepConf | 3.75 (-44.5) | 81.7 | 3.67 (-46.4) | 84.2 | 4.34 (-48.8) | 60.0 | 3.97 (-48.1) | 71.7 | 1.68 (-42.5) | 68.7 |
| STEP | 3.71 (-45.1) | 83.3 | 3.66 (-46.6) | 83.3 | 4.15 (-51.0) | 63.3 | 4.08 (-46.7) | 75.8 | 2.44 (-16.4) | 68.2 |
| Gambit (Ours) | 4.21 (-37.7) | 85.8 | 4.09 (-40.3) | 85.0 | 3.05 (-64.0) | 65.6 | 3.81 (-50.2) | 75.8 | 2.21 (-25.3) | 68.2 |
| Microsoft-Phi | ||||||||||
| SC@256 | 4.24 | 86.7 | 4.20 | 88.5 | 5.43 | 56.7 | 5.56 | 73.3 | 3.05 | 76.3 |
| Slim-SC | 3.43 (-19.1) | 85.0 | 3.50 (-16.7) | 86.7 | 4.72 (-13.1) | 55.7 | 4.48 (-19.4) | 74.2 | 2.24 (-26.6) | 72.3 |
| DeepConf | 2.56 (-39.6) | 85.8 | 2.75 (-34.5) | 86.7 | 2.86 (-47.3) | 57.5 | 3.02 (-45.7) | 74.2 | 1.61 (-47.2) | 74.8 |
| STEP | 2.39 (-43.6) | 87.5 | 2.44 (-41.9) | 90.0 | 2.75 (-49.4) | 56.7 | 2.78 (-50.0) | 75.0 | 2.10 (-31.1) | 76.7 |
| Gambit (Ours) | 1.76 (-58.5) | 88.3 | 1.86 (-55.7) | 90.0 | 1.72 (-68.3) | 58.3 | 1.75 (-68.5) | 75.8 | 1.59 (-47.9) | 77.1 |
| Base Model | System | AIME-25 | AIME-26 | HMMT-24 | HMMT-25 | GPQA |
|---|---|---|---|---|---|---|
| DeepSeek-R1-0528 -Qwen3-8B | STEP + SeqScorer | 83.3 | 84.2 | 61.7 | 75.8 | 66.7 |
| Gambit + SeqScorer | 88.5 (+5.2) | 86.7 (+2.5) | 69.4 (+7.7) | 76.7 (+0.9) | 67.7 (+1.0) | |
| Qwen3-4B -Thinking-2507 | STEP + SeqScorer | 86.7 | 86.7 | 60.0 | 65.0 | 67.1 |
| Gambit + SeqScorer | 90.0 (+3.3) | 87.5 (+0.8) | 61.7 (+1.7) | 65.8 (+0.8) | 68.2 (+1.1) |

| Execution Component | Time (s) | % Wall Clock |
|---|---|---|
| GPU Compute (Forward Pass & Sampling) | 37,851.97 | 99.03% |
| Beam-search Overhead (Scoring & Tree Mgmt) | 370.76 | 0.97% |
| Total Wall Clock | 38,222.73 | 100.00% |
![Figure 4: End-to-end pipeline of Gambit on an AIME problem (capacity C=5, swap size K=2). During warmup, C=5 parallel traces are evaluated (color intensity denotes running score s¯∈[0,1]). Every Δ steps, a tournament ranks the active traces: the K=2 lowest-scoring traces are pruned (×) and replaced by new branches spawned from the highest-scoring prefixes via prefix caching (green arrows). This zero-sum reallocation maintains exactly C active traces throughout generation. Upon completion, answers are aggregated via a score-weighted majority vote, correctly selecting answer 29 (∑s¯=1.78 vs. 1.43).](https://media.metallab.ai/papers/2608.08020/f3.png)
| AIME-25 | AIME-26 | HMMT-24 | HMMT-25 | GPQA | ||
|---|---|---|---|---|---|---|
| Qwen3-4B-Thinking-2507 | ||||||
| Tokens (K) | SC | 6,023 | 5,817 | 7,622 | 6,857 | 2,276 |
| Slim-SC | 3,930 | 3,829 | 4,010 | 3,723 | 1,659 | |
| DeepConf | 3,266 | 3,192 | 4,278 | 4,148 | 1,516 | |
| STEP | 3,960 | 3,506 | 4,023 | 3,884 | 2,089 | |
| Gambit (Ours) | 3,071 | 3,449 | 3,002 | 3,493 | 1,826 | |
| Latency (s) | SC | 3,465 | 3,338 | 5,358 | 4,313 | 593 |
| Slim-SC | 1,905 | 1,841 | 2,412 | 1,995 | 555 | |
| DeepConf | 2,095 | 2,188 | 3,231 | 2,948 | 605 | |
| STEP | 1,390 | 1,232 | 2,016 | 1,507 | 786 | |
| Gambit (Ours) | 1,350 | 1,177 | 1,912 | 2,179 | 527 | |
| DeepSeek-R1-0528-Qwen3-8B | ||||||
| Tokens (K) | SC | 6,764 | 6,849 | 8,465 | 7,652 | 2,919 |
| Slim-SC | 5,874 | 6,080 | 7,323 | 6,933 | 2,256 | |
| DeepConf | 3,753 | 3,666 | 4,337 | 3,972 | 1,679 | |
| STEP | 3,711 | 3,661 | 4,147 | 4,077 | 2,444 | |
| Gambit (Ours) | 4,211 | 4,089 | 3,053 | 3,806 | 2,211 | |
| Latency (s) | SC | 4,078 | 4,107 | 5,640 | 4,873 | 880 |
| Slim-SC | 3,462 | 3,564 | 5,071 | 4,342 | 771 | |
| DeepConf | 2,692 | 2,582 | 3,256 | 2,800 | 744 | |
| STEP | 1,519 | 1,469 | 1,902 | 1,715 | 730 | |
| Gambit (Ours) | 1,571 | 1,842 | 2,014 | 2,169 | 702 | |
| Phi-4 | ||||||
| Tokens (K) | SC | 4,243 | 4,198 | 5,426 | 5,559 | 3,050 |
| Slim-SC | 3,426 | 3,503 | 4,716 | 4,482 | 2,242 | |
| DeepConf | 2,557 | 2,749 | 2,860 | 3,022 | 1,608 | |
| STEP | 2,390 | 2,435 | 2,754 | 2,780 | 2,097 | |
| Gambit (Ours) | 1,756 | 1,855 | 1,717 | 1,752 | 1,590 | |
| Latency (s) | SC | 2,760 | 2,636 | 3,848 | 4,046 | 1,730 |
| Slim-SC | 2,123 | 2,166 | 3,069 | 2,704 | 1,048 |
研究结果
- 在相同硬件限制下,Gambit相比纯剪枝基线STEP,在HMMT-24上准确率最多提高6.7个百分点,在AIME-25上提高3.3个百分点。
- 相比标准并行采样(Self-Consistency),Gambit将总token消耗最多降低68.5%(Phi-4在HMMT-25上:175万 vs 556万token),完成路径的吞吐量提高一倍以上(Qwen3-4B上为0.216对0.098)。
- 在4B模型上,Gambit在AIME-25上与经过精细校准的DeepConf打平(均为90.0%),同时在HMMT-24(+6.7个百分点)和GPQA(+2.6个百分点)上更优。
- 束搜索机制本身的算法开销经测量仅占总运行时间的不到1%(0.97%),证实其不会造成系统瓶颈。
- 在一道AIME 2025题目的案例分析中,即便把并行采样的样本数翻倍到512条,标准方法仍未找到正确答案,而Gambit用少得多的生成token就得到了正确答案。
可应用场景
- 可作为竞赛级数学或研究生级科学问题等正确路径稀少、推理链很长的任务中的推理时算力分配策略。
- 对使用vLLM等推理服务框架、希望同时缓解KV-cache显存压力和GPU闲置问题的推理服务运营者具有参考价值。
- 已经在用STEP、DeepConf等轻量内部打分信号的系统,可以考虑用主动分支重新分配算力取代单纯剪枝的思路。
局限与待验证事项
- 实测范围仅限于AIME、HMMT、GPQA-Diamond等数学科学竞赛类基准,以及Qwen3-4B、DeepSeek-R1-8B、Phi-4-14B等特定开源权重模型,尚未报告在其他领域或更大规模模型上的验证。
- 效果依赖打分函数的质量,论文只比较了STEP的现成MLP打分器和作者自行训练的序列打分器两种。
- 由于早期推理信号被认为不稳定,系统在预热阈值(w=12K token)之前不进行打分和检查点保存,这一阈值设置是否适用于其他类型问题未做单独验证。
- 结果均在单块NVIDIA B300 GPU上测得,在多GPU或其他硬件世代上的复现情况论文中未报告。
为什么重要
部署推理型AI模型最大的成本就是为了提高准确率而反复生成候选答案所消耗的GPU时间和显存。Gambit展示了在相同硬件条件下如何同时获得更高准确率、更快完成速度和更低token消耗,这对任何需要优化推理模型运行成本的人都有直接参考价值。
本文术语
- Self-Consistency · 对同一问题独立生成多条推理路径,再用多数投票选出最终答案的方法
- KV-cache · Transformer模型存储此前计算过的键值向量的显存空间,供后续生成token时复用
- 束搜索(beam search) · 在搜索过程中只保留分数最高的一部分候选路径、舍弃其余的策略;本文将其应用在'思考步骤'层面而非单个token层面
- 剪枝(pruning) · 在推理过程中提前终止被判定希望渺茫的路径,以节省算力
- 隐藏状态(hidden state) · 模型内部层产生的中间表示向量,这里被用作轻量评估某条推理路径质量的信号
论文原文摘要(英文)
Test-time compute scaling is a primary driver of performance in large reasoning models (LRMs), but extreme inefficiency bounds current approaches, shifting the critical question from how much compute to spend, to where to allocate it. We formalize test-time reasoning as a constrained compute allocation problem over partial trajectories. Under a fixed hardware budget, existing paradigms fail to actively allocate the compute to the most promising partial progress: traditional parallel sampling treats traces independently and induces severe memory bottlenecks, while subtractive pruning starves hardware and fails to actively and sufficiently shift the output distribution. To overcome this dichotomy, we introduce Gambit, an inference algorithm that executes thought-level beam search. By periodically pruning unpromising trajectories and immediately branching from high-quality prefixes, Gambit dynamically concentrates compute onto the most promising reasoning traces via a light-weight scorer probing hidden states while maintaining continuous high hardware utilization. Extensive evaluations across multiple models and benchmarks demonstrate that Gambit strictly dominates existing baselines. Under identical hardware constraints, our method yields up to a +6.7\% absolute accuracy gain on HMMT-24 and +3.3\% on AIME-25 over pruning baselines, delivers >2times higher throughput on trace completion, and reduces total token consumption by up to 68.5\% relative to standard parallel sampling.
在 arXiv 阅读最新论文
- SWE-bench Science: Can Coding Agents Resolve Engineering Tasks in Science?让AI编程助手去修复真实科学软件,连最强的那个也有一半以上任务没做对
- FlashPrefill V2: Block-Sparse Prefill Attention for Long-Context LLM Serving把稀疏注意力从论文原型变成能真正上线服务的加速方案
- PolicyGuide: From Guarding One Action to Guiding the Whole Workflow for Policy-Compliant LLM Agents让客服AI坐席不只是拦住一个危险动作,而是把整个流程走对
- EXIMO: VLM Guided Exploration of VLA Policies不用人工遥控演示,让会说话的AI来教机械臂做新家务
- EnvHarness: Awakening Static Worlds for Agent Learning不重新搭建训练环境,而是给现有环境套一层可插拔组件,针对每个智能体的具体弱点重新塑形
- Bounded Sovereignty and the Control Tax: Pricing AI Oversight When the Deployer Does Not Own the Model租用AI而非拥有AI的机构,安全监管能力只剩一半
- Beyond Imitation: Filtering On-Policy Distillation by Reasoning ProgressAI模仿老师模型学习时,会误伤本来推理正确的步骤,新方法专门过滤掉这种误伤
- PersonalBench: Measuring the Authorship Gap in LLM Personalization让AI模仿某人的文风,结果发现它始终摆脱不了自己的腔调
METAL MEDIA 最新报道
图片来源: Lijie Yang et al., arXiv:2608.08020, CC BY-SA 4.0