Refactoring Codebases through Library Design
Not on the map. Why?
Abstract (arXiv)
Maintainable and general software allows developers to build robust applications efficiently, yet achieving these qualities often requires refactoring specialized solutions into reusable components. This challenge becomes particularly relevant as code agents become used to solve isolated one-off programming problems. We investigate code agents' capacity to refactor code in ways that support growth and reusability. We first investigate what makes a good refactoring, finding via simulation results and a human study that Minimum Description Length best correlates with preferable refactorings. We then present both a benchmark and a method for refactoring: MiniCode, a benchmark where multiple files must be refactored into a shared library, and Librarian, a sample-and-rerank method for generating reusable libraries. We compare Librarian to state-of-the-art library generation methods, and study it on real-world code bases.
Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Builds on 13 of its 33 references that are in the map. First posted on arXiv 26 May 2025.
Builds on
13 of 33 references.
References · 13
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
- 2022Beyond the Imitation Game: Quantifying and extrapolating the capabilities of language modelscited by 1,998
- 2022Competition-Level Code Generation with AlphaCodecited by 1,462
- 2025KernelBench: Can LLMs Write Efficient GPU Kernels?cited by 225
- 2024TroVE: Inducing Verifiable and Efficient Toolboxes for Solving Programmatic Taskscited by 75
- 2022Top-Down Synthesis for Library Learningcited by 58
- 2024Commit0: Library Generation from Scratchcited by 52
- 2023LILO: Learning Interpretable Libraries by Compressing and Documenting Codecited by 49
- 2021Leveraging Language to Learn Program Abstractions and Search Heuristicscited by 45
- 2024ReGAL: Refactoring Programs to Discover Generalizable Abstractionscited by 36
- 2025RefactorBench: Evaluating Stateful Reasoning in Language Agents Through Codecited by 30
- 2024ECCO: Can We Improve Model-Generated Code Efficiency Without Sacrificing Functional Correctness?cited by 27
1 more
Built on by
Citing papers per year: 2025: 1; 2026: 3.
4 papers.
- 2025Self-Abstraction from Grounded Experience for Plan-Guided Policy Refinementcited by 9
- 2026CodeTaste: Can LLMs Generate Human-Level Code Refactorings?cited by 8
- 2026Do Coding Agents Need Executable World Models, Simplification, and Verification to Solve ARC-AGI-3?cited by 3
- 2026Can Agents Design Libraries for Agents?cited by 0
- 2026Can Agents Design Libraries for Agents?29 Sep 2026
- 2026Do Coding Agents Need Executable World Models, Simplification, and Verification to Solve ARC-AGI-3?16 Jul 2026
- 2026CodeTaste: Can LLMs Generate Human-Level Code Refactorings?4 Mar 2026
- 2025Self-Abstraction from Grounded Experience for Plan-Guided Policy Refinement8 Nov 2025