Papers
Topics
Authors
Recent
Search
2000 character limit reached

Recursion of Thought: A Divide-and-Conquer Approach to Multi-Context Reasoning with Language Models

Published 12 Jun 2023 in cs.CL and cs.AI | (2306.06891v1)

Abstract: Generating intermediate steps, or Chain of Thought (CoT), is an effective way to significantly improve LLMs' (LM) multi-step reasoning capability. However, the CoT lengths can grow rapidly with the problem complexity, easily exceeding the maximum context size. Instead of increasing the context limit, which has already been heavily investigated, we explore an orthogonal direction: making LMs divide a problem into multiple contexts. We propose a new inference framework, called Recursion of Thought (RoT), which introduces several special tokens that the models can output to trigger context-related operations. Extensive experiments with multiple architectures including GPT-3 show that RoT dramatically improves LMs' inference capability to solve problems, whose solution consists of hundreds of thousands of tokens.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (20)
  1. Making neural programming architectures generalize via recursion. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net.
  2. PaLM: Scaling language modeling with pathways. ArXiv, abs/2204.02311.
  3. Successive prompting for decomposing complex questions. ArXiv, abs/2212.04092.
  4. Parametrized hierarchical procedures for neural programming. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings. OpenReview.net.
  5. Michael Hahn. 2020. Theoretical limitations of self-attention in neural sequence models. Transactions of the Association for Computational Linguistics, 8:156–171.
  6. Sepp Hochreiter and Jürgen Schmidhuber. 1997. Long short-term memory. Neural Computation, 9:1735–1780.
  7. Decomposed prompting: A modular approach for solving complex tasks. ArXiv, abs/2210.02406.
  8. Diederik P. Kingma and Jimmy Ba. 2015. Adam: A method for stochastic optimization. In 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings.
  9. Large language models are zero-shot reasoners. ArXiv, abs/2205.11916.
  10. Solving quantitative reasoning problems with language models. ArXiv, abs/2206.14858.
  11. Neural program lattices. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net.
  12. Show your work: Scratchpads for intermediate computation with language models. ArXiv, abs/2112.00114.
  13. PyTorch: An Imperative Style, High-Performance Deep Learning Library. In Advances in Neural Information Processing Systems 32, pages 8024–8035. Curran Associates, Inc.
  14. Learning compositional neural programs with recursive tree search and planning. In Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pages 14646–14656.
  15. Scott E. Reed and Nando de Freitas. 2016. Neural programmer-interpreters. In 4th International Conference on Learning Representations, ICLR 2016, San Juan, Puerto Rico, May 2-4, 2016, Conference Track Proceedings.
  16. Long range arena: A benchmark for efficient transformers. ArXiv, abs/2011.04006.
  17. Efficient transformers: A survey. ACM Computing Surveys, 55:1 – 28.
  18. Attention is all you need. In Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pages 5998–6008.
  19. Chain of thought prompting elicits reasoning in large language models. ArXiv, abs/2201.11903.
  20. Least-to-most prompting enables complex reasoning in large language models. ArXiv, abs/2205.10625.
Citations (21)

Summary

  • The paper introduces Recursion of Thought (RoT), a recursive divide-and-conquer framework that overcomes context limitations in language models.
  • The methodology uses special tokens (GO, STOP, THINK) to break complex problems into subproblems, significantly boosting performance on arithmetic and algorithmic tasks.
  • Experimental results show near-perfect accuracy on complex tasks, highlighting RoT's scalability across models from GPT-3 to compact architectures.

Recursion of Thought: A Divide-and-Conquer Approach to Multi-Context Reasoning with LLMs

Introduction

The paper "Recursion of Thought: A Divide-and-Conquer Approach to Multi-Context Reasoning with LLMs" (2306.06891) introduces a novel inference framework named Recursion of Thought (RoT). This approach dramatically enhances the multi-context reasoning capability of LMs, such as GPT-3, by implementing a recursive divide-and-conquer strategy. While previous methodologies like Chain of Thought (CoT) significantly improve reasoning by extending the context of LMs, they are inherently limited by their maximum context sizes. The RoT solves this limitation by allowing models to break complex tasks into smaller, manageable sub-problems, thereby circumventing the constraints posed by context length limitations.

Methodology

The RoT framework is built on three main components: the use of special tokens GO, STOP, and THINK; a recursive problem-solving strategy; and a training regime that supports such recursive processes. Unlike traditional methodologies that extend the context length, RoT enables recursive context generation through these tokens. During inference, the model uses these tokens to demarcate and handle subproblems of a given task. The GO and STOP tokens indicate the beginning and end of a problem or subproblem, respectively. The THINK token, critically, initiates the recursion to tackle a subproblem as a distinct context, facilitating multi-context reasoning by creating multiple smaller contexts.

Training RoT involves supervised learning with ground truth intermediate steps that detail when each special token should be emitted. This structured approach provides the models with a clear framework for problem decomposition and subproblem integration, ensuring that valid pathways of reasoning are learned and applied.

Experimental Results

The experiments conducted confirm that RoT significantly enhances reasoning capabilities over long token sequences — up to hundreds of thousands of tokens — across various tasks, including arithmetic and algorithmic problems. The performance of systems enhanced with RoT was compared to those using traditional CoT and those without thought prompts. Results show that RoT provides near-perfect accuracy for these extremely complex tasks, demonstrating its robustness and scalability in handling contextually large problems.

Moreover, testing was not limited to highly parameterized models like GPT-3 but extended to tiny models like Transformers and LSTMs without pre-training. Even these smaller architectures performed complex reasoning tasks effectively under the RoT framework, indicating the potential for broad applicability across different model sizes.

Implications and Future Work

The implications of RoT are vast. Its ability to allow any LLM to manage complex reasoning tasks without architectural changes is profound. This could play an essential role in future advancements of LMs, especially in environments where task solutions inherently exceed the current context limitations.

However, the current implementation relies heavily on supervised training, which is computationally expensive. Future work could focus on reducing this dependency, possibly through reinforcement learning techniques that maintain performance while minimizing the supervision requirement.

The potential of RoT extends beyond the current set of synthetic tasks designed for this paper, opening avenues for application in natural language tasks that demand long reasoning chains. A critical next step involves curating or developing datasets that naturally require lengthy reasoning beyond existing benchmarks.

Conclusion

Recursion of Thought not only offers a practical solution to the limitations posed by context size in LLMs but also poses a fundamental shift in how complex reasoning tasks can be approached and solved. By leveraging recursion and divide-and-conquer strategies, RoT sets the stage for more efficient and scalable LLMs capable of handling tasks that were previously considered impractical due to their required reasoning scale.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Authors (2)

Collections

Sign up for free to add this paper to one or more collections.

Tweets

Sign up for free to view the 6 tweets with 16 likes about this paper.