WorksComputer Science
Habitats: A Framework for Open-Ended Evolution of Agent Objectives
Abstract
Designing what an agent should optimize can be as difficult as optimizing the agent itself. Existing language-model-based reward-generation methods typically refine objectives for predefined tasks and couple the decision of what to explore with the synthesis of how to implement it, potentially narrowing the resulting behavioral repertoire. We introduce Habitats, a framework for open-ended evolution of executable agent objectives. Habitats maintains a population of reward-policy pairs and evaluates every policy under every population reward, producing a cross-fitness matrix that exposes self-mastery, transfer, and functional diversity. A population-level Planner uses this information to select parent rewards and issue targeted mutation directives, while a separate Mutator translates those directives into validated reward programs. We evaluate Habitats in a discrete Card Sandbox and three continuous-control environments (Cart-Pole, Hopper, and Cheetah) against Independent Generation and Direct Mutation baselines. Across four environments and three random seeds, Habitats achieves the highest macro-averaged final Specialist Quality and Behavioral Diversity, with final diversity reaching 1.8x that of Direct Mutation and 2.5x that of Independent Generation. Finally, across ten downstream objectives unseen during evolution, frozen Habitats policy libraries achieve higher paired win rates than size-matched Direct Mutation and Independent Generation libraries at 10,000 adaptation episodes, while also surpassing task-specific policies trained from scratch for 20,000 episodes. These results suggest that separating population-level planning from reward synthesis enables the discovery of diverse, learnable, and reusable behaviors.
Introduction
Reinforcement learning (RL) trains autonomous agents to maximize a scalar reward through interaction with an environment [22]. When that signal is well specified, reward maximization can induce complex and highly capable behavior, motivating the reward-is-enough hypothesis that it may provide a sufficient basis for general intelligence [21].
In open-ended domains, however, specifying the reward is itself the bottleneck. Common alternatives each fail differently: human preference labels are subjective and expensive at scale [3, 16]; learned reward models are brittle and vulnerable to overoptimization [6]; and hand-designed rewards require domain-specific engineering while often admitting unintended shortcuts [1]. Progress in these settings may therefore depend as much on discovering useful objectives as on learning policies to optimize them. Furthermore, when future tasks are unknown, a diverse set of such objectives can produce a repertoire of behaviors that can later be reused [2].
If objectives must themselves be discovered, evolutionary optimization provides a natural search mechanism because it does not require a differentiable objective. Recent work has used large language models (LLMs) as evolutionary operators over executable code, including mathematical constructions [18] and even reward functions [12]. A common design, however, uses a single model both to select what to modify and to perform the modification, typically conditioning on the best candidates found so far. Selection pressure and the model’s generative prior then reinforce one another, narrowing the population.
We introduce Habitats, a framework for open-ended objective evolution that separates population-level planning from reward synthesis. Each individual pairs an executable reward with its trained policy. An LLM-powered Planner uses survival, cross-fitness, and diversity information to select parents and propose targeted mutation directives, which a separate LLM-based Mutator converts into executable objectives. Offspring generation can therefore respond to population health rather than only refine the highest-scoring individuals. Across a discrete Card Sandbox and three continuous-control environments, we show that Habitats discovers diverse, high-quality, grounded behaviors that support sample-efficient adaptation to objectives unseen during evolution.
Our contributions are:
A two-stage evolutionary architecture that separates population-level search decisions from reward synthesis, enabling diversity-aware evolution of executable objectives.
A behavior-grounded application of population-wide cross-fitness to objective evolution, measuring mastery, transfer, and diversity through learned policies rather than reward-code differences.
Evidence that population-guided planning improves behavioral diversity and grounded coverage while preserving specialist quality and enabling sample-efficient reuse under unseen objectives.
Related Work
Reward design and learning from feedback. Reward shaping augments environment rewards with auxiliary signals that can accelerate learning while preserving the optimal policy, but still requires humans to specify both the desired behavior and shaping function [14]. Preference-based RL learns rewards from human comparisons, yet feedback is costly and learned reward models remain vulnerable to overoptimization [3, 16, 6]. Habitats instead searches directly over executable objectives.
Coevolution, open-endedness, and quality diversity. Coevolutionary methods have long used population-wide interaction matrices and relative performance to preserve informative niches and sustain evolutionary progress [19, 4]; POET similarly pairs evolving environments with their optimized policies and transfers solutions between them [24]. Quality-diversity methods maintain collections of high-performing, behaviorally distinct solutions [13, 17]. Separately, the Option Keyboard shows that policies learned from predefined pseudo-rewards can form a reusable basis for composing new behaviors [2]. Habitats builds on population-wide cross-evaluation but applies it to executable rewards, discovering objectives that induce a diverse, reusable policy repertoire rather than defining them in advance.
LLM-guided objective and agent design. Motif and MaestroMotif use LLM feedback to construct intrinsic rewards and skill libraries, while Eureka iteratively generates reward code using policy-training feedback [12] (Kissiarov et al. 2023; Kissiarov et al. 2024). FunSearch and AlphaEvolve evolve programs against predefined evaluators, and ADAS uses a meta-agent to construct agentic systems in code [18, 11, 15, 8]. Habitats instead uses one prompted LLM role to monitor population-wide behavioral structure and another to synthesize its proposed executable objectives.
The Habitats Framework
Habitats casts open-ended objective discovery as an evolutionary search over a population of executable reward functions. Rather than optimizing a single hand-specified reward, Habitats maintains an evolving population of individuals, each pairing a synthesized reward with a policy trained against it. We first outline the system lifecycle (§ 3.1), then formalize its core objects (§ 3.2), define cross-fitness evaluation, survivor selection, and quality-diversity tracking (§ 3.3), describe Planner–Mutator offspring synthesis (§ 3.4), and conclude with implementation details (§ 3.5).
System Overview and Lifecycle
An evolutionary run proceeds through generations . At each generation , Habitats follows the five-stage lifecycle illustrated in Figure 1. Newly synthesized rewards are paired with policies trained from scratch, while surviving policies retain their parameters. Every policy is evaluated under every population reward to construct a cross-fitness matrix and population-level quality-diversity statistics. An individual survives only if its policy dominates its own reward and outperforms the random-policy baseline. The Planner then selects parents and issues mutation directives (natural-language specifications of intended behavioral changes) which the Mutator implements as validated reward programs. Survivors and valid offspring form . Algorithm 1 provides the complete procedure.
Figure 1. Habitats evolutionary lifecycle. At generation , the population contains executable reward–policy pairs. (1) Policies for newly synthesized rewards are trained from scratch, while inherited survivor policies remain fixed. (2) Every policy is evaluated under every population reward to construct the cross-fitness matrix . (3) Normalized cross-fitness profiles are used to compute Specialist Quality (SQ), Behavioral Diversity (BD), and Grounded Behavioral Profile Coverage (GC). (4) Individuals whose policies dominate their own reward niches and outperform the random-policy baseline form the survivor set . (5) The Planner determines the offspring count, selects parents, and proposes mutation directives, while the Mutator generates and validates executable reward programs. Valid offspring join the survivors to form ; invalid candidates receive up to three replacement attempts before their offspring slot is discarded.
Problem Formalization and Key Definitions
Evolution proceeds in generations, each comprising one full pass through the five-step lifecycle above. At generation , Habitats maintains a population of individuals. Each individual pairs an executable reward function with the policy trained against it: . Here, defines the objective and is the corresponding policy. Surviving reward–policy pairs are carried forward across generations with their learned policy parameters fixed; only newly synthesized rewards are paired with newly initialized policies and trained using the environment’s fixed policy-optimization procedure. In other words, only reward programs are subject to evolutionary variation.
Reward function contract. Each objective is represented as an executable Python function
where are the pre- and post-transition states, is the selected action, and info contains auxiliary environment metadata (see Appendix § 10 for the environment-specific reward interfaces and exposed metadata). The environment dynamics remain fixed throughout evolution; only evolves, and it governs the training of . Habitats is agnostic to the specific control environment: a new environment can be integrated through a lightweight adapter exposing its state, action, transition, and metadata interfaces without modifying the evolutionary loop.
Although written in transition-level notation, reward programs may maintain internal state across steps, enabling history-dependent objectives; this state is reset at episode boundaries and isolated across evaluation rollouts.
Cross-Fitness Evaluation and Survivor Selection
Cross-fitness evaluation. Habitats evaluates every policy against every reward in the population, producing an cross-fitness matrix :
where is the performance of policy at generation , trained against reward , when evaluated under reward . The diagonal measures self-mastery: how well a policy satisfies the objective against which it was trained. The off-diagonal entries , , measure transferability: how well that behavior generalizes to objectives for which it was not explicitly trained.
Because synthesized rewards may have incomparable numerical scales, each column of is rescaled to , mapping its population minimum and maximum to 0 and 1. We denote the resulting matrix by . This prevents reward magnitude from substituting for reward quality.
The complete cross-fitness evaluation procedure, including the cross-fitness matrix normalization formula, rollout counts, episode horizons, aggregation, and random-policy evaluation, is provided in Appendix § 11.
Survivor selection. Survivors are selected through niche dominance. Let denote the fitness of a random policy under reward . An individual survives if and only if its policy achieves the highest fitness on its own reward niche relative to all co-evolving policies and outperforms the random-policy baseline:
Because policy training is finite-budget, diagonal dominance is not automatic: a policy trained on another reward may transfer better to . The criterion therefore retains rewards that are learnable within the fixed budget and induce their strongest population policy. The surviving individuals form the set .
Quality-diversity tracking. To monitor population health and detect convergence toward homogeneous behavior, Habitats tracks two complementary quality-diversity metrics computed from the normalized cross-fitness matrix .
Specialist Quality (SQ) measures the average proficiency of policies on their own synthesized reward niches:
Behavioral Diversity (BD) measures the functional distinctness of the policies in the population. Let denote the normalized cross-fitness profile of policy at generation . Before computing BD, zero-norm profiles are excluded and the remaining profiles are reindexed; let denote their number. Note that no zero-norm profiles occurred in the reported experiments. Behavioral Diversity is the average pairwise cosine distance between the remaining profiles:
If , we define . Here, provides numerical stability. High indicates that the population contains policies with distinct functional specializations across the evolved reward landscape.
Offspring Synthesis: Planner and Mutator
Naive genetic-programming operators, such as random token substitution or subtree crossover, frequently produce invalid syntax or incoherent reward programs. They also provide no mechanism for steering mutation toward underexplored regions of the population’s behavior space. Habitats addresses both limitations with a two-stage architecture: a Planner decides what to explore based on population-level state, while a separately prompted Mutator implements that decision as reward code.
The Planner (). The Planner inspects the current survivors , the normalized cross-fitness matrix , and the population quality-diversity metrics . It determines the number of offspring and, for each offspring slot , selects a parent set , with , and produces a natural-language mutation directive :
This centralized planning step is the mechanism through which population-wide information, including survivor fitness profiles, specialist quality, and behavioral diversity, directly guides parent selection and offspring generation.
The Mutator (). For each offspring slot , the Mutator receives the environment interface description , the reward functions associated with the selected parent set , and the Planner directive . It synthesizes a candidate reward function
Each valid child reward is paired with a newly initialized policy trained against it, forming an offspring individual . We denote the set of valid individuals produced across the offspring slots by . The next population is then .
Every synthesized reward program undergoes static syntax checking and sandboxed test execution. If validation fails, the candidate is rejected and the Mutator is called again, for up to three replacement attempts. If all four attempts fail, the offspring slot is discarded and no individual is added to .
Implementation and Hyperparameters
The complete set of prompts used by the system during initialization, planning, and mutation is included in Appendix § 12. Complete policy-optimization, evaluation, language-model, software, compute, and random-seed details are provided in Appendix § 13.
Experimental Setup
We evaluate Habitats in four control environments: a discrete Card Sandbox and three continuous-control domains from the publicly available DeepMind Control Suite [[23]], which uses the MuJoCo physics engine. In order to parallelize training efficiently, we also utilize the Brax engine [[5]]. The Card Sandbox uses tabular Q-learning, while the MuJoCo environments use Proximal Policy Optimization (PPO) [[20]]. In all environments, policies are trained exclusively against synthesized rewards; native task rewards are not used for policy optimization. The full environment specifications are provided in Appendix § 10.
Environments
Card Sandbox. The Card Sandbox is a discrete card-management environment in which agents manipulate cards across a deck, hand, and table using nine primitive actions: pass, draw, play to one of three table slots, retrieve from one of three table slots, and discard. The environment provides no predefined task objective, so all learned behavior must arise from synthesized rewards. Each run begins with reward–policy pairs and proceeds for generations, which we find sufficient in practice (see § 5.4). Policies are represented by tabular Q-functions.
MuJoCo continuous control. We evaluate continuous-control behavior in Cart-Pole, Hopper, and Cheetah. These environments span balancing and locomotion tasks with continuous state and action spaces. Each run begins with reward–policy pairs and proceeds for generations, which we find sufficient in practice (see § 5.4). All policies are trained using PPO with a fixed architecture, optimizer, and interaction budget.
Evaluation Protocol
We perform three independent evolutionary runs per environment and method using random seeds. All methods use the same initial population sizes, generation counts, and policy-level hyperparameters. Every newly generated policy receives the same environment-interaction budget, and every policy–reward pair is evaluated the same way. Because population sizes evolve endogenously, total policy-training interactions and cross-fitness evaluations may differ across methods.
Baselines
We compare Habitats against two competitive evolutionary baselines with matched per-policy training and evaluation budgets (see Appendix § 14 for full details):
Independent Generation. At each generation, offspring rewards are generated independently without parent conditioning or Planner guidance, while retaining the same evolutionary selection and elitism.
Direct Mutation. This is Habitats without the Planner: surviving rewards are passed directly to the Mutator, preserving lineage-based inheritance while removing population-level guidance.
Metrics
Specialist Quality (SQ). Specialist Quality is the mean normalized diagonal of the cross-fitness matrix, as defined in Eq. (4). We report its mean across generations and its value on , along with its equal-weight macro-averages across environments.
Behavioral Diversity (BD). Behavioral Diversity is the mean pairwise cosine distance between normalized cross-fitness profiles, as defined in Eq. (5). We report its mean across generations and its value on , along with its equal-weight macro-averages across environments.
Grounded Behavioral Profile Coverage (GC). GC counts grounded, functionally distinct policies within each generation. A policy is grounded when its reward executes successfully and its self-fitness exceeds the corresponding random-policy baseline by
Among grounded policies, normalized cross-fitness profiles are rounded to one decimal place and deduplicated within each generation; their number defines . We report final-generation coverage and .
Full metric definitions and edge-case handling are provided in Appendix § 11.
Downstream Adaptation
To test whether evolved behaviors remain useful beyond their original objectives, we evaluate frozen policy libraries from Habitats, Direct Mutation, and Independent Generation on ten Card Sandbox tasks fixed before evolution. For each method and seed, we uniformly sample 15 final survivors without reference to downstream performance. A meta-policy routes among these frozen policies and is trained for 1,000, 2,000, 5,000, 10,000, or 20,000 episodes, then compared with a task-specific Scratch policy trained for 20,000 episodes using matched hyperparameters and seeds. We aggregate performance using paired win rate. Full task definitions, evaluation details, and per-task results are provided in Appendix § 16.
Results and Analysis
Overall Objective-Discovery Performance
Figure 2A-C summarizes the principal results, with complete per-environment values reported in Appendix § 15 (Table 3 and Table 4). The baselines are deliberately stringent ablations of Habitats: all three methods share the same evolutionary loop, policy training, cross-fitness evaluation, and survivor selection, but differ in how offspring rewards are generated and allocated. Independent Generation removes parent conditioning and population-level planning, whereas Direct Mutation retains parent-conditioned evolution but removes the Planner. Both baselines allocate one offspring slot per survivor, whereas Habitats allows the Planner to adaptively determine the offspring count from the current population state.

Figure 2. Population quality, diversity, grounded coverage, and downstream adaptation. (A–B) SQ and BD are equal-weight macro-averages across environments, shown as their means across generations and their values in the final population. (C) GCAUC is reported separately for each environment on a logarithmic scale. (D) Downstream adaptation is measured by paired win rate against task-specific Scratch policies trained for 20,000 episodes. Meta-policies route among size-matched, frozen libraries produced by Habitats, Direct Mutation, or Independent Generation and are trained for 1,000, 2,000, 5,000, 10,000, or 20,000 episodes; the dashed line denotes parity. Error bars in (C–D) indicate ±1 standard deviation over three seeds.
| Environment | Method | Mean SQ | Final SQ | Mean BD | Final BD |
| Card Sandbox | Independent Generation | 0.9558 0.0146 | 0.9294 0.0998 | 0.4725 0.0754 | 0.3815 0.1800 |
| Direct Mutation | 0.9919 0.0007 | 0.9907 0.0131 | 0.4259 0.2218 | 0.3906 0.2662 | |
| Habitats | 0.9683 0.0227 | 0.9539 0.0277 | 0.6710 0.0289 | 0.6676 0.2036 | |
| Cart-Pole | Independent Generation | 0.3591 0.1613 | 0.2988 0.2252 | 0.1971 0.1713 | 0.1672 0.1631 |
| Direct Mutation | 0.5152 0.1324 | 0.4085 0.1094 | 0.3163 0.1896 | 0.2882 0.1871 | |
| Habitats | 0.4162 0.1309 | 0.6615 0.3564 | 0.2987 0.1409 | 0.4456 0.0165 | |
| Hopper | Independent Generation | 0.7585 0.1394 | 0.8000 0.2000 | 0.0384 0.0333 | 0.0373 0.0365 |
| Direct Mutation | 0.9462 0.0932 | 1.0000 0.000 | 0.0281 0.0072 | 0.0409 0.0023 | |
| Habitats | 0.8163 0.1624 | 0.8537 0.2025 | 0.2139 0.1464 | 0.1981 0.1172 | |
| Cheetah | Independent Generation | 0.8867 0.0075 | 0.9602 0.0165 | 0.0516 0.0088 | 0.0349 0.0099 |
| Direct Mutation | 0.9102 0.0203 | 0.8896 0.0957 | 0.0879 0.0574 | 0.1521 0.0573 | |
| Habitats | 0.9140 0.0113 | 0.9442 0.0690 | 0.1585 0.0698 | 0.2186 0.0602 | |
| Macro-average | Independent Generation | 0.7400 | 0.7471 | 0.1899 | 0.1552 |
| Direct Mutation | 0.8409 | 0.8222 | 0.2146 | 0.2180 | |
| Habitats | 0.7787 | 0.8533 | 0.3355 | 0.3825 |
Table 3. Complete Specialist Quality (SQ) and Behavioral Diversity (BD) results.
| Environment | Method | Final GC | |
| Card Sandbox | Independent Generation | 211.33 36.56 | 23.67 5.31 |
| Direct Mutation | 244.33 38.64 | 23.33 6.60 | |
| Habitats | 322.67 37.89 | 26.00 2.83 | |
| Cart-Pole | Independent Generation | 7 5 | 1 1 |
| Direct Mutation | 16 10 | 2 1 | |
| Habitats | 6 6 | 2 2 | |
| Hopper | Independent Generation | 7 2 | 1 1 |
| Direct Mutation | 2 4 | 0 1 | |
| Habitats | 16 14 | 3 3 | |
| Cheetah | Independent Generation | 18 1 | 4 2 |
| Direct Mutation | 21 7 | 4 2 | |
| Habitats | 29 3 | 7 2 |
Table 4. Complete Grounded Behavioral Profile Coverage (GC) results.
Specialist Quality. All three methods produce policies that specialize effectively under their paired rewards. Direct Mutation achieves the highest macro-averaged mean SQ across generations (0.8409), followed by Habitats (0.7787) and Independent Generation (0.7400). On the final evaluated population, however, Habitats achieves the highest macro-average (0.8533), compared with 0.8222 for Direct Mutation and 0.7471 for Independent Generation. Both Direct Mutation and Habitats exceed Independent Generation in mean SQ in all four environments and in final SQ in three of four, consistent with evolutionary inheritance helping preserve and refine productive objectives. The per-environment results are mixed: Direct Mutation leads mean SQ in Card Sandbox, Cart-Pole, and Hopper, while Habitats leads in Cheetah; the best final SQ is distributed across all three methods. Habitats therefore does not uniformly dominate specialist quality, but remains competitive while optimizing for a broader population-level objective.
Behavioral Diversity. The clearest advantage of Habitats is behavioral diversity. Its macro-averaged mean BD is 0.3355, exceeding Direct Mutation (0.2146) by 56% and Independent Generation (0.1899) by 77%. The difference grows on the final population: Habitats reaches 0.3825, approximately 1.8× Direct Mutation (0.2180) and 2.5× Independent Generation (0.1552). Habitats achieves the highest final BD in all four environments and the highest mean BD in three of four, trailing Direct Mutation only slightly in Cart-Pole (0.2987 versus 0.3163). The largest final-population differences appear in Hopper and Cheetah, where Habitats produces substantially more distinct cross-fitness profiles. The effect is most pronounced in Hopper, where Habitats achieves 7.6× the mean BD and 4.8× the final BD of Direct Mutation. Because Direct Mutation differs from Habitats primarily by removing the Planner and its population-level context, this pattern is consistent with diversity-aware planning steering mutation toward less redundant behavioral niches.
Grounded coverage. The coverage results show that these diversity gains generally correspond to distinct, learnable behaviors rather than merely different reward programs. Habitats achieves the highest in Card Sandbox, Hopper, and Cheetah, while Direct Mutation leads in Cart-Pole. On the final population, Habitats attains the highest mean GC in Card Sandbox, Hopper, and Cheetah and ties Direct Mutation in Cart-Pole. Coverage varies substantially across seeds and cannot be meaningfully macro-averaged because its scale depends on the evolutionary horizon and population size. Nevertheless, its per-environment pattern reinforces the central result: population-guided planning primarily improves behavioral diversity and grounded coverage while preserving competitive specialist quality.
Downstream Utility of Evolved Policy Libraries
Figure 2D shows that Habitats supports sample-efficient adaptation to unforeseen objectives. Across ten tasks held out from evolution, a meta-policy routing among 15 frozen Habitats policies achieves a paired win rate of 0.467 0.029 after 5,000 episodes, approaching mean parity with task-specific Scratch policies trained for 20,000 using only one quarter of the downstream-training budget. At 10,000 episodes, it reaches 0.617 0.058, surpassing parity using half the training budget. Under the same protocol with size-matched libraries, this exceeds Direct Mutation (0.533 0.029) and Independent Generation (0.467 0.058), and remains higher than either baseline after 20,000 episodes.
These results show that Habitats discovers non-trivial skills that remain useful under objectives unknown during evolution. Its advantage over size-matched Direct Mutation and Independent Generation libraries suggests that population-level planning produces a more broadly reusable repertoire, rather than merely a larger collection of task-specific behaviors. Because the library is evolved once and reused, its discovery cost can be amortized across downstream tasks, enabling new meta-policies to adapt efficiently by learning how to route among existing skills. Complete protocols and results are provided in Appendix § 16.
Qualitative Analysis of Evolved and Discovered Behaviors
The quantitative results show that Habitats maintains distinct behavioral niches; we next examine what those niches contain. Across discrete and continuous-control environments, evolution produced interpretable objectives that exploit different affordances of the same embodiment without receiving a target behavior or predefined skill taxonomy.
Distinct uses of the same embodiment. Figure 3 shows the clearest example. In response to the Planner directive Smooth Retro Runner: High-Speed Coordinated Backward Gallop, the Mutator constructed an executable objective whose policy learned stable, coordinated backward locomotion. Other Cheetah objectives produced a low forward crawl or repeated vertical jumps with little horizontal displacement. Hopper policies similarly ranged from explosive forward leaps to long, controlled strides that achieved speed without rapid joint motion. These behaviors differ in direction, posture, and movement strategy rather than representing minor variations of a conventional gait.

Figure 3. Evolved backward locomotion. In the Cheetah environment, Habitats produced an individual that learned to move backward in response to the Planner directive Smooth Retro Runner: High-Speed Coordinated Backward Gallop. Link to video.
Compositional objective discovery. The Card Sandbox exhibits a parallel pattern in a discrete domain. Evolution progressed from simple relations, such as the ascending arrangement required by The Sorting Table, to increasingly structured mini-games. Later objectives added equal spacing, fixed that spacing to one, or combined spatial patterns with primality and divisibility constraints. Habitats therefore composed ordering, position, parity, and arithmetic relations rather than repeatedly expressing the same underlying task.
Contraction and recovery. One Card Sandbox run exposes the population-level feedback loop particularly clearly. A policy induced by The Composite Arithmetic Solver generalized across several existing objectives and displaced multiple specialists, temporarily contracting the population around a narrower set of behaviors. Subsequent Planner–Mutator cycles generated new objectives combining sandwich patterns, primality, parity, and divisibility, restoring a broader repertoire of specializations. The trace therefore captures a complete qualitative cycle: specialization, generalist takeover, population contraction, and renewed diversification. This recovery illustrates the intended role of population-level planning: offspring generation responds to the state of the evolving ecology rather than repeatedly mutating its dominant individual in isolation.
Together, these examples show that Habitats discovers meaningful skills and structural concepts while responding dynamically to population contraction. Selection operates on what each reward causes a policy to learn, and the Planner uses that behavioral context to redirect subsequent objective generation. Appendix I provides many additional Cheetah and Hopper behaviors, Card Sandbox objective families, evolutionary progressions, and cross-niche replacement events.
Robustness to Evolutionary Horizon and Language-Model Backbone
Evolutionary horizon. To test whether our results depend on the chosen evolutionary horizon, we extend Card Sandbox from 15 to 30 generations and all three continuous-control environments from 6 to 10. By the original stopping points, SQ is already near its long-run level, and Habitats continues to achieve the highest BD throughout the additional generations in all four environments. Extending evolution therefore does not change the main comparison between methods, supporting the original horizons as sufficient for evaluation. Complete trajectories are provided in Appendix J.
Language-model backbone. To assess the effect of the underlying language model, we evaluate Habitats in Card Sandbox using gemini-3.5-flash, gemini-3.8-flash, and gemini-4-argon, while holding all other settings fixed. All three achieve near-perfect final SQ, showing that Habitats reliably discovers learnable objectives across backbones. The strongest tested backbone, gemini-4-argon, produces substantially greater behavioral diversity, reaching a final BD of : 62% higher than gemini-3.5-flash and 110% higher than gemini-3.8-flash. Crucially, this increase occurs without reducing specialist quality. This supports the central design of Habitats: stronger Planner and Mutator capabilities can be translated into broader populations of distinct, learnable behaviors, suggesting further headroom as language models improve. Complete results and evolutionary trajectories are provided in Appendix K.
Discussion
Population-level planning changes the character of evolution. Habitats does not uniformly maximize specialist quality: Direct Mutation achieves the highest mean SQ across generations, whereas Habitats achieves the highest final macro-average. Direct Mutation’s advantage over Independent Generation suggests that parent conditioning provides useful evolutionary memory. Habitats’ principal advantage lies in population structure: it achieves the highest final BD in all four environments and the highest grounded coverage in three of four while maintaining competitive SQ. This pattern suggests that parent-conditioned mutation refines productive objectives, while population-level planning prevents that refinement from collapsing onto a narrow behavioral family. The largest diversity gains occur in Hopper and Cheetah, whose embodiments support multiple gaits, postures, and movement directions. Yet Cart-Pole also achieves its highest final SQ and BD under Habitats, indicating that population guidance can benefit constrained environments. Determining when these gains justify the additional planning overhead remains a direction for future work.
Cross-fitness grounds novelty in learned behavior. Building on coevolutionary cross-evaluation, Habitats uses cross-fitness to distinguish reward novelty from behavioral novelty: syntactically different rewards need not induce distinct policies. This distinction is illustrated by the observed generalist takeover: a broadly capable policy displaced several specialists and temporarily contracted the population, after which population-level planning helped restore behavioral breadth. Habitats is therefore better understood as an ecology of competing objectives and behaviors than as a collection of independently generated rewards. The resulting crawling, jumping, bounding, and striding behaviors further suggest an emergent objective basis analogous to the predefined cumulants of the Option Keyboard [2].
When is objective evolution preferable? Task-specific learning remains appropriate when a single objective is known in advance. Population-guided evolution is more relevant when desired capabilities are unknown or plural and the goal is to construct a repertoire that can be inspected, composed, or reused. The Card Sandbox demonstrates this utility: routing among frozen Habitats policies approaches mean parity with task-specific policies trained from scratch for 20,000 episodes after only 5,000 episodes and surpasses it after 10,000. Moreover, the Habitats library adapted for 10,000 episodes achieves a higher mean win rate than size-matched Direct Mutation and Independent Generation libraries adapted for 20,000, indicating that population-level planning produces a more reusable behavioral repertoire. Because the library is evolved once and reused, its discovery cost can be amortized across unforeseen objectives. By evolving the objectives that shape behavior, Habitats moves toward open-ended objective discovery; its bounded environments, interfaces, and evolutionary horizons, however, preclude claims of unbounded open-ended evolution.
Limitations and outlook. Our evaluation covers four simulated environments, three evolutionary seeds, and finite horizons; the language-model ablation is limited to Card Sandbox and three Gemini backbones. Although per-policy budgets are matched, total computation varies with endogenous population size. Because each method generates its own rewards, BD and GC use method-specific cross-fitness spaces whose coordinates also change across generations; they therefore characterize within-population structure rather than behavior under a shared reward basis. The size-matched downstream evaluation provides a common external comparison of library utility. Finite-rollout survivor selection may also discard near ties. Habitats evolves only rewards while holding the policy architecture and optimization procedure fixed, even though different objectives may benefit from different policies. Future work could jointly evolve objectives and policies and extend survivor selection to consider computational efficiency, allowing a comparably capable but cheaper policy to displace a more expensive specialist. Moreover, providing the Planner with explicit population context may become impractical as populations and histories grow. Further directions include compressed population representations, persistent behavioral archives, broader environments, compute-amortized downstream evaluation, and the joint evolution of objectives, environments, and compositional controllers.
Within these limits, our results show that coupling language models with behavioral evaluation and population-level planning can produce evolving objective repertoires whose policies remain diverse, grounded, and reusable.
Responsible-Use Statement
Habitats automates the generation of executable agent objectives; outside controlled simulations, this capability could produce unintended goals, exploit evaluation flaws, or reduce human oversight over agent behavior. Our experiments are confined to sandboxed simulations with retained code and execution traces. Real-world use would require sandboxing, restricted permissions, independent evaluation, human approval before deployment, and reliable halt and rollback mechanisms.
Acknowledgments
We thank Yousuf Ali for his assistance in open-sourcing the Habitats codebase, available at https://github.com/google-deepmind/habitats.
Habitats Algorithm
Algorithm 1 formalizes the evolutionary lifecycle introduced in § 3.1. Newly synthesized policies are trained from scratch against their corresponding rewards, while surviving policies retain fixed parameters across subsequent generations.
Algorithm 1 Habitats evolutionary lifecycle
Require: Initial population , number of evaluated generations , environment description , grounding threshold , and numerical regularizer .
Ensure: Final evaluated population , final survivor set , per-generation metrics, and evolutionary traces.
for do
Train each newly initialized policy in against its corresponding reward; keep inherited survivor policies fixed.
Evaluate every policy against every population reward to construct .
Evaluate the random-policy baseline under every population reward.
Independently normalize each column of to obtain .
Compute , , the grounded set , and .
Select the survivor set using niche dominance and the random-policy baseline.
if then
The Planner selects and produces parent–directive pairs .
Initialize the valid offspring set .
for do
Initialize the attempt counter and validity flag .
while do
Synthesize a candidate reward using the Mutator.
Validate the candidate using static syntax checking and sandboxed execution.
.
if is valid then
.
end if
end while
if then
Pair with a newly initialized policy and add the pair to .
else
Discard offspring slot .
end if
end for
Update the population: .
end if
end for
Compute .
return , , and the recorded metrics.
Environment Specifications
As defined in Eq. (1), every synthesized objective is implemented as an executable function with the common interface
Here, info abstracts over auxiliary implementation inputs, including the environment adapter and terminal flag; the concrete Python signatures are provided in Appendix § 12.
Table 1 summarizes the environment spaces, policy-optimization algorithms, and evolutionary settings. Native task rewards are not used for policy optimization.
| Property | Card Sandbox | Cart-Pole | Hopper | Cheetah |
| Observation space | Discrete | Continuous | Continuous | Continuous |
| Action space | Discrete, | Continuous | Continuous | Continuous |
| Policy optimization | Tabular Q-learning | PPO | PPO | PPO |
| Train episode horizon | 500 | 1,000 | 1,000 | 1,000 |
| Initial population | 3 | 4 | 4 | 4 |
| Generations | 15 | 6 | 6 | 6 |
Table 1. Environment specifications and evolutionary settings.
Card Sandbox. The Card Sandbox is implemented as a custom single-player card environment. It operates over a 32-card deck containing four copies of each card value from 1 to 8. The agent maintains a hand with a maximum size of one and interacts with three table slots.
The environment has nine discrete actions:
Action 0 passes, action 1 draws from the deck, actions 2–4 play the card in hand to table slots 0–2, actions 5–7 retrieve cards from table slots 0–2, and action 8 discards the card in hand.
The observation is represented as a discrete scalar with possible values. Each of the hand and three table positions contains either 0 for an empty position or a card value in . The state index is encoded deterministically as
where is the card value in hand and are the values in the three table slots.
Synthesized reward functions receive the encoded pre- and post-transition states together with structured metadata in info. This metadata exposes the decoded state components, raw hand and table arrays, remaining deck contents, action names, and the current step count. The Card Sandbox does not provide a predefined task reward during policy optimization; all learned behavior is induced by the synthesized reward programs.
MuJoCo control environments. The continuous-control experiments use the DeepMind Control Suite [23] with the MuJoCo physics engine. We evaluate the domain–task pairs cartpole/balance, hopper/hop, and cheetah/run, covering balancing and locomotion behaviors. These task identifiers are used only to instantiate the underlying control environments; their native task rewards are discarded and are not used for policy optimization or cross-fitness evaluation. Observations and bounded continuous actions are represented using single-precision float32 values.
For cartpole, the policy receives a five-dimensional observation and produces a one-dimensional action bounded to . The metadata supplied to synthesized reward functions includes cart_position, pole_angle_cosine, and pole_angular_velocity.
For hopper, the policy receives a 15-dimensional observation and produces a four-dimensional action bounded component-wise to . The metadata includes speed, height, and touch foot-contact sensor signals.
For cheetah, the policy receives a 17-dimensional observation and produces a six-dimensional action bounded component-wise to . The metadata includes speed, torso_height, and torso_angle.
MuJoCo episodes terminate after a maximum horizon of 1,000 steps or when an applicable domain-specific physical termination condition is reached. Each synthesized reward function receives the raw pre-transition state, action, post-transition state, and domain-specific diagnostic metadata. Newly generated policies are initialized and trained from scratch using PPO, while surviving policies retain their learned parameters and are not updated in subsequent generations.
Evaluation and Metric Details
Cross-fitness evaluation
For a population of size , each policy is evaluated under each reward function . Let denote the return obtained during evaluation rollout . For an episode containing transitions, the return is the undiscounted cumulative synthesized reward:
The empirical cross-fitness entry is the mean return across evaluation rollouts:
Although policy optimization internally uses a discount factor , cross-fitness evaluation does not discount rewards. Evaluation episodes end when the environment emits a terminal timestep or when the evaluation horizon is reached. The evaluation horizon is steps for the Card Sandbox and steps for the MuJoCo environments. When an episode reaches the maximum horizon without naturally terminating, its return is the sum of the rewards observed up to that horizon; no value-function bootstrap estimate is added.
Cross-fitness normalization.
Synthesized rewards may differ substantially in scale and range. To make returns comparable across reward functions, each column of the cross-fitness matrix is independently min–max normalized:
We use for numerical stability. If all policies obtain the same return under a reward function, the corresponding normalized column is zero.
Specialist Quality
Specialist Quality measures how effectively policies optimize their paired objectives relative to the other policies in the current population. It is defined as the mean normalized diagonal of the cross-fitness matrix:
Behavioral Diversity
Let
denote the within-generation cross-fitness profile of policy . Before computing Behavioral Diversity, zero-norm profiles are excluded and the remaining profiles are reindexed. Let denote the number of remaining profiles. No zero-norm profiles occurred in the reported experiments.
Behavioral Diversity is the mean pairwise cosine distance between the remaining profiles:
If , we define .
Grounding criterion.
For each reward function , we independently evaluate a uniformly random policy and estimate its mean and standard deviation of returns, and . The learning-progress score of the paired trained policy is
A reward is considered grounded when it executes successfully and satisfies
We use and denote the set of grounded individuals at generation by .
Grounded Behavioral Profile Coverage
Profiles from different generations are not directly comparable because the population rewards, and therefore the profile coordinates, change throughout evolution. We consequently compute coverage separately within each generation.
For every grounded individual , we use its normalized cross-fitness profile
Each coordinate is rounded to one decimal place, and duplicate quantized profiles are removed. The resulting per-generation profile set is
where rounding is applied element-wise. Grounded Behavioral Profile Coverage at generation is
We report final-generation coverage and coverage accumulated across the evolutionary trajectory:
The accumulated measure counts grounded profile instances across generations.
System Prompts and Evolutionary Operator Templates
This appendix documents the system instructions and context templates used by the decoupled two-stage Planner–Mutator evolutionary architecture. Offspring synthesis operates in two phases: (1) high-level population planning through the Offspring Planner , which inspects cross-fitness matrices and population-health metrics to produce structured breeding directives; and (2) low-level reward synthesis through the Mutator , which translates these directives and any selected parent code into executable Python reward functions.
Offspring Planner Prompts
The Offspring Planner acts as an autonomous evolutionary-algorithm controller. It evaluates population-level health and cross-fitness information to determine whether the population requires exploration, such as seeding new behavioral niches or combining distant policies, or exploitation, such as refining high-performing specialists.
Planner System Instruction
The following system instruction is supplied to . It defines the Planner’s reasoning protocol, steering rules based on Specialist Quality and Behavioral Diversity , and structured JSON output schema.
You are an expert RL researcher and evolutionary algorithm
controller.
Your task is to plan the next generation of reward functions in an
evolutionary run.
You will be given the current generation’s agents, their evolved
reward codes, their performance fitness grid, the agents selected as
survivors, and a Population Health Report containing quality and
diversity metrics.
You must decide how many new offspring to generate and how to
generate them.
You can choose to mutate existing survivors or generate entirely new
individuals without parents to explore radically new areas of the
search space.
For each offspring:
1. Select one to three parents from the survivors, or leave
parent_ids empty ([]) to generate an entirely new individual.
2. Provide reasoning for the parent selection, or for starting fresh,
together with the mutation or generation strategy.
3. Provide a hint or direction for the mutator/generator. Examples
include “combine the exploration strategy of agent_1 with the
exploitation strategy of agent_2,” “make a small change to
agent_3’s weights to improve performance,” or, when generating a
new individual, “focus on maximizing exploration.”
Population Health Report Metrics:
• Specialist Quality: Measures how well policies perform on their
own target rewards on average, from 0.0 to 1.0.
– High (~1.0) means agents are successfully learning and
specializing.
– Low (< 0.5) means agents are struggling to learn or one
dominant policy is winning across objectives.
• Behavioral Diversity: Measures how different the policies’
performance profiles are from one another, from 0.0 to 1.0.
– High (~1.0) means policies have discovered very different
strategies.
– Low (< 0.3) means the population is homogenizing, risking
stagnation.
Use the Population Health Report to steer evolution as follows:
If Specialist Quality is LOW and Behavioral Diversity is HIGH: The population is in chaos. Rewards may be too different or too difficult. Prioritize EXPLOITATION by proposing simpler, more incremental offspring rewards.
If Specialist Quality is HIGH and Behavioral Diversity is LOW: The population is stagnating. Prioritize EXPLORATION by proposing radical mutations, combining substantially different parents, or introducing new structural concepts.
If both are HIGH: The population is healthy. Maintain a balance between incremental improvements and continued exploration.
Constraints:
You must select parents only from the list of survivors, unless generating a new individual, in which case leave
parent_idsempty.
You must output the plan as JSON matching the following schema:
{
"offspring_plans": [
{
"parent_ids": ["agent_id_1", "agent_id_2"],
"reasoning": "Description of why these parents were chosen...",
"mutation_hint": "Specific instructions for the mutator..."
}
]
}
Planner User Context Template
At generation , receives the full population state, cross-fitness matrix, and quality-diversity metrics through the following template:
Environment Description:
{env_desc}
Current Generation: {generation}
Number of Survivors: {num_survivors}
-- POPULATION HEALTH REPORT --
Specialist Quality: {specialist_quality}
Behavioral Diversity: {behavioral_diversity}
Survivors (Selected for next generation):
{survivors}
All Agents in this Generation:
{all_agents}
Fitness Grid (Row i is Policy i, Column j is Reward j):
{fitness_grid}
Analyze the data and generate the offspring plans.
Reward Synthesizer and Mutator Prompts
The Mutator translates Planner directives and selected parent source code into executable Python functions. To reduce programmatic stagnation and code duplication, it is also conditioned on a rolling window of previously generated reward functions, denoted by .
Mutator System Instruction
The system instruction enforces reward simplicity, valid Python syntax, and the required function contract. You are an expert RL researcher and evolutionary operator. Your task is to design, mutate, and improve Python reward functions for a reinforcement learning agent to elicit interesting and diverse behaviors in a PLAYGROUND environment.
The original game-theoretic objectives, such as winning or reaching a predefined goal, are COMPLETELY DISREGARDED. The environment is a playground for exploration.
You must output a new reward function in Python. The output MUST be a valid Python code block beginning with python and ending with . It must define the following function:
def compute_reward(env, state, action, next_state, done, info
) -> float:
Inside this function, you may decode states using environment-specific methods. Do not use external libraries other than standard Python libraries, such as math.
The function must return a single finite Python float representing the synthesized reward for the current transition. The function cannot modify the environment’s termination signal. Explain the strategy and behavioral objective in comments inside the code.
CRITICAL REQUIREMENTS FOR REWARD DESIGN:
Keep the reward function as SIMPLE and interpretable as possible. Avoid unnecessary complexity.
Define a clear and simple behavioral objective.
Prefer simple, sparse, or discrete rewards, such as +1.0 for goal progress, -1.0 for invalid actions, and 0.0 otherwise, when sufficient.
Use continuous reward shaping only when necessary to guide the agent toward the objective.
Avoid combining many reward components unless essential.
Do NOT define helper functions inside compute_reward. Implement all logic inline or use existing environment methods, such as env.decode, to maximize performance.
Parent Mutation and Combination Template
When mutating surviving parents under Planner guidance, receives the parent source code, Planner directive, and historical forbidden reward programs through the following template:
Environment Description:
{env_desc}
Parent Reward Functions from the previous generation (use these to mutate or combine):
{parent_codes}
Previously generated reward functions in this run (DO NOT duplicate these):
{forbidden_codes}
Generate a NEW mutated reward function that differs from the forbidden functions while inheriting or modifying strategies from the selected parents.
Mutation Instruction/Hint:
{mutation_hint}
Environment Interface Description Prompts ({env_desc})
Whenever the Planner or Mutator is called, the {env_desc} placeholder is populated with the domain-specific environment specification. This description provides the LLM with the observation structure, action space, available helper methods, action bounds, and reward-function signature.
Discrete Card Sandbox Description
Environment: Playing Card Playground (single-player)
State Space: Discrete(6561) representing the game state.
You can decode the state integer using env.decode(state), which
returns a dictionary:
{
"hand": int (0–8, 0 = empty),
"table": list of 3 ints (0–8, 0 = empty)
}
Action Space: Discrete(9)
0: Pass
1: Draw (deck to hand)
2–4: Play hand to table slots 0–2
5–7: Take from table slots 0–2 to hand
8: Discard hand
This is a PLAYGROUND. There is no predetermined objective, winning
condition, or built-in task reward.
Goal: Evolve a SIMPLE and interesting objective, effectively
creating a mini-game for the agent to play in this environment.
Examples include arranging cards on the table in patterns, matching
values, hoarding cards, or cycling cards between the hand and table.
Continuous Cart-Pole Description
Environment: MuJoCo Cart-Pole Playground (Continuous)
Observation Space: np.ndarray of shape (5,) representing the
flattened physics state:
Index 0: cart_position (float) – horizontal position of the cart
on the slider
Index 1: cos_pole_angle (float) – cosine of the pole angle (1.0 =
upright, -1.0 = hanging down)
Index 2: sin_pole_angle (float) – sine of the pole angle
Index 3: cart_velocity (float) – horizontal velocity of the cart
Index 4: pole_angular_velocity (float) – angular velocity of the
pole
You can decode state and next_state arrays using env.decode(state),
which returns a dictionary:
{
"cart_position": float,
"cos_pole_angle": float,
"sin_pole_angle": float,
"cart_velocity": float,
"pole_angular_velocity": float
}
Action Space: Continuous(1) – an np.ndarray of shape (1,) in [-1.0,
1.0], representing the horizontal force applied to the cart.
Convenience properties available on env:
env.cart_position -> float
env.pole_angle_cosine -> float (1.0 = upright)
env.pole_angle_sine -> float
env.cart_velocity -> float
env.pole_angular_velocity -> float
env.get_env() -> underlying DM Control environment for advanced
physics access
Function signature:
def compute_reward(env: MujocoEnv, state: np.ndarray,
action: np.ndarray, next_state: np.ndarray,
done: bool, info: dict)
-> float:
This is a PLAYGROUND. There is no predetermined objective, winning condition, or built-in task reward.
Goal: Evolve a SIMPLE and interesting objective for the agent to explore in this environment. Examples include balancing the pole upright, swinging the pole, moving the cart to a target position while balancing, or minimizing cart movement.
Continuous Hopper Description
Environment: MuJoCo Hopper Playground (Continuous)
Observation Space: np.ndarray of shape (15,) representing the flattened physics state.
Positions (indices 0–5):
Index 0: rootz (float) – vertical position (height) of the torso
Index 1: rooty (float) – angle of the torso (orientation/tilt)
Index 2: waist (float) – waist joint angle connecting the torso to the pelvis
Index 3: hip (float) – hip joint angle connecting the pelvis to the thigh
Index 4: knee (float) – knee joint angle connecting the thigh to the calf
Index 5: ankle (float) – ankle joint angle connecting the calf to the foot
Velocities (indices 6–12):
Index 6: rootx_vel (float) – horizontal velocity (approximately forward speed)
Index 7: rootz_vel (float) – vertical velocity
Index 8: rooty_vel (float) – angular velocity of the torso
Index 9: waist_vel (float) – waist joint velocity
Index 10: hip_vel (float) – hip joint velocity
Index 11: knee_vel (float) – knee joint velocity
Index 12: ankle_vel (float) – ankle joint velocity
Touch sensors (indices 13–14):
Index 13: touch_toe (float) – log1p of the toe touch-sensor signal, where 0.0 indicates no contact
Index 14: touch_heel (float) – log1p of the heel touch-sensor signal, where 0.0 indicates no contact
Horizontal position (rootx) is excluded from the observation to maintain translational invariance.
You can decode state and next_state arrays using env.decode(state), which returns a dictionary:
{
"rootz": float, "rooty": float,
"waist": float, "hip": float, "knee": float, "ankle": float,
"rootx_vel": float, "rootz_vel": float, "rooty_vel": float,
"waist_vel": float, "hip_vel": float, "knee_vel": float,
"ankle_vel": float,
"touch_toe": float, "touch_heel": float
}
Action Space: Continuous(4) – an np.ndarray of shape (4,) in [-1.0, 1.0], representing torques applied to four joints:
Index 0: waist torque (gear ratio 30)
Index 1: hip torque (gear ratio 40)
Index 2: knee torque (gear ratio 30)
Index 3: ankle torque (gear ratio 10)
Convenience properties available on env:
env.height-> float (height of the torso relative to the foot; standing threshold approximately 0.6)env.speed-> float (horizontal speed of the torso)env.touch-> tuple[float, float] (touch_toe, touch_heel)env.get_env()-> underlying DM Control environment for advanced physics access
Function signature:
def compute_reward(env: MujocoEnv, state: np.ndarray,
action: np.ndarray, next_state: np.ndarray,
done: bool, info: dict)
-> float:
This is a PLAYGROUND. There is no predetermined objective, winning condition, or built-in task reward.
Goal: Evolve a SIMPLE and interesting objective for the agent to explore in this playground. Examples include standing upright and balancing, hopping forward, hopping as high as possible, balancing on one toe, minimizing energy use while standing, or achieving a target speed.
Continuous Cheetah Description
Environment: MuJoCo Cheetah Playground (Continuous)
Observation Space: np.ndarray of shape (17,) representing the flattened physics state.
Positions (indices 0–7):
Index 0: rootz (float) – vertical position (height) of the torso
Index 1: rooty (float) – angle of the torso (orientation)
Index 2: bthigh (float) – back-thigh joint angle
Index 3: bshin (float) – back-shin joint angle
Index 4: bfoot (float) – back-foot joint angle
Index 5: fthigh (float) – front-thigh joint angle
Index 6: fshin (float) – front-shin joint angle
Index 7: ffoot (float) – front-foot joint angle
Velocities (indices 8–16):
Index 8: rootx_vel (float) – horizontal velocity (approximately forward speed)
Index 9: rootz_vel (float) – vertical velocity
Index 10: rooty_vel (float) – angular velocity of the torso
Index 11: bthigh_vel (float) – back-thigh joint velocity
Index 12: bshin_vel (float) – back-shin joint velocity
Index 13: bfoot_vel (float) – back-foot joint velocity
Index 14: fthigh_vel (float) – front-thigh joint velocity
Index 15: fshin_vel (float) – front-shin joint velocity
Index 16: ffoot_vel (float) – front-foot joint velocity
Horizontal position (rootx) is excluded from the observation to maintain translational invariance.
You can decode state and next_state arrays using env.decode(state),
which returns a dictionary:
{
"rootz": float, "rooty": float,
"bthigh": float, "bshin": float, "bfoot": float,
"fthigh": float, "fshin": float, "ffoot": float,
"rootx_vel": float, "rootz_vel": float, "rooty_vel": float,
"bthigh_vel": float, "bshin_vel": float, "bfoot_vel": float,
"fthigh_vel": float, "fshin_vel": float, "ffoot_vel": float
}
Action Space: Continuous(6) – an np.ndarray of shape (6,) in [-1.0,
1.0], representing torques applied to six joints:
Index 0: bthigh (back-thigh torque)
Index 1: bshin (back-shin torque)
Index 2: bfoot (back-foot torque)
Index 3: fthigh (front-thigh torque)
Index 4: fshin (front-shin torque)
Index 5: ffoot (front-foot torque)
Convenience properties available on env:
env.speed -> float (horizontal speed of the torso)
env.torso_height -> float (vertical position of the torso)
env.torso_angle -> float (orientation angle of the torso)
env.get_env() -> underlying DM Control environment for advanced
physics access
Function signature:
def compute_reward(env: MujocoEnv, state: np.ndarray,
action: np.ndarray, next_state: np.ndarray,
done: bool, info: dict)
-> float:
This is a PLAYGROUND. There is no predetermined objective, winning
condition, or built-in task reward.
Goal: Evolve a SIMPLE and interesting objective for the agent to
explore in this playground. Examples include running forward at
high speed, running backward, maintaining a target torso height or
posture, performing flips, or minimizing torque and energy use.
Hyperparameters, Implementation, Compute, and Random Seeds
Policy-optimization hyperparameters.
Table 2 reports the policy-training and evaluation settings across discrete and continuous environments.
| Hyperparameter | Card Sandbox | Continuous control |
| Policy optimizer | Tabular Q-learning | PPO (Brax/JAX) |
| Learning rate | 0.05 | Cart-Pole/Cheetah: ; Hopper: |
| Discount factor | 0.95 | 0.99 |
| Exploration or clipping | -greedy, 1.0 0.01 decay | PPO clip ratio |
| Training budget per new policy | 20,000 episodes | 100,000 environment steps |
| Evaluation rollouts | 10 episodes | 10 episodes |
| Train episode horizon | 500 steps | 1,000 steps |
| GAE parameter | Not applicable | 0.95 |
| PPO epochs per update | Not applicable | 10 |
| Minibatch size | Not applicable | 64 |
Table 2. Policy-training and evaluation hyperparameters.
We run these settings using the DM Control library [23] and ACME [7] libraries.
Language-model configuration.
Unless otherwise specified, all evolutionary language-model operations use gemini-3.5-flash. In the backbone ablation, both the Planner and Mutator instead use gemini-3.8-flash or gemini-4-argon, with all other settings held fixed.
Decoding settings: Sampling parameters are not explicitly set in
GenerateContentConfig. The SDK defaults used during the experiments are temperature 1.0, top- 0.95, and a maximum output length of 8,192 tokens. No API seed is provided.Structured output: Offspring Planner responses are constrained to JSON objects adhering to a predefined schema, with
offspring_planscontainingparent_ids, reasoning, andmutation_hint. Mutator responses are parsed to extract executable Python code blocks.Retry policy and transient error handling: The custom
LLMClientwrapper retries transient API failures, network timeouts, and quota rate limits up to five times using exponential backoff before raising an exception.Sandbox code validation and replacement: Synthesized reward functions undergo static AST syntax checking and sandboxed execution before policy training. If validation fails, the candidate is rejected and the Mutator is called again, for up to three replacement attempts. If all four attempts for an offspring slot fail, that slot is discarded. Only validated candidates proceed to policy training.
Software, database infrastructure, and compute.
The Habitats framework is implemented in Python 3.13 using JAX and PyTorch.
Distributed Asynchronous Execution: To minimize wall-clock runtime, policy evaluation rollouts and independent Q-learning training runs are dispatched asynchronously across multi-threaded worker pools (
ThreadPoolExecutor) configured withmax_workers = 5for evaluation and up to 10 workers for parallel environment interaction. They run on a chip with 8 CPUs and 32GB of RAM. On average, a single Q-Learning experiment takes around 1h to run. PPO policy training for continuous MuJoCo domains runs on dedicated NVIDIA H100 GPU host machines that have 8 CPUs and 32GB of RAM. A single PPO experiment takes on average around 2h to complete.State Persistence and Auditing: Full experimental state (including run metadata, generation summaries, raw and normalized cross-fitness matrices , Specialist Quality, Behavioral Diversity,
agent reward code histories, and LLM reasoning traces) is continuously persisted to a relational SQLite database. Policy weights are checkpointed incrementally.
Random seeds and experimental control.
To account for stochasticity, all reported results are aggregated across three independent evolutionary runs initialized with
These seeds initialize the Python and NumPy random-number generators, controlling environment initialization and tabular Q-learning exploration. No deterministic seed is provided to the Gemini API, so language-model generations and complete end-to-end runs are not guaranteed to be exactly reproducible.
Baseline and Budget-Matching Details
To assess the contributions of population-level LLM planning () and LLM-guided code mutation (), Habitats is evaluated against two evolutionary baselines: Independent Generation and Direct Mutation. All three methods use identical policy-optimization algorithms, evaluation protocols, environment settings, and survivor-selection rules. They differ in how offspring reward functions are generated and allocated.
Baseline Definitions
Independent Generation (IndependentOffspringStrategy). At each generation , offspring reward functions are generated independently from the environment-description prompt, , without parent conditioning, crossover, or Planner directives. Historical duplicate avoidance through and niche-dominance survivor selection remain active, but offspring have no lineage-based dependence on previous generations.
Direct Mutation (DirectMutationOffspringStrategy). Surviving individuals in are selected in round-robin order and passed directly to with a generic variation prompt. This preserves lineage-based reward inheritance and incremental mutation while removing population-level planning through and structured adaptation based on Specialist Quality or Behavioral Diversity.
Habitats (HabitatsOffspringStrategy). Habitats uses the complete two-stage architecture. The Offspring Planner inspects the normalized cross-fitness matrix and the population-health report (, ). It then produces structured breeding plans specifying parent selections, crossover targets, and mutation directives, which are executed by .
For both baselines, the number of offspring slots is set to , allocating one offspring slot per survivor. Thus, before accounting for offspring slots discarded after failed validation, the target next-generation population size is . For Habitats, is determined dynamically by the planner.
Budget-Matching Protocol
We exactly match per-policy training and per-pair evaluation budgets, while total language-model inference and policy-training costs may vary with the resulting offspring and population sizes.
Language-model inference allocation. For offspring slots, each method uses between and Mutator calls because every slot permits one initial generation attempt and up to three replacement attempts. Habitats additionally uses one Planner call per generation, whereas Independent Generation and Direct Mutation use no Planner calls.
Policy-training and evaluation budgets. Every newly generated policy receives the same environment-interaction budget within a given environment. For a population of size , cross-fitness evaluation requires policy–reward evaluations per generation. Each policy is evaluated under each reward using the same number of rollouts and the same episode horizon across all methods. The evaluation horizon is for the Cardan Sandbox and for the MuJoCo environments.
Because population size evolves endogenously, the total number of environment interactions and the total number of cross-fitness rollouts are not constrained to be identical across methods.
Invalid candidates. Every candidate reward generated by undergoes Python abstract-syntax-tree parsing and sandboxed execution before policy training. Each offspring slot permits one initial generation attempt and up to three replacement attempts. If all four candidates are invalid, the offspring slot is discarded. The same validation and replacement protocol is used for all methods.
Full Results Tables
Tables 3 and 4 report the complete numerical results underlying Figure 2. All entries are reported as mean standard deviation across three seeds. Within each environment and metric, the highest mean is shown in bold. Mean SQ and mean BD are averaged over the evaluated generations, whereas final SQ, final BD, and final GC are computed on the final evaluated population . is the sum of per-generation grounded coverage over the evolutionary trajectory. We additionally report equal-weight macro-averages across environments for SQ and BD. We do not aggregate GC across environments because its scale depends on the number of evaluated generations and population size, both of which vary across environments.
Downstream Adaptation Evaluation
Downstream Tasks
We evaluate whether evolved policy libraries support downstream learning in the Card Sandbox. The ten downstream task specifications were fixed before evolution and were never explicitly provided through the evolution prompts, policy-training objectives, or survivor-selection procedure. All tasks use the same environment dynamics and primitive action interface while defining distinct downstream reward functions.
| Task | Objective |
| Ascending Sort | Play cards in non-decreasing order. |
| Descending Sort | Play cards in non-increasing order. |
| Triplet Matching | Construct groups of three cards with matching values. |
| Target Sum | Select cards whose cumulative value reaches a specified target. |
| High-Card Maximization | Maximize the cumulative value of the cards played. |
| Low-Card Minimization | Preferentially play cards with the smallest available values. |
| Even–Odd Pattern | Produce sequences that alternate between even- and odd-valued cards. |
| Sandwich Pair | Construct patterns of the form ––. |
| Rapid Clear Discard | Empty the hand as quickly as possible. |
| Full-House Triple–Pair | Construct a combination containing one matching triplet and one matching pair. |
Table 5. Downstream Card Sandbox tasks used to evaluate adaptation with evolved policy libraries.
Policy Libraries and Downstream Agents
For each evolutionary method and seed, we construct a fixed library by uniformly sampling 15 policies without replacement from the final survivor population. This size-matches the Habitats, Direct Mutation, and Independent Generation libraries. Selection is performed without reference to downstream performance. These policies remain frozen throughout downstream training. A hierarchical meta-policy observes the environment state and selects one library policy at each step; the selected policy then produces the primitive environment action.
We compare this architecture with a tabular Q-learning policy, which we call Scratch, trained directly on each downstream reward using the same learning algorithm and optimization hyperparameters as the Card Sandbox policies. Meta-policies over each evolved library are trained using downstream budgets episodes, while Scratch is trained for episodes. All library conditions use the same meta-policy architecture, exploration-schedule construction, evaluation protocol, and matched random seeds.
This comparison measures adaptation efficiency conditional on an already evolved policy library; it does not compare total computation, including the cost of evolving that library.
Evaluation Protocol and Win Rate
We evaluate meta-policies over the Habitats, Direct Mutation, and Independent Generation libraries, together with the matched Scratch agent, on all ten downstream tasks using three matched seeds. For each method and seed, a separate meta-policy is trained at each downstream budget and compared with the Scratch policy trained for 20,000 episodes. Per-task performance is measured by mean return over 50 evaluation episodes.
Because reward scales differ across tasks, we aggregate performance using paired win rate rather than averaging raw returns. For library source , evolution seed , and training budget , let , , and denote the numbers of tasks on which the corresponding meta-policy respectively outperforms, ties, or underperforms the matched Scratch policy trained for 20,000 episodes. A tie is recorded when their paired mean returns are equal. We define
Thus, WR = 0.5 represents parity with Scratch. We compute win rate independently for each method, seed, and budget and report its mean and standard deviation across the three seeds.
Complete Downstream Results
Tables 6–8 report complete per-task returns for meta-policies trained over each evolved library. Because reward scales and success criteria differ across tasks, raw returns should be compared only within each row. At 5,000 episodes, Habitats and Direct Mutation approach parity with Scratch, achieving paired win rates of and , respectively. At 10,000 episodes, Habitats reaches , compared with for Direct Mutation and for Independent Generation. Habitats at 10,000 episodes also exceeds both baseline libraries after 20,000 episodes, demonstrating more sample-efficient downstream reuse.
| Downstream task | Habitats meta-policy | Scratch | ||||
| 1k | 2k | 5k | 10k | 20k | 20k | |
| Ascending Sort | ||||||
| Descending Sort | ||||||
| Triplet Matching | ||||||
| Target Sum | ||||||
| High-Card Maximization | ||||||
| Low-Card Minimization | ||||||
| Even–Odd Pattern | ||||||
| Sandwich Pair | ||||||
| Rapid Clear Discard | ||||||
| Full-House Triple–Pair | ||||||
| Win rate vs. Scratch 20k | – |
Table 6. Complete downstream-adaptation results for the Habitats library. Meta-policy columns vary the downstream training budget, while Scratch is trained for 20,000 episodes. Entries report mean return standard deviation across three matched seeds. Within each task, the highest mean is shown in bold. The final row reports paired win rate against Scratch, computed independently within each seed using Eq. (22).
| Downstream task | Direct Mutation meta-policy | Scratch | ||||
| 1k | 2k | 5k | 10k | 20k | 20k | |
| Ascending Sort | ||||||
| Descending Sort | ||||||
| Triplet Matching | ||||||
| Target Sum | ||||||
| High-Card Maximization | ||||||
| Low-Card Minimization | ||||||
| Even–Odd Pattern | ||||||
| Sandwich Pair | ||||||
| Rapid Clear Discard | ||||||
| Full-House Triple–Pair | ||||||
| Win rate vs. Scratch 20k | – |
Table 7. Complete downstream-adaptation results for the Direct Mutation library. Meta-policy columns vary the downstream training budget, while Scratch is trained for 20,000 episodes. Entries report mean return standard deviation across three matched seeds. Within each task, the highest mean is shown in bold. The final row reports paired win rate against Scratch.
| Downstream task | Independent Generation meta-policy | Scratch | ||||
| 1k | 2k | 5k | 10k | 20k | 20k | |
| Ascending Sort | ||||||
| Descending Sort | ||||||
| Triplet Matching | ||||||
| Target Sum | ||||||
| High-Card Maximization | ||||||
| Low-Card Minimization | ||||||
| Even–Odd Pattern | ||||||
| Sandwich Pair | ||||||
| Rapid Clear Discard | ||||||
| Full-House Triple–Pair | ||||||
| Win rate vs. Scratch 20k | – |
Table 8. Complete downstream-adaptation results for the Independent Generation library. Meta-policy columns vary the downstream training budget, while Scratch is trained for 20,000 episodes. Entries report mean return ± standard deviation across three matched seeds. Within each task, the highest mean is shown in bold. The final row reports paired win rate against Scratch.
Qualitative Examples
The aggregate metrics characterize whether Habitats produces high-quality, behaviorally distinct, and grounded populations, but they do not convey what the discovered objectives actually require. We therefore inspect representative reward programs, induced policy specializations, and niche-replacement events from the evolutionary traces. These examples were selected from the evaluated runs and were not generated retrospectively.
Discrete Card Sandbox
We inspect representative reward programs and induced behaviors from three independent Habitats runs in the Card Sandbox. Let denote the values occupying the three table positions and let denote the card currently held by the agent. The conditions below summarize the principal objective implemented by each reward program; the executable rewards may also contain intermediate shaping terms that facilitate learning.
Breadth of discovered objectives. Despite operating within the same compact environment, the generated rewards elicited markedly different ways of manipulating the cards. Some objectives were based on ordering relations. For example, The Sorting Table rewarded the strictly increasing arrangement , while The Peak Pattern instead required the non-monotonic configuration . Other objectives emphasized arithmetic structure. The Summation Table required , whereas The Table Product coupled the held card to the table through . The Magic Fifteen introduced a global constraint over the complete active configuration, .
Habitats also discovered objectives based on repetition and symmetry. The Perfect Triplet required three cards of the same value, while The Symmetric Sandwich required matching outer cards surrounding a different center, . Although both objectives use the same cards and primitive actions, they demand different forms of coordination: one policy must collect repeated values, whereas the other must preserve both equality and position.
Other rewards relied on number-theoretic properties absent from the simpler ordering and matching objectives. Distinct Even Trio required three pairwise-distinct even cards, while Strict Divisibility Descent required a decreasing sequence satisfying and . The discovered objectives therefore extended beyond variations of sorting and matching to include parity, primality, arithmetic progressions, target sums, products, and modular relations.
Increasing compositionality. Across the evolutionary traces, later objectives frequently combined relations that appeared separately in simpler rewards. The progression from The Sorting Table to The Stepping Stones illustrates this pattern. Whereas the former requires only ascending order, the latter also requires equal spacing, . The Consecutive Run further specializes this structure by fixing the spacing to one: and .
A similar elaboration occurred among sandwich objectives. Starting from the basic symmetry of The Symmetric Sandwich, Habitats generated The High–Low Sandwich, which restricts the outer cards to high values and the center to a low value. Other variants imposed parity or number-class constraints. The High-Odd/Low-Even Sandwich, for example, requires high odd cards in the outer positions and a low even card in the center, whereas The Composite Sandwich restricts the pattern to composite values. The same compositional pattern appeared in The Prime Peak Pattern, which combines the non-monotonic structure of The Peak Pattern with the requirement that every participating card be prime.
These examples show that mutation did more than rename existing objectives or adjust their numerical coefficients. It introduced new relational structure and composed previously useful concepts into increasingly constrained mini-games. The resulting rewards require policies to coordinate several properties simultaneously, including card value, position, parity, and arithmetic relation.
Cross-reward generalization. Cross-evaluation reveals when a policy trained under one generated reward acquires behavior that is also useful under another. Because selection occurs within reward-defined niches, a newly generated individual can replace an incumbent specialist by performing better on the incumbent’s own objective. These replacement events provide qualitative evidence that the induced behaviors are not confined to the rewards under which they were learned.
The clearest example appeared in the first run, where a policy trained on The Composite Arithmetic Solver displaced specialists associated with The Sorting Table, The Stepping Stones, The Divisibility Pair, and The Consecutive Run. The challenger had been trained on an objective combining factor-product and arithmetic-progression structure, yet its resulting behavior transferred across several simpler ordering and arithmetic niches.
This transfer does not imply that the corresponding reward programs are logically equivalent or that one constraint formally contains another. Selection operates on realized policy behavior rather than textual or symbolic similarity between reward functions. Habitats can therefore expose functional relationships that would not necessarily be apparent from the reward names or source code alone.
Comparable niche replacements appeared in the other runs. In the second run, The Composite Solver replaced the Peak Pattern specialist. In the third, Strict Divisibility Descent displaced Ascending Prime Straight, while Distinct Even Trio later displaced Parity Alternator. The continued appearance of such events suggests that cross-niche competition remained active as new objectives and behaviors entered the population.
Takeover and re-diversification. Broadly capable policies can replace several incumbent specialists within a short portion of an evolutionary trace, temporarily narrowing the range of behaviors represented in the surviving population. The first run provides the clearest example. The emergence of The Composite Arithmetic Solver produced a concentrated takeover across multiple existing niches, leaving a smaller collection of broadly successful behaviors.
This contraction did not persist. Subsequent generations introduced objectives including Descending Even Run, Prime Sandwich, Composite Sandwich, Prime Peak Pattern, High-Odd/Low-Even Sandwich, Strict Divisibility Descent, and Distinct Even Trio. These objectives introduced new combinations of direction, magnitude, parity, primality, and divisibility, restoring a broad range of policy specializations after the generalist takeover. The trace therefore exhibits a qualitative cycle of specialization, generalist replacement, population contraction, and renewed diversification.
The second run displayed a similar but later turnover. Its population first accumulated objectives such as Addition Equalizer, Ascending Odd Straight, Parity Sandwich, and Prime Sum. A subsequent takeover replaced several established specialists: The Composite Solver displaced The Peak Pattern, while policies trained on Parity Sandwich and Descending Divisibility Chain both displaced the Perfect Triplet specialist. Later offspring again introduced distinct structural constraints, preventing the takeover from terminating objective discovery altogether.
Stable diversification. The third run followed a different qualitative trajectory. Rather than undergoing a pronounced generalist takeover, it retained a broad mixture of ordering, matching, prime-constrained, parity-based, and divisibility-based objectives throughout evolution. The population nevertheless remained dynamic. The Consecutive Run displaced the Ascending Straight specialist, while policies associated with Three of a Kind, Ascending Prime Straight, and Odd Sandwich each transferred successfully to the Prime Sum niche. Later replacements involving Strict Divisibility Descent and Distinct Even Trio show that continued objective discovery and competitive turnover can also occur without a sharp population bottleneck.
Summary. Taken together, these examples reveal an evolving collection of structurally different objectives rather than variations of a single reward template. Later rewards frequently combine relations introduced separately by earlier objectives, producing increasingly compositional policy specializations. Cross-evaluation also creates meaningful population-level competition: new policies can replace incumbent specialists on the incumbents’ own rewards, sometimes producing temporary takeovers followed by the emergence of new niches. The resulting population is therefore better understood as an evolving ecology of objectives and behaviors than as a collection of independently generated reward programs.
Continuous Cart-Pole
Cart-Pole generated multiple different individuals that learned to master their own niches.
Breadth of discovered objectives. The Smooth Omnidirectional Spinner required the agent to maintain rapid, continuous pole rotation in either the clockwise or counter-clockwise direction. The reward program incentivized the absolute value of the pole’s angular velocity, making the direction of spin irrelevant and rewarding only sustained rotational speed. Rather than imposing a hard positional constraint or early termination when the cart drifted, the reward employed a smooth Gaussian-style centering term that provided a stable, non-zero gradient across the entire track length.
The Quiet Centered Balancer, derived from The Smooth Omnidirectional Spinner, required the agent to maintain a motionless, vertically upright pole at the center of the track. The reward maximized the cosine of the pole angle (peaking when the pole points straight up) while uniformly penalizing angular velocity to suppress oscillations. It inherited the smooth Gaussian centering term from The Smooth Omnidirectional Spinner, but replaced the spin incentive with a stillness objective. The resulting policy swung the pole upward through smooth, controlled adjustments and then held it in a quiet equilibrium, producing a fundamentally different motor strategy from the continuous-rotation policy despite sharing the same centering mechanism.
The Downward Stroller required the agent to keep the pole hanging straight down (the minimum-energy equilibrium) while maintaining a steady cruising speed along the track. The reward combined a downward-orientation measure that peaked when the pole pointed vertically downward, a Gaussian velocity reward centered on a moderate target speed, and a soft boundary penalty that increased smoothly as the cart approached the track edges. This individual represents an independent line of discovery that inverts the conventional understanding of the environment. Standard Cart-Pole objectives treat the downward-hanging configuration as a failure state; this reward treats it as the goal. By coupling the inverted orientation target with a constant-velocity objective and soft boundary awareness, the reward constructs a mini-task that exercises control capabilities (smooth velocity regulation, gentle reversal, boundary avoidance) entirely absent from both the spinning and balancing policies.
Increasing compositionality. The lineage from The Smooth Omnidirectional Spinner to The Quiet Centered Balancer provides a clear example of compositional inheritance within the evolutionary trace. The Spinner introduced two innovations relative to earlier reward programs: direction-agnostic rotation reward via the absolute angular velocity, and smooth Gaussian centering in place of hard positional constraints. The Balancer retained the centering mechanism but replaced the rotation objective with an orientation-and-stillness objective. This selective recombination mirrors the compositional elaboration observed in the Card Sandbox, where later rewards combined relations introduced separately by earlier objectives.
Physical contrast and skill grounding. The three objectives partition the environment’s state space into non-overlapping behavioral regimes. The Spinner maximizes angular velocity and is indifferent to pole orientation; the Balancer minimizes angular velocity and targets the upward equilibrium; the Stroller minimizes angular velocity but targets the downward equilibrium while simultaneously regulating translational speed. Each policy must coordinate cart motion with pole dynamics, but the nature of that coordination differs: the Spinner uses the cart to sustain rotational momentum, the Balancer uses it to damp perturbations around an unstable fixed point, and the Stroller uses it to cruise at constant speed without disturbing a stable fixed point. These three strategies collectively demonstrate that Habitats can discover objectives spanning different dynamical regimes from a single environment.
Continuous Cheetah
Breadth of discovered objectives. The generated rewards induced locomotion modes that differ not only in speed but in the fundamental physical strategy employed by the agent. The Commando Crawl required the agent to slide and drag itself forward as rapidly as possible while keeping its torso strictly below a low elevation threshold and maintaining a perfectly flat body orientation. The reward program achieved this through a combination of forward-speed incentive, a steep quadratic penalty on torso elevation above the threshold, and an orientation penalty that suppressed tumbling or flipping during the crawl. A small action-magnitude regularizer discouraged high-frequency joint vibrations, yielding a smooth, belly-down dragging gait that is qualitatively unlike any standard running policy. In contrast, The Trampoline Jumper required the agent to launch itself vertically as high as possible while remaining perfectly stationary in the horizontal direction and maintaining a stable, upright posture. This reward combined an upward-velocity incentive with a bonus for achieving elevation above the baseline standing height, a heavy penalty on any horizontal displacement, orientation and angular-velocity penalties to keep the torso flat during flight, and a control-effort regularizer for smooth coordination. The resulting policy produced repeated vertical hops with negligible lateral drift, a locomotion mode that shares no kinematic features with the crawling specialist.
Locomotion relevance and skill grounding. These two objectives illustrate how Habitats can decompose the latent capability space of a single morphology into complementary skills. Crawling and jumping are both physically meaningful locomotion primitives: one minimizes the body’s vertical profile while maximizing ground contact, and the other maximizes vertical impulse while suppressing horizontal motion. Neither objective was specified by the experimenter; both emerged from the evolutionary process operating over the same action space and dynamics.
The diversity of the discovered rewards is particularly notable because the Cheetah morphology is often regarded as a “running” environment. Habitats demonstrates that the body can be repurposed for fundamentally different types of movement when the objective function is varied.
Continuous Hopper
Breadth of discovered objectives. The Gazelle required the agent to execute explosive, long-distance forward bounds by coupling forward speed with vertical elevation. The reward program terminated episodes when the torso dropped below a minimum height, preventing dragging or collapse. Through a combination of uprightness multipliers, decay factors, and vertical bonuses, the policy learned to convert vertical thrust into long parabolic arcs rather than low, shuffling hops.
The Giant Strider instead targeted high forward velocity while imposing a substantial penalty on joint velocities. This discouraged rapid, high-frequency actuation and forced the policy to produce speed through long, controlled strides. The resulting behavior covered ground efficiently through broad, sweeping motions rather than the explosive aerial bounds learned by The Gazelle.
The Pogo Stick required the agent to hop as high as possible while remaining stationary and upright. The reward applied a quadratic height bonus above a standing threshold, making dynamic jumping more profitable than merely standing tall. This height reward was gated by an uprightness factor that vanished when the torso tilted beyond a moderate angular threshold, while a horizontal-speed penalty suppressed lateral drift.
Contrasting physical strategies. The three objectives divide the Hopper’s dynamics along complementary axes. The Gazelle combines vertical thrust with forward movement to produce explosive bounds. The Giant Strider pursues forward speed under a joint-velocity constraint, favoring long and controlled ground-covering motions. The Pogo Stick treats horizontal displacement as a liability and redirects the same morphology’s thrust capacity into repeated vertical launches.
These behaviors demonstrate that Habitats can discover several physically distinct strategies from the same embodiment: aerial bounding, efficient striding, and stationary vertical hopping. Their coexistence within one evolutionary population shows that objective evolution can separate locomotion into complementary behavioral primitives without an experimenter-specified skill taxonomy or curriculum.
Evolutionary-Horizon Analysis
To test whether the main results depend on the chosen evolutionary horizons, we extend Card Sandbox from 15 to 30 generations and Cart-Pole, Hopper, and Cheetah from 6 to 10 generations. In order to make sure continuous individuals have enough time to learn their reward, we use the same training configurations as those given by the Brax engine Freeman et al. [ [5] for each specific MuJoCo environments. Those configurations are given in Table 9.
| Hyperparameter | Cartpole | Cheetah | Hopper |
| Policy optimizer | PPO (Brax / JAX) | ||
| Learning rate | |||
| Discount factor | 0.97 | 0.95 | 0.997 |
| Exploration or clipping | PPO clip ratio | ||
| Training budget per new policy | 10,000,000 steps | 50,000,000 steps | 50,000,000 steps |
| Evaluation rollouts | 20 episodes | 20 episodes | 20 episodes |
| Train episode horizon | 1,000 steps | 1,000 steps | 1,000 steps |
| GAE parameter | 0.95 | 0.95 | 0.95 |
| PPO epochs per update | 4 | 10 | 10 |
| Minibatch size | 1,024 | 512 | 512 |
| Number of minibatches | 32 | 32 | 32 |
| Parallel environments | 2,048 | 2,048 | 2,048 |
| Unroll length | 5 | 20 | 64 |
| Entropy coefficient | |||
| Reward scaling | 10.0 | 10.0 | 10.0 |
| Policy / value network | MLP (64, 64), Swish | ||
| Observation normalization | Yes | Yes | Yes |
| Advantage normalization | Yes | Yes | Yes |
Table 9. Policy-training and evaluation hyperparameters for MuJoCo continuous control environments.
Results are reported as mean standard deviation across three seeds.
Figure 4 shows that all three methods reach consistently high SQ before the original 15-generation horizon. Habitats’ BD stabilizes near 0.6 and remains substantially higher throughout the additional generations, finishing at , compared with for Direct Mutation and for Independent Generation.

Figure 4. Extended evolutionary horizon in Card Sandbox. SQ and BD across 30 generations, together with their trajectory means and final-generation values. Shaded regions and error bars indicate standard deviation across three seeds.
Figure 5–Figure 7 show a consistent pattern across the continuous-control environments. SQ enters a stable, high-performing regime by the original 6-generation horizon, while Habitats maintains the highest BD throughout the additional generations. Across all four environments, extending evolution therefore preserves the principal comparison between methods, supporting the original horizons as sufficient for evaluation.

Figure 5. Extended evolutionary horizon in Cart-Pole. SQ and BD across 10 generations, with means and final values.

Figure 7. Extended evolutionary horizon in Cheetah. SQ and BD across 10 generations, with means and final values.

Figure 6. Extended evolutionary horizon in Hopper. SQ and BD across 10 generations, with means and final values.
Language-Model Backbone Ablation
We evaluate the sensitivity of Habitats to the underlying language-model backbone in Card Sandbox. We compare gemini-3.5-flash, gemini-3.8-flash, and gemini-4-argon, using the same backbone for both the Planner and Mutator. All other prompts, evolutionary settings, policy-training budgets, and evaluation procedures are held fixed. Each configuration is evolved for 30 generations, and results are reported as mean standard deviation across three seeds.
Figure 8 and Table 10 show that all three backbones rapidly reach near-perfect SQ and maintain it throughout evolution. The principal difference is behavioral diversity: Gemini 4 Argon achieves 62% higher final BD than Gemini 3.5 Flash and 110% higher final BD than Gemini 3.8 Flash. As shown by the evolutionary trajectories in Figure 8, this advantage emerges early and persists throughout evolution rather than arising from a single final-generation measurement. These results show that Habitats can translate stronger Planner and Mutator capabilities into a substantially broader repertoire of distinct, learnable behaviors.

Figure 8. Language-model backbone ablation in Card Sandbox. Left panels show Specialist Quality (SQ) and Behavioral Diversity (BD) across 30 evolutionary generations; shaded regions indicate standard deviation across three seeds. Right panels report their means across generations and final-generation values. All three backbones achieve near-perfect final SQ, while Gemini 4 Argon maintains substantially greater BD without sacrificing specialist quality.
| Backbone | Mean SQ | Final SQ | Mean BD | Final BD |
| Gemini 3.5 Flash | 0.9494 0.0002 | 0.9979 0.0007 | 0.4929 0.0801 | 0.4899 0.0888 |
| Gemini 3.8 Flash | 0.9577 0.0026 | 0.9996 0.0006 | 0.4294 0.0729 | 0.3788 0.1127 |
| Gemini 4 Argon | 0.9586 0.0020 | 0.9995 0.0007 | 0.7569 0.0368 | 0.7959 0.0577 |
Table 10. Complete language-model backbone ablation results. Mean SQ and BD are averaged over the evolutionary trajectory, while final SQ and BD are computed on the final population. Entries report mean standard deviation across three seeds. The highest mean in each column is shown in bold.
References
- [1]Dario Amodei, Chris Olah, Jacob Steinhardt, Paul F. Christiano, John Schulman, and Dan Mané. Concrete problems in AI safety. CoRR, abs/1606.06565, 2016. URL http://arxiv.org/abs/1606.06565.
- [2]André Barreto, Diana Borsa, Shaobo Hou, Gheorghe Comanici, Eser Aygün, Philippe Hamel, Daniel Toyama, Jonathan J. Hunt, Shibl Mourad, David Silver, and Doina Precup. The option keyboard: Combining skills in reinforcement learning. In Advances in Neural Information Processing Systems, volume 32, pages 13031–13041, 2019.arxiv.org/abs/2106.13105
- [3]Paul F. Christiano, Jan Leike, Tom B. Brown, Miljan Martic, Shane Legg, and Dario Amodei. Deep reinforcement learning from human preferences. In Proceedings of the 31st International Conference on Neural Information Processing Systems, NIPS’17, page 4302–4310, Red Hook, NY, USA, 2017. Curran Associates Inc. ISBN 9781510860964.arxiv.org/abs/1706.03741
- [4]Sevan G. Ficici and Jordan B. Pollack. Challenges in coevolutionary learning: Arms-race dynamics, open-endedness, and mediocre stable states. In Artificial Life VI, pages 238–247. MIT Press, 1998.
- [5]C. Daniel Freeman, Erik Frey, Anton Raichuk, Sertan Girgin, Igor Mordatch, and Olivier Bachem. Brax – a differentiable physics engine for large scale rigid body simulation, 2021. URL https://arxiv.org/abs/2106.13281.
- [6]Leo Gao, John Schulman, and Jacob Hilton. Scaling laws for reward model overoptimization. In Proceedings of the 40th International Conference on Machine Learning, ICML’23. JMLR.org, 2023.arxiv.org/abs/2210.10760
- [7]Matthew W. Hoffman, Bobak Shahriari, John Aslanides, Gabriel Barth-Maron, Nikola Momchev, Danila Sinopalnikov, Piotr Stańczyk, Sabela Ramos, Anton Raichuk, Damien Vincent, Léonard Hussenot, Robert Dadashi, Gabriel Dulac-Arnold, Manu Orsini, Alexis Jacq, Johan Ferret, Nino Vieillard, Seyed Kamar Seyed Ghasemipour, Sertan Girgin, Olivier Pietquin, Feryal Behbahanian, Tamara Norman, Abbas Abdolmaleki, Albin Cassirer, Fan Yang, Kate Baumli, Sarah Henderson, Abe Friesen, Ruba Haroun, Alex Novikov, Sergio Gómez Colmenarejo, Serkan Cabi, Caglar Gulcehre, Tom Le Paine, Srivatsan Srinivasan, Andrew Cowie, Ziyu Wang, Bilal Piot, and Nando de Freitas. Acme: A research framework for distributed reinforcement learning. arXiv preprint arXiv:2006.00979, 2020. URL https://arxiv.org/abs/2006.00979.
- [8]Shengran Hu, Cong Lu, and Jeff Clune. Automated design of agentic systems. In The Thirteenth International Conference on Learning Representations, 2025. URL https://openreview.net/forum?id=t9U3LW7JVX.arxiv.org/abs/2408.08435
- [11]Joel Lehman, Jonathan Gordon, Shawn Jain, Kamal Ndousse, Cathy Yeh, and Kenneth O. Stanley. Evolution through large models. In Wolfgang Banzhaf, Penousal Machado, and Mengjie Zhang, editors, Handbook of Evolutionary Machine Learning, pages 331–366. Springer Nature Singapore, Singapore, 2024. ISBN 978-981-99-3814-8. doi: 10.1007/978-981-99-3814-8_11. URL https://doi.org/10.1007/978-981-99-3814-8_11.
- [12]Yecheng Jason Ma, William Liang, Guanzhi Wang, De-An Huang, Osbert Bastani, Dinesh Jayaraman, Yuke Zhu, Linxi Fan, and Anima Anandkumar. Eureka: Human-level reward design via coding large language models. In The Twelfth International Conference on Learning Representations, 2024. URL https://openreview.net/forum?id=1EdurRU055F.arxiv.org/abs/2310.12931
- [13]Jean-Baptiste Mouret and Jeff Clune. Illuminating search spaces by mapping elites, 2015. URL https://arxiv.org/abs/1504.04909.
- [14]Andrew Y. Ng, Daishi Harada, and Stuart J. Russell. Policy invariance under reward transformations: Theory and application to reward shaping. In Proceedings of the Sixteenth International Conference on Machine Learning, ICML ’99, page 278–287, San Francisco, CA, USA, 1999. Morgan Kaufmann Publishers Inc. ISBN 1558606122.
- [15]Alexander Novikov, Ngân Vũ, Marvin Eisenberger, Emilien Dupont, Po-Sen Huang, Adam Zsolt Wagner, Sergey Shirobokov, Borislav Kozlovskii, Francisco J. R. Ruiz, Abbas Mehrabian, M. Pawan Kumar, Abigail See, Swarat Chaudhuri, George Holland, Alex Davies, Sebastian Nowozin, Pushmeet Kohli, and Matej Balog. AlphaEvolve: A coding agent for scientific and algorithmic discovery, 2025. URL https://arxiv.org/abs/2506.13131.
- [16]Long Ouyang, Jeff Wu, Xu Jiang, Diogo Almeida, Carroll L. Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, John Schulman, Jacob Hilton, Fraser Kelton, Luke Miller, Maddie Simens, Amanda Askell, Peter Welinder, Paul Christiano, Jan Leike, and Ryan Lowe. Training language models to follow instructions with human feedback. In Proceedings of the 36th International Conference on Neural Information Processing Systems, NIPS ’22, Red Hook, NY, USA, 2022. Curran Associates Inc. ISBN 9781713871088.arxiv.org/abs/2203.02155
- [17]Justin K. Pugh, Lisa B. Soros, and Kenneth O. Stanley. Quality diversity: A new frontier for evolutionary computation. Frontiers in Robotics and AI, Volume 3 - 2016, 2016. doi: 10.3389/frobt.2016.00040. URL https://www.frontiersin.org/journals/robotics-and-ai/articles/10.3389/frobt.2016.00040.DOI
- [18]Bernardino Romera-Paredes, Mohammadamin Barekatain, Alexander Novikov, Matej Balog, M. Pawan Kumar, Emilien Dupont, Francisco J. R. Ruiz, Jordan S. Ellenberg, Pengming Wang, Omar Fawzi, Pushmeet Kohli, and Alhussein Fawzi. Mathematical discoveries from program search with large language models. Nature, 625(7995):468–475, 2024. doi: 10.1038/s41586-023-06924-6. URL https://doi.org/10.1038/s41586-023-06924-6.
- [19]Christopher D. Rosin and Richard K. Belew. New methods for competitive coevolution. Evol. Comput., 5(1):1–29, March 1997. ISSN 1063-6560. doi: 10.1162/evco.1997.5.1.1. URL https://doi.org/10.1162/evco.1997.5.1.1.
- [20]John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms, 2017. URL https://arxiv.org/abs/1707.06347.
- [21]David Silver, Satinder Singh, Doina Precup, and Richard S. Sutton. Reward is enough. Artificial Intelligence, 299:103535, 2021. ISSN 0004-3702. doi: https://doi.org/10.1016/j.artint.2021.103535. URL https://www.sciencedirect.com/science/article/pii/S0004370221000862.
- [22]Richard S. Sutton and Andrew G. Barto. Reinforcement Learning: An Introduction. Adaptive Computation and Machine Learning series. The MIT Press, Cambridge, MA, 2nd edition, 2018. ISBN 9780262039246.
- [23]Yuval Tassa, Yotam Doron, Alistair Muldal, Tom Erez, Yazhe Li, Diego de Las Casas, David Budden, Abbas Abdolmaleki, Josh Merel, Andrew Lefrancq, Timothy Lillicrap, and Martin Riedmiller. Deepmind control suite, 2018. URL https://arxiv.org/abs/1801.00690.
- [24]Rui Wang, Joel Lehman, Jeff Clune, and Kenneth O. Stanley. Poet: open-ended coevolution of environments and their optimized solutions. In Proceedings of the Genetic and Evolutionary Computation Conference, GECCO ’19, page 142–151, New York, NY, USA, 2019. Association for Computing Machinery. ISBN 9781450361118. doi: 10.1145/3321707.3321799. URL https://doi.org/10.1145/3321707.3321799.
