Successful Rollouts are Not Equal:
Discovering Influential Behaviors for Training Coding Agents

1Carnegie Mellon University 2University of Illinois Urbana-Champaign 3University of Pennsylvania & Oracle AI

Overview

Manual hypotheses by domain experts versus automatic candidate discovery with CATRadar, and the five findings

To find demonstration behaviors that affect the effectiveness of training, (left) prior works rely on human experts to manually make hypotheses, while (right) CATRadar narrows down the search space by automatically discovering candidate behaviors by extracting and comparing the behaviors of different trained agents.

Teacher resolved rate versus student resolved rate for R2E-Gym and Hybrid-Gym teachers

Across different training sets, on the same sets of task instances, successful demonstrations generated by different teacher models lead to substantially different performance, and higher teacher performance does not necessarily transfer to better student performance.

Abstract

Most coding agent training methods judge the quality of demonstrations based on their final outcome, such as execution results or rubric scores. However, we observe that the effectiveness of training also substantially depends on how the demonstrations achieve the results. Previous work has manually made hypotheses about which demonstration behaviors influence the performance. To find such influential behaviors for Coding Agent Training more efficiently, we present CATRadar, an analysis method to automatically discover candidate behaviors by defining, extracting, and comparing the behaviors of different trained agents. CATRadar enables us to find behaviors that are influential to at least one model, including specific repo-exploration strategies, the planning and verification patterns, and the verbosity of the reasoning text. Our insights also translate to performance gains by various methods, including data selection, agent step synthesis, and behavior-conditioned rollout. Results show that our agent step synthesis method improves Qwen3-8B's resolved rate from 11.6% to 17.6% on SWE-Bench Verified.

8 teachers × 3 students 7 of 10 examined behaviors affect at least one model Qwen3-8B: 11.6% → 17.6% on SWE-Bench Verified
Successful rollouts are not equal
Same training instances, same student, only successful demonstrations: different teachers still lead to substantially different students

CATRadar: Automatic Candidate Behavior Discovery

CATRadar framework: rollout, discover behavioral differences, verify distinguishability, scale up

We run two trained coding agents on the same task instances, use a discovery agent to propose behavioral differences with a well-defined judge metric, and verify the distinguishability of each behavior by fitting a logistic regression.

Rollout and Discover

A discovery agent (e.g., Claude-Opus-4.7) compares the paired trajectories of two agents and proposes behavioral differences. Each behavior comes with a judge metric, computed by a script or an LLM judge; only well-defined metrics are kept.

Verify Distinguishability

We score each trajectory with the judge metric and fit a logistic regression that predicts which agent produced it. A behavior is distinguishing if the Wald test gives p < 0.01 (N = 50 trajectories per agent).

Scale Up

Verified behaviors join the candidate list, and the discovery agent is asked for further differences, for at most k = 5 iterations per task set and agent pair, across multiple training tasks and agent pairs.

We then test each candidate with controlled data interventions that change only the target behavior in the training demonstrations: trajectory post-editing adds, modifies, or removes steps while keeping every retained step supported by its preceding context, and behavior-conditioned generation prompts the teacher to exhibit the behavior on the same instances. A behavior is influential if its presence or absence leads to a substantial performance change.

Discovered Behaviors

We apply CATRadar to 8 teacher models and 3 student models (Qwen2.5Coder-7B, Qwen3-4B, Qwen3-8B), trained on R2E-Gym issue-solving and Hybrid-Gym function localization and evaluated on SWE-Bench Verified with the OpenHands agent harness. Compared with the behaviors manually hypothesized in prior work, CATRadar discovers a broader range of behaviors, spanning trajectory-level features, problem-solving strategies, and tool-use patterns.

