Adversarial Reasoning for Repair Based on Inferred Program Intent

📅 2025-05-19
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
Existing automated program repair (APR) tools rely on test-suite-driven code transformations, neglecting explicit modeling of program intent—leading to overfitting and intent deviation in generated patches. To address this, we propose AdverIntent-Agent: the first multi-agent APR framework that implicitly infers diverse program intents via adversarial reasoning. Its core innovation lies in a closed-loop collaboration among three specialized agents—reasoning, testing, and repair—integrated with dynamic, precise LLM prompting, fine-grained program semantic analysis, and targeted test generation. This enables joint validation of intent, tests, and patches. By transcending the limitations of conventional test-driven paradigms, AdverIntent-Agent repairs 77 defects on Defects4J 2.0 and 105 on HumanEval-Java, achieving substantial improvements in patch correctness and alignment with developer intent.

Technology Category

Application Category

📝 Abstract
Automated program repair (APR) has shown promising results, particularly with the use of neural networks. Currently, most APR tools focus on code transformations specified by test suites, rather than reasoning about the program intent and the high-level bug specification. Without a proper understanding of program intent, these tools tend to generate patches that overfit incomplete test suites and fail to reflect the developers intentions. However, reasoning about program intent is challenging. In our work, we propose an approach called AdverIntent-Agent, based on critique and adversarial reasoning. Our approach is novel to shift the focus from generating multiple APR patches to inferring multiple potential program intents. Ideally, we aim to infer intents that are, to some extent, adversarial to each other, maximizing the probability that at least one aligns closely with the developers original intent. AdverIntent-Agent is a multi-agent approach consisting of three agents: a reasoning agent, a test agent, and a repair agent. First, the reasoning agent generates adversarial program intents along with the corresponding faulty statements. Next, the test agent produces adversarial test cases that align with each inferred intent, constructing oracles that use the same inputs but have different expected outputs. Finally, the repair agent uses dynamic and precise LLM prompts to generate patches that satisfy both the inferred program intent and the generated tests. AdverIntent-Agent was evaluated on two benchmarks: Defects4J 2.0 and HumanEval-Java. AdverIntent-Agent correctly repaired 77 and 105 bugs in both benchmarks, respectively.
Problem

Research questions and friction points this paper is trying to address.

Inferring program intent to avoid overfitting test suites
Generating adversarial test cases for diverse intent validation
Repairing bugs using dynamic LLM prompts aligned with intent
Innovation

Methods, ideas, or system contributions that make the work stand out.

Adversarial reasoning for inferring program intents
Multi-agent system for program repair
Dynamic LLM prompts for patch generation
🔎 Similar Papers
No similar papers found.