Research map / Large language models / Agents, code and math
LILO: Learning Interpretable Libraries by Compressing and Documenting Code
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
LILO combines LLM-guided program synthesis, Stitch-based compression, and LLM auto-documentation to learn interpretable program libraries that outperform DreamCoder and an LLM-only baseline on REGEX, CLEVR, and LOGO.
Problem
Library learning for program synthesis is computationally expensive with enumerative search (DreamCoder needs CPU-months), and learned libraries are hard to interpret; LLMs struggle to use anonymous abstractions.
Approach
Alternate LLM-guided search with enumerative search, compress solutions with Stitch's branch-and-bound lambda-abstraction refactoring each iteration, and use an LLM to generate human-readable names and docstrings (AutoDoc) for abstractions, which improves both interpretability and downstream LLM synthesis.
Key results
- LILO achieves 77.07% mean test solve rate on REGEX (vs 43.93% DreamCoder) and 48.95% on LOGO (vs 28.53% DreamCoder) in online synthesis.
- On CLEVR, LILO reaches 96.76% mean vs 94.50% for DreamCoder.
- Without AutoDoc, adding Stitch abstractions to the LLM solver hurt performance (e.g., -30.60 points on REGEX relative to LLM Solver), and AutoDoc recovers +9.73 on REGEX.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| add enumerative search (ablation) | LILO · LOGO | solve rate (mean %): 21.02 -> 48.95 | Helped |
| add enumerative search (ablation) | LILO · REGEX | solve rate (mean %): 62.93 -> 77.07 | Helped |
| add enumerative search (ablation) | LILO · CLEVR | solve rate (mean %): 88.03 -> 96.76 | Helped |
| add AutoDoc to Stitch-compressed abstractions (ablation) | LILO NoSearch · REGEX | solve rate (mean %): +9.73 | Helped |
| add AutoDoc to Stitch-compressed abstractions (ablation) | LILO NoSearch · CLEVR | solve rate (mean %): +2.27 | Helped |
| add AutoDoc to Stitch-compressed abstractions (ablation) | LILO NoSearch · LOGO | solve rate (mean %): +0.00 | No clear effect |
| add Stitch compression without AutoDoc (ablation) | LLMSolver · REGEX | solve rate (mean %): -30.60 | Hurt |
| add Stitch compression without AutoDoc (ablation) | LLMSolver · CLEVR | solve rate (mean %): -2.91 | Hurt |
| add Stitch compression without AutoDoc (ablation) | LLMSolver · LOGO | solve rate (mean %): -11.11 | Hurt |
| select examples by cosine similarity instead of random sampling (ablation) | LILO · REGEX | solve rate (mean %) | No clear effect |
| select examples by cosine similarity instead of random sampling (ablation) | LILO · CLEVR | solve rate (mean %) | No clear effect |
| select examples by cosine similarity instead of random sampling (ablation) | LILO · LOGO | solve rate (mean %) | No clear effect |
Surprising findings
- Providing the LLM with raw Stitch abstractions without documentation degraded synthesis performance substantially (-30.60 points on REGEX), which motivated AutoDoc.
- The LLM-only baseline without library learning bootstraps its performance over time, suggesting in-context accumulation acts as non-compressive library learning.
Limitations
- AutoDoc generations sometimes contain ambiguous or incorrect semantic descriptions that may hurt downstream synthesis.
- Experiments are limited to three inductive synthesis domains with a lambda-calculus DSL rather than modern imperative languages.
- Relies on closed-source OpenAI models, limiting reproducibility.
Experimental setup
Datasets: REGEX string editing dataset (LAPS) CLEVR-based scene reasoning dataset (LAPS) LOGO turtle graphics dataset (LAPS)
Benchmarks: REGEX CLEVR LOGO
Metrics: percent of test tasks solved (max, mean, std over 3 seeds)
Baselines: DreamCoder LLM Solver (no library learning) LLM Solver + enumerative search LILO without search LILO without AutoDoc
Builds on: DreamCoder Stitch LAPS
Closest papers by meaning
- HYSYNTH: Context-Free LLM Approximation for Guiding Program Synthesis (NeurIPS 2024 · similarity 0.86)
- BigCodeBench: Benchmarking Code Generation with Diverse Function Calls and Complex Instructions (ICLR 2025 · similarity 0.86)
- CodeChain: Towards Modular Code Generation Through Chain of Self-revisions with Representative Sub-modules (ICLR 2024 · similarity 0.86)
- ReGAL: Refactoring Programs to Discover Generalizable Abstractions (ICML 2024 · similarity 0.86)
- EffiCoder: Enhancing Code Generation in Large Language Models through Efficiency-Aware Fine-tuning (ICML 2025 · similarity 0.86)
- Guess & Sketch: Language Model Guided Transpilation (ICLR 2024 · similarity 0.86)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