Behavior Judge Metric LEGO Hybrid Others Ours
Multi-round searchRun keyword searching commands for ≥ 2 times✓
Has fine-grained keywordsSearch for fine-grained keywords (e.g., specific filenames) instead of only broad keywords (e.g., def or class)✓
Limit target files before readLimit the candidates to ≤ 30 files before reading any file✓
Use task-trackerUse the <function=task_tracker> tool for explicit reasoning✓
Verify after editHas verification steps after the final file-editing action✓✓
Use thinkUse the <function=think> tool for explicit reasoning✓
Reasoning text verbosityThe length of the text part outside tool calls✓✓
Stuck in loopTry different commands after failing for 3 timesUU
Exploration lengthThe number of actions before the first file-editing action (≥ 16: high; 6–15: medium; ≤ 5: low)U
Trajectory lengthHas ≤ 7 agent actions: short; ≥ 8 agent actions: longU✓✓U

Some of the behaviors discovered and examined by our framework. “✓”: the behavior is shown to be relevant to the final performance for some student models; “U”: the behavior is tested but not shown to be relevant. “LEGO” (Terminal-LEGO), “Hybrid” (Hybrid-Gym), and “Others” refer to existing works.

What Behaviors Affect Coding Agent Training?

Trajectory-level features are not good indicators

Longer trajectories and stronger teachers are commonly assumed to give better training data, but neither is significantly correlated with student performance.

Student performance versus teacher performance, p-value 0.687

(a) Teacher performance

Student performance versus teacher trajectory length, p-value 0.422

(b) Trajectory length

Student performance (Qwen2.5Coder-7B) is not significantly correlated with trajectory-level features such as teacher success rate or trajectory length.

Effective repo-exploration strategies

Prior work checks whether a demonstration explores the repository sufficiently, but not how. CATRadar identifies two concrete strategies: Multi-Search, which searches for multiple keywords iteratively, and Target-Read, which only reads a file after narrowing down the target to a few files. Demonstrations with both strategies improve training (Method 1 and Method 3).

Planning steps have different effects on different models

We remove all task-tracker actions (a to-do-list tool in OpenHands) from Claude-Opus-4.5 demonstrations. Their presence improves Qwen2.5Coder-7B and Qwen3-8B, while degrading Qwen3-4B.

Effect of removing task-tracker actions for three student models

Planning steps in demonstrations have different effects on different models. Bold labels mark significant performance changes after removing all task-tracker actions from demonstrations (p-value < 0.05).

Verification transfers from simple to complex tasks

Remove Verify removes all steps after the last file-editing action; Add Verify, for demonstrations without any verification steps, copies the verification steps from another agent's demonstration of the same instance. Students trained on function-localization demonstrations with more verification steps also verify more on issue-solving. Verification improves the 7B and 8B models, but does not consistently improve Qwen3-4B.

Teacher Model (Hybrid-Gym) Teacher Qwen2.5Coder-7B Qwen3-4B Qwen3-8B
# Verify # VerifyRes%Loc%Patch% # VerifyRes%Loc%Patch% # VerifyRes%Loc%Patch%
Opus-4.5 4.4 13.313.642.857.2 11.616.043.055.0 14.417.241.454.6
Remove Verify 0.0 8.911.0 (-2.6)39.653.0 7.018.6 (+2.6)46.460.2 7.715.8 (-1.4)37.450.9
Opus-4.7 1.1 4.39.432.847.8 4.712.233.446.8 9.311.630.245.4
Add Verify 4.2 11.210.8 (+1.4)34.054.2 9.913.4 (+1.2)38.450.8 15.215.0 (+3.4)36.250.8

Verification procedure in a simple training task (e.g., function localization) transfers to more complex tasks (e.g., issue-solving). However, the effect of verification steps depends on the student and teacher model. We highlight significant increases and decreases in resolved rates (p-value < 0.05).

Verbosity of reasoning text affects trajectory length

We prompt an LLM to rewrite the reasoning text (the non-tool-call text and the content of “think” actions) to be shorter or longer in proportion to its original length, without adding new information; “0x” removes all reasoning text.

Trajectory length and resolved rate as the verbosity of reasoning text changes

When the verbosity of reasoning text increases (including non-tool-call text and content of the “think” actions), the trajectory length in general increases, and the performance first increases and then decreases.

Practical Utility of Our Discoveries

We apply the discoveries through three methods, ordered by increasing data-construction cost.

