Amazon Science

Toward sample-efficient agentic post-training

6.9内容质量

TL;DR · AI 摘要

Toward sample-efficient agentic post-training - Amazon Science Machine learning Toward sample-efficient agentic post-tra...

核心要点

  • 主题聚焦:Toward sample-efficient agentic post-training
  • 来源:Amazon Science,建议结合原文判断细节。
  • AI 分析暂不可用,本条为保底评分与摘要。
#AI#编程#安全
打开原文

Toward sample-efficient agentic post-training - Amazon Science

Machine learning

Toward sample-efficient agentic post-training

Five lessons on helping agents learn more from every training run.

By

Vijay Lingam

,

Aditya Golatkar

November 30, 2026

8 min read

Share

  • Copy link
  • Email
  • X
  • LinkedIn
  • Facebook
  • Line
  • Reddit
  • QZone
  • Sina Weibo
  • WeChat
  • WhatsApp

分享到微信

x

Key takeaways

  • Amazon scientists introduce seven new post-training methods that extract more learning signal from existing rollouts rather than generating expensive new ones, solving the core limitation of group-relative policy optimization (GRPO), where every action in a task shares the same end-of-task reward (so a bug-finding search and a build-breaking edit get identical credit).
  • The methods include SALT, which merges equivalent steps across attempts, so shared actions' signals cancel out; MURPHY, which passes credit from a successful revision back to an earlier failed attempt; RAD (reward-aligned distillation), which reweights a teacher's token-level signals toward reward; projected distillation, which trains on small verified edits near the model's own almost-correct solution; and PINT, which internalizes privileged hints into a temporary teacher's weights.
  • Two further methods handle special cases: AHEAD uses hindsight to strengthen per-step penalties at the mistaken action, and ExecTune trains a small guide model to steer a black-box agent whose weights can't be changed; together, they demonstrate that sparse final verdicts can be turned into dense, step-level training signals.

Was this answer helpful?

Credit for the whole attempt. Each solid bar is a token the agent generated. The code passes the final tests, so every generated token gets the same positive training signal (green) . Outlined bars are results returned by tools the agent interacts with. Credit by decision. The code still passes the final tests, but the fix gets positive credit, the edit it undoes gets negative credit, and routine steps get little weight. These colors show one possible assignment of credit.

Large language models are increasingly deployed as agents that pursue goals over many steps — say, fixing a bug by reading files, running tests, and editing code. Once they’ve been pretrained on large volumes of linguistic data, one way to refine them is reinforcement learning (RL) with verifiable rewards. The agent attempts a task, a program scores the result, and the model learns from that score.

The scoring usually comes only at the end of the task. With the standard optimization algorithm, group-relative policy optimization (GRPO), every action the agent took shares in the reward: the search that found the bug and the edit that broke the build get the same credit. Distinguishing different actions’ contributions has historically meant generating more attempts, or rollouts , which is expensive. How much more can we learn from the rollouts we already have?

Across seven recent papers, we propose seven new training methods that help answer this question. In this post, we apply all seven methods to a single running example and extract five lessons from the results.

The example

During post-training, an agent is asked to write a function, nth_prime(n) , that returns the n th prime within a time limit. The standard way to generate the sequence of primes is some variation on the sieve of Eratosthenes, which steps through the integers, starting with two. It flags all the multiples of two, up to some maximum value, then moves on to the next unflagged number (three) and repeats the procedure. The numbers left unflagged by successive iterations of this procedure are themselves prime.

Agents’ implementations of nth_prime(n) frequently call a helper function that generates all the primes up to n and stores them in an array. In our examples, we call that function primes , and the function primes[n] indexes into the array at location n . Indexing often causes errors, because the first prime is stored at primes[0] , not primes[1] , while nth_prime begins counting at one.

Lesson 1

A good attempt contains bad steps, and a failed attempt contains good steps

Across attempts, the agent reads the same specification before writing different versions of nth_prime . Some versions pass; others fail. With GRPO, even reading the specification is rewarded in one attempt and penalized in another.

One of our methods, SALT , fixes this by building a graph that merges all steps with equivalent starting states, actions, and resulting states. Each merged step gets the average advantage of the attempts that took it. Across rollouts, the shared actions’ positive and negative signals cancel, while the differing edits retain their own credit.

