Hypothesis Search: Inductive Reasoning with Language Models

Ruocheng Wang, Eric Zelikman, Gabriel Poesia, Yewen Pu, Nick Haber, Noah D. Goodman

TL;DR

Researchers have developed a new pipeline called Hypothesis Search that significantly boosts the inductive reasoning of Large Language Models (LLMs). By prompting models to first describe a rule in natural language and then implement it as a Python program, they achieved a 30% accuracy on the notoriously difficult Abstraction and Reasoning Corpus (ARC), nearly doubling the performance of standard prompting methods.

What Problem Does This Paper Address?

Inductive reasoning—the ability to look at a few examples and figure out the underlying rule—is a hallmark of human intelligence. While LLMs are great at "in-context learning," they often stumble when the rules are complex or require extreme precision.

A prime example is the Abstraction and Reasoning Corpus (ARC). In ARC, you might see three pairs of grids where a "teal shape moves to the bottom and doubles in size." Your job is to apply that rule to a new grid. For humans, this is intuitive; for LLMs, it’s a nightmare. Direct prompting usually results in the model "hallucinating" a messy, incorrect grid because it tries to predict the answer in one go without explicitly "thinking" about the rule first.

Methods

The authors propose a multi-stage pipeline that mimics the scientific method:

  1. Hypothesis Generation: Instead of asking for the answer, they ask GPT-4 to propose multiple candidate rules (hypotheses) in plain English.
  2. Hypothesis Reduction: To save on computation, they use the LLM to summarize these candidates into a smaller, more diverse set of promising ideas.
  3. Implementation: For each natural language hypothesis, the LLM writes a Python function (using NumPy) to execute that transformation.
  4. Verification & Feedback: The system runs the code on the provided training examples. If the code fails or produces the wrong output, the error message and the failed example are fed back to the LLM to "debug" the program.
  5. Selection: The first program that passes all training examples is used to generate the final answer for the test case.

This approach disentangles the creative act of finding a rule from the mechanical act of applying it.

Datasets

The study evaluates the pipeline across four diverse inductive reasoning benchmarks:

  • ARC: 2D visual grid transformations (the primary challenge).
  • 1D-ARC: A simplified, one-dimensional version of ARC.
  • SyGuS: A benchmark for string transformations (similar to Excel's "Flash Fill").
  • List Functions: A dataset involving complex manipulations of integer lists (sorting, filtering, etc.).

Key Insights and Ideas

  • The Power of Code as a Representation: Natural language is great for high-level concepts but is often ambiguous. Code is precise and, crucially, verifiable. By forcing the model to write code, the researchers created a way to "fact-check" the model's reasoning before it commits to an answer.
  • Levels of Abstraction: The paper shows that reasoning benefits from multiple layers. Moving from Examples → English Description → Python Code → Prediction works better than skipping any of those steps.
  • "Correct on Training" implies "Correct on Test": An interesting finding in these domains is that if a generated program is correct for all training examples, it almost always generalizes perfectly to the test input. This makes the training set a very reliable "filter" for hypotheses.

Key Results

The results show a massive leap over "Direct Prompting" (where the model just tries to guess the output grid):

  • ARC: Accuracy jumped from 17% (Direct) to 30% (Automated Pipeline). When a human was allowed to pick the best LLM-generated hypothesis, accuracy reached 33%.
  • 1D-ARC: Performance increased from 39.6% to 73.1%.
  • List Functions: Accuracy more than doubled, from 31% to 69%.
  • Ablation Study: The researchers found that "Program Only" (writing code without an English hypothesis) was better than direct prompting but significantly worse than the full pipeline, proving that the natural language "thinking" step is vital.

Limitations and Future Work

Despite the success, several hurdles remain:

  • Computational Cost: Running multiple LLM calls for generation, summarization, and debugging is expensive and slow compared to a single prompt.
  • Visual Bottleneck: Currently, the model "sees" the grids as text-based NumPy arrays. The authors suggest that true Vision-Language Models (VLMs) might be needed to solve the most visually complex ARC tasks that involve irregular shapes or complex spatial relationships.
  • Search Space: While the pipeline filters hypotheses well, the model still sometimes fails to generate the correct hypothesis in the first place, especially for very large grids where the context window becomes a limitation.

The authors conclude that as LLMs become cheaper and vision capabilities improve, this "Hypothesis Search" framework could become a standard way to tackle complex, symbolic reasoning problems.

Summary updated

BibTeX
@inproceedings{wang2024hypothesis,
  author = {Ruocheng Wang and Eric Zelikman and Gabriel Poesia and Yewen Pu and Nick Haber and Noah D. Goodman},
  title = {{Hypothesis Search: Inductive Reasoning with Language Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=G7UtIGQmjm},
}
Figure