ReGAL: Refactoring Programs to Discover Generalizable Abstractions
Elias Stengel-Eskin, Archiki Prasad, Mohit Bansal

TL;DR
ReGAL is a gradient-free method that refactors code to learn reusable abstractions, improving program prediction accuracy across diverse domains by enabling large language models to utilize shared function libraries.
Contribution
ReGAL introduces a novel refactoring-based approach for learning reusable code abstractions that enhance LLM program synthesis without gradient updates.
Findings
ReGAL improves accuracy of LLMs on multiple datasets.
Shared abstractions facilitate better program prediction.
ReGAL outperforms some existing methods on key benchmarks.
Abstract
While large language models (LLMs) are increasingly being used for program synthesis, they lack the global view needed to develop useful abstractions; they generally predict programs one at a time, often repeating the same functionality. Generating redundant code from scratch is both inefficient and error-prone. To address this, we propose Refactoring for Generalizable Abstraction Learning (ReGAL), a gradient-free method for learning a library of reusable functions via code refactorization, i.e., restructuring code without changing its execution output. ReGAL learns from a small set of existing programs, iteratively verifying and refining its abstractions via execution. We find that the shared function libraries discovered by ReGAL make programs easier to predict across diverse domains. On five datasets -- LOGO graphics generation, Date reasoning, TextCraft (a Minecraft-based text-game)…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSemantic Web and Ontologies
MethodsRefunds@Expedia|||How do I get a full refund from Expedia? · 15 Ways to Contact How can i speak to someone at Delta Airlines · Attention Is All You Need · Sparse Evolutionary Training · Lib · Cosine Annealing · Linear Layer · Linear Warmup With Cosine Annealing · Weight Decay · Dropout
