Better patching using LLM prompting, via Self-Consistency
On the map: LLM reasoning → Reasoning for agents, planning and code
Abstract (arXiv)
Large Language models (LLMs) can be induced to solve non-trivial problems with "few-shot" prompts including illustrative problem-solution examples. Now if the few-shots also include "chain of thought" (CoT) explanations, which are of the form problem-explanation-solution, LLMs will generate a "explained" solution, and perform even better. Recently an exciting, substantially better technique, self-consistency [1] (S-C) has emerged, based on the intuition that there are many plausible explanations for the right solution; when the LLM is sampled repeatedly to generate a pool of explanation-solution pairs, for a given problem, the most frequently occurring solutions in the pool (ignoring the explanations) tend to be even more likely to be correct! Unfortunately, the use of this highly-performant S-C (or even CoT) approach in software engineering settings is hampered by the lack of explanations; most software datasets lack explanations. In this paper, we describe an application of the S-C approach to program repair, using the commit log on the fix as the explanation, only in the illustrative few-shots. We achieve state-of-the art results, beating previous approaches to prompting-based program repair, on the MODIT dataset; we also find evidence suggesting that the correct commit messages are helping the LLM learn to produce better patches.
Key facts. Cited by 29 papers in the map (data through 14 Oct 2026). Placed in Reasoning for agents, planning and code, one of 17 directions in LLM reasoning. Builds on 20 of its 27 references that are in the map. First posted on arXiv 31 May 2023.
Builds on
20 of 27 references.
References · 20
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2022Self-Consistency Improves Chain of Thought Reasoning in Language Modelscited by 5,708
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 885
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 744
- 2022A Systematic Evaluation of Large Language Models of Codecited by 363
- 2018SequenceR: Sequence-to-Sequence Learning for End-to-End Program Repaircited by 145
- 2022Few-shot training LLMs for project-specific code-summarizationcited by 129
- 2018An Empirical Study on Learning Bug-Fixing Patches in the Wild via Neural Machine Translationcited by 108
8 more
- 2021CURE: Code-Aware Neural Machine Translation for Automatic Program Repaircited by 86
- 2023Impact of Code Language Models on Automated Program Repaircited by 85
- 2023Automatic Semantic Augmentation of Language Model Prompts (for Code Summarization)cited by 72
- 2022NatGen: Generative pre-training by "Naturalizing" source codecited by 54
- 2021Neural Program Repair with Execution-based Backpropagationcited by 50
- 2022CoditT5: Pretraining for Source Code and Natural Language Editingcited by 45
- 2022Code Generation Tools (Almost) for Free? A Study of Few-Shot, Pre-Trained Language Models on Codecited by 39
- 2021On Multi-Modal Learning of Editing Source Codecited by 25
Built on by
Citing papers per year: 2023: 1; 2024: 8; 2025: 12; 2026: 8.
29 papers.
Sort:
By area:
- 2024When LLMs Meet Cybersecurity: A Systematic Literature Reviewcited by 71
- 2024Calibration and Correctness of Language Models for Codecited by 49
- 2025PatchPilot: A Cost-Efficient Software Engineering Agent with Early Attempts on Formal Verificationcited by 22
- 2025Frontier AI's Impact on the Cybersecurity Landscapecited by 21
- 2024CigaR: Cost-efficient Program Repair with LLMscited by 15
- 2024Aligning the Objective of LLM-based Program Repaircited by 12
- 2024Studying LLM Performance on Closed- and Open-source Datacited by 11
- 2024VELO: A Vector Database-Assisted Cloud-Edge Collaborative LLM QoS Optimization Frameworkcited by 10
- 2023Language Models are Better Bug Detector Through Code-Pair Classificationcited by 3
- 2024Chain of Targeted Verification Questions to Improve the Reliability of Code Generated by LLMscited by 3
- 2025COSMosFL: Ensemble of Small Language Models for Fault Localisationcited by 3
- 2025SynPO: Synergizing Descriptiveness and Preference Optimization for Video Detailed Captioningcited by 3
17 more
- 2025AgentSUMO: An Agentic Framework for Interactive Simulation Scenario Generation in SUMO via Large Language Modelscited by 3
- 2026Atropos: Improving Cost-Benefit Trade-off of LLM-based Agents under Self-Consistency with Early Termination and Model Hotswapcited by 3
- 2024From Cool Demos to Production-Ready FMware: Core Challenges and a Technology Roadmapcited by 2
- 2025StyleRec: A Benchmark Dataset for Prompt Recovery in Writing Style Transformationcited by 2
- 2025VALID-Mol: a Systematic Framework for Validated LLM-Assisted Molecular Designcited by 2
- 2025Towards Adaptive Software Agents for Debuggingcited by 1
- 2025What Do They Fix? LLM-Aided Categorization of Security Patches for Critical Memory Bugscited by 1
- 2025DualResearch: Entropy-Gated Dual-Graph Retrieval for Answer Reconstructioncited by 1
- 2025CryptoQA: A Large-scale Question-answering Dataset for AI-assisted Cryptographycited by 1
- 2025T3: Multi-level Tree-based Automatic Program Repair with Large Language Modelscited by 0
- 2026DenTab: A Dataset for Table Recognition and Visual QA on Real-World Dental Estimatescited by 0
- 2026Knowledge Graph-Enhanced Zero-Shot Topic Classification: A Multi-Strategy Comparative Studycited by 0
- 2026A Self Consistency Based Reranking for Narrative Question Answeringcited by 0
- 2026SFL-MTSC: Leveraging Semantic Frame-Level Multi-Task Self-Consistency for Robust Multi-Intent Spoken Language Understandingcited by 0
- 2026Bulkhead: Automated Semantic Detection and Remediation of Container Escape Vulnerabilitiescited by 0
- 2026From Natural Language Policies to Executable Obligations: A Verification Harness for Dependable In-Car LLM Agentscited by 0
- 2026Blockchain-Enabled Artificial Intelligence and AI Agents for Secure Data Sharing and Cybersecurity Applicationscited by 0
- 2026Blockchain-Enabled Artificial Intelligence and AI Agents for Secure Data Sharing and Cybersecurity Applications23 Sep 2026
- 2026From Natural Language Policies to Executable Obligations: A Verification Harness for Dependable In-Car LLM Agents24 Aug 2026
- 2026Bulkhead: Automated Semantic Detection and Remediation of Container Escape Vulnerabilities14 Jul 2026
- 2026SFL-MTSC: Leveraging Semantic Frame-Level Multi-Task Self-Consistency for Robust Multi-Intent Spoken Language Understanding24 Jun 2026
- 2026A Self Consistency Based Reranking for Narrative Question Answering14 Jun 2026
- 2026Knowledge Graph-Enhanced Zero-Shot Topic Classification: A Multi-Strategy Comparative Study28 May 2026
- 2026DenTab: A Dataset for Table Recognition and Visual QA on Real-World Dental Estimates17 Apr 2026
- 2026Atropos: Improving Cost-Benefit Trade-off of LLM-based Agents under Self-Consistency with Early Termination and Model Hotswap16 Apr 2026
- 2025CryptoQA: A Large-scale Question-answering Dataset for AI-assisted Cryptography2 Dec 2025
- 2025AgentSUMO: An Agentic Framework for Interactive Simulation Scenario Generation in SUMO via Large Language Models10 Nov 2025
- 2025DualResearch: Entropy-Gated Dual-Graph Retrieval for Answer Reconstruction10 Oct 2025
- 2025What Do They Fix? LLM-Aided Categorization of Security Patches for Critical Memory Bugs26 Sep 2025
17 more
- 2025VALID-Mol: a Systematic Framework for Validated LLM-Assisted Molecular Design29 Jun 2025
- 2025T3: Multi-level Tree-based Automatic Program Repair with Large Language Models26 Jun 2025
- 2025SynPO: Synergizing Descriptiveness and Preference Optimization for Video Detailed Captioning1 Jun 2025
- 2025Towards Adaptive Software Agents for Debugging25 Apr 2025
- 2025Frontier AI's Impact on the Cybersecurity Landscape7 Apr 2025
- 2025StyleRec: A Benchmark Dataset for Prompt Recovery in Writing Style Transformation6 Apr 2025
- 2025COSMosFL: Ensemble of Small Language Models for Fault Localisation5 Feb 2025
- 2025PatchPilot: A Cost-Efficient Software Engineering Agent with Early Attempts on Formal Verification4 Feb 2025
- 2024From Cool Demos to Production-Ready FMware: Core Challenges and a Technology Roadmap28 Oct 2024
- 2024VELO: A Vector Database-Assisted Cloud-Edge Collaborative LLM QoS Optimization Framework19 Jun 2024
- 2024Chain of Targeted Verification Questions to Improve the Reliability of Code Generated by LLMs22 May 2024
- 2024When LLMs Meet Cybersecurity: A Systematic Literature Review6 May 2024
- 2024Aligning the Objective of LLM-based Program Repair13 Apr 2024
- 2024Studying LLM Performance on Closed- and Open-source Data23 Feb 2024
- 2024CigaR: Cost-efficient Program Repair with LLMs9 Feb 2024
- 2024Calibration and Correctness of Language Models for Code3 Feb 2024
- 2023Language Models are Better Bug Detector Through Code-Pair Classification14 Nov 2023
- 2025PatchPilot: A Cost-Efficient Software Engineering Agent with Early Attempts on Formal Verificationcited by 22
- 2025AgentSUMO: An Agentic Framework for Interactive Simulation Scenario Generation in SUMO via Large Language Modelscited by 3
- 2025Towards Adaptive Software Agents for Debuggingcited by 1
- 2026From Natural Language Policies to Executable Obligations: A Verification Harness for Dependable In-Car LLM Agentscited by 0
- 2026Blockchain-Enabled Artificial Intelligence and AI Agents for Secure Data Sharing and Cybersecurity Applicationscited by 0
- 2026Blockchain-Enabled Artificial Intelligence and AI Agents for Secure Data Sharing and Cybersecurity Applications23 Sep 2026
- 2026From Natural Language Policies to Executable Obligations: A Verification Harness for Dependable In-Car LLM Agents24 Aug 2026
- 2025AgentSUMO: An Agentic Framework for Interactive Simulation Scenario Generation in SUMO via Large Language Models10 Nov 2025
- 2025Towards Adaptive Software Agents for Debugging25 Apr 2025
- 2025PatchPilot: A Cost-Efficient Software Engineering Agent with Early Attempts on Formal Verification4 Feb 2025
- 2026Atropos: Improving Cost-Benefit Trade-off of LLM-based Agents under Self-Consistency with Early Termination and Model Hotswapcited by 3
- 2025DualResearch: Entropy-Gated Dual-Graph Retrieval for Answer Reconstructioncited by 1
- 2025T3: Multi-level Tree-based Automatic Program Repair with Large Language Modelscited by 0
- 2026A Self Consistency Based Reranking for Narrative Question Answeringcited by 0
- 2026SFL-MTSC: Leveraging Semantic Frame-Level Multi-Task Self-Consistency for Robust Multi-Intent Spoken Language Understandingcited by 0
- 2026SFL-MTSC: Leveraging Semantic Frame-Level Multi-Task Self-Consistency for Robust Multi-Intent Spoken Language Understanding24 Jun 2026
- 2026A Self Consistency Based Reranking for Narrative Question Answering14 Jun 2026
- 2026Atropos: Improving Cost-Benefit Trade-off of LLM-based Agents under Self-Consistency with Early Termination and Model Hotswap16 Apr 2026
- 2025DualResearch: Entropy-Gated Dual-Graph Retrieval for Answer Reconstruction10 Oct 2025
- 2025T3: Multi-level Tree-based Automatic Program Repair with Large Language Models26 Jun 2025
- 2024When LLMs Meet Cybersecurity: A Systematic Literature Reviewcited by 71
- 2024Calibration and Correctness of Language Models for Codecited by 49
- 2025Frontier AI's Impact on the Cybersecurity Landscapecited by 21
- 2024CigaR: Cost-efficient Program Repair with LLMscited by 15
- 2024Aligning the Objective of LLM-based Program Repaircited by 12
- 2024Studying LLM Performance on Closed- and Open-source Datacited by 11
- 2024VELO: A Vector Database-Assisted Cloud-Edge Collaborative LLM QoS Optimization Frameworkcited by 10
- 2023Language Models are Better Bug Detector Through Code-Pair Classificationcited by 3
- 2024Chain of Targeted Verification Questions to Improve the Reliability of Code Generated by LLMscited by 3
- 2025COSMosFL: Ensemble of Small Language Models for Fault Localisationcited by 3
- 2024From Cool Demos to Production-Ready FMware: Core Challenges and a Technology Roadmapcited by 2
- 2025StyleRec: A Benchmark Dataset for Prompt Recovery in Writing Style Transformationcited by 2
12 most cited of 18 All 18 (JSON)
- 2026Bulkhead: Automated Semantic Detection and Remediation of Container Escape Vulnerabilities14 Jul 2026
- 2026Knowledge Graph-Enhanced Zero-Shot Topic Classification: A Multi-Strategy Comparative Study28 May 2026
- 2026DenTab: A Dataset for Table Recognition and Visual QA on Real-World Dental Estimates17 Apr 2026
- 2025CryptoQA: A Large-scale Question-answering Dataset for AI-assisted Cryptography2 Dec 2025
- 2025What Do They Fix? LLM-Aided Categorization of Security Patches for Critical Memory Bugs26 Sep 2025
- 2025VALID-Mol: a Systematic Framework for Validated LLM-Assisted Molecular Design29 Jun 2025
- 2025Frontier AI's Impact on the Cybersecurity Landscape7 Apr 2025
- 2025StyleRec: A Benchmark Dataset for Prompt Recovery in Writing Style Transformation6 Apr 2025
- 2025COSMosFL: Ensemble of Small Language Models for Fault Localisation5 Feb 2025
- 2024From Cool Demos to Production-Ready FMware: Core Challenges and a Technology Roadmap28 Oct 2024
- 2024VELO: A Vector Database-Assisted Cloud-Edge Collaborative LLM QoS Optimization Framework19 Jun 2024
- 2024Chain of Targeted Verification Questions to Improve the Reliability of Code Generated by LLMs22 May 2024
12 newest of 18 All 18 (JSON)
Similar, not cited
Close in wording, no citation either way
- 2025Towards Effectively Leveraging Execution Traces for Program Repair with Code LLMs
- 2024An Empirical Study on Self-correcting Large Language Models for Data Science Code Generation
- 2025Automated Repair of C Programs Using Large Language Models
- 2024ThinkRepair: Self-Directed Automated Program Repair
- 2026Large Language Models for Programming: Actually Fixing or Reimplementing Incorrect Code?
- 2026If It's Not Buggy, Don't Fix It: On the Dynamics of Iterative Bug-fixing with LLMs
- 2026Prompt-Driven Code Summarization: A Systematic Literature Review
- 2024Code Repair with LLMs gives an Exploration-Exploitation Tradeoff