cd /news/artificial-intelligence/toward-sample-efficient-agentic-post… · home › topics › artificial-intelligence › article
[ARTICLE · art-178851] src=amazon.science ↗ pub= topic=artificial-intelligence verified=true sentiment=↑ positive

Toward sample-efficient agentic post-training

Amazon Science researchers published a post detailing seven new reinforcement-learning training methods, drawn from seven recent papers, that extract more learning signal from existing rollouts in agentic post-training. The methods, including SALT (step-level advantage assignment via trajectory graphs) and MURPHY (reflective multi-turn RL for self-correcting code generation), address the standard group-relative policy optimization (GRPO) problem in which every action in a multi-step agent trajectory shares the same end-of-task reward. The work targets sample efficiency, aiming to distinguish good steps inside failed attempts and bad steps inside successful ones without generating additional expensive rollouts.

recommendation

When training agents with GRPO on end-of-task rewards, merge equivalent steps across rollouts and average their advantages so shared actions cancel out and only differing edits keep credit.

more in playbook: Evals and testing for LLM apps
by read8 min views6 publishedNov 30, 2026
Toward sample-efficient agentic post-training
Image: Amazon (auto-discovered)

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 nth 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.

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.

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.

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.

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.

Privileged-information internalization (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.

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.

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.

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.

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.

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @amazon science 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/toward-sample-effici…] indexed:0 read:8min 2026-11-30 · —