Manuscript Offprint

arXiv:2610.26650

From Outcomes to Components: A Counterfactual Evaluation Framework for LLM-Proposed Repairs

Hengyu Ye, Songhua Hu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

An LLM-generated repair action specifies which records to change and by how much. A failed action may still contain a useful target set or numerical update, depending on how the two are paired. We evaluate this problem in traffic networks and databases, where aggregate observations obscure the records that need correction. We examine the pairings by executing each combination from the same initial state, using a reference action that restores the affected records. In 76 of 114 traffic actions, the gain from correcting both parts exceeds the sum of the gains from correcting each part alone. Six of these actions become worse after either correction alone, but improve when both parts are corrected. In database repair, replacing only the proposed update with the reference update worsens 17 of 108 model actions, all of which select unaffected records. We also test whether parts of two proposals can be reused. On held-out observations, selecting among the proposals and their recombined target-update pairs recovers 61.6% of the reference action's loss reduction, compared with 58.0% from selecting between the proposals alone.

1 Introduction

Large language models (LLMs) use tools to inspect and modify external systems (Lu et al., 2025; Yao et al., 2025). Repair tasks require them to turn observed discrepancies into changes that restore the system's behavior (Jha et al., 2025). For repairs that act on selected records, target selection identifies which records to change, and update selection specifies the change to their values. An unsuccessful repair may contain a useful update applied to the wrong targets. Improving the next repair requires deciding what to change and what to retain.

Existing evaluations measure task outcomes and locate failures (Lu et al., 2025; Zhang et al., 2025). Studies of reasoning separate finding an error from correcting it (Tyen et al., 2024), while counterfactual evaluations assess targeted interventions (Ma et al., 2026; Bonagiri et al., 2026). For a model-proposed repair, these perspectives motivate a more specific question: what is gained or lost by correcting one decision while retaining the other?

Missed targets can obscure a useful update. A model that selects too many records may limit collateral damage by proposing a mild update. Replacing it with the inverse of the fault can then repair affected records more fully while damaging unaffected records. The effect of correcting one decision depends on its partner.

Aggregate observations make these choices difficult. A discrepancy can involve many records, and changing one record can affect several observations. Models must infer both where to intervene and how much to change from this indirect evidence. We examine this problem in traffic and database repair: road counts

*GPT assisted with drafting and revising the manuscript. The authors verified the data, analyses, and final text and take responsibility for the work.

†^{\dagger}Corresponding author.

combine trips from many origin–destination (OD) pairs, while database reports combine rows with overlapping attributes.

We propose a framework for evaluating these decisions within an already generated repair (Figure 1). Component replacement exchanges either the proposed targets or the proposed update for its reference counterpart, leaving the other unchanged. Four executions from the same initial state measure the original action, each replacement, and their combination. The comparison asks both whether a proposed component is useful with the reference partner and whether correcting it helps with the proposed partner. We instantiate the framework with known faults, whose inverse actions provide the reference components.

The study makes three contributions:

• An evaluation framework that relates target accuracy to retained value and interaction through target-update replacements of a model action.

  • Cross-domain diagnostic evidence that missed targets hide useful updates, while excessive targets can make update correction harmful. Numerical-search controls test how far update tuning can compensate for missed targets, while repeated database trials measure how often correcting the update harms repairs.

• A component-reuse study that exchanges decisions between proposals and selects repairs through execution preview. Held-out observations measure when the additional candidates help, how gains vary across generations, and the execution cost of obtaining them.

a Four executions

Same corrupted state and outcome measure

Proposed

targets

Proposed update

Reference update

Original repair

Correct the update

Apply proposed

Apply reference

Correct the targets

Reference repair

Apply proposed

Apply reference

Affected record

Selected record

Measured outcome

b Two diagnostic patterns

Missed records

Keep the update and replace the targets.

Useful update, incomplete selection.

Excess records

Mild update

Reference update

Correction also changes healthy records.

Correct update, harmful combination.

Figure 1: From a repair outcome to a diagnosis of its decisions. A submitted repair supplies selected records and a numerical update. Four executions combine proposed and reference components, changing the update horizontally and the targets vertically. The illustrated selection errors lead to different diagnoses: missed records can hide a useful update, while excess records can make a stronger correction harmful. Record diagrams are schematic. Reference components enter the evaluation after the model submits its action.

References (28)