Combining LLMs and Genetic Search for ARC-AGI-2
Abstract
LLMs can generate programs for ARC-AGI-2 tasks, but the provided compute only allows a small number of attempts to generate, debug and validate solutions. Genetic algorithms can search and test many more programs, but random search rarely starts in a useful neighborhood of the solution space. We combine the two methods through a compact domain specific language (DSL). First, a quantized Qwen3.5-4B LLM generates an initial set of programs for each ARCAGI-2 task. Then, we use those programs to seed an initial population of starting programs, and use genetic algorithms to evolve these programs towards a solution to the given task. The DSL is designed such that every mutated program remains valid and can be executed. The initial programs proposed by the LLM solve 2 (3.3%) of the first 60 tasks of the ARC-2 public evaluation set. The genetic algorithm solves an additional 4, giving 6 correct test outputs in total (10.0%). If we try using evolving solutions without this LLM seeding, we do not arrive at any solutions at all. The results show that genetic search can improve programs generated by LLMs and produce additional correct solutions.
Figures & tables
| Tensor | Shape | Contents |
|---|---|---|
| State | Grid channels for programs and task examples, including OUT, color masks, objects, and scratch grids. | |
| Registers | Shared perceived facts plus per-program scratch registers. | |
| Genes | Twenty fixed-width genes per chromosome. |
| GA parameter | Value |
|---|---|
| Islands | 2 |
| Population per island | 4,000 |
| Chromosome length | 20 genes |
| LLM-derived / random initialization | 40% / 60% |
| Tournament size | 2 |
| Gene mutation probability | 0.09% |
| Condition | Test solves | Solve rate | Interpretation |
|---|---|---|---|
| LLM seed pool only | 2/60 | 3.3% | Correct program already present before evolution. |
| LLM seed pool + GA | 6/60 | 10.0% | Evolution adds four correct solutions! |
| Task | Seed programs | Source | Generation | Test output |
| 08ed6ac7 | 93 | LLM | - | Correct |
| 0b17323b | 69 | LLM | - | Correct |
| 1190e5a7 | 46 | LLM | - | Incorrect |
| 017c7c7b | 73 | GA | 22 | Correct |
| 0c786b71 | 18 | GA | 35 | Correct |
| 0c9aba6e | 45 | GA | 50 | Correct |
| Task | Combined system | Unseeded GA best after 200 generations |
|---|---|---|
| 0b17323b | Exact at generation 0 | 79.73% |
| 017c7c7b | Exact at generation 22 | 93.50% |
| 0c786b71 | Exact at generation 35 | 83.18% |
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| Setting | Value |
|---|---|
| Model | Qwen3.5-4B, Q4_K_M GGUF |
| Topology | One llama-server per GPU; --split-mode none ; all layers on the selected GPU |
| Parallelism | 10 conversation slots per GPU in the production pipeline (12gb VRAM) |
| Context | 35,000 tokens per slot; 350,000-token total server context at 10 slots |
| KV cache | Q8_0 keys and values; Flash Attention enabled |
| Decoding mode | Thinking disabled with reasoning budget 0 and chat-template enable_thinking=false |
| # | Operation | Tier | Function |
|---|---|---|---|
| 0 | NOP | core | No-Op; fills unused chromosome gene positions. |
| 1 | COPY | core | Copy one channel (color or object) to another. |
| 2 | TRANSLATE | core | Shift content by a row and column offset. |
| 3 | RAY_STEP | core | Extend content repeatedly in a given direction. |
| 4 | BOOL_OR | core | Union of two channel channel grids. |
| 5 | BOOL_AND | core | Intersection of two channel grids. |