Leveraging Metamemory Agent for Enhanced Data-Free Code Generation in Large Language Models
On the map: LLM agents and tool use → Software engineering coding agents
Abstract (arXiv)
Large language models (LLMs) have shown strong performance in automated code generation, with few-shot prompting widely used for its simplicity and effectiveness. However, few-shot methods depend on curated or manually crafted reference examples, limiting their applicability in data-free coding scenarios such as real-world data-free coding scenarios and benchmarks without training sets. Existing methods that generate reference examples via recitation or analogy cannot guarantee their authenticity or accuracy. Inspired by human metamemory, we propose a novel metamemory agent to enhance one-time code generation in data-free coding scenarios. The agent guides LLMs to recall relevant prior knowledge, evaluate confidence in recalled information, and selectively exploit reliable content for problem solving. This agent removes the need for external reference examples, improves the authenticity and accuracy of recalled knowledge, and adaptively tailors the recall&evaluation process to each task. Extensive experiments demonstrate that the proposed metamemory agent significantly improves one-time code generation quality across data-free coding scenarios. The AI contribution is the metamemory agent, which makes self-recalled examples reliable through confidence evaluation and selection; the engineering application is data-free automated code generation, validated on eight public benchmarks.
Key facts. Cited by 3 papers in the map (data through 7 Oct 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 42 of its 70 references that are in the map. First posted on arXiv 14 Jan 2025.
Builds on
42 of 70 references.
Closest ancestors · 1
Same direction, newest first
Other references · 41
- 2023GPT-4 Technical Reportcited by 18,132
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2022Large Language Models are Zero-Shot Reasonerscited by 4,323
- 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,064
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2024LiveCodeBench: Holistic and Contamination Free Evaluation of Large Language Models for Codecited by 1,906
- 2022Competition-Level Code Generation with AlphaCodecited by 1,427
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,332
- 2024Qwen2.5-Coder Technical Reportcited by 1,151
- 2019Self-Supervised Learning of Pretext-Invariant Representationscited by 806
29 more
- 2020Self-supervised Learning: Generative or Contrastivecited by 693
- 2023Plan-and-Solve Prompting: Improving Zero-Shot Chain-of-Thought Reasoning by Large Language Modelscited by 550
- 2021Recent Advances in Natural Language Processing via Large Pre-Trained Language Models: A Surveycited by 457
- 2024InternLM2 Technical Reportcited by 391
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 389
- 2023CodeGeeX: A Pre-Trained Model for Code Generation with Multilingual Benchmarking on HumanEval-Xcited by 294
- 2023Prompting Large Language Model for Machine Translation: A Case Studycited by 247
- 2023Adapted Large Language Models Can Outperform Medical Experts in Clinical Text Summarizationcited by 244
- 2022Selective Annotation Makes Language Models Better Few-Shot Learnerscited by 242
- 2023An Empirical Evaluation of Using Large Language Models for Automated Unit Test Generationcited by 193
- 2019SPoC: Search-based Pseudocode to Codecited by 176
- 2022Self-Adaptive In-Context Learning: An Information Compression Perspective for In-Context Example Selection and Orderingcited by 158
- 2023Towards Making the Most of ChatGPT for Machine Translationcited by 138
- 2023Self-planning Code Generation with Large Language Modelscited by 121
- 2023Large Language Models as Analogical Reasonerscited by 107
- 2022Automated Repair of Programs from Large Language Modelscited by 71
- 2023Large Language Models are Few-Shot Summarizers: Multi-Intent Comment Generation via In-Context Learningcited by 71
- 2022Recitation-Augmented Language Modelscited by 65
- 2024Revisiting Demonstration Selection Strategies in In-Context Learningcited by 57
- 2023SheetCopilot: Bringing Software Productivity to the Next Level through Large Language Modelscited by 53
- 2024A Performance Study of LLM-Generated Code on Leetcodecited by 48
- 2024LLM-Based Test-Driven Interactive Code Generation: User Study and Empirical Evaluationcited by 46
- 2022Code Generation Tools (Almost) for Free? A Study of Few-Shot, Pre-Trained Language Models on Codecited by 39
- 2024CYCLE: Learning to Self-Refine the Code Generationcited by 39
- 2023StudentEval: A Benchmark of Student-Written Prompts for Large Language Models of Codecited by 32
- 2023Teaching Language Models to Self-Improve through Interactive Demonstrationscited by 26
- 2023ChatCoder: Chat-based Refine Requirement Improves LLMs' Code Generationcited by 13
- 2024OOP: Object-Oriented Programming Evaluation Benchmark for Large Language Modelscited by 8
- 2024Refactoring Deep Learning Code: A Study of Practices and Unsatisfied Tool Needscited by 3
Built on by
Citing papers per year: 2025: 3.
3 papers.
- 2025Advances and Challenges in Foundation Agents: From Brain-Inspired Intelligence to Evolutionary, Collaborative, and Safe Systemscited by 125
- 2025Enhancing Input-Label Mapping in In-Context Learning with Contrastive Decodingcited by 4
- 2025Lifecycle-Aware code generation: Leveraging Software Engineering Phases in LLMscited by 0
- 2025Lifecycle-Aware code generation: Leveraging Software Engineering Phases in LLMs28 Oct 2025
- 2025Advances and Challenges in Foundation Agents: From Brain-Inspired Intelligence to Evolutionary, Collaborative, and Safe Systems31 Mar 2025
- 2025Enhancing Input-Label Mapping in In-Context Learning with Contrastive Decoding19 Feb 2025
Similar, not cited
Close in wording, no citation either way
- 2024MapCoder: Multi-Agent Code Generation for Competitive Problem Solving
- 2025Enhancing LLM Code Generation: A Systematic Evaluation of Multi-Agent Collaboration and Runtime Debugging for Improved Accuracy, Reliability, and Latency
- 2025A Self-Improving Coding Agent
- 2025CodeVisionary: An Agent-based Framework for Evaluating Large Language Models in Code Generation
- 2025TALM: Dynamic Tree-Structured Multi-Agent Framework with Long-Term Memory for Scalable Code Generation
- 2023AgentCoder: Multi-Agent-based Code Generation with Iterative Testing and Optimisation
- 2025MapCoder-Lite: Distilling Multi-Agent Coding into a Single Small LLM
- 2025Learning to Solve and Verify: A Self-Play Framework for Code and Test Generation