REAgent: Requirement-Driven LLM Agents for Software Issue Resolution

Shiqi Kuang, Zhao Tian, Kaiwei Lin, Chaofan Tao, Shaowei Wang, Haoli Bai, Lifeng Shang, Junjie ChenarXiv 2026

TL;DR

LLMs are becoming proficient coders, but they often stumble when trying to fix real-world software bugs because bug reports are messy, ambiguous, and incomplete. REAgent bridges this gap by applying classical requirements engineering to the AI era, transforming vague issue descriptions into structured, information-rich specifications before a single line of code is written. By iteratively refining these requirements based on test feedback, REAgent achieves a significant 17.4% average improvement in resolving complex repository-level issues.

What Problem Does This Paper Address?

Automated issue resolution—the ability for an AI to take a bug report and produce a working code patch—is a "holy grail" of AI-assisted software engineering. While LLMs excel at function-level tasks (like writing a single algorithm), they struggle with repository-level issues where the context is scattered across thousands of files.

The authors argue that the current bottleneck isn't just the LLM’s reasoning ability, but the quality of the task specification. Most existing agents treat a user's bug report as a direct instruction. However, over 70% of bug reports lack essential details like reproduction steps or clear success criteria. When an LLM receives a "garbage" input, it produces a "garbage" patch. REAgent addresses this by focusing on what is being solved, rather than just how to solve it.

Methods

REAgent introduces a requirement-driven framework consisting of three main components that operate in an iterative loop:

  1. Requirement Generation: Instead of just reading the bug report, a specialized agent explores the codebase to gather context. It then populates a structured template with nine primary attributes, including "Steps to Reproduce," "Root Cause Analysis," and "Expected Behavior." This turns a vague complaint into a formal engineering spec.
  2. Requirement Assessment: How do you know if a requirement is accurate? REAgent uses a clever proxy: it generates a patch based on the requirement and runs it against generated tests. It calculates a Requirement Assessment Score (RAS)—the ratio of passed tests. If the RAS is 1.0, the requirement is deemed high-quality.
  3. Requirement Refinement: If the RAS is low, a "Requirement Analysis Agent" diagnoses the failure. It classifies the problem into one of three categories: Conflict (inconsistency with the issue), Omission (missing info), or Ambiguity (vague descriptions). It then provides actionable feedback to the generation agent to try again.

This process repeats for a set number of iterations (typically $N=4$), selecting the best candidate based on the highest RAS.

Datasets

The authors evaluated REAgent using three widely recognized benchmarks for repository-level software engineering:

  • SWE-bench Lite: A subset of 300 GitHub issues designed for efficient evaluation.
  • SWE-bench Verified: A curated set of 500 high-quality instances verified by humans to ensure the bugs are real and the solutions are correct.
  • SWE-bench Pro: A more challenging extension featuring 731 instances across multiple programming languages and larger, industrial-scale codebases.

For their experiments, the authors sampled 100 instances from each benchmark to manage computational costs.

Key Insights and Ideas

  • Traceability as a Quality Signal: The most innovative idea is using the "traceability" between requirements and code. Since we can't easily "unit test" a natural language requirement, REAgent tests the code produced from that requirement to work backward and verify the requirement's quality.
  • Structured Specs Beat Raw Text: The ablation studies showed that simply forcing the LLM to fill out a structured template (the nine attributes) significantly improved performance compared to letting it reason in an unstructured way.
  • Orthogonality: REAgent isn't a competitor to existing agents like SWE-agent; it’s a "pre-processor." It improves the quality of the prompt that any coding agent would use, making it a complementary layer for the entire field.
  • The "Aha" Moment on Iteration: The authors found that REAgent benefits more from extra iterations than other agents. As $N$ increased from 1 to 10, REAgent’s performance climbed much more steeply than its competitors, suggesting its refinement loop is exceptionally effective.

Key Results

REAgent was tested using two top-tier models: DeepSeek-V3.2 and Qwen-Plus.

  • Performance Boost: Across all benchmarks, REAgent consistently outperformed five state-of-the-art baselines (including Agentless and Trae-agent). It achieved an average improvement of 17.40% in the number of successfully resolved issues.
  • Syntactic Correctness: The percentage of patches that could be successfully applied to the codebase (syntactic correctness) increased by 22.17% to 49.50% compared to baselines.
  • Efficiency vs. Effectiveness: While REAgent uses more input tokens (due to the detailed requirements and iterations), the authors argue the trade-off is worth it, as the cost per successfully resolved issue remains acceptable for real-world use.

Limitations and Future Work

  • Dependence on Test Quality: The assessment phase relies on LLM-generated tests. If the tests are wrong, the RAS score becomes a noisy signal. The authors plan to integrate more robust "coverage-guided" test generation in the future.
  • Token Overhead: The framework is "chatty." Future work will focus on more efficient context management to compress historical data without losing the "essential" engineering details.
  • Fixed Iterations: Currently, the system runs for a fixed number of loops. The authors suggest an "adaptive iteration" strategy that stops early if a perfect requirement is found or continues if progress is being made.

Summary updated

BibTeX
@misc{kuang2026reagent,
  author = {Shiqi Kuang and Zhao Tian and Kaiwei Lin and Chaofan Tao and Shaowei Wang and Haoli Bai and Lifeng Shang and Junjie Chen},
  title = {{REAgent: Requirement-Driven LLM Agents for Software Issue Resolution}},
  year = {2026},
  eprint = {2604.06861},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2604.06861},
}
Figure