Outcome-Conditioned Reasoning Distillation for Resolving Software Issues

Chenglin Li, Yisen Xu, Zehao Wang, Shin Hwei Tan, Tse-Hsun Chen

TL;DR

This paper introduces ConRAD, a novel framework that distills "reasoning plans" from historically resolved software bugs to guide automated program repair (APR). By learning from past successes, ConRAD significantly improves the accuracy and efficiency of fixing bugs, especially in complex, real-world scenarios.

What Problem Does This Paper Address?

Automated program repair (APR) systems often struggle with complex, real-world software issues that require long-horizon reasoning and understanding of interdependencies within a codebase. Existing Large Language Model (LLM)-based APR approaches typically treat each bug in isolation, failing to leverage the vast knowledge embedded in a project's history of resolved bugs. This leads to inefficient exploration, high computational costs, and a tendency to drift from the correct solution. The challenge is to effectively transfer the "how-to-fix" knowledge from past bugs to new, similar issues without requiring extensive retraining or complex search mechanisms.

Methods

ConRAD tackles this by introducing Outcome-Conditioned Reasoning Distillation (ConRAD). The core idea is to learn from verified fixes by working backward from the known correct outcome. This process involves three key stages:

  1. Repository-Level Exemplar Mining: This stage identifies historically resolved bugs within the same repository that are semantically similar to the current bug. It uses a combination of textual similarity and a more nuanced semantic alignment to ensure relevance.
  2. Exemplar Guardian: A crucial filtering step that uses an LLM to evaluate whether a retrieved historical bug is truly transferable. It acts as a conservative filter, discarding potentially misleading examples to prevent negative transfer.
  3. Outcome-Conditional Reasoning Distillation (BRD): This is the heart of ConRAD. Instead of just reusing the fix, BRD reconstructs a structured, step-wise reasoning plan by conditioning the LLM's generation on the ground-truth outcome of the historical bug. This backward reasoning approach ensures that the generated plan is globally consistent with the correct fix, unlike forward exploration which can be prone to errors. These distilled plans are then injected as in-context guidance during inference for new bugs.

Datasets

The primary dataset used for evaluation is SWE-Bench Lite, a widely used, cost-efficient, and representative subset of real-world software engineering issues. It contains 300 issues, each with a ground-truth patch and associated tests for verification.

Key Insights and Ideas

  • Learning from the Past is Crucial: Real-world software development repositories contain a wealth of knowledge in their resolved bug histories. Effectively leveraging this history is key to improving APR.
  • Backward Reasoning is Powerful: Instead of exploring many potential paths forward, reasoning backward from a known correct solution (the verified fix) leads to more robust and globally consistent repair plans.
  • Filtering is Essential: Not all historical bugs are good teachers. A robust filtering mechanism (the Exemplar Guardian) is vital to prevent misleading guidance and ensure effective knowledge transfer.
  • Structured Plans Beat Open-Ended Exploration: Distilled, step-wise reasoning plans provide more constrained and effective guidance than unguided, open-ended exploration, especially for complex, multi-stage tasks.

Key Results

ConRAD demonstrated significant improvements across multiple LLM backbones (GPT-40, GPT-5, DeepSeek-V3) on SWE-Bench Lite:

  • Improved Pass@1: ConRAD boosted Pass@1 (percentage of issues solved with a single patch attempt) by 10.4% for GPT-40, 8.6% for DeepSeek-V3, and 10.3% for GPT-5, outperforming strong baselines.
  • Enhanced Localization: ConRAD also improved fault localization accuracy, indicating that the distilled plans help guide earlier stages of the repair process more effectively.
  • Efficiency Gains: Compared to a Monte Carlo Tree Search (MCTS) based forward-search baseline, ConRAD achieved a +13.0% higher Pass@1 while using 9.71 times fewer LLM calls and 2.47 times fewer tokens. This highlights ConRAD as a significantly more compute-efficient alternative.
  • Generalizability: ConRAD's benefits were shown to be independent of the underlying APR scaffold, as it also improved performance when integrated with mini-SWE-agent.

Limitations and Future Work

The authors acknowledge several limitations:

  • Dataset Specificity: The evaluation was primarily conducted on SWE-Bench Lite, which focuses on Python projects. Generalization to other languages or domains may require further investigation.
  • Data Dependency: ConRAD relies on the availability of suitable historical fixes within a repository. Projects with sparse bug-fix histories might have fewer effective exemplars.
  • LLM Reliability: The effectiveness of the Exemplar Guardian and the reasoning distillation process depends on the LLM's inherent reasoning capabilities, which can vary.

Future work could involve extending ConRAD to other languages and domains, exploring more sophisticated exemplar selection strategies, and investigating how to best integrate ConRAD with more advanced agentic APR systems.

Summary updated

BibTeX
@inproceedings{li2026outcome,
  author = {Chenglin Li and Yisen Xu and Zehao Wang and Shin Hwei Tan and Tse-Hsun Chen},
  title = {{Outcome-Conditioned Reasoning Distillation for Resolving Software Issues}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=MjGhDpCtF9},
}
Figure