LILO: Learning Interpretable Libraries by Compressing and Documenting Code
Not on the map. Why?
Abstract (arXiv)
While large language models (LLMs) now excel at code generation, a key aspect of software development is the art of refactoring: consolidating code into libraries of reusable and readable programs. In this paper, we introduce LILO, a neurosymbolic framework that iteratively synthesizes, compresses, and documents code to build libraries tailored to particular problem domains. LILO combines LLM-guided program synthesis with recent algorithmic advances in automated refactoring from Stitch: a symbolic compression system that efficiently identifies optimal lambda abstractions across large code corpora. To make these abstractions interpretable, we introduce an auto-documentation (AutoDoc) procedure that infers natural language names and docstrings based on contextual examples of usage. In addition to improving human readability, we find that AutoDoc boosts performance by helping LILO's synthesizer to interpret and deploy learned abstractions. We evaluate LILO on three inductive program synthesis benchmarks for string editing, scene reasoning, and graphics composition. Compared to existing neural and symbolic methods - including the state-of-the-art library learning algorithm DreamCoder - LILO solves more complex tasks and learns richer libraries that are grounded in linguistic knowledge.
Key facts. Cited by 46 papers in the map (data through 7 Oct 2026). Builds on 44 of its 88 references that are in the map. First posted on arXiv 30 Oct 2023.
Builds on
44 of 88 references.
References · 44
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,601
- 2023Toolformer: Language Models Can Teach Themselves to Use Toolscited by 4,072
- 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,064
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
- 2023Voyager: An Open-Ended Embodied Agent with Large Language Modelscited by 2,081
- 2016CLEVR: A Diagnostic Dataset for Compositional Language and Elementary Visual Reasoningcited by 1,445
- 2022Competition-Level Code Generation with AlphaCodecited by 1,427
- 2021What Makes Good In-Context Examples for GPT-3?cited by 1,184
- 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,122
- 2022Large Language Models Are Human-Level Prompt Engineerscited by 1,020
32 more
- 2021Measuring Coding Challenge Competence With APPScited by 879
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
- 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
- 2015Neural Module Networkscited by 375
- 2023Chain-of-Verification Reduces Hallucination in Large Language Modelscited by 317
- 2018Neural-Symbolic VQA: Disentangling Reasoning from Vision and Language Understandingcited by 304
- 2022Memorizing Transformerscited by 219
- 2022Synchromesh: Reliable code generation from pre-trained language modelscited by 156
- 2016DeepCoder: Learning to Write Programscited by 145
- 2017Learning to Reason: End-to-End Module Networks for Visual Question Answeringcited by 125
- 2017RobustFill: Neural Program Learning under Noisy I/Ocited by 124
- 2021Skill Induction and Planning with Latent Languagecited by 99
- 2022Natural Language to Code Generation in Interactive Data Science Notebookscited by 86
- 2016Neuro-Symbolic Program Synthesiscited by 84
- 2017Learning with Latent Languagecited by 75
- 2022Language Models Can Teach Themselves to Program Bettercited by 75
- 2017Learning to Infer Graphics Programs from Hand-Drawn Imagescited by 73
- 2021DOBF: A Deobfuscation Pre-Training Objective for Programming Languagescited by 68
- 2022Top-Down Synthesis for Library Learningcited by 57
- 2021What Context Features Can Transformer Language Models Use?cited by 49
- 2019Learning to Infer Program Sketchescited by 44
- 2021Leveraging Language to Learn Program Abstractions and Search Heuristicscited by 44
- 2019Program Synthesis and Semantic Parsing with Learned Code Idiomscited by 34
- 2023The Larger They Are, the Harder They Fail: Language Models do not Recognize Identifier Swaps in Pythoncited by 29
- 20213DP3: 3D Scene Perception via Probabilistic Programmingcited by 26
- 2022babble: Learning Better Abstractions with E-Graphs and Anti-Unificationcited by 22
- 2018Beyond imitation: Zero-shot task transfer on robots by learning concepts as cognitive programscited by 21
- 2015Program Synthesis from Polymorphic Refinement Typescited by 20
- 2021Generating Adversarial Computer Programs using Optimized Obfuscationscited by 20
- 2014Mining Idioms from Source Codecited by 19
- 2017Agile Software Development Methods: Review and Analysiscited by 18
- 2021Multi-modal Program Inference: a Marriage of Pre-trainedLanguage Models and Component-based Synthesiscited by 12
Built on by
Citing papers per year: 2024: 15; 2025: 13; 2026: 18.
46 papers.
Sort:
By area:
- 2024Agent Workflow Memorycited by 342
- 2025Inducing Programmatic Skills for Agentic Taskscited by 103
- 2024WorldCoder, a Model-Based LLM Agent: Building World Models by Writing Code and Interacting with the Environmentcited by 99
- 2024Towards Guaranteed Safe AI: A Framework for Ensuring Robust and Reliable AI Systemscited by 94
- 2024Symbolic Regression with a Learned Concept Librarycited by 76
- 2024TroVE: Inducing Verifiable and Efficient Toolboxes for Solving Programmatic Taskscited by 70
- 2024What Are Tools Anyway? A Survey from the Language Model Perspectivecited by 53
- 2024ReGAL: Refactoring Programs to Discover Generalizable Abstractionscited by 32
- 2024Pix2Code: Learning to Compose Neural Visual Concepts as Programscited by 18
- 2026SkillDAG: Self-Evolving Typed Skill Graphs for LLM Skill Selection at Scalecited by 15
- 2025Modeling Open-World Cognition as On-Demand Synthesis of Probabilistic Modelscited by 14
- 2024Synthesizing Programmatic Reinforcement Learning Policies with Large Language Model Guided Searchcited by 13
34 more
- 2025Self-Steering Language Modelscited by 13
- 2024Loose LIPS Sink Ships: Asking Questions in Battleship with Language-Informed Program Samplingcited by 12
- 2026Executable World Models for ARC-AGI-3 in the Era of Coding Agentscited by 12
- 2025AI Agents as Universal Task Solverscited by 9
- 2025ShapeLib: Designing a library of programmatic 3D shape abstractions with Large Language Modelscited by 5
- 2024TurtleBench: A Visual Programming Benchmark in Turtle Geometrycited by 4
- 2025Refactoring Codebases through Library Designcited by 4
- 2026DreamProver: Evolving Transferable Lemma Libraries via a Wake-Sleep Theorem-Proving Agentcited by 4
- 2024Library Learning Doesn't: The Curious Case of the Single-Use "Library"cited by 3
- 2025GATE: Graph-based Adaptive Tool Evolution Across Diverse Taskscited by 3
- 2025LLM Library Learning Fails: A LEGO-Prover Case Studycited by 3
- 2025Characterizing Language Use in a Collaborative Situated Gamecited by 3
- 2026Do Coding Agents Need Executable World Models, Simplification, and Verification to Solve ARC-AGI-3?cited by 3
- 2024AbstractBeam: Enhancing Bottom-Up Program Synthesis using Library Learningcited by 2
- 2025Self-Evolving Visual Concept Library using Vision-Language Criticscited by 2
- 2025A Compute-Matched Re-Evaluation of TroVE on MATHcited by 2
- 2025Learning Interestingness in Automated Mathematical Theory Formationcited by 2
- 2025Transductive Visual Programming: Evolving Tool Libraries from Experience for Spatial Reasoningcited by 2
- 2026Artificial Intelligence and the Structure of Mathematicscited by 2
- 2026AllocBench: Measuring Online Tool Allocation Capability in LLM Agentscited by 2
- 2026ReaComp: Compiling LLM Reasoning into Symbolic Solvers for Efficient Program Synthesiscited by 1
- 2024Sketch-Plan-Generalize: Learning and Planning with Neuro-Symbolic Programmatic Representations for Inductive Spatial Conceptscited by 0
- 2024MathDSL: A Domain-Specific Language for Concise Mathematical Solutions Via Program Synthesiscited by 0
- 2026Prospective Compression in Human Abstraction Learningcited by 0
- 2026ShapeCodeBench: A Renewable Benchmark for Perception-to-Program Reconstruction of Synthetic Shape Scenescited by 0
- 2026Inducing Reasoning Primitives from Agent Tracescited by 0
- 2026When LLMs Develop Languages: Symbolic Communication for Efficient Multi-Agent Reasoningcited by 0
- 2026Atomic Units of X: The Compression Layer of Intelligencecited by 0
- 2026PACE: Primitive-Aware Code Evolution for Automated Algorithm Designcited by 0
- 2026SkillComposer: Learning Reusable Skills for Natural-Language Robot Programmingcited by 0
- 2026Super Library Agent: Joint Generation and Maintenance of Multiple Applications Beyond the Single Codebasecited by 0
- 2026REFACTOR-VLA: Unsupervised Library Learning of Typed Motor Programscited by 0
- 2026X-Tree: Tokenizing Reusable Experience for Efficient Agent Generalizationcited by 0
- 2026MatLoom: Layered Text-to-Material Generation in a Compact Program Spacecited by 0
- 2026MatLoom: Layered Text-to-Material Generation in a Compact Program Space30 Sep 2026
- 2026X-Tree: Tokenizing Reusable Experience for Efficient Agent Generalization26 Sep 2026
- 2026REFACTOR-VLA: Unsupervised Library Learning of Typed Motor Programs1 Sep 2026
- 2026Super Library Agent: Joint Generation and Maintenance of Multiple Applications Beyond the Single Codebase29 Aug 2026
- 2026SkillComposer: Learning Reusable Skills for Natural-Language Robot Programming14 Aug 2026
- 2026PACE: Primitive-Aware Code Evolution for Automated Algorithm Design7 Aug 2026
- 2026AllocBench: Measuring Online Tool Allocation Capability in LLM Agents25 Jul 2026
- 2026Do Coding Agents Need Executable World Models, Simplification, and Verification to Solve ARC-AGI-3?16 Jul 2026
- 2026Atomic Units of X: The Compression Layer of Intelligence14 Jul 2026
- 2026When LLMs Develop Languages: Symbolic Communication for Efficient Multi-Agent Reasoning28 Jun 2026
- 2026SkillDAG: Self-Evolving Typed Skill Graphs for LLM Skill Selection at Scale2 Jun 2026
- 2026Inducing Reasoning Primitives from Agent Traces2 Jun 2026
34 more
- 2026ShapeCodeBench: A Renewable Benchmark for Perception-to-Program Reconstruction of Synthetic Shape Scenes12 May 2026
- 2026Prospective Compression in Human Abstraction Learning11 May 2026
- 2026ReaComp: Compiling LLM Reasoning into Symbolic Solvers for Efficient Program Synthesis6 May 2026
- 2026Executable World Models for ARC-AGI-3 in the Era of Coding Agents6 May 2026
- 2026DreamProver: Evolving Transferable Lemma Libraries via a Wake-Sleep Theorem-Proving Agent29 Apr 2026
- 2026Artificial Intelligence and the Structure of Mathematics7 Apr 2026
- 2025Transductive Visual Programming: Evolving Tool Libraries from Experience for Spatial Reasoning24 Dec 2025
- 2025Characterizing Language Use in a Collaborative Situated Game3 Dec 2025
- 2025Learning Interestingness in Automated Mathematical Theory Formation5 Nov 2025
- 2025AI Agents as Universal Task Solvers14 Oct 2025
- 2025A Compute-Matched Re-Evaluation of TroVE on MATH16 Jul 2025
- 2025Modeling Open-World Cognition as On-Demand Synthesis of Probabilistic Models16 Jul 2025
- 2025Refactoring Codebases through Library Design26 May 2025
- 2025Self-Steering Language Models9 Apr 2025
- 2025Inducing Programmatic Skills for Agentic Tasks9 Apr 2025
- 2025LLM Library Learning Fails: A LEGO-Prover Case Study3 Apr 2025
- 2025Self-Evolving Visual Concept Library using Vision-Language Critics31 Mar 2025
- 2025GATE: Graph-based Adaptive Tool Evolution Across Diverse Tasks20 Feb 2025
- 2025ShapeLib: Designing a library of programmatic 3D shape abstractions with Large Language Models13 Feb 2025
- 2024TurtleBench: A Visual Programming Benchmark in Turtle Geometry31 Oct 2024
- 2024Library Learning Doesn't: The Curious Case of the Single-Use "Library"26 Oct 2024
- 2024MathDSL: A Domain-Specific Language for Concise Mathematical Solutions Via Program Synthesis26 Sep 2024
- 2024Symbolic Regression with a Learned Concept Library14 Sep 2024
- 2024Agent Workflow Memory11 Sep 2024
- 2024AbstractBeam: Enhancing Bottom-Up Program Synthesis using Library Learning27 May 2024
- 2024Synthesizing Programmatic Reinforcement Learning Policies with Large Language Model Guided Search26 May 2024
- 2024Towards Guaranteed Safe AI: A Framework for Ensuring Robust and Reliable AI Systems10 May 2024
- 2024Sketch-Plan-Generalize: Learning and Planning with Neuro-Symbolic Programmatic Representations for Inductive Spatial Concepts11 Apr 2024
- 2024What Are Tools Anyway? A Survey from the Language Model Perspective18 Mar 2024
- 2024Loose LIPS Sink Ships: Asking Questions in Battleship with Language-Informed Program Sampling29 Feb 2024
- 2024WorldCoder, a Model-Based LLM Agent: Building World Models by Writing Code and Interacting with the Environment19 Feb 2024
- 2024Pix2Code: Learning to Compose Neural Visual Concepts as Programs13 Feb 2024
- 2024ReGAL: Refactoring Programs to Discover Generalizable Abstractions29 Jan 2024
- 2024TroVE: Inducing Verifiable and Efficient Toolboxes for Solving Programmatic Tasks23 Jan 2024
- 2024Agent Workflow Memorycited by 342
- 2025Inducing Programmatic Skills for Agentic Taskscited by 103
- 2026SkillDAG: Self-Evolving Typed Skill Graphs for LLM Skill Selection at Scalecited by 15
- 2026DreamProver: Evolving Transferable Lemma Libraries via a Wake-Sleep Theorem-Proving Agentcited by 4
- 2026AllocBench: Measuring Online Tool Allocation Capability in LLM Agentscited by 2
- 2026Super Library Agent: Joint Generation and Maintenance of Multiple Applications Beyond the Single Codebasecited by 0
- 2026X-Tree: Tokenizing Reusable Experience for Efficient Agent Generalizationcited by 0
- 2026X-Tree: Tokenizing Reusable Experience for Efficient Agent Generalization26 Sep 2026
- 2026Super Library Agent: Joint Generation and Maintenance of Multiple Applications Beyond the Single Codebase29 Aug 2026
- 2026AllocBench: Measuring Online Tool Allocation Capability in LLM Agents25 Jul 2026
- 2026SkillDAG: Self-Evolving Typed Skill Graphs for LLM Skill Selection at Scale2 Jun 2026
- 2026DreamProver: Evolving Transferable Lemma Libraries via a Wake-Sleep Theorem-Proving Agent29 Apr 2026
- 2025Inducing Programmatic Skills for Agentic Tasks9 Apr 2025
- 2024Agent Workflow Memory11 Sep 2024
- 2025Self-Steering Language Modelscited by 13
- 2024Library Learning Doesn't: The Curious Case of the Single-Use "Library"cited by 3
- 2025Transductive Visual Programming: Evolving Tool Libraries from Experience for Spatial Reasoningcited by 2
- 2026ReaComp: Compiling LLM Reasoning into Symbolic Solvers for Efficient Program Synthesiscited by 1
- 2026Inducing Reasoning Primitives from Agent Tracescited by 0
- 2026When LLMs Develop Languages: Symbolic Communication for Efficient Multi-Agent Reasoningcited by 0
- 2026When LLMs Develop Languages: Symbolic Communication for Efficient Multi-Agent Reasoning28 Jun 2026
- 2026Inducing Reasoning Primitives from Agent Traces2 Jun 2026
- 2026ReaComp: Compiling LLM Reasoning into Symbolic Solvers for Efficient Program Synthesis6 May 2026
- 2025Transductive Visual Programming: Evolving Tool Libraries from Experience for Spatial Reasoning24 Dec 2025
- 2025Self-Steering Language Models9 Apr 2025
- 2024Library Learning Doesn't: The Curious Case of the Single-Use "Library"26 Oct 2024
- 2024WorldCoder, a Model-Based LLM Agent: Building World Models by Writing Code and Interacting with the Environmentcited by 99
- 2024Towards Guaranteed Safe AI: A Framework for Ensuring Robust and Reliable AI Systemscited by 94
- 2026Executable World Models for ARC-AGI-3 in the Era of Coding Agentscited by 12
- 2026Do Coding Agents Need Executable World Models, Simplification, and Verification to Solve ARC-AGI-3?cited by 3
- 2026REFACTOR-VLA: Unsupervised Library Learning of Typed Motor Programscited by 0
- 2026REFACTOR-VLA: Unsupervised Library Learning of Typed Motor Programs1 Sep 2026
- 2026Do Coding Agents Need Executable World Models, Simplification, and Verification to Solve ARC-AGI-3?16 Jul 2026
- 2026Executable World Models for ARC-AGI-3 in the Era of Coding Agents6 May 2026
- 2024Towards Guaranteed Safe AI: A Framework for Ensuring Robust and Reliable AI Systems10 May 2024
- 2024WorldCoder, a Model-Based LLM Agent: Building World Models by Writing Code and Interacting with the Environment19 Feb 2024
- 2024Symbolic Regression with a Learned Concept Librarycited by 76
- 2024TroVE: Inducing Verifiable and Efficient Toolboxes for Solving Programmatic Taskscited by 70
- 2024What Are Tools Anyway? A Survey from the Language Model Perspectivecited by 53
- 2024ReGAL: Refactoring Programs to Discover Generalizable Abstractionscited by 32
- 2024Pix2Code: Learning to Compose Neural Visual Concepts as Programscited by 18
- 2025Modeling Open-World Cognition as On-Demand Synthesis of Probabilistic Modelscited by 14
- 2024Synthesizing Programmatic Reinforcement Learning Policies with Large Language Model Guided Searchcited by 13
- 2024Loose LIPS Sink Ships: Asking Questions in Battleship with Language-Informed Program Samplingcited by 12
- 2025AI Agents as Universal Task Solverscited by 9
- 2025ShapeLib: Designing a library of programmatic 3D shape abstractions with Large Language Modelscited by 5
- 2024TurtleBench: A Visual Programming Benchmark in Turtle Geometrycited by 4
- 2025Refactoring Codebases through Library Designcited by 4
12 most cited of 27 All 27 (JSON)
- 2026MatLoom: Layered Text-to-Material Generation in a Compact Program Space30 Sep 2026
- 2026SkillComposer: Learning Reusable Skills for Natural-Language Robot Programming14 Aug 2026
- 2026PACE: Primitive-Aware Code Evolution for Automated Algorithm Design7 Aug 2026
- 2026Atomic Units of X: The Compression Layer of Intelligence14 Jul 2026
- 2026ShapeCodeBench: A Renewable Benchmark for Perception-to-Program Reconstruction of Synthetic Shape Scenes12 May 2026
- 2026Prospective Compression in Human Abstraction Learning11 May 2026
- 2026Artificial Intelligence and the Structure of Mathematics7 Apr 2026
- 2025Characterizing Language Use in a Collaborative Situated Game3 Dec 2025
- 2025Learning Interestingness in Automated Mathematical Theory Formation5 Nov 2025
- 2025AI Agents as Universal Task Solvers14 Oct 2025
- 2025A Compute-Matched Re-Evaluation of TroVE on MATH16 Jul 2025
- 2025Modeling Open-World Cognition as On-Demand Synthesis of Probabilistic Models16 Jul 2025
12 newest of 27 All 27 (JSON)