arXiv(opens in a new tab)cs.AIAug 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2608.23911

PROOF-Gen: From Optimized Data to Better Distillation

Anh Ta, Junjie Zhu, Shahin Shayandeh

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

Abstract

Supervised fine-tuning on teacher-generated trajectories is the standard first stage for distilling tool-calling capabilities into deployable models. Post-training pipelines that drive shipped tool-calling agents re-run this stage on a daily or weekly cadence, paying the frontier-teacher cost each cycle, yet the mechanism is generate-and-filter (keep the teacher's passing trajectories, discard the rest) and each cycle leaves behind the same hard scenarios because failures supply no signal. On τ2\tau2-bench, 57% of teacher trials fail, two-thirds of them near-misses (most tool calls correct, undone by one decisive error).

We introduce PROOF-Gen (Per-scenario Reflective Optimization to Overcome Failed Generation), which recovers golden trajectories from these failures via per-scenario prompt optimization. For each failed task, a reflector analyzes the execution trace and evaluation feedback, then writes corrective guidance that steers the teacher to a passing trajectory. The guidance is stripped before training, so the student learns from clean demonstrations with no task-specific scaffold.

On τ2\tau2-bench, per-scenario optimization recovers 93% of failed scenarios. Fine-tuned on the combined data, Qwen3-4B-Instruct-2507 improves from Pass 1^{1}=0.132 to 0.529 and Gemma 4 E4B-it gains +7.2pp on BFCL v4 multi-turn. In a deployed pipeline, the method lifts trajectory quality by +6.3pp goal completion and transfers to a deployed on-device model (+1.5pp goal completion; +1.7 to +5.0pp across response-quality metrics), with positive transfer in every locale (non-English average +1.48pp).

1 Introduction

Distillation via supervised fine-tuning (SFT) is the dominant first stage for transferring capabilities from frontier models to the smaller, deployable models that drive tool-calling agents in pro-

Figure

Figure 1: Training pipeline. For each task the teacher originally failed, a per-scenario optimization loop (green) iteratively refines a cheatsheet from the trajectory's feedback until the teacher produces a passing (“golden”) trajectory. The cheatsheet is stripped at scaffold removal, so the student trains only on what the trajectory demonstrates; the fine-tuning procedure is otherwise unchanged.

duction (Agarwal et al., 2024; Li et al., 2025; Luo et al., 2026). Post-training cycles run on a daily or weekly cadence to absorb new scenarios, tools, and policies; every cycle pays the same frontier-teacher cost, and every cycle leaves behind the same hard scenarios, because the standard generate-and-filter mechanism (run the teacher, score with a verifier, keep the passing trajectories) extracts no signal from failures. Recent advances in the training algorithm (on-policy sampling, alternative divergences, partial supervision; Agarwal et al. 2024; Luo et al. 2026; Amani et al. 2026), data selection (Li et al., 2025), and trajectory structure (Jiang et al., 2026) all rest on a shared assumption: the teacher can produce correct demonstrations for the tasks that matter.

But Chu et al. (2025) show that SFT tends to memorize its training distribution rather than generalize beyond it. If the hardest scenarios are systematically absent from that distribution, no training algorithm or selection strategy can compensate; the ceiling on distillation quality is set upstream, at data generation time.

In settings with execution-based verification, the standard pipeline (Chen et al., 2023; Liu et al., 2024) is generate-and-filter: execute the teacher,

Figure

Figure 2: The accuracy asymmetry in failed GPT-4o trajectories on τ\tau2-bench (278 tasks, 3 trials each; 473 of 834 trials fail). Most failures execute over half of tool calls correctly (high tool-call accuracy), yet a single missed action cascades into an incorrect end state (environment and database failure). Because tool-call accuracy is already high in failures, turn-level or partial-credit signals saturate without lifting end-to-end completion; what is missing is a complete trajectory through the decisive step. We confirm this in Section 4.

score with a verifier, and keep passing trajectories (rejection sampling; Yuan et al. 2023; STaR; Ze-likman et al. 2022; ReST; Gulcehre et al. 2023). The filter is binary; a trajectory that completed all but one of its required actions is discarded identically to one that failed immediately, so hard cases produce no training signal. On τ\tau2-bench, 67% of failed GPT-4o trajectories execute over half of the required tool calls correctly, yet a single missed action cascades into full failure and the entire trajectory is discarded (Figure 2).

This asymmetry also explains why turn-level alternatives to binary filtering are insufficient. The natural response to discarding a near-complete trajectory is to award partial credit for the actions it got right. But Figure 2 shows tool-call accuracy is already high in failures; rewarding correct intermediate actions reinforces behavior the teacher already exhibits. What the student never observes is a complete trajectory that navigates the single decision point where the teacher fails. We confirm this empirically in Section 4: training on the partial-credit baseline (the filtered-only condition) lifts tool-call accuracy by 25pp but does not improve end-to-end task completion in any model-benchmark pair.

Likewise, sampling more, raising temperature, or running k-shot rejection recovers stochastic failures but not strategic ones: a single missed action at a state-dependent decision point survives any number of resamples from the same teacher.

We introduce Per-scenario Reflective Optimization to Overcome Failed Generation (PROOF-Gen), which brings prompt optimization into this pipeline but inverts its usual goal: instead of finding one prompt that generalizes across tasks, we optimize each scenario independently (Figure 1). Using GEPA (Agrawal et al., 2026), an iterative prompt optimizer, we analyze each failed execution trace and evaluation feedback, then add corrective instructions to a per-scenario cheatsheet appended to the teacher's system prompt. The teacher re-executes the task from scratch, and the process repeats until all evaluators pass. The cheatsheet is stripped before training (Figure 1); the student learns from what the trajectory demonstrates, not from the scaffold that produced it. The method applies to any domain with an executor and a verifier.

This design also yields capability–voice decoupling: because the executor is left unchanged, recovered trajectories inherit a stronger reflector’s problem-solving without its interaction style. The resulting distillation is voice-preserving, letting a team upgrade task coverage without disrupting an established product voice, latency profile, or tone (Section 4).

We organize our investigation around three questions: whether per-scenario optimization reliably recovers high-quality trajectories from teacher failures (RQ1); whether students trained on recovered trajectories outperform those trained on filtered-only data, the partial-credit baseline (RQ2); and whether the approach holds up beyond benchmarks under deployment-scale evaluation across tens of locales (RQ3). We address each in turn in Section 4.

We conduct our primary study on τ\tau2-bench (Barres et al., 2025), a stochastic multi-turn tool-calling benchmark, with additional experiments on BFCL v4 multi-turn (Patil et al., 2025). The teacher is GPT-4o, whose low pass rate on the official benchmark 1^{1} leaves substantial room to validate recovery. Two small instruction-tuned models fine-tuned on recovered data improve on both benchmarks, and the pipeline has been adopted within a production tool-calling agent post-training system; we report all three settings in Section 4.

References (5)

  • - For each line_id, call get_details_by_id(id=<line_id>)
  • - Call get_data_usage(customer_id=..., line_id=...)
  • - The model missed required steps: locking all doors, pressing the brake pedal, then starting the engine
  • rear_right
  • Mobile data