Group-relative policy optimization (GRPO) gives the same specification-reading action conflicting credit. SALT averages its credit across the four attempts, while the differing edits keep their own signals.

One version of nth_prime finds the right primes but times out on a large input. The agent receives the timeout error as textual feedback and uses it to write a faster version of the function, which passes. Scoring each of these attempts separately gives the first program no credit for finding the right primes. Another of our methods, MURPHY , uses revision scores to assign credit to earlier attempts, so we can learn from failed programs that lead to successful corrections.

The agent uses timeout feedback from an unsuccessful run to write a successful revision. MURPHY passes credit from the revision back to the program that timed out.

Lesson 2

A teacher helps only when its advice points toward reward

One existing method for extracting additional training information from a rollout that receives a single score is on-policy distillation . With on-policy distillation, the model being trained (the student) attempts to perform a task, and a stronger teacher model scores every token (word or word part) it generates, providing dense feedback instead of a single verdict.

In our example, suppose a teacher guides the agent’s next attempt. Its token-level signals encourage the correct index, n - 1, but also push the agent to replace an efficient sieve with a slower method. Agreement with the teacher does not guarantee better code.

Our third method, reward-aligned distillation (RAD) , looks at the gradients — the direction of adjustment to the model parameters — resulting from each output token and uses them to estimate how each token’s distillation signal affects reward. This strengthens useful guidance and suppresses or reverses harmful signals.

The negative weight at “sieve” reverses advice predicted to hurt reward. Guidance on the correct index keeps a positive weight, and the update becomes more aligned with reward.

Lesson 3

When every attempt fails, learn from a target close to your own

Now suppose that every one of the agent’s versions of the function generates the primes correctly but returns primes[n] instead of primes[n-1] . As a consequence, all attempts fail. But the reference solution is so unlike the model’s almost-correct solutions that training on it erodes skills the model already has.

Our projected-distillation method asks a secondary model for small edit that yields a verified correction — here, changing the index to n -1. The training target is just the edited spans, which are continually revised as the student improves.

Changing primes[n] to primes[n-1] fixes the error while preserving the working prime generator. A full reference solution changes much more of the student’s code.

Lesson 4

Hindsight lets the agent teach itself, if it’s used carefully

A common variation on on-policy distillation is on-policy self -distillation. Here, the teacher is not a stronger model but the same model as the student, primed with additional contextual information — such as, for instance, the hint that “the first prime is at index zero”.

This approach can run into problems during post-training, however. The information the teacher bases its scores on is nowhere present in the data the student sees. If the student looks for patterns in the input data that explain the teacher’s scores, it may end up drawing spurious correlations or learning heuristics that don’t generalize.

P rivileged- i nformation i nt ernalization ( PINT ) addresses this by taking the privileged information out of the teacher’s context and putting it in the teacher’s weights. First, we generate a sequence of rollouts, both with the privileged information and without it. Then we select a subset of successful rollouts, generated both ways, and use it to post-train a “temporary teacher”.

Now, when the temporary teacher scores the student’s outputs, it’s basing its scores only on the same data the student sees, so its outputs are better aligned with the student’s.

Successful corrections teach a temporary teacher how the indexing of the primes array works. The temporary teacher then scores the student’s code using the same context the student saw.

If an agent-generated function fails its test and receives the error message “expected 2, got 3”, it not only indicates an indexing error but tells us where to look for it: the action that wrote return primes[n] . Like the rewards accorded to whole rollouts, the hints provided during on-policy self-distillation are much more useful when they’re assigned to specific steps of the task execution.

With adaptive hindsight with environment-augmented distillation ( AHEAD ), we execute a rollout with the student model and use the results to reweight the per-step advantages calculated by the teacher.

The test failure identifies an indexing error. Hindsight strengthens the penalty at that action without changing the sign of the failed attempt’s advantage.

Lesson 5

If you can’t retrain the model that acts, train the one that advises it

