LILO: Learning Interpretable Libraries by Compressing and Documenting Code

Gabriel Grand, L. Wong, Matthew Bowers, Theo X. Olausson, Muxin Liu +2 more
10/1/2023

No official code found. Best implementation: gabegrand/lilo (103 stars, last commit 2024-08-29).

Abstract

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.

View on arXivView PDF

Code Implementations(1)

gabegrand/liloCommunity100%

LILO: Library Induction with Language Observations

1038HTML, OCamlMay 16, 20232 years ago

Similar Papers

Cite this paper

@article{grand2023lilo,
  title  = {LILO: Learning Interpretable Libraries by Compressing and Documenting Code},
  author = {Gabriel Grand and L. Wong and Matthew Bowers and Theo X. Olausson and Muxin Liu and J. B. Tenenbaum and Jacob Andreas},
  year   = {2023},
  eprint = {2310.19791},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2310.19791},
  journal = {ICLR 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2310.19791.svg)](https://codeofpaper.com/paper/2310.19791)

Discussion