Current literature, aiming to surpass the "Chain-of-Thought" approach, often resorts to an external modus operandi involving halting, modifying, and then resuming the generation process to boost Large Language Models' (LLMs) reasoning capacities. This mode escalates the number of query requests, leading to increased costs, memory, and computational overheads. Addressing this, we propose the Algorithm of Thoughts -- a novel strategy that propels LLMs through algorithmic reasoning pathways, pioneering a new mode of in-context learning. By employing algorithmic examples, we exploit the innate recurrence dynamics of LLMs, expanding their idea exploration with merely one or a few queries. Our technique outperforms earlier single-query methods and stands on par with a recent multi-query strategy that employs an extensive tree search algorithm. Intriguingly, our results suggest that instructing an LLM using an algorithm can lead to performance surpassing that of the algorithm itself, hinting at LLM's inherent ability to weave its intuition into optimized searches. We probe into the underpinnings of our method's efficacy and its nuances in application.
翻译:当前旨在超越“思维链”方法的文献常采用外部操作模式,即通过暂停、修改并恢复生成过程来提升大型语言模型的推理能力。这种模式会显著增加查询请求数量,导致成本、内存和计算开销上升。针对这一问题,我们提出“算法思维”——一种通过算法推理路径驱动大型语言模型的新型策略,开创了上下文学习的新范式。通过使用算法示例,我们利用大型语言模型固有的递归动力学,仅需一次或数次查询即可扩展其思想探索范围。该技术优于早期的单次查询方法,并与采用广泛树搜索算法的多查询策略性能相当。有趣的是,实验结果表明,使用算法指导大型语言模型可使其性能超越算法本身,揭示了模型将其直觉融入优化搜索的固有能力。我们深入探究了该方法有效性的基础及其应用中的细微差异。