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 ranMethod as code

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

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

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 41 code samples harvested from 1 repository linked to this paper: 32 ran (of which 4 constructed an object rather than computing a result; 10 with no instrument failure: 4 honoured, 2 violated, 4 with no contract checked; 22 where Syntology's instrument failed) · 9 unverified. Where Syntology's instrument failed: 16 where our contract draft was wrong; 6 where the contract check could not run; failures of Syntology's instrument, not of the code.

By repository: official repository: 41 samples from 1 repository, 32 ran (10 with no instrument failure; 22 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

Levels written on 2026-09-22 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed. 5 of the 32 samples that ran have no recorded date.

Qualcomm-AI-research/codeit officialmentioned in papermentioned on GitHubpytorchSyntology: 41 samples, 32 ran (22 instrument-failed) · 9 unverified 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 (of which 4 constructed an object rather than computing a result; 10 with no instrument failure: 4 honoured, 2 violated, 4 with no contract checked; 22 where Syntology's instrument failed) · 9 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page has not changed since , the first build that kept a record date for it; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

4ran · honoured contract
2ran · violated contract
16ran · our draft was wrong
6ran; the contract check could not run
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. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (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 are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. 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 six 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; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. 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.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity.

Qualcomm-AI-research/codeit official repository 41 samples, 32 ran (22 instrument-failed) · 9 unverified
PopulationTree codeit/augment/genetic.py ran BSD-3-Clause-Clear · pointer only · 5a889f45ec35ace2 · report fixture: returned PopulationTree · level recorded 2026-09-22
ProgramMutator codeit/augment/genetic.py ran BSD-3-Clause-Clear · pointer only · 0ca10f7987f7e3f5 · report fixture: returned ProgramMutator · level recorded 2026-09-22
Task in 17 papers codeit/augment/genetic.py ran BSD-3-Clause-Clear · pointer only · 3215558dec21b76e · report fixture: returned Task · level recorded 2026-09-22
TypeInferer codeit/augment/genetic.py ran BSD-3-Clause-Clear · pointer only · 663e3c33f8beaa30 · report fixture: returned TypeInferer · level recorded 2026-09-22
build_general_type_to_primitive_function_mapping codeit/augment/genetic.py ran · our draft was wrong BSD-3-Clause-Clear · pointer only · a792436574cb8a36 · report fixture: signature primitives:list/1/str · returned dict · level recorded 2026-09-22
build_primitive_function_to_general_type_mapping codeit/augment/genetic.py ran · our draft was wrong BSD-3-Clause-Clear · pointer only · bdff87a4c2b09334 · report fixture: signature type_to_function_mapping:dict/0/? · returned dict · level recorded 2026-09-22
calculate_performance codeit/agent.py ran · violated contract BSD-3-Clause-Clear · pointer only · ad432ec024f7e66d · report fixture: signature solutions:dict/0/?, task_key:str/0/str · returned tuple · level recorded, date not recorded
cell_sampler codeit/augment/genetic.py ran; the contract check could not run (RAISES) BSD-3-Clause-Clear · pointer only · fa8e1aaf26bd9cad · report fixture: signature I:ndarray/2/int, OBJECTS:frozenset/0/? · returned tuple · level recorded 2026-09-22
change_function_name codeit/augment/genetic.py ran · our draft was wrong BSD-3-Clause-Clear · pointer only · d440e9a190ac2556 · report fixture: signature program:str/0/str, child_id:int/0/int · returned str · level recorded 2026-09-22
contains_non_base_type codeit/augment/genetic.py ran · violated contract BSD-3-Clause-Clear · pointer only · 48365ca029cd4ade · report fixture: signature term_type:str/0/str · returned bool · level recorded 2026-09-22
display_type codeit/augment/genetic.py ran · our draft was wrong BSD-3-Clause-Clear · pointer only · ca56e081f31c0018 · report fixture: signature term_type:ArrowType/0/? · returned ArrowType · level recorded 2026-09-22
filter_by_inference_keys run/run_codeit.py ran · our draft was wrong BSD-3-Clause-Clear · pointer only · 3a16b6289b603c98 · report fixture: signature tasks:dict/0/?, inference_keys:list/1/str · returned dict · level recorded, date not recorded
filter_population_by_size codeit/augment/genetic.py ran · our draft was wrong BSD-3-Clause-Clear · pointer only · f2e43abb4b090b39 · report fixture: signature task_population:dict/0/?, grid_size:tuple/1/int · returned dict · level recorded 2026-09-22
filter_tasks_by_input_dimensions codeit/augment/genetic.py ran · our draft was wrong BSD-3-Clause-Clear · pointer only · 4054c380d9c1a16c · report fixture: signature tasks:dict/0/?, max_rows:int/0/int, max_columns:int/0/int · returned dict · level recorded 2026-09-22
find_first_x codeit/augment/genetic.py ran · our draft was wrong fingerprinted BSD-3-Clause-Clear · pointer only · ffe7482ebd5d840d · report fixture: signature input_string:str/0/str · returned str · level recorded 2026-09-22
get_func_name codeit/augment/genetic.py ran · our draft was wrong BSD-3-Clause-Clear · pointer only · 27064c0c54006326 · report fixture: signature func_def:str/0/str · returned str · level recorded 2026-09-22
get_function_names_with_output_type codeit/augment/genetic.py ran · our draft was wrong BSD-3-Clause-Clear · pointer only · 113c9f4b6c4a8053 · report fixture: signature output_type:str/0/str, type_to_function_mapping:dict/0/? · returned list · level recorded 2026-09-22
get_function_types codeit/augment/genetic.py ran · our draft was wrong BSD-3-Clause-Clear · pointer only · d34bd77f1580bc22 · report fixture: signature func_def:str/0/str · returned tuple · level recorded 2026-09-22
get_grid_size codeit/augment/genetic.py ran · honoured contract BSD-3-Clause-Clear · pointer only · 2a25b9259dde5c3a · report fixture: signature grid:list/1/list · returned tuple · level recorded 2026-09-22
get_num_programs run/run_codeit.py ran · honoured contract BSD-3-Clause-Clear · pointer only · 5824e673c05bbd51 · report fixture: signature agent:Agent/0/?, mode:str/0/str · returned int · level recorded, date not recorded
list_to_tuple codeit/augment/genetic.py ran · honoured contract BSD-3-Clause-Clear · pointer only · 965ff5003da35606 · report fixture: signature listoflists:list/1/list · returned tuple · level recorded 2026-09-22
normalise_cell codeit/augment/genetic.py ran; the contract check could not run (RAISES) BSD-3-Clause-Clear · pointer only · 258eb81b564d0b3f · report fixture: signature cell:set/0/?, I:list/1/list · returned frozenset · level recorded 2026-09-22
object_sampler codeit/augment/genetic.py ran; the contract check could not run (RAISES) fingerprinted BSD-3-Clause-Clear · pointer only · 30ccff49d96c238b · report fixture: signature I:ndarray/2/int, OBJECTS:list/1/frozenset · returned frozenset · level recorded 2026-09-22
performance_over_tasks codeit/agent.py ran · honoured contract fingerprinted BSD-3-Clause-Clear · pointer only · 46be79408beca620 · report fixture: signature performance_by_task:list/1/float · returned float64 · level recorded, date not recorded
program_to_program_lines codeit/augment/genetic.py ran · our draft was wrong fingerprinted BSD-3-Clause-Clear · pointer only · e017b07e36a77f43 · report fixture: signature program_string:str/0/str · returned str · level recorded 2026-09-22
remove_redundant_lines codeit/augment/genetic.py ran · our draft was wrong fingerprinted BSD-3-Clause-Clear · pointer only · 9c35b11d97682173 · report fixture: signature program_str:str/0/str · returned str · level recorded 2026-09-22
replace_x codeit/augment/genetic.py ran · our draft was wrong fingerprinted BSD-3-Clause-Clear · pointer only · 06dd5bc91255c2eb · report fixture: signature x_old:str/0/str, x_new:str/0/str, input_string:str/0/str · returned str · level recorded 2026-09-22
sample_integer_set codeit/augment/genetic.py ran · our draft was wrong BSD-3-Clause-Clear · pointer only · 0b37eaf28f553e13 · report fixture: signature primitive_constants:dict/0/? · returned frozenset · level recorded 2026-09-22
sample_object_from_patch codeit/augment/genetic.py ran · our draft was wrong BSD-3-Clause-Clear · pointer only · 9b827c28751c700d · report fixture: signature patch:list/1/int · returned frozenset · level recorded 2026-09-22
sample_objects codeit/augment/genetic.py ran; the contract check could not run (RAISES) BSD-3-Clause-Clear · pointer only · 720842f503a718ef · report fixture: signature I:ndarray/2/int, OBJECTS:frozenset/0/? · returned frozenset · level recorded 2026-09-22
valid_grid codeit/augment/genetic.py ran; the contract check could not run (RAISES) fingerprinted BSD-3-Clause-Clear · pointer only · 35a3a514964eb409 · report fixture: signature value:list/1/list · returned bool · level recorded 2026-09-22
valid_grid_fast codeit/agent.py ran; the contract check could not run (RAISES) · metamorphic tier: deterministic fingerprinted BSD-3-Clause-Clear · pointer only · b08a4ca506072484 · report fixture: signature value:list/1/list · returned bool · level recorded, date not recorded
TaskEvolver codeit/augment/genetic.py unverified BSD-3-Clause-Clear · pointer only · cc17c7829a24c82e · report
from_dict in 7 papers codeit/augment/genetic.py unverified BSD-3-Clause-Clear · pointer only · 0232d1b03729354b · report
get_primitive_constant_type codeit/augment/genetic.py unverified BSD-3-Clause-Clear · pointer only · 12ead3ea3a548d6c · report
get_primitive_function_type codeit/augment/genetic.py unverified BSD-3-Clause-Clear · pointer only · a9fe63eda6190bfc · report
handle_timeout codeit/augment/genetic.py unverified BSD-3-Clause-Clear · pointer only · dab2d7cbaed329ce · report
mutate_input_one_step codeit/augment/genetic.py unverified BSD-3-Clause-Clear · pointer only · 35f2d5afe53e1635 · report
patch_sampler codeit/augment/genetic.py unverified BSD-3-Clause-Clear · pointer only · b2a254a4a76ff136 · report
sample_indices in 7 papers codeit/augment/genetic.py unverified BSD-3-Clause-Clear · pointer only · 5761dc5c761194fc · report
sample_indices_set codeit/augment/genetic.py unverified BSD-3-Clause-Clear · pointer only · 5025771c421695db · report

Method as code Syntology

What Syntology's graph records as this paper's claimed method, lifted into code: each assembly names its bricks (functions and classes), each with its own role and its own verification level. An assembly is not a check that the code implements the method correctly or reproduces the paper's results. Levels are each brick's own verification level in Syntology's graph (level 0: no recorded run), listed brick by brick and never combined into one level; “ran” means the brick executed on a synthesized input, not that its output is correct, and the instrument figure counts failures of Syntology's instrument, not of the code. Where a model read the code against the paper's claim, each assembly's label verdict is one model's judgement, kept in this page's JSON twin; it is not calibrated, so no card prints it.

1 assembly on this paper: 1 harvested, 0 generated.

harvested Assembly for CodeIt (graph method: CodeIt). 36 bricks; individually on a fixture: 27 ran (of which 4 constructed an object rather than computing a result; 7 with no instrument failure: 2 honoured, 1 violated, 4 with no contract checked; 20 where Syntology's instrument failed) · 9 unverified. The assembly has not been run end-to-end.

  1. TaskEvolver entry · level 0 · unverified · cc17c7829a24c82e
  2. PopulationTree helper · level 1 · ran · 5a889f45ec35ace2
  3. ProgramMutator helper · level 1 · ran · 0ca10f7987f7e3f5
  4. Task helper · level 1 · ran · 3215558dec21b76e
  5. TypeInferer helper · level 1 · ran · 663e3c33f8beaa30
  6. build_general_type_to_primitive_function_mapping helper · level 1 · ran · our draft was wrong · a792436574cb8a36
  7. build_primitive_function_to_general_type_mapping helper · level 1 · ran · our draft was wrong · bdff87a4c2b09334
  8. change_function_name helper · level 1 · ran · our draft was wrong · d440e9a190ac2556
  9. contains_non_base_type helper · level 1 · ran · violated contract · 48365ca029cd4ade
  10. display_type helper · level 1 · ran · our draft was wrong · ca56e081f31c0018
  11. filter_population_by_size helper · level 1 · ran · our draft was wrong · f2e43abb4b090b39
  12. filter_tasks_by_input_dimensions data_transform · level 1 · ran · our draft was wrong · 4054c380d9c1a16c
  13. get_function_names_with_output_type helper · level 1 · ran · our draft was wrong · 113c9f4b6c4a8053
  14. handle_timeout helper · level 0 · unverified · dab2d7cbaed329ce
  15. mutate_input_one_step helper · level 0 · unverified · 35f2d5afe53e1635
  16. remove_redundant_lines helper · level 1 · ran · our draft was wrong · 9c35b11d97682173
  17. valid_grid helper · level 1 · ran; the contract check could not run (RAISES) · 35a3a514964eb409
  18. from_dict helper · level 0 · unverified · 0232d1b03729354b
  19. program_to_program_lines helper · level 1 · ran · our draft was wrong · e017b07e36a77f43
  20. find_first_x helper · level 1 · ran · our draft was wrong · ffe7482ebd5d840d
  21. get_primitive_constant_type helper · level 0 · unverified · 12ead3ea3a548d6c
  22. get_primitive_function_type helper · level 0 · unverified · a9fe63eda6190bfc
  23. replace_x helper · level 1 · ran · our draft was wrong · 06dd5bc91255c2eb
  24. get_func_name helper · level 1 · ran · our draft was wrong · 27064c0c54006326
  25. get_function_types helper · level 1 · ran · our draft was wrong · d34bd77f1580bc22
  26. get_grid_size helper · level 1 · ran · honoured contract · 2a25b9259dde5c3a
  27. cell_sampler helper · level 1 · ran; the contract check could not run (RAISES) · fa8e1aaf26bd9cad
  28. object_sampler helper · level 1 · ran; the contract check could not run (RAISES) · 30ccff49d96c238b
  29. sample_indices helper · level 0 · unverified · 5761dc5c761194fc
  30. sample_indices_set helper · level 0 · unverified · 5025771c421695db
  31. sample_integer_set helper · level 1 · ran · our draft was wrong · 0b37eaf28f553e13
  32. sample_objects helper · level 1 · ran; the contract check could not run (RAISES) · 720842f503a718ef
  33. list_to_tuple helper · level 1 · ran · honoured contract · 965ff5003da35606
  34. patch_sampler helper · level 0 · unverified · b2a254a4a76ff136
  35. sample_object_from_patch helper · level 1 · ran · our draft was wrong · 9b827c28751c700d
  36. normalise_cell helper · level 1 · ran; the contract check could not run (RAISES) · 258eb81b564d0b3f

Each brick ends with its code_sha256, Syntology's identity for that exact code; click one to copy the get_code call that returns it. For agents, on Syntology's MCP service: assembly(arxiv_id="2402.04858") returns these assemblies with each brick's role and wiring (how to connect).

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