LILO: Learning Interpretable Libraries by Compressing and Documenting Code

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Grand, Gabriel, Wong, Lionel, Bowers, Maddy, Olausson, Theo X., Liu, Muxin, Tenenbaum, Joshua B., Andreas, Jacob
Format: Preprint
Published: 2023
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866916159966674944
author Grand, Gabriel
Wong, Lionel
Bowers, Maddy
Olausson, Theo X.
Liu, Muxin
Tenenbaum, Joshua B.
Andreas, Jacob
author_facet Grand, Gabriel
Wong, Lionel
Bowers, Maddy
Olausson, Theo X.
Liu, Muxin
Tenenbaum, Joshua B.
Andreas, Jacob
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2310_19791
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle LILO: Learning Interpretable Libraries by Compressing and Documenting Code
Grand, Gabriel
Wong, Lionel
Bowers, Maddy
Olausson, Theo X.
Liu, Muxin
Tenenbaum, Joshua B.
Andreas, Jacob
Computation and Language
Artificial Intelligence
Machine Learning
Programming Languages
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.
title LILO: Learning Interpretable Libraries by Compressing and Documenting Code
topic Computation and Language
Artificial Intelligence
Machine Learning
Programming Languages
url https://arxiv.org/abs/2310.19791