Fiorucci reviews how agents learn through actions and rewards, then describes how reinforcement learning with verifiable rewards can complement supervised fine-tuning. Tasks with automatically checkable outcomes, such as correct answers, wins, or successful tool calls, can provide training signals without requiring large collections of curated examples.
Let LLMs Wander: Engineering RL Environments
Speaker
Stefano Fiorucci, an AI and software engineer at deepset working on Haystack, explains how to build reinforcement learning environments for language model training and evaluation at an AI Engineer talk.
Fiorucci introduces Verifiers, an open-source Python library for building environments for language model evaluation and training. Its components support single-turn, multi-turn, and tool-based interactions, while handling model serving and parallel rollouts. Examples include reversing text, checking a math answer with a follow-up question, and connecting tools.
Fiorucci builds a game environment that tracks the board, validates moves, applies opponent moves, and rewards outcomes and output formatting. He improves it with a minimax opponent whose difficulty can be varied, penalties that let play continue after invalid moves, and seeded opponent behavior to make rollout comparisons more consistent. Stratified sampling balances opponent difficulty across training batches.
Fiorucci evaluates GPT-5 mini and Liquid AI's LFM2, then uses 200 filtered synthetic examples to fine-tune LFM2 on move formatting and valid moves. Reinforcement learning improves its game performance: it dominates random opponents and draws 85% of games against an optimal opponent. A further run with stronger opponents and adjusted sampling temperature produces a player that beats the teacher model, GPT-5 mini, against an optimal opponent.
Fiorucci says small batches can make training unstable when games and opponent skill vary, while larger batches tend to train more slowly but steadily. He warns that an opponent algorithm can have a hidden bias that the model memorizes, and recommends inspecting rollouts and testing the trained model on the actual task. He suggests building environments around a few frequently used tools and points to the Wiki Search example in Prime RL.
Takeaways
- Choose tasks with outcomes your environment can verify automatically, such as a correct answer or a won game.
- Inspect rollouts and test models on real task behavior, since benchmark scores can hide learned quirks.
- Control environment randomness so reward differences reflect the model's choices more clearly.
- Balance opponent difficulty across batches to reduce unstable updates from unusually easy or hard games.
- Start with a promising base model and use supervised fine-tuning to teach task format before reinforcement learning.
Mentioned in this talk
Search inside this talk
What was claimed 7
- built
Prime Intellect built
Verifiers“the post-training tools we build that are fully open source: the Verifiers and Prime RL libraries”
0:26inModern Post-Training: A Deep DiveYouTube Verified3 sources· Talk, Web· archived
- built
deepset GmbH built Haystack
“where I develop Haystack, an open-source LLM framework”
YouTube Verified3 sources· Talk, Web· archived
- works atStefano Fiorucci works at
deepset GmbH“By day, I work on AI orchestration at deepset”
YouTube Verified2 sources· Talk, Web· archived
- feature
Verifiers: Provides modular components and base classes for single-turn, multi-turn, and tool environments for LLM evaluation and training.“The library provides base classes for several setups”
YouTube Unverified1 source· Talk
- integrates with
“integrates with other frameworks such as PrimeRL”
YouTube Unverified1 source· Talk
- integrates with
Verifiers integrates with
Environments Hub“Verifiers is tightly integrated with the Environments Hub”
YouTube Unverified1 source· Talk
- metricTic-Tac-Toe environment: The trained model draws 85% of the time against an optimal opponent.
“draws 85% of the time against an optimal opponent”
YouTube Unverified1 source· Talk










