DreamCoder-ARC: Neurosymbolic ARC Solver
- The paper introduces a neurosymbolic framework that integrates programmatic abstraction, neural-guided search, and DSL induction to solve ARC tasks.
- DreamCoder-ARC employs a wake-sleep architecture with program enumeration, abstraction induction, and neural model training to enhance synthesis efficiency.
- Empirical results demonstrate superior performance using bidirectional search and ensemble LLM strategies, supported by the reproducible arckit library.
DreamCoder-ARC is a neurosymbolic, program synthesis-based system designed to address the Abstraction and Reasoning Corpus (ARC), a benchmark suite of visual reasoning tasks intended to probe broad generalization in artificial intelligence. By integrating programmatic abstraction (via library learning), neural-guided search, and domain-specific language (DSL) induction, DreamCoder-ARC offers a structured approach to solving ARC tasks. Its pipeline is further augmented with LLM prompting and ensemble methods, resulting in state-of-the-art performance on a subset of ARC tasks and establishing a reproducible platform for future research (Alford et al., 2021, Bober-Irizar et al., 2024).
1. System Overview and Wake-Sleep Architecture
At its core, DreamCoder-ARC implements a wake-sleep architecture adapted for ARC’s program synthesis formulation. The system consists of three primary phases:
- Wake (Program Enumeration): Programs in a typed, grid-centric DSL (PeARL) are enumerated to fit the input/output pairs defining an ARC task. Candidate solutions are sampled in order of increasing , leveraging a joint probabilistic model:
where is an MDL prior over the current DSL grammar.
- Sleep-Compression (Abstraction Induction): Solution programs (the “frontiers”) from wake are analyzed to identify common subexpressions. These are promoted to new, higher-order primitives, thereby expanding the DSL and biasing future searches toward compressed, reusable abstractions.
- Dreaming Sleep (Neural Recognition Model Training): A neural model guides future synthesis by learning a contextual grammar , which predicts the likelihood of rewrite rules or primitives appearing in solution programs conditioned on the task. Training is performed on “dreamed” (synthetically generated) tasks using an entropy-based objective,
which combines program likelihood and a binary classification loss over primitive usage for , the 3D recognition tensor output.
Each phase alternates in an iterative loop: 7 (Bober-Irizar et al., 2024)
2. Domain-Specific Language: PeARL
DreamCoder-ARC’s effectiveness is predicated on the expressiveness and structure of its DSL, PeARL (Perceptual Abstraction & Reasoning Language). PeARL captures functional, type-safe manipulations over grid representations prevalent in ARC.
- Types:
grid(rectangular subimages with spatial metadata)colour(int-valued, with $0$ as background)pos,size(coordinate/shape tuples)count(integer for arithmetic)list[T](homogeneous, e.g.,list[grid])
- Primitives:
- Rigid Transforms: rotate90, rot180, flipX, swapXY
- Cropping & Embedding: leftHalf, rightHalf, mirrorY, ic_embed
- Color Manipulation: topCol, filterCol, eraseCol, invert
- Morphology: fillHoles, makeBorder
- Splits & Reductions: split4, split8, pickMaxSize, pickUnique
- Higher-Order: mapSplit8, mkList
Program Example:
8
Type signatures: topCol: grid → colour, filterCol: colour → grid → grid, yielding composite programs such as:
$\lambda \$0. \operatorname{filterCol}(\operatorname{topCol} \$0, \$0)-\log P_\text{library}(p)$0 where:
- Nodes $-\log P_\text{library}(p)$1: Grid values are either grounded (produced by a known subprogram) or ungrounded (output to be synthesized).
- Edges $-\log P_\text{library}(p)$2: Operator applications in one of three modes:
- Forward: Ordinary functional application from inputs to outputs.
- Inverse: Deductive reasoning to infer potential inputs for a desired output using known function inverse semantics.
- Conditional-Inverse: If some arguments are known, deduce the remainder.
Neural guidance leverages a deep set aggregation of CNN-embedded grid states, with a learned policy $-\log P_\text{library}(p)$3 over operators, modes, and node arguments. Training combines supervised traces and policy-gradient reinforcement on synthetic (dreamed) expansions, utilizing a reward structure:
- $-\log P_\text{library}(p)$4 if the target node is grounded (solution found)
- $-\log P_\text{library}(p)$5 penalty for invalid actions to prune dead-ends
Mathematically, the policy is: $-\log P_\text{library}(p)$6 with cross-entropy and RL updates optimizing program synthesis paths (Alford et al., 2021).
4. Empirical Evaluation and Results
DreamCoder-ARC is evaluated across multiple domains:
- ARC Symmetry Tasks: On a curated set of 18 symmetry/mirroring ARC problems, the bidirectional agent in a restricted DSL solved 14/18, matching forward-only search.
- 24-Game Arithmetic Puzzles: With four numbers and basic arithmetic operations, bidirectional search significantly outperformed forward-only (e.g., for depth-4, 85.3% vs 67.0% puzzles solved).
- Double-and-Add Tasks: Bidirectional agent achieved 100% test accuracy after one epoch of supervised training; forward-only failed to generalize at all even after 50 epochs.
Ablation experiments established that:
- Library learning (abstraction induction) alone increased ARC symmetry problems solved from 16 to 22 after four compression cycles.
- Bidirectional neural guidance consistently dominated forward-only baselines in arithmetic settings.
A table from (Bober-Irizar et al., 2024) summarizes LLM and DreamCoder ARC coverage:
| Model | ARC-Easy (Aug) | ARC-Hard (Aug) |
|---|---|---|
| DreamCoder | 70 | 18 |
| GPT-4 | 85 | 32 |
Overlap is partial: only 37% of “easy” tasks solved by GPT-4 were also solved by DreamCoder, illustrating differing strengths.
5. LLM Prompting and Ensemble Strategies
ARC task serialization techniques allow modern LLMs (GPT-3, GPT-4, LLaMA) to be prompted in both completion and chat modalities. Grid inputs are tokenized row-wise; multiple orientation augmentations (original, transposed, rotated) counteract LLM biases. Deterministic, greedy decoding ensures reproducibility, with up to three guesses permitted per test grid.
LLM solutions cover distinct subsets of ARC tasks. Ensemble analysis employs weighted-voting, with DreamCoder, GPT-4, and IceCuber each contributing multiple solutions weighted by empirical solver confidence. Combined, this ensemble achieves:
| System Combination | ARC-Easy | ARC-Hard |
|---|---|---|
| IceCuber + DreamCoder + GPT-4 | 228/400 (57.0%) | 161/400 (40.3%) |
This combination substantially outperforms any single constituent system (Bober-Irizar et al., 2024).
6. Limitations and Future Directions
While DreamCoder-ARC demonstrates nontrivial progress, scaling to the full 400-task ARC evaluation remains beyond reach for current instantiations. Key constraints are:
- DSL Expressiveness: Many ARC problems require object detection, novel visual primitives, or sophisticated counting that are absent from the hand-engineered DSL.
- Search Complexity: Even bidirectional heuristics can permit exponential search graph growth due to branching in inverse expansions.
- Abstraction/Inverse Gap: Newly induced abstractions lack automatic inverse semantics, impeding immediate integration into bidirectional reasoning.
- Learning Efficiency: Recognition model training, while accelerating search, remains data-intensive relative to the sample efficiency observed in human ARC solvers.
Planned future improvements include:
- Automated synthesis of inverses for newly induced abstractions
- Type-directed pruning in search to reduce invalid inverses
- Incorporation of neural–symbolic perceptual pipelines in lieu of hand-crafted encoders
- DSL extensions for richer visual/combinatorial reasoning
- Meta-learning and curriculum approaches for rapid adaptation with minimal I/O pairs (Alford et al., 2021, Bober-Irizar et al., 2024).
7. Software and Reproducibility: the arckit Library
To advance reproducible research, DreamCoder-ARC is accompanied by the open-source arckit Python library. arckit provides:
- Full ARC-Easy and ARC-Hard datasets with metadata
- Pythonic APIs (
TaskSet,Task) for data access - Utilities for exact-match accuracy computation under Kaggle rules (up to three guesses)
- Prompt templates for diverse LLM platforms
- Vector-graphics visualization for I/O grids and predictions
- An interactive command-line interface (
arctask)
Installation is available via: 9 with detailed documentation and code at https://github.com/mxbi/arckit (Bober-Irizar et al., 2024).
DreamCoder-ARC establishes a reproducible, neurosymbolic framework that integrates abstraction-driven program synthesis, neural search guidance, and LLM prompting for the challenging ARC benchmark, significantly advancing the state of systematic machine reasoning.