mlsanityData to 7 Oct 2026

CYCLE: Learning to Self-Refine the Code Generation

arXiv 2403.18746 ↗First posted 27 Mar 2024cs.SE cs.CLcited by 39

Not on the map. Why?

Abstract (arXiv)

Pre-trained code language models have achieved promising performance in code generation and improved the programming efficiency of human developers. However, their self-refinement capability is typically overlooked by the existing evaluations of code LMs, which focus only on the accuracy of the one-time prediction. For the cases when code LMs fail to implement the correct program, developers actually find it hard to debug and fix the faulty prediction since it is not written by the developers themselves. Unfortunately, our study reveals that code LMs cannot efficiently self-refine their faulty generations as well. In this paper, we propose CYCLE framework, learning to self-refine the faulty generation according to the available feedback, such as the execution results reported by the test suites. We evaluate CYCLE on three popular code generation benchmarks, HumanEval, MBPP, and APPS. The results reveal that CYCLE successfully maintains, sometimes improves, the quality of one-time code generation, while significantly improving the self-refinement capability of code LMs. We implement four variants of CYCLE with varied numbers of parameters across 350M, 1B, 2B, and 3B, and the experiments show that CYCLE consistently boosts the code generation performance, by up to 63.5%, across benchmarks and varied model sizes. We also notice that CYCLE outperforms code LMs that have 3× more parameters in self-refinement.

Key facts. Cited by 39 papers in the map (data through 7 Oct 2026). Builds on 38 of its 55 references that are in the map. First posted on arXiv 27 Mar 2024.

Builds on

38 of 55 references.

References · 38

  1. 2020Language Models are Few-Shot Learnerscited by 32,199
  2. 2019PyTorch: An Imperative Style, High-Performance Deep Learning Librarycited by 20,160
  3. 2022Training language models to follow instructions with human feedbackcited by 15,712
  4. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  5. 2020Scaling Laws for Neural Language Modelscited by 6,411
  6. 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,064
  7. 2017Deep reinforcement learning from human preferencescited by 3,846
  8. 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,747
  9. 2021Program Synthesis with Large Language Modelscited by 3,509
  10. 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,317
  11. 2019The Curious Case of Neural Text Degenerationcited by 2,881
  12. 2020Learning to summarize from human feedbackcited by 2,562
26 more
  1. 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,346
  2. 2019Fine-Tuning Language Models from Human Preferencescited by 2,124
  3. 2023Code Llama: Open Foundation Models for Codecited by 2,105
  4. 2018SentencePiece: A simple and language independent subword tokenizer and detokenizer for Neural Text Processingcited by 1,973
  5. 2021Multitask Prompted Training Enables Zero-Shot Task Generalizationcited by 1,462
  6. 2022Competition-Level Code Generation with AlphaCodecited by 1,427
  7. 2023Large Language Models Cannot Self-Correct Reasoning Yetcited by 965
  8. 2023Teaching Large Language Models to Self-Debugcited by 963
  9. 2021Measuring Coding Challenge Competence With APPScited by 879
  10. 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
  11. 2023StarCoder: may the source be with you!cited by 790
  12. 2021Cross-Task Generalization via Natural Language Crowdsourcing Instructionscited by 696
  13. 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
  14. 2022A Systematic Evaluation of Large Language Models of Codecited by 360
  15. 2022The Stack: 3 TB of permissively licensed source codecited by 354
  16. 2021Symbolic Knowledge Distillation: from General Language Models to Commonsense Modelscited by 270
  17. 2022Efficient Training of Language Models to Fill in the Middlecited by 248
  18. 2022Grounded Copilot: How Programmers Interact with Code-Generating Modelscited by 216
  19. 2023SantaCoder: don't reach for the stars!cited by 169
  20. 2023Large Language Models for Code: Security Hardening and Adversarial Testingcited by 149
  21. 2022Large Language Models Meet NL2Code: A Surveycited by 135
  22. 2023Self-Edit: Fault-Aware Code Editor for Code Generationcited by 110
  23. 2023DERA: Enhancing Large Language Model Completions with Dialog-Enabled Resolving Agentscited by 52
  24. 2023Exploring the Potential of ChatGPT in Automated Code Refinement: An Empirical Studycited by 44
  25. 2021Self-Tuning for Data-Efficient Deep Learningcited by 39
  26. 2020Patching as Translation: the Data and the Metaphorcited by 18

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 15; 2025: 16; 2026: 8.

39 papers.

Sort:

