Learning to Reason in Real-Time
Organizations: University of Waterloo, Waterloo, Ontario, Canada · National Research Council Canada
Abstract
AI agents that operate in the real world must reason correctly and on-time, yet they currently do not account for how time should alter their reasoning. Modern agents learn to do tasks in environments that are entirely synchronous: where the world waits for the agent to act before changing. A real-time environment, by contrast, changes independent of the agent. Existing approaches try to bridge this gap by imposing a ratio of thinking to acting. However, for an agent to succeed in real-time it must learn to act quickly when delay is costly and to reason longer when the benefit outweighs the missed opportunities. To this end, we introduce real-time reasoning training (RRT) as the class of training techniques for real-time reasoning agents. We develop three standard RRT techniques: (1) using real-time data, (2) decoupling acting and observing, and (3) curriculum learning in time. Together, these simple techniques substantially outperform strong baselines. Across time pressures, we outperform the strongest non-RRT baseline by an average of 33% reward on in-distribution and 55% reward on out-of-distribution tasks in two real-time environments: Frogger and Snake. These results demonstrate that we can teach agents to balance reasoning and responsiveness under real-time constraints, and that RRT opens a broad, new set of capabilities for real-time agents.
Figures & tables
| In-distribution | Out-of-distribution | |||||
|---|---|---|---|---|---|---|
| 200 | 100 | 50 | 200 | 100 | 50 | |
| Synchronous | 0.16 | 0.03 | 0.02 | 0.17 | 0.02 | 0.01 |
| + Real-time trajectories | 0.56 | 0.54 | 0.55 | 0.57 | 0.56 | 0.52 |
| + Decoupling acting & observing | 0.94 | 0.57 | 0.60 | 0.67 | 0.56 | 0.57 |
| + Curriculum learning in time | 0.94 | 0.90 | 0.85 | 0.89 | 0.73 | 0.60 |
| Method | Outcome | 400 | 200 | 100 | 50 |
|---|---|---|---|---|---|
| Synchronous | Real-time error | 50.8 | 92.0 | 99.7 | 100.0 |
| Logic error | 0.0 | 0.0 | 0.0 | 0.0 | |
| Won | 49.2 | 8.0 | 0.3 | 0.0 | |
| S1 | Real-time error | 0.0 | 0.0 | 0.0 | 0.0 |
| Logic error | 2.8 | 72.2 | 72.7 | 75.8 | |
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
| Environment | Task type | Description | Reward condition |
|---|---|---|---|
| Frogger | In-distribution | Cross a 10 6 board from the bottom row to the top row while cars slide sideways along their rows and wrap around. | 1.0 for reaching the top row; 0.0 if hit by a car. |
| In-distribution | Same crossing, but three numbered checkpoint tiles on car rows must be visited in ascending order before reaching the top row. Stepping on a checkpoint out of order ends the game, as does reaching the top row. | Fraction of the four objectives completed (three checkpoints plus the top row). The top row only counts once all three checkpoints are visited. | |
| In-distribution | The basic crossing rotated a quarter turn on a 6 10 board: lanes are columns with cars sliding up or down, and the frog crosses from the rightmost column to the leftmost. | 1.0 for reaching the goal column; 0.0 if hit by a car. | |
| Out-of-distribution | Round trip: reach the top row, then return to the exact starting cell on the bottom row while traffic keeps moving. Touching the top row does not end the game. | 1.0 for the full round trip; 0.5 for reaching the top but dying on the return; 0.0 for dying on the way up. | |
| Snake | In-distribution | Snake on a 10 8 board with 5 static boulders. Eat 5 food items, each respawning after it is eaten; hitting a wall, the snake’s own body or a boulder ends the game. | 1.0 for eating all 5; otherwise food eaten / 5. |
| In-distribution | Same board with the roles swapped: eat 5 boulders and avoid 5 static apples. | 1.0 for eating all 5 boulders; otherwise boulders eaten / 5. |
Agentic RL
Agentic reinforcement learning trains AI agents to plan, use tools, and adapt through feedback from multi-step interactions.
See all 255 papers