NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

CodeIt: Self-Improving Language Models with Prioritized Hindsight Replay

Natasha Butt, Blazej Manczak, Auke Wiggers, Corrado Rainone, David W. Zhang, Michaël Defferrard, Taco Cohen

Abstract

The Abstraction and Reasoning Corpus (ARC) serves as a rigorous benchmark for artificial general intelligence, requiring models to solve novel reasoning tasks from minimal examples. We present CodeIt, a neuro-symbolic framework that leverages hindsight relabeling and prioritized experience replay to enable Large Language Models (LLMs) to self-improve on ARC. By learning from syntactically valid but task-incorrect programs, CodeIt overcomes the sparse reward problem inherent in program synthesis. Our approach achieves a state-of-the-art 15% success rate on the ARC evaluation set, surpassing GPT-4 and traditional symbolic search methods.

Introduction

The Abstraction and Reasoning Corpus (ARC) is frequently described as an "IQ test for AI." Unlike most benchmarks that evaluate pattern recognition or memorization, ARC demands "fluid intelligence"—the capacity to reason about objects, spatial relationships, and numerical concepts from just a few demonstrations.

Current LLMs face significant hurdles with ARC. First, the domain of program synthesis suffers from sparse rewards: a generated program typically either solves a task perfectly or fails entirely, providing no gradient for learning from near-misses. Second, ARC tasks rely on core knowledge—innate human priors like object permanence and symmetry—that are difficult to encode in standard neural architectures.

Methods: The CodeIt Framework

CodeIt (Code Iteration) addresses these challenges through a self-improving neuro-symbolic loop. The system employs a neural model (CodeT5+) to generate programs in a symbolic Domain Specific Language (DSL).

The framework operates in two alternating stages:

  • Sampling and Hindsight Relabeling: The model attempts to synthesize a program $\rho$ to solve an ARC task (Input $I$, Target Output $O^*$). If the program fails to produce $O^*$ but generates a valid grid $O$, the system "relabels" the experience. It treats the failure as a success for a different task: transforming $I$ into $O$. This ensures that every syntactically correct program provides a learning signal, helping the model master the DSL's syntax and semantics.
  • Learning with Prioritized Experience Replay (PER): The model is fine-tuned on a buffer of these relabeled experiences. To prevent the model from being overwhelmed by trivial relabeled tasks, PER is used to prioritize programs that successfully solve the original, human-intended ARC tasks.

Datasets and Task Representation

The primary evaluation is conducted on the ARC benchmark, which contains 400 training and 400 evaluation tasks. Each task consists of a few "demo" examples and a "test" input for which the model must predict the output.

To facilitate learning, the authors utilize Hodel’s DSL and a set of 400 human-written programs to initialize the model's understanding. Furthermore, grids are represented using a sparse grid representation—listing coordinates for each color—rather than raw 2D arrays. This object-centric format is more token-efficient and aligns with human perceptual priors.

Key Insights

  • Implicit Curriculum through Productive Failure: Hindsight relabeling creates a natural progression. Initially, the model learns basic grid manipulations (e.g., mirroring) through relabeling. As its proficiency grows, it discovers the complex logic required for actual ARC tasks.
  • Self-Refinement and Efficiency: The self-improvement loop encourages algorithmic elegance. In over half (53%) of solved tasks, CodeIt eventually found shorter, more efficient programs in later iterations.
  • Sample Efficiency: Hindsight relabeling led to a 40% improvement in sample efficiency, allowing the model to learn more from fewer environment interactions.

Results and Performance

CodeIt achieved a state-of-the-art success rate of 15% (59/400) on the ARC evaluation set. This performance exceeds both raw symbolic search and advanced neural models like GPT-4 (~12% in similar settings). Analysis on the ConceptARC benchmark revealed that while CodeIt excels at object-centric reasoning, it still faces challenges with complex numerical or purely logical tasks.

Limitations and Future Directions

Despite its success, CodeIt is constrained by the expressivity of its DSL; it cannot solve tasks requiring concepts absent from the predefined language. Future work may involve "library learning," where the model autonomously invents new functions. Additionally, the model struggles with programs exceeding 11 lines of code. Integrating intermediate "execution states" into the reasoning process could help the model decompose complex tasks into manageable steps.

Summary updated

BibTeX
@inproceedings{butt2024codeit,
  author = {Natasha Butt and Blazej Manczak and Auke Wiggers and Corrado Rainone and David W. Zhang and Michaël Defferrard and Taco Cohen},
  title = {{CodeIt: Self-Improving Language Models with Prioritized Hindsight Replay}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=SXVn5IFsrs},
}
Figure