Finally, suppose the coding agent is a model whose weights we cannot change. We can still train a small guide to suggest a strategy, such as “Generate primes efficiently, select index n-1 , and check the boundary case.” ExecTune first fine-tunes the guide on strategies written by a stronger teacher model, keeping only those the agent executes successfully. Then it applies reinforcement learning with rewards computed from the agent’s own execution.

The guide learns which indexing and efficiency advice the frozen model can use. Execution feedback trains the guide; the model that writes the code stays fixed.

Putting it together

For the agent writing nth_prime , a shared action, a timeout message, a teacher’s token scores, a one-line correction, a later test result, and a guide’s strategy each offer something the final verdict alone cannot. Our work demonstrates different ways to turn that information into training signals tied to task success.

The relevant budget — environment interactions, generated tokens, teacher calls, updates, or wall-clock time — depends on the method. Comparing existing rollouts and generating new revisions have different costs. The increase in the model’s accuracy must ultimately be assessed alongside the cost of implementing the additional training methods.

This schematic maps group-relative policy optimization (GRPO), conventional on-policy distillation (OPD) and on-policy self-distillation, and our seven new methods onto a common RL-and-distillation template. Projected distillation adds a loss on edited spans; ExecTune optimizes the guide.

Looking ahead

Long coding tasks make the question of using rollouts efficiently especially pressing. An action may pay off dozens of tool calls later. We’re now studying how agents can learn from execution traces, assign credit across those long chains, and decide when a guide’s advice is worth its cost.

The final verdict may be sparse. The experience that produced it isn’t.

Papers

SALT: Step-level Advantage Assignment for Long-horizon Agents via Trajectory Graph Authors: Jiazheng Li, Yawei Wang, David Yan, Yijun Tian, Zhichao Xu, Huan Song, Panpan Xu, Lin Lee Cheong Findings of EACL 2026

MURPHY: Feedback-Aware GRPO with Retrospective Credit Assignment for Multi-Turn Code Generation Authors: Chanakya Ekbote*, Vijay Lingam*, Sujay Sanghavi, Behrooz Omidvar-Tehrani, Jun Huan, Anoop Deoras, Stefano Soatto (*equal contribution) NeurIPS 2026

Reward-Aligned Distillation Authors: Yilan Chen, Zian Su, Manish Prajapat, Dingmin Wang, Rui Song, Rein Houthooft, Vijay Lingam NeurIPS 2026 Workshop on Transitioning from Pre-Training to Post-Training

Projected Distillation: On Learning to Solve Hard Problems from Close, Correct Targets Authors: Shripad V. Deshmukh, Christian Bock, Kangrui Ruan, Abhijeet Awasthi, Vijay Lingam, Rein Houthooft, Manish Prajapat NeurIPS 2026 Workshop on Foundations of LLM Post-Training in Changing Environments

PINT: Effective On-Policy Self-Distillation via Privileged Information Internalization Authors: Zian Su, Yilan Chen, Manish Prajapat, Rui Song, Rein Houthooft, Vijay Lingam NeurIPS 2026 workshop

AHEAD: Adaptive Hindsight with Environment-Augmented Distillation for Agentic RL Authors: Xiaolong Jin, Dingmin Wang, Vijay Lingam, Varun Kumar NeurIPS 2026 Workshop on Transitioning from Pre-Training to Post-Training

ExecTune: Effective Steering of Black-Box LLMs with Guide Models Authors: Vijay Lingam, Aditya Golatkar, Anwesan Pal, Ben Vo, Narayanan Sadagopan, Alessandro Achille, Jun Huan, Anoop Deoras, Stefano Soatto ICLR 2026 Workshop on Lifelong Agents

Acknowledgments: We worked with Panpan Xu, Luke Huan, Stefano Soatto, Anoop Deoras, Varun Kumar and the coauthors listed above, including interns from MIT, Purdue University, UC San Diego, the University of Connecticut and the University of Massachusetts.

Research areas

  • Machine learning
  • Conversational AI

Tags

  • Reinforcement learning
  • Large language models (LLMs)
  • Knowledge distillation
  • Code generation
  • NeurIPS
  • ICLR
  • EACL

About the Author

Vijay Lingam is a senior applied scientist with Amazon Web Services.

Aditya Golatkar is a senior applied scientist with Amazon Web Services.