Method 1: Behavior-aware data selection

Under a fixed training-data budget, we keep demonstrations with both Multi-Search (at least three keyword searches) and Target-Read (narrow down to ≤ 50 candidate files before reading), and compare against equally sized subsets lacking either strategy.

Teacher Model Qwen2.5Coder-7B Qwen3-4B Qwen3-8B
Res%Loc%Patch% Res%Loc%Patch% Res%Loc%Patch%
Training: R2E-Gym Issue-Solving
GPT5-mini Subsets (250 examples)
w/o Multi-Search 9.034.452.4 10.043.862.2 10.243.860.4
w/o Target-Read 8.636.252.0 13.248.862.4 10.442.456.6
Both Strategies (ours) 11.4 (+2.8)49.463.6 14.2 (+4.2)58.475.4 13.8 (+3.6)48.263.2
Training: Hybrid-Gym Func-Localize
Claude-Opus-4.5 Subsets (250 examples)
w/o Multi-Search 2.813.631.6 11.838.051.4 4.815.229.2
w/o Target-Read 5.417.633.0 8.016.644.0 5.815.430.4
Both Strategies (ours) 7.2 (+4.4)21.239.0 13.2 (+5.2)35.450.8 11.6 (+6.8)28.441.8
Claude-Opus-4.7 Subsets (350 examples)
w/o Multi-Search 2.815.842.8 7.227.540.0 8.626.840.2
w/o Target-Read 3.49.425.0 7.620.633.6 4.211.826.8
Both Strategies (ours) 6.0 (+3.2)27.261.4 9.6 (+2.4)25.836.8 10.2 (+6.0)27.239.4

Data selection results on SWE-Bench Verified. Parenthesized results are absolute gains compared to the lower resolved rate of the two ablations. We highlight gains for resolved rates that are significantly better than both ablations and one of the ablations (p-value < 0.05).

Method 2: Adding synthesized agent steps

We prompt an LLM to generate a task-tracker call for each function localization demonstration with a to-do list: identify the target file, locate the function, generate its docstring, and verify correctness. Subsequent task-tracker calls update the items at completion points, giving four synthesized task-tracker actions per demonstration. Although we train on function localization, the issue-solving resolved rate improves in all evaluated settings.

Training Setting (Teacher → Student) Res% Loc% Patch%
Training: Hybrid-Gym Func-Localize
GPT-5-mini → Qwen2.5Coder-7B6.044.666.2
Add task-tracker9.6 (+3.6)33.248.4
GPT-5-mini → Qwen3-8B10.856.671.6
Add task-tracker13.0 (+2.2)49.261.6
Opus-4.7 → Qwen2.5Coder-7B9.432.847.8
Add task-tracker12.2 (+2.8)38.655.2
Opus-4.7 → Qwen3-8B11.630.245.4
Add task-tracker17.6 (+6.0)40.653.0

Adding synthetic task-planning steps to training trajectories improves performance on SWE-Bench Verified. We highlight significant improvements in resolved rates.

Method 3: Behavior-conditioned demonstration generation

We iteratively ask an agent to write a teacher prompt that elicits Multi-Search and Target-Read, generate a small set of demonstrations, and label them with an LLM judge, until the prompt significantly increases the share of demonstrations with these strategies (p < 0.05). Training on the new demonstrations improves Qwen2.5Coder-7B from 6.0% to 9.2%, while directly prompting the student to follow the strategies gives a smaller gain (7.2%).

Teacher Model Teacher (Hybrid-Gym Func-Loc) Student (SWE-Bench Verified)
Multi-Search%Target-Read%Res% Multi-Search%Target-Read%Res%Loc%Patch%
GPT-5-mini 58.81.589.7 74.953.26.044.666.2
+ prompt student 58.81.589.7 75.657.67.2 (+1.2)48.267.0
+ prompt teacher 72.510.485.9 78.264.39.2 (+3.2)43.455.6

Student performance (Qwen2.5Coder-7B) on SWE-Bench Verified under different teacher models and prompting strategies. We highlight significant changes in resolved rates.