arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2310.19791cs.CLcs.AIcs.LGcs.PL
收藏

LILO:通过压缩和文档化代码学习可解释库

LILO: Learning Interpretable Libraries by Compressing and Documenting Code

MIT CSAIL(麻省理工学院计算机科学与人工智能实验室);MIT Brain and Cognitive Sciences(麻省理工学院脑与认知科学系);Harvey Mudd College(哈维穆德学院)

Gabriel Grand, Lionel Wong, Maddy Bowers, Theo X. Olausson, Muxin Liu, Joshua B. Tenenbaum, Jacob Andreas

AI总结:

LILO是一个神经符号框架,结合LLM程序合成与Stitch压缩及AutoDoc文档化,在三个基准上超越DreamCoder,学习更丰富可解释的库。

摘要:

虽然大型语言模型(LLMs)如今在代码生成方面表现出色,但软件开发的一个关键方面是重构的艺术:将代码整合为可重用且可读的程序库。在本文中,我们介绍了LILO,一个神经符号框架,它迭代地合成、压缩和文档化代码,以构建针对特定问题领域的库。LILO将LLM引导的程序合成与Stitch中自动重构的最新算法进展相结合:Stitch是一个符号压缩系统,能够高效地识别大型代码语料库中的最优lambda抽象。为了使这些抽象具有可解释性,我们引入了一种自动文档化(AutoDoc)程序,该程序基于上下文使用示例推断自然语言名称和文档字符串。除了提高人类可读性外,我们发现AutoDoc通过帮助LILO的合成器解释和部署所学抽象来提升性能。我们在三个归纳程序合成基准上评估了LILO,这些基准涉及字符串编辑、场景推理和图形组合。与现有的神经和符号方法——包括最先进的库学习算法DreamCoder——相比,LILO解决了更复杂的任务,并学习了更丰富、基于语言知识扎根的库。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