By area:

  1. 2024Beyond Functional Correctness: Exploring Hallucinations in LLM-Generated Codecited by 106
  2. 2024From LLMs to LLM-based Agents for Software Engineering: A Survey of Current, Challenges and Futurecited by 85
  3. 2024Alibaba LingmaAgent: Improving Automated Issue Resolution via Comprehensive Repository Explorationcited by 58
  4. 2024Lingma SWE-GPT: An Open Development-Process-Centric Language Model for Automated Software Improvementcited by 57
  5. 2024Code Repair with LLMs gives an Exploration-Exploitation Tradeoffcited by 50
  6. 2024From Code to Correctness: Closing the Last Mile of Code Generation with Hierarchical Debuggingcited by 46
  7. 2024LeDex: Training LLMs to Better Self-Debug and Explain Codecited by 39
  8. 2025AutoTriton: Automatic Triton Programming with Reinforcement Learning in LLMscited by 38
  9. 2025VulnBot: Autonomous Penetration Testing for A Multi-Agent Collaborative Frameworkcited by 30
  10. 2025QualityFlow: An Agentic Workflow for Program Synthesis Controlled by LLM Quality Checkscited by 22
  11. 2025Exploring Autonomous Agents: A Closer Look at Why They Fail When Completing Taskscited by 20
  12. 2025debug-gym: A Text-Based Environment for Interactive Debuggingcited by 19
27 more
  1. 2025Sailing by the Stars: A Survey on Reward Models and Learning Strategies for Learning from Rewardscited by 14
  2. 2024Are LLMs Correctly Integrated into Software Systems?cited by 13
  3. 2024RGD: Multi-LLM Based Agent Debugger via Refinement and Generation Guidancecited by 12
  4. 2025Reasoning-as-Logic-Units: Scaling Test-Time Reasoning in Large Language Models Through Logic Unit Alignmentcited by 12
  5. 2024API-guided Dataset Synthesis to Finetune Large Code Modelscited by 11
  6. 2025Risk Assessment Framework for Code LLMs via Leveraging Internal Statescited by 8
  7. 2025Enhancing LLM Code Generation: A Systematic Evaluation of Multi-Agent Collaboration and Runtime Debugging for Improved Accuracy, Reliability, and Latencycited by 8
  8. 2025Validating Network Protocol Parsers with Traceable RFC Document Interpretationcited by 7
  9. 2025Differentiation-Based Extraction of Proprietary Data from Fine-Tuned LLMscited by 6
  10. 2025QCoder Benchmark: Bridging Language Generation and Quantum Hardware through Simulator-Based Feedbackcited by 6
  11. 2025Large Language Models for Validating Network Protocol Parserscited by 5
  12. 2026How Many Tries Does It Take? Iterative Self-Repair in LLM Code Generation Across Model Scales and Benchmarkscited by 5
  13. 2024SeCodePLT: A Unified Platform for Evaluating the Security of Code GenAIcited by 4
  14. 2024Mastering the Craft of Data Synthesis for CodeLLMscited by 3
  15. 2025Leveraging Metamemory Agent for Enhanced Data-Free Code Generation in Large Language Modelscited by 3
  16. 2025Teaching LLM to Reason: Reinforcement Learning from Algorithmic Problems without Codecited by 3
  17. 2026Falsification, Not Exposure: An Internally Preregistered Placebo-Controlled Decomposition of Self-Repair Feedback in Frozen Small Code Modelscited by 3
  18. 2025SDA: Steering-Driven Distribution Alignment for Open LLMs without Fine-Tuningcited by 2
  19. 2026Executing as You Generate: Hiding Execution Latency in LLM Code Interpreterscited by 2
  20. 2024Insights from Benchmarking Frontier Language Models on Web App Code Generationcited by 1
  21. 2024FTSmartAudit: A Knowledge Distillation-Enhanced Framework for Automated Smart Contract Auditing Using Fine-Tuned LLMscited by 1
  22. 2026From LLMs to Agents in Programming: The Impact of Providing an LLM with a Compilercited by 1
  23. 2026Feedback Over Form: Why Execution Feedback Matters More Than Pipeline Topology in 1-3B Code Generationcited by 1
  24. 2026FLARE: Fine-Grained Diagnostic Feedback for LLM Code Refinementcited by 1
  25. 2024Investigating the Transferability of Code Repair for Low-Resource Programming Languagescited by 0
  26. 2026ExeCRE: Execution-Consistency Guided Reliability Estimation for Self-Correcting Code Generationcited by 0
  27. 2026ACTS-SQL: Agentic and Critic-Oriented Tree-Structured SQL Correctness with Large Language Modelscited by 0