Lune

ICLR2024Top-tier venue

L2MAC: Large Language Model Automatic Computer for Extensive Code Generation

Samuel Holt, Max Ruiz Luyten, Mihaela van der Schaar

Abstract

Transformer-based large language models (LLMs) are constrained by the fixed context window of the underlying transformer architecture, hindering their ability to produce long and coherent outputs. Memory-augmented LLMs are a promising solution, but current approaches cannot handle long output generation tasks since they (1) only focus on reading memory and reduce its evolution to the concatenation of new memories or (2) use very specialized memories that cannot adapt to other domains. This paper presents L2MAC 1 , the first practical LLM-based general-purpose stored-program automatic computer (von Neumann architecture) framework, an LLM-based multi-agent system, for long and consistent output generation. Its memory has two components: the instruction registry, which is populated with a prompt program to solve the user-given task, and a file store, which will contain the final and intermediate outputs. Each instruction in turn is executed by a separate LLM agent, whose context is managed by a control unit capable of precise memory reading and writing to ensure effective interaction with the entire file store. These components enable L2MAC to generate extensive outputs, bypassing the constraints of the finite context window while producing outputs that fulfill a complex user-specified task. We empirically demonstrate that L2MAC achieves state-of-the-art performance in generating large codebases for system design tasks, significantly outperforming other coding methods in implementing the detailed user-specified task; we show that L2MAC works for general-purpose extensive text-based tasks, such as writing an entire book; and we provide valuable insights into L2MAC's performance improvement over existing methods.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

14 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Discovering Preference Optimization Algorithms with and for Large Language Models cites Automatically Learning Hybrid Digital Twins of Dynamical Systems
  • Discovering Preference Optimization Algorithms with and for Large Language Models cites Data-Driven Discovery of Dynamical Systems in Pharmacology using Large Language Models
  • Automatically Learning Hybrid Digital Twins of Dynamical Systems cites Data-Driven Discovery of Dynamical Systems in Pharmacology using Large Language Models
  • Data-Driven Discovery of Dynamical Systems in Pharmacology using Large Language Models cites Automatically Learning Hybrid Digital Twins of Dynamical Systems
  • Automatically Learning Hybrid Digital Twins of Dynamical Systems cites Language Models are Few-Shot Learners
  • Data-Driven Discovery of Dynamical Systems in Pharmacology using Large Language Models cites Reflexion: language agents with verbal reinforcement learning
  • Self-Refine: Iterative Refinement with Self-Feedback cites Training language models to follow instructions with human feedback
  • COFFE: A Code Efficiency Benchmark for Code Generation cites Reflexion: language agents with verbal reinforcement learning
  • COFFE: A Code Efficiency Benchmark for Code Generation cites Training language models to follow instructions with human feedback
  • Reflexion: language agents with verbal reinforcement learning cites Self-Refine: Iterative Refinement with Self-Feedback
  • Reflexion: language agents with verbal reinforcement learning cites Toolformer: Language Models Can Teach Themselves to Use Tools
  • Training language models to follow instructions with human feedback cites Language Models are Few-Shot Learners
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers14

  1. Discovering Preference Optimization Algorithms with and for Large Language ModelsChris Lu, Samuel Holt, Claudio Fanconi, Alex J. Chan et al.NeurIPS 2024 · 41 citations
  2. Automatically Learning Hybrid Digital Twins of Dynamical SystemsSamuel Holt, Tennison Liu, Mihaela van der SchaarNeurIPS 2024 · 26 citations
  3. Data-Driven Discovery of Dynamical Systems in Pharmacology using Large Language ModelsSamuel Holt, Zhaozhi Qian, Tennison Liu, James Weatherall et al.NeurIPS 2024 · 16 citations
  4. COFFE: A Code Efficiency Benchmark for Code GenerationYun Peng, Jun Wan, Yichen Li, Xiaoxue RenFSE 2025 · 8 citations
  5. QiMeng-GEMM: Automatically Generating High-Performance Matrix Multiplication Code by Exploiting Large Language ModelsQirui Zhou, Yuanbo Wen, Ruizhi Chen, Ke Gao et al.AAAI 2025 · 7 citations

Builds on21

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida et al.NeurIPS 2022 · 24,707 citations
  3. Toolformer: Language Models Can Teach Themselves to Use ToolsTimo Schick, Jane Dwivedi-Yu, Roberto Dessì, Roberta Raileanu et al.NeurIPS 2023 · 5,989 citations
  4. Reflexion: language agents with verbal reinforcement learningNoah Shinn, Federico Cassano, Ashwin Gopinath, Karthik Narasimhan et al.NeurIPS 2023 · 5,828 citations
  5. Self-Refine: Iterative Refinement with Self-FeedbackAman Madaan, Niket Tandon, Prakhar Gupta, Skyler Hallinan et al.NeurIPS 2023 · 4,972 citations

Related papers

  1. MemoRAG: Boosting Long Context Processing with Global Memory-Enhanced Retrieval AugmentationHongjin Qian, Zheng Liu, Peitian Zhang, Kelong Mao et al.WWW 2025 · 92 citations
  2. Agentic Memory: Learning Unified Long-Term and Short-Term Memory Management for Large Language Model AgentsYi Yu, Liuyi Yao, Yuexiang Xie, Qingquan Tan et al.ACL 2026 · 40 citations
  3. VizoMem: A Visual-Textual Memory Framework for Efficient Long-Horizon ReasoningWeijie Liang, Yuanfeng Song, Xing Chen, Caleb Chen Cao et al.ACL Findings 2026
  4. MAC-Reasoner: A Multi-Agent Collaborative Framework for Enhancing Logical Reasoning in Large Language ModelsYehua Lin, Liping Zheng, Yin ChenACL Findings 2026
  5. Memory-Augmented LLM-based Multi-Agent System for Automated Feature Generation on Tabular DataFengxian Dong, Zhi Zheng, Xiao Han, Wei Chen et al.ACL 2026
Dusk over the sea between two cliffs drawn in fine vertical lines