Agents that learn from failed trials: Training them to anticipate mistakes seen in hindsight

SRD distills mistakes observed in completed trials into pre-action predictions, adding a learning signal to agent training even when every trial receives the same reward.

Self-Retrospection Distillation: Turning Post-hoc Experiences into Prior Foresight — arXiv:2610.08077

When will it reach products?

3–6 mo — You may see this idea in the next 3–6 months, likely in the training infrastructure for coding and research agents. It is more likely to appear as a model update that makes better use of failed trials than as a new prediction interface shown to users.

What happened?

Salesforce AI Research and collaborators developed a training method that helps AI agents learn from completed trials what information they will need and what mistakes they might make before starting. The method can also enable learning when every trial fails and training based only on success scores cannot make progress.

Why it matters

This approach could matter for coding assistants, information-retrieval tools, and multi-step digital workflows. It aims to turn failed trials from a cost into a training resource. In the experiments, models trained with the method do not need to generate a separate prediction at inference time. The first benefits will likely appear in the training efficiency and task success of existing agents rather than as a new user-facing feature.

Technical summary

Self-Retrospection Distillation (SRD) adds an auxiliary training objective to reinforcement learning with verifiable rewards (RLVR). The teacher version of the same model sees the completed interaction trajectory, while the student produces predictions about necessary information or error traps using only pre-interaction context. Self-distillation aligns the teacher’s and student’s token-level probability distributions on the student’s own generated prediction. This creates a training signal even when there is no reward variation within a group. The main results use only the error-traps channel; the prediction text does not need to be generated at inference time.

Contribution

The paper’s main contribution is a shift in what retrospective information from experience trains, rather than a change in what that information contains. Prospective learning supervises pre-interaction predictions instead of directly supervising the action distribution. SRD implements this idea as an auxiliary objective that uses the same model as both teacher and student; even experiences without within-group reward variation can contribute to this objective.

arXiv