How AI Agents Learn to Prepare for Unfamiliar Situations
Danijar Hafner is building AI agents that use learned models of the world to plan actions in situations they have not encountered before. His work spans video games and robots, and now continues at a startup he formed after leaving Google DeepMind in the fall of 2025.
An unfamiliar room can be a serious test for a robot. To work in a person’s home, a machine would need to respond to a floor plan and furniture it had never encountered during training. Danijar Hafner’s work aims to help AI agents prepare for situations like these by learning to predict what might happen next.
“The story describes increasingly capable autonomous agents that plan ahead and act in unfamiliar real-world environments, with only a mild concern about human dependence.”Why it scores Terminator
Learning by imagining outcomes
Hafner uses model-based reinforcement learning. He builds world models, AI systems designed to emulate physical reality, and trains agents inside them. The agents treat these models like simulations, try actions, and use the resulting experience to estimate the consequences of future choices.
That ability to plan ahead could help an agent respond when it meets an unfamiliar situation in the real world. The approach is especially relevant to robots, which must operate in environments that cannot be fully anticipated in advance.
Hafner’s technique is meant to reduce the need for robots to learn complex tasks through repeated trial and error in the physical world. Instead, they can learn within a model and use those experiences to guide their actions outside it.
Testing the idea in games
Before moving toward physical robots, Hafner tested his approach in video games. His work produced a series of agents that demonstrated increasingly ambitious uses of world models.
- PlaNet let agents plan actions ahead.
- Dreamer 2 reached human-level performance in Atari 2600 games using a world model.
- Dreamer 3 solved the Minecraft Diamond challenge by mining in-game gems on its own.
- Dreamer 4 learned to mine diamonds from recorded gameplay videos, without interacting with the game directly.
These milestones show different ways an agent can use experience to choose actions. In Dreamer 4, the training material was an offline data set of recorded gameplay, rather than direct interaction with the game.
Moving from virtual worlds to robots
Hafner has also worked to bring agents into physical settings. His DayDreamer project used the Dreamer algorithm to let robots operate in novel environments and respond to new experiences, including being pushed over, without specific training for those events.
The challenge is consequential for robots intended to work around people. A home is not a fixed game level: the layout and objects may differ from anything a robot has seen. An agent that can make predictions about unfamiliar conditions could help a robot adapt as it encounters them.
Hafner’s new venture is a continuation of this work. Its office in San Francisco’s SoMa district is still in stealth mode, and humanoid robots imported from China occupy the sparse space. He describes the robots as a physical next step in his effort to help AI navigate environments beyond its training.
A research path that continues
Hafner grew up in a rural town in northeastern Germany, where both his parents were classical musicians. A neighbor taught him programming, and online AI courses in high school turned his interest into a passion. “I was always fascinated with how thinking works,” he says.
In 2015, while a second-year engineering undergraduate at Hasso Plattner Institute in Potsdam, he became a student researcher at Google Brain. He later held a dozen internships and other positions at the company, including work with Google Brain and Google DeepMind in the UK, Canada, and the US. His collaborators included Geoffrey Hinton and Ashish Vaswani.
Timothy Lillicrap, a former manager and coauthor at Google, praised Hafner’s ability to build research systems. Lillicrap said, “In many cases he would build, single-handedly, things it would take entire teams of engineers to build.”
Hafner left Google DeepMind to form his startup in the fall of 2025. He has not shared many details about what comes next, but described his motivation as solving a problem “that would change the world.” The work so far points to a central ambition: agents that can use learned models to act when reality does not match what they have already seen.
Read next