Papers › CodeIt: Self-Improving Language Models with Prioritized Hindsight Replay

CodeIt: Self-Improving Language Models with Prioritized Hindsight Replay

7 Feb 2024arXiv:2402.04858archive 2025-07-28

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

Large language models are increasingly solving tasks that are commonly believed to require human-level reasoning ability. However, these models still perform very poorly on benchmarks of general intelligence such as the Abstraction and Reasoning Corpus (ARC). In this paper, we approach ARC as a programming-by-examples problem, and introduce a novel and scalable method for language model self-improvement called Code Iteration (CodeIt). Our method iterates between 1) program sampling and hindsight relabeling, and 2) learning from prioritized experience replay. By relabeling the goal of an episode (i.e., the target program output given input) to the realized output produced by the sampled program, our method effectively deals with the extreme sparsity of rewards in program synthesis. Applying CodeIt to the ARC dataset, we demonstrate that prioritized hindsight replay, along with pre-training and data-augmentation, leads to successful inter-task generalization. CodeIt is the first neuro-symbolic approach that scales to the full ARC evaluation dataset. Our method solves 15% of ARC evaluation tasks, achieving state-of-the-art performance and outperforming existing neural and symbolic baselines. Our code is available at https://github.com/Qualcomm-AI-research/codeit .

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2402.04858")

Code

Syntology Ran 32 of 41 code samples harvested from 1 repository linked to this paper; 9 have no recorded run. Of those that ran: 4 ran · honoured contract; 2 ran · violated contract; 16 ran · our draft was wrong; 6 ran · fixture could not drive it; 4 ran with no contract checked.

By repository: official repository: 41 samples from 1 repository, 32 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

Qualcomm-AI-research/codeit officialmentioned in papermentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

41 samples harvested; 32 ran; 4 honoured the contract we drafted; 9 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

4ran · honoured contract
2ran · violated contract
16ran · our draft was wrong
6ran · fixture could not drive it
4ran
9unverified

Licence: 41 of the 41 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from Qualcomm-AI-research/codeit. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

