WhoBuilt

Agent Reinforcement Fine Tuning

Dec 9, 2025· 17 min· 24K views·Watch on YouTube

Speakers

Will Hang and Cathy Zhou, who work on OpenAI’s fine-tuning team, explain Agent Reinforcement Fine-Tuning and share coding-agent examples from Cognition, Codota, Cosine, and Mosaic on the AI Engineer channel.

How Agent RFT fits into agent development

Will describes agents as models that reason while using tools to act on the outside world. He recommends improving prompts and the task setup first, then using fine-tuning when more performance is needed. Agent RFT trains model weights using a specified reward, while the agent explores different tool-use strategies.

Training with tools and rewards

Agent RFT lets models call tools hosted on public endpoints during training and invokes a custom reward endpoint after each rollout. Will says it can adapt a model to a business environment, improve tool use, and reduce latency by rewarding agents that stay within a tool-call budget. Each rollout gets a UUID so tool calls and the final answer can be tied together for grading.

Examples from coding agents

Cognition trained Devin to select files for code edits, rewarding file selection with F1; its improvement rose from five points on about 100 examples to 10 points on 1,000, and parallel tool calls cut a workflow from eight to 10 steps to four. Codota trained GPT-5 on about 1,000 question-answer pairs from eight repositories, improving performance by 6% while reducing tool calls and output tokens. Cosine used a strict test-based grader and checks for code quality, while Mosaic trained GPU kernel generation on about 100 PyTorch prompts and added checks to catch reward hacking.

Conditions for successful RFT

Will advises using a well-defined task and training and evaluation data that reflect production traffic. The model should show variation across attempts, with some rollouts doing better than others so it can learn from the reward. He also recommends closing reward loopholes and using continuous rewards where possible; Mosaic, for example, scored kernel correctness and speedup after adding checks against hacked outputs.

Takeaways

  • Improve prompts and tool setup before fine-tuning; use RFT when those changes are not enough.
  • Build training and evaluation datasets that match real production tasks and inputs.
  • Define measurable rewards, check for loopholes, and grade the outcome that matters, such as tests passing or files correctly selected.
  • Track tool-call counts and latency alongside accuracy; RFT may reduce long, inefficient trajectories.
  • Provide enough high-quality examples and sampling compute for the model to discover successful approaches.

Mentioned in this talk

Search inside this talk

What was claimed 13

Show all 13 facts

Related talks