Abstract
Training Large Language Model (LLM) agents typically relies on high-quality, successful interaction trajectories, often resulting in the disposal of up to 80% of generated data due to errors. We introduce Negative-Aware Training (NAT), a framework that leverages these failed trajectories by reformatting them with outcome-aware prompts. By teaching agents to distinguish between correct and incorrect reasoning paths, NAT significantly improves performance across mathematical reasoning and question-answering tasks, particularly in data-scarce environments, without increasing computational costs.
Introduction
The transition from general-purpose LLMs to specialized agents capable of tool use and multi-step reasoning is primarily driven by Supervised Fine-Tuning (SFT). However, the standard SFT pipeline is inherently wasteful; it discards "negative" trajectories—failed attempts at solving complex tasks. This not only increases the cost of data collection but also prevents the model from learning to identify and avoid the specific logical pitfalls that lead to failure. Standard SFT views these failures as noise, whereas NAT recognizes them as valuable signals for error avoidance.
Methodology: Negative-Aware Training (NAT)
NAT addresses data inefficiency by incorporating failed trajectories into the training set through a process called Negative-Aware Reformatting. Instead of filtering out negatives, the task query is modified to reflect the outcome of the trajectory.
As illustrated in the framework overview, the process involves two distinct prompt modifications:
- Positive Samples: For successful trajectories, the prompt is appended with: "Please generate a solution that correctly answers the question."
- Negative Samples: For failed trajectories, it is appended with: "Please generate a solution that incorrectly answers the question."
During inference, the model is consistently prompted to provide a "correct" answer. This contrastive training allows the model to navigate toward successful reasoning paths more effectively than models trained on positive data alone. Unlike Reinforcement Learning from Human Feedback (RLHF) or Direct Preference Optimization (DPO), NAT is a "plug-and-play" method that does not require complex reward modeling or paired preference data.
Key Insights: Learning from Mistakes
The core philosophy of NAT is that failures are informative. A failed trajectory often contains 90% correct reasoning, with the error occurring at a specific logical junction or calculation step. By explicitly labeling these as "incorrect," the model learns to identify where reasoning "goes off the rails."
Furthermore, the quality of negative samples matters. NAT performs optimally when negatives are "near-misses"—logical attempts that fail due to minor errors—rather than incoherent gibberish. This suggests that using high-quality models like GPT-3.5 to generate initial trajectories provides a more potent training signal. Analysis also revealed a "guardrail" effect: NAT-trained models make significantly fewer "action errors," such as calling tools with incorrect syntax, compared to models trained only on successful examples.
Experimental Results
The researchers evaluated NAT across diverse benchmarks, including GSM8K for math and HotpotQA for multi-hop reasoning. NAT consistently outperformed standard SFT and specialized agent-tuning baselines. On mathematical tasks, NAT improved average accuracy by 4.89 points over standard SFT.
As shown in the figure above, a primary advantage of NAT is its robustness in low-resource settings. When the number of positive samples is reduced (e.g., to 500 or 1,000), the performance gap between NAT and standard SFT widens dramatically. In a scenario with only 2,000 positive samples, NAT achieved a gain of nearly 9 points. This demonstrates that negative samples can effectively compensate for a lack of perfect "gold-standard" data.
Conclusion and Future Work
NAT demonstrates a data-efficient paradigm for agent tuning. By transforming discarded failures into valuable training examples, it allows researchers to maximize the utility of generated data. While the current implementation relies on ground-truth answers for labeling, it sets the stage for more sophisticated error-aware training. Future research will focus on automated metrics to distinguish "useful" failures and exploring the scalability of NAT on frontier models with hundreds of billions of parameters.
Summary updated