Vibeleaderboard
← All Intel
Intel / video

Training Agents 4: From reward functions to environments.

Source
youtube.com
Author
Hugging Face
Date

Context

Training an AI model with reinforcement learning needs a reward, a score for its behavior. Session 4 of Hugging Face's Training Agents series explains why a simple scoring stops being enough once a model acts over many steps, such as opening files, running commands, reading errors and retrying. The score then has to come from what happened after those actions, so the reward lives inside an environment the agent acts in, built on the reset and step contract from Gym, the classic RL toolkit. Intel also covers RL environments on the Hugging Face Hub.

The listing says the session builds an environment with OpenEnv, trains with TRL's GRPOTrainer, and shows two demos: a Qwen3-1.7B model's held-out pass rate on MBPP, a Python problem set, going from 0.49 to 0.59, and a 's reward rising from 0.27 to 0.71 in 10 steps. Those are the presenters' figures with no setup visible here, and a rising training reward is not the same as general ability. The session also covers reward hacking, where an agent exploits the environment, for example by reading a fix from history.

Key takeaways · AI-distilled
  • In TRL, environment_factory and get_reward take the place of reward_funcs, and the openenv CLI handles init, push, pull and fork for environments on the Hub.
  • The session's first demo trains Qwen3-1.7B on MBPP inside a live Python session, with held-out pass rate rising from 0.49 to 0.59.
  • A second demo trains a real coding (OpenCode) on DeepCoder problems in Hugging Face sandboxes via Harbor, with reward rising from 0.27 to 0.71 in 10 steps.
  • Reward hacking moves into the environment: examples include a try/except that never failed and a CVE fix read from .git history, so the sandbox has to be locked down.
Terms in this piece · Glossary
  • Function — A named block of instructions that takes inputs, called arguments, and hands back a result, called its return value.
  • Agent mode — A mode in which one agent can inspect, edit, run commands, and iterate toward an outcome.
  • Git and version control — A system for recording and comparing changes to a codebase.
  • Harness engineering — Designing the full environment and feedback system around an agent.
Read the source www.youtube.com
More from Hugging Face
Recommended reads
Comments

Checking sign-in…

Loading comments…