PopulationTree Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository ran BSD-3-Clause-Clear · pointer only · 5a889f45ec35ace2 · report
ProgramMutator Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository ran BSD-3-Clause-Clear · pointer only · 0ca10f7987f7e3f5 · report
Task Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository ran BSD-3-Clause-Clear · pointer only · 3215558dec21b76e · report
TypeInferer Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository ran BSD-3-Clause-Clear · pointer only · 663e3c33f8beaa30 · report
build_general_type_to_primitive_function_mapping Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository ran · our draft was wrong BSD-3-Clause-Clear · pointer only · a792436574cb8a36 · report
build_primitive_function_to_general_type_mapping Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository ran · our draft was wrong BSD-3-Clause-Clear · pointer only · bdff87a4c2b09334 · report
calculate_performance Qualcomm-AI-research/codeit/codeit/agent.py official repository ran · violated contract BSD-3-Clause-Clear · pointer only · ad432ec024f7e66d · report
cell_sampler Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository ran · fixture could not drive it BSD-3-Clause-Clear · pointer only · fa8e1aaf26bd9cad · report
change_function_name Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository ran · our draft was wrong BSD-3-Clause-Clear · pointer only · d440e9a190ac2556 · report
contains_non_base_type Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository ran · violated contract BSD-3-Clause-Clear · pointer only · 48365ca029cd4ade · report
display_type Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository ran · our draft was wrong BSD-3-Clause-Clear · pointer only · ca56e081f31c0018 · report
filter_by_inference_keys Qualcomm-AI-research/codeit/run/run_codeit.py official repository ran · our draft was wrong BSD-3-Clause-Clear · pointer only · 3a16b6289b603c98 · report
filter_population_by_size Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository ran · our draft was wrong BSD-3-Clause-Clear · pointer only · f2e43abb4b090b39 · report
filter_tasks_by_input_dimensions Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository ran · our draft was wrong BSD-3-Clause-Clear · pointer only · 4054c380d9c1a16c · report
find_first_x Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository ran · our draft was wrong fingerprinted BSD-3-Clause-Clear · pointer only · ffe7482ebd5d840d · report
get_func_name Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository ran · our draft was wrong BSD-3-Clause-Clear · pointer only · 27064c0c54006326 · report
get_function_names_with_output_type Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository ran · our draft was wrong BSD-3-Clause-Clear · pointer only · 113c9f4b6c4a8053 · report
get_function_types Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository ran · our draft was wrong BSD-3-Clause-Clear · pointer only · d34bd77f1580bc22 · report
get_grid_size Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository ran · honoured contract BSD-3-Clause-Clear · pointer only · 2a25b9259dde5c3a · report
get_num_programs Qualcomm-AI-research/codeit/run/run_codeit.py official repository ran · honoured contract BSD-3-Clause-Clear · pointer only · 5824e673c05bbd51 · report
list_to_tuple Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository ran · honoured contract BSD-3-Clause-Clear · pointer only · 965ff5003da35606 · report
normalise_cell Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository ran · fixture could not drive it BSD-3-Clause-Clear · pointer only · 258eb81b564d0b3f · report
object_sampler Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository ran · fixture could not drive it fingerprinted BSD-3-Clause-Clear · pointer only · 30ccff49d96c238b · report
performance_over_tasks Qualcomm-AI-research/codeit/codeit/agent.py official repository ran · honoured contract fingerprinted BSD-3-Clause-Clear · pointer only · 46be79408beca620 · report
program_to_program_lines Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository ran · our draft was wrong fingerprinted BSD-3-Clause-Clear · pointer only · e017b07e36a77f43 · report
remove_redundant_lines Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository ran · our draft was wrong fingerprinted BSD-3-Clause-Clear · pointer only · 9c35b11d97682173 · report
replace_x Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository ran · our draft was wrong fingerprinted BSD-3-Clause-Clear · pointer only · 06dd5bc91255c2eb · report
sample_integer_set Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository ran · our draft was wrong BSD-3-Clause-Clear · pointer only · 0b37eaf28f553e13 · report
sample_object_from_patch Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository ran · our draft was wrong BSD-3-Clause-Clear · pointer only · 9b827c28751c700d · report
sample_objects Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository ran · fixture could not drive it BSD-3-Clause-Clear · pointer only · 720842f503a718ef · report
valid_grid Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository ran · fixture could not drive it fingerprinted BSD-3-Clause-Clear · pointer only · 35a3a514964eb409 · report
valid_grid_fast Qualcomm-AI-research/codeit/codeit/agent.py official repository ran · fixture could not drive it fingerprinted BSD-3-Clause-Clear · pointer only · b08a4ca506072484 · report
TaskEvolver Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository unverified BSD-3-Clause-Clear · pointer only · cc17c7829a24c82e · report
from_dict Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository unverified BSD-3-Clause-Clear · pointer only · 0232d1b03729354b · report
get_primitive_constant_type Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository unverified BSD-3-Clause-Clear · pointer only · 12ead3ea3a548d6c · report
get_primitive_function_type Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository unverified BSD-3-Clause-Clear · pointer only · a9fe63eda6190bfc · report
handle_timeout Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository unverified BSD-3-Clause-Clear · pointer only · dab2d7cbaed329ce · report
mutate_input_one_step Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository unverified BSD-3-Clause-Clear · pointer only · 35f2d5afe53e1635 · report
patch_sampler Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository unverified BSD-3-Clause-Clear · pointer only · b2a254a4a76ff136 · report
sample_indices Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository unverified BSD-3-Clause-Clear · pointer only · 5761dc5c761194fc · report
sample_indices_set Qualcomm-AI-research/codeit/codeit/augment/genetic.py official repository unverified BSD-3-Clause-Clear · pointer only · 5025771c421695db · report

Tasks

ARCData AugmentationLanguage ModelingLanguage ModellingProgram Synthesis

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections