TL;DR
Designing the perfect "reward" to train an AI is often harder than training the AI itself. Habitats is a new framework that uses Large Language Models (LLMs) to evolve a diverse library of "mini-games" (objectives), creating agents with a broad repertoire of skills that can be reused to solve new, unseen tasks faster than training from scratch.
What Problem Does This Paper Address?
In Reinforcement Learning (RL), we usually give an agent a "reward" (a numerical score) for doing what we want. If you want a robot to walk, you reward forward progress. But in complex or "open-ended" environments, defining these rewards is a nightmare. Humans are expensive to ask, hand-designed rewards often lead to "reward hacking" (where the agent finds a lazy shortcut), and AI-generated rewards often lack variety.
The authors tackle the bottleneck of objective discovery. How do we move beyond training an agent for one specific task and instead help it discover a whole "habitat" of diverse, learnable, and useful behaviors?
Methods
The core of Habitats is a two-stage evolutionary loop that separates the "what" from the "how."
- The Population: Habitats maintains a group of individuals, where each individual is a pair: an executable reward function (Python code) and the policy (the brain) trained to maximize it.
- The Cross-Fitness Matrix: This is the secret sauce. Every policy in the population is tested against every reward function. This creates a grid that reveals who is a specialist, who is a generalist, and—crucially—how different the behaviors actually are.
- The Planner (LLM 1): Acting like a high-level CEO, this LLM looks at the cross-fitness data. If it sees the population is getting "boring" (everyone doing the same thing), it issues a "mutation directive"—a natural language instruction like "Combine the jumping strategy of Agent A with the crawling of Agent B."
- The Mutator (LLM 2): This LLM acts like a programmer. it takes the Planner's directive and writes the actual Python code for a new reward function.
- Survivor Selection: Only agents that "master" their own niche and beat a random baseline survive to the next generation.
Datasets
The researchers evaluated Habitats across four distinct "playgrounds":
- Card Sandbox: A custom discrete environment where agents manipulate cards. There is no built-in goal; all behavior must be "invented" by the framework.
- MuJoCo Continuous Control: Three classic physics benchmarks—Cart-Pole (balancing), Hopper (one-legged hopping), and Cheetah (running).
In these environments, the "native" rewards (like "run forward") were discarded. The agents had to discover their own reasons to move.
Key Insights and Ideas
- Separation of Concerns: By having one LLM plan the strategy and another write the code, Habitats avoids the "echo chamber" effect where an LLM just keeps refining the same mediocre idea.
- Behavioral Grounding: Diversity isn't measured by how different the code looks, but by how differently the agents act. This ensures that "novelty" actually means "new skills."
- Generalist Takeover & Recovery: The authors observed a fascinating cycle: a "generalist" policy would occasionally emerge that was good at everything, causing the population to shrink. The Planner would then detect this "stagnation" and intentionally push for new, radical niches to restore diversity.
- Emergent Skills: Without being told to, the system discovered complex behaviors like "The Commando Crawl" (staying low to the ground) and "The Pogo Stick" (jumping as high as possible while staying stationary).
Key Results
Habitats significantly outperformed baselines that either generated rewards randomly or mutated them without a high-level plan.
- Diversity: Habitats achieved 1.8x the behavioral diversity of direct mutation and 2.5x that of independent generation.
- Reusability: The researchers took the "frozen" library of skills evolved by Habitats and used them to solve 10 new tasks. A "meta-policy" picking from these pre-learned skills reached parity with a task-specific agent (trained for 20,000 episodes) in just 5,000 episodes.
- Superiority: At 10,000 episodes of adaptation, the Habitats library outperformed agents trained from scratch for twice as long.
Limitations and Future Work
- Computational Cost: The cross-fitness matrix scales quadratically ($N^2$). As the population grows, evaluating every agent against every reward becomes very expensive.
- Fixed Architectures: Currently, Habitats only evolves the objectives. The authors suggest that future work could jointly evolve the neural network architectures or the environments themselves.
- Safety: Automating reward generation is powerful but risky. The authors emphasize that real-world applications would require strict sandboxing and human oversight to prevent agents from discovering "dangerous" objectives.
Summary updated