REGAL: Refactoring Programs to Discover Generalizable Abstractions

REGAL: Refactoring Programs to Discover Generalizable Abstractions

2024 | Elias Stengel-Eskin * 1 Archiki Prasad * 1 Mohit Bansal 1
The paper introduces Refactoring for Generalizable Abstraction Learning (ReGAL), a gradient-free method for learning reusable functions through code refactoring. ReGAL addresses the limitations of large language models (LLMs) in generating redundant and error-prone code by learning from a small set of existing programs. It iteratively verifies and refines abstractions via execution, improving the accuracy of LLMs across diverse domains such as LOGO graphics generation, date reasoning, TextCraft, MATH, and TabMWP. ReGAL's abstractions are found to be reusable and encapsulate frequently used subroutines and environment dynamics. The method is evaluated on five datasets, showing significant improvements in accuracy for various LLMs, including open-source models like CodeLlama-13B, which outperform larger proprietary models like GPT-3.5 in two out of three domains. The paper also discusses the benefits of ReGAL's abstractions, including reusability and generalizability, and provides an error analysis to highlight its effectiveness.The paper introduces Refactoring for Generalizable Abstraction Learning (ReGAL), a gradient-free method for learning reusable functions through code refactoring. ReGAL addresses the limitations of large language models (LLMs) in generating redundant and error-prone code by learning from a small set of existing programs. It iteratively verifies and refines abstractions via execution, improving the accuracy of LLMs across diverse domains such as LOGO graphics generation, date reasoning, TextCraft, MATH, and TabMWP. ReGAL's abstractions are found to be reusable and encapsulate frequently used subroutines and environment dynamics. The method is evaluated on five datasets, showing significant improvements in accuracy for various LLMs, including open-source models like CodeLlama-13B, which outperform larger proprietary models like GPT-3.5 in two out of three domains. The paper also discusses the benefits of ReGAL's abstractions, including reusability and generalizability, and provides an error analysis to highlight its effectiveness.
Reach us at info@study.space
[slides] ReGAL%3A Refactoring Programs to Discover Generalizable Abstractions | StudySpace