Skip to main content
QUICK REVIEW

[Paper Review] Quiet-STaR: Language Models Can Teach Themselves to Think Before Speaking

Eric Zelikman, Georges Harik|arXiv (Cornell University)|Mar 14, 2024
Natural Language Processing TechniquesComputer Science13 citations
TL;DR

Quiet-STaR generalizes Self-Taught Reasoner to learn rationales from broad web text, training LM to think before predicting future text, achieving zero-shot reasoning gains without task-specific fine-tuning.

ABSTRACT

When writing and talking, people sometimes pause to think. Although reasoning-focused works have often framed reasoning as a method of answering questions or completing agentic tasks, reasoning is implicit in almost all written text. For example, this applies to the steps not stated between the lines of a proof or to the theory of mind underlying a conversation. In the Self-Taught Reasoner (STaR, Zelikman et al. 2022), useful thinking is learned by inferring rationales from few-shot examples in question-answering and learning from those that lead to a correct answer. This is a highly constrained setting -- ideally, a language model could instead learn to infer unstated rationales in arbitrary text. We present Quiet-STaR, a generalization of STaR in which LMs learn to generate rationales at each token to explain future text, improving their predictions. We address key challenges, including 1) the computational cost of generating continuations, 2) the fact that the LM does not initially know how to generate or use internal thoughts, and 3) the need to predict beyond individual next tokens. To resolve these, we propose a tokenwise parallel sampling algorithm, using learnable tokens indicating a thought's start and end, and an extended teacher-forcing technique. Encouragingly, generated rationales disproportionately help model difficult-to-predict tokens and improve the LM's ability to directly answer difficult questions. In particular, after continued pretraining of an LM on a corpus of internet text with Quiet-STaR, we find zero-shot improvements on GSM8K (5.9%$ ightarrow$10.9%) and CommonsenseQA (36.3%$ ightarrow$47.2%) and observe a perplexity improvement of difficult tokens in natural text. Crucially, these improvements require no fine-tuning on these tasks. Quiet-STaR marks a step towards LMs that can learn to reason in a more general and scalable way.

Motivation & Objective

  • Motivate learning general reasoning from unstructured text rather than curated datasets.
  • Develop a scalable method for generating and using intermediate rationales at every token.
  • Introduce meta-tokens and a mixing mechanism to incorporate thoughts into predictions without destabilizing training.
  • Show that thinking improves predictions for difficult tokens and enables zero-shot improvements on reasoning tasks.

Proposed method

  • Generate multiple rationales (thoughts) after each token in parallel using token markers for start and end of thought.
  • Use a mixing head to interpolate between base LM predictions and post-thought predictions for each token.
  • Optimize rationale generation with REINFORCE, comparing thought-assisted predictions to an averaged baseline across multiple thoughts per token.
  • Apply non-myopic loss by supervising multiple future tokens beyond the immediate next token (teacher-forcing) to stabilize training.
  • Train on web-text corpora (OpenWebText-derived OpenWebMath and C4) with a 7B parameter LM (Mistral 7B) to learn reasoning from diverse data.
  • Employ a parallel sampling technique with a diagonal attention mask to generate thoughts efficiently across all token positions.

Experimental results

Research questions

  • RQ1Can a language model learn to generate useful internal rationales from broad, uncurated text data?
  • RQ2Do internal thoughts improve zero-shot reasoning performance on tasks requiring reasoning without task-specific fine-tuning?
  • RQ3How does the length of generated thoughts affect reasoning performance and token predictability?
  • RQ4What are the effects of meta-tokens and the mixing mechanism on training stability and learning signal quality?

Key findings

  • Quiet-STaR yields zero-shot improvements on CommonsenseQA (36.3% to 47.2%) and GSM8K (5.9% to 10.9%).
  • Improvements scale with the number of thinking tokens used during training.
  • Improvements also appear when training on C4, though to a smaller margin (GSM8K: 5.9% to 8.1%; CommonsenseQA: 36.3% to 42.6%).
  • Longer thoughts generally provide greater benefits for difficult tokens, indicating better handling of complex reasoning.
  • Quiet-STaR enhances direct-answering abilities without task-specific fine-tuning.
  • Internal rationales can complement zero-shot chain-of-thought prompting by improving the quality and coherence of reasoning.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.