提出最优推理算法,用最少计算量实现更好生成效果
Caterpillar of Thoughts: The Optimal Test-Time Algorithm for Large Language Models
- 将推理过程建模为可回溯的马尔可夫链,设计最优搜索策略
- 理论证明最优算法生成的是‘毛毛虫状’树结构,仅需有限回溯
- 提出新算法CaT,比ToT更高效,减少生成次数且成功率更高
大型语言模型在允许额外推理时间计算时,可通过采样、思维链、回溯或修正部分解来显著提升输出质量。尽管此类方法已取得广泛实证成功,但其推理计算的结构设计仍缺乏理论指导。本文将测试时间计算建模为与马尔可夫链交互的算法:任意时刻,算法可从任意先前观察到的状态重新生成。该框架涵盖了思维链(CoT)、树状思维(ToT)及最佳k选(Best-of-k)等现有方法。我们证明,尽管回溯可使生成次数指数级减少,但理论上只需一种极有限的回溯形式即足够——最优算法始终生成‘毛毛虫树’结构:若移除所有叶节点,剩余部分为一条路径。基于此发现,我们提出新算法Caterpillar of Thoughts(CaT),显著减少状态/标记生成次数。实验表明,相比ToT,CaT在更低生成开销下实现了更高的成功概率。
原文摘要 · Abstract (English)
Large language models (LLMs) can often produce substantially better outputs when allowed to use additional test-time computation, such as sampling, chain of thought, backtracking, or revising partial solutions. Despite the growing empirical success of such techniques, there is limited theoretical understanding of how inference time computation should be structured, or what constitutes an optimal use of a fixed computation budget. We model test-time computation as an algorithm interacting with a Markov chain: at any point, the algorithm may resume generation from any previously observed state. That is, unlike standard Markov chains where the states are drawn passively, we allow the algorithm to backtrack to any previously observed state of the Markov chain at any time. Many of the existing test-time algorithms, such as Chain-of-Thought (CoT) (Wei et al., 2023), Tree-of-Thoughts (ToT) (Yao et al., 2023), or Best-of-$k$ (Brown et al., 2024) could be seen as specific algorithms in this model. We prove that while backtracking can reduce the number of generations exponentially, a very limited form of backtracking is theoretically sufficient. Namely, we show that the optimal algorithm always generates a caterpillar tree. That is, if we remove the leaves of the state tree generated by the optimal algorithm, we obtain a path. Motivated by our characterization of the optimal algorithm, we present Caterpillar of Thoughts (CaT), a new test-time computation algorithm, reducing the number of token/state generations. Our empirical evaluation shows that CaT, compared to ToT, achieves a better success rate while also reducing the number of token generations.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。