{"slug": "toward-sample-efficient-agentic-post-training", "title": "Toward sample-efficient agentic post-training", "summary": "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.", "body_md": "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.\n\nThe 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?\n\nAcross 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.\n\n**The example**\n\nDuring 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.\n\nAgents’ 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.\n\n**Lesson 1**\n\n*A good attempt contains bad steps, and a failed attempt contains good steps*\n\nAcross 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.\n\nOne of our methods, [SALT](https://www.amazon.science/publications/salt-step-level-advantage-assignment-for-long-horizon-agents-via-trajectory-graph), 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.\n\nOne 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](https://www.amazon.science/publications/murphy-reflective-multi-turn-reinforcement-learning-for-self-correcting-code-generation-in-large-language-models), uses revision scores to assign credit to earlier attempts, so we can learn from failed programs that lead to successful corrections.\n\n**Lesson 2**\n\n*A teacher helps only when its advice points toward reward*\n\nOne 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.\n\nIn 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.\n\nOur third method, [reward-aligned distillation (RAD)](https://arxiv.org/abs/2610.14572), 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.\n\n**Lesson 3**\n\n*When every attempt fails, learn from a target close to your own*\n\nNow 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.\n\nOur [projected-distillation](https://arxiv.org/abs/2610.27467) 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.\n\n**Lesson 4**\n\n*Hindsight lets the agent teach itself, if it’s used carefully*\n\nA 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”.\n\nThis 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.\n\n*P*rivileged-*i*nformation i*nt*ernalization ([PINT](https://openreview.net/pdf?id=R1peldcnUL)) 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”.\n\nNow, 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.\n\nIf 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.\n\nWith adaptive hindsight with environment-augmented distillation ([AHEAD](https://arxiv.org/abs/2608.24114)), we execute a rollout with the student model and use the results to reweight the per-step advantages calculated by the teacher.\n\n**Lesson 5**\n\n*If you can’t retrain the model that acts, train the one that advises it*\n\nFinally, 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](https://www.amazon.science/publications/exectune-effective-steering-of-black-box-llms-with-guide-models) 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.\n\n**Putting it together**\n\nFor 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.\n\nThe 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.\n\n**Looking ahead**\n\nLong 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.\n\nThe final verdict may be sparse. The experience that produced it isn’t.\n\n**Papers**\n\n**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*\n\nFindings of EACL 2026\n\n**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)*\n\nNeurIPS 2026\n\n**Reward-Aligned Distillation*** Authors: Yilan Chen, Zian Su, Manish Prajapat, Dingmin Wang, Rui Song, Rein Houthooft, Vijay Lingam*\n\nNeurIPS 2026 Workshop on Transitioning from Pre-Training to Post-Training\n\n**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*\n\nNeurIPS 2026 Workshop on Foundations of LLM Post-Training in Changing Environments\n\n**PINT: Effective On-Policy Self-Distillation via Privileged Information Internalization*** Authors: Zian Su, Yilan Chen, Manish Prajapat, Rui Song, Rein Houthooft, Vijay Lingam*\n\nNeurIPS 2026 workshop\n\n**AHEAD: Adaptive Hindsight with Environment-Augmented Distillation for Agentic RL*** Authors: Xiaolong Jin, Dingmin Wang, Vijay Lingam, Varun Kumar*\n\nNeurIPS 2026 Workshop on Transitioning from Pre-Training to Post-Training\n\n**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*\n\nICLR 2026 Workshop on Lifelong Agents\n\n**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.", "url": "https://wpnews.pro/news/toward-sample-efficient-agentic-post-training", "canonical_source": "https://www.amazon.science/blog/toward-sample-efficient-agentic-post-training", "published_at": "2026-11-30 20:27:35+00:00", "updated_at": "2026-11-30 20:43:26.619705+00:00", "lang": "en", "topics": ["artificial-intelligence", "machine-learning", "large-language-models", "ai-agents", "ai-research"], "entities": ["Amazon Science", "SALT", "MURPHY", "group-relative policy optimization", "GRPO"], "also_reported_by": [], "takeaway": "SALT merges agent steps with equivalent starting states, actions and resulting states into a graph and assigns each merged step the average advantage of the attempts that took it, so shared actions' positive and negative signals cancel while differing edits keep their own credit.", "recommendation": {"advice": "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.", "playbook": "evals-testing", "playbook_url": "https://wpnews.pro/playbooks/evals-testing"}, "alternates": {"html": "https://wpnews.pro/news/toward-sample-efficient-agentic-post-training", "markdown": "https://wpnews.pro/news/toward-sample-efficient-agentic-post-training.md", "text": "https://wpnews.pro/news/toward-sample-efficient-agentic-post-training.txt", "jsonld": "https://wpnews.pro/news/toward-sample-efficient-agentic-post-training.jsonld"}}