betaFeedback

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 t∈{1,…,T}t \in\{1,\ldots,T\}. At each generation t<Tt<T, 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 Pt+1P_{t+1}. Algorithm 1 provides the complete procedure.

Figure 1. Habitats evolutionary lifecycle. At generation tt, the population Pt\mathcal{P}_t 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 Ft\mathbf{F}_t. (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 Vt\mathcal{V}_t. (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 Pt+1=Vt∪Ot\mathcal{P}_{t+1} = \mathcal{V}_t \cup\mathcal{O}_t; 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 tt, Habitats maintains a population Pt={I1,…,INt}P_t=\{I_1,\ldots,I_{N_t}\} of NtN_t individuals. Each individual pairs an executable reward function with the policy trained against it: Ii=(Ri,πi)I_i=(R_i,\pi_i). Here, RiR_i defines the objective and πi(a∣s)\pi_i(a\mid s) 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

Ri:(s,a,s′,info)⟶R,(1)R_i:(s,a,s',\mathrm{info})\longrightarrow\mathbb{R}, \tag*{(1)}

where s,s′∈Ss,s'\in\mathcal{S} are the pre- and post-transition states, a∈Aa\in\mathcal{A} 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 T(s′∣s,a)\mathcal{T}(s'\mid s,a) remain fixed throughout evolution; only RiR_i evolves, and it governs the training of πi\pi_i. 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 Nt×NtN_t\times N_t cross-fitness matrix Ft∈RNt×Nt\mathbf{F}_t\in\mathbb{R}^{N_t\times N_t}:

Ft[i,j]=Eval⁡(πi,Rj),(2)\mathbf{F}_t[i,j]=\operatorname{Eval}(\pi_i,R_j), \tag*{(2)}

where Ft[i,j]\mathbf{F}_t[i,j] is the performance of policy πi\pi_i at generation tt, trained against reward RiR_i, when evaluated under reward RjR_j. The diagonal Ft[i,i]\mathbf{F}_t[i,i] measures self-mastery: how well a policy satisfies the objective against which it was trained. The off-diagonal entries Ft[i,j]\mathbf{F}_t[i,j], i≠ji\ne j, 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 Ft\mathbf{F}_t is rescaled to [0,1][0,1], mapping its population minimum and maximum to 0 and 1. We denote the resulting matrix by F~t\widetilde{\mathbf{F}}_t. 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 Ft[rand,i]\mathbf{F}_t[\mathrm{rand}, i] denote the fitness of a random policy under reward RiR_i. An individual IiI_i 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:

Survivor⁡t(Ii)=1(Ft[i,i]=max⁡kFt[k,i] and Ft[i,i]>Ft[rand,i]).(3)\operatorname{Survivor}_t(I_i) = \mathbf{1}\left(\mathbf{F}_t[i,i] = \max_k \mathbf{F}_t[k,i]\ \text{and}\ \mathbf{F}_t[i,i] > \mathbf{F}_t[\mathrm{rand},i]\right). \tag*{(3)}

Because policy training is finite-budget, diagonal dominance is not automatic: a policy trained on another reward may transfer better to RiR_i. The criterion therefore retains rewards that are learnable within the fixed budget and induce their strongest population policy. The surviving individuals form the set Vt⊆Pt\mathcal{V}_t \subseteq\mathcal{P}_t.

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 F~t\widetilde{\mathbf{F}}_t.

Specialist Quality (SQ) measures the average proficiency of policies on their own synthesized reward niches:

SQt=1∣Pt∣∑i=1NtF~t[i,i].(4)\mathrm{SQ}_t = \frac{1}{|\mathcal{P}_t|}\sum_{i=1}^{N_t}\widetilde{\mathbf{F}}_t[i,i]. \tag*{(4)}

Behavioral Diversity (BD) measures the functional distinctness of the policies in the population. Let ft[i]=F~t[i,:]\mathbf{f}_t[i] = \widetilde{\mathbf{F}}_t[i,:] denote the normalized cross-fitness profile of policy πi\pi_i at generation tt. Before computing BD, zero-norm profiles are excluded and the remaining profiles are reindexed; let NtBDN_t^{\mathrm{BD}} 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:

BDt=2NtBD(NtBD−1)∑1≤i<j≤NtBD(1−ft[i]⋅ft[j]∥ft[i]∥2∥ft[j]∥2+ϵ).(5)\mathrm{BD}_t = \frac{2}{N_t^{\mathrm{BD}}\left(N_t^{\mathrm{BD}}-1\right)} \sum_{1\leq i<j\leq N_t^{\mathrm{BD}}}\left(1-\frac{\mathbf{f}_t[i]\cdot\mathbf{f}_t[j]}{\lVert\mathbf{f}_t[i]\rVert_2\lVert\mathbf{f}_t[j]\rVert_2+\epsilon}\right). \tag*{(5)}

If NtBD<2N_t^{\mathrm{BD}} < 2, we define BDt=0\mathrm{BD}_t = 0. Here, ϵ>0\epsilon> 0 provides numerical stability. High BDt\mathrm{BD}_t 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 (Mplan\mathcal{M}_{\mathrm{plan}}). The Planner inspects the current survivors Vt\mathcal{V}_t, the normalized cross-fitness matrix F~t\tilde{\mathbf{F}}_t, and the population quality-diversity metrics (SQt,BDt)(\mathrm{SQ}_t, \mathrm{BD}_t). It determines the number of offspring KtK_t and, for each offspring slot k∈{1,…,Kt}k \in\{1,\ldots,K_t\}, selects a parent set Pk⊆VtP_k \subseteq\mathcal{V}_t, with 0≤∣Pk∣≤30 \leq|P_k| \leq3, and produces a natural-language mutation directive hkh_k:

(Pk,hk)=Mplan(Vt,F~t,SQt,BDt).(6)(P_k,h_k) = \mathcal{M}_{\mathrm{plan}}\left(\mathcal{V}_t,\tilde{\mathbf{F}}_t,\mathrm{SQ}_t,\mathrm{BD}_t\right). \tag*{(6)}

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 (Mmutate\mathcal{M}_{\mathrm{mutate}}). For each offspring slot kk, the Mutator receives the environment interface description EdescE_{\mathrm{desc}}, the reward functions associated with the selected parent set PkP_k, and the Planner directive hkh_k. It synthesizes a candidate reward function

Rchild(k)=Mmutate(Edesc,{Rp:Ip∈Pk},hk).(7)R_{\mathrm{child}}^{(k)} = \mathcal{M}_{\mathrm{mutate}}\left(E_{\mathrm{desc}},\{R_p : I_p \in P_k\},h_k\right). \tag*{(7)}

Each valid child reward is paired with a newly initialized policy trained against it, forming an offspring individual Ichild(k)=(Rchild(k),πchild(k))I_{\mathrm{child}}^{(k)} = (R_{\mathrm{child}}^{(k)},\pi_{\mathrm{child}}^{(k)}). We denote the set of valid individuals produced across the KtK_t offspring slots by Ot\mathcal{O}_t. The next population is then Pt+1=Vt∪Ot\mathcal{P}_{t+1} = \mathcal{V}_t \cup\mathcal{O}_t.

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 Ot\mathcal{O}_t.

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 Ninit=3N_{\mathrm{init}} = 3 reward–policy pairs and proceeds for T=15T = 15 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 Ninit=4N_{\mathrm{init}} = 4 reward–policy pairs and proceeds for T=6T = 6 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 PTP_T, 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 PTP_T, 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

Li=Ft[i,i]−μirandσirand+ϵ>λ,λ=0.5.L_i = \frac{F_t[i,i] - \mu_i^{\mathrm{rand}}}{\sigma_i^{\mathrm{rand}} + \epsilon} > \lambda, \qquad\lambda= 0.5.

Among grounded policies, normalized cross-fitness profiles are rounded to one decimal place and deduplicated within each generation; their number defines GCtGC_t. We report final-generation coverage and GCAUC=∑t=1TGCtGC_{\mathrm{AUC}} = \sum_{t=1}^{T} GC_t.

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.

Population quality, diversity, grounded coverage, and downstream adaptation

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.

EnvironmentMethodMean SQFinal SQMean BDFinal BD
Card SandboxIndependent Generation0.9558 ±\pm 0.01460.9294 ±\pm 0.09980.4725 ±\pm 0.07540.3815 ±\pm 0.1800
Direct Mutation0.9919 ±\pm 0.00070.9907 ±\pm 0.01310.4259 ±\pm 0.22180.3906 ±\pm 0.2662
Habitats0.9683 ±\pm 0.02270.9539 ±\pm 0.02770.6710 ±\pm 0.02890.6676 ±\pm 0.2036
Cart-PoleIndependent Generation0.3591 ±\pm 0.16130.2988 ±\pm 0.22520.1971 ±\pm 0.17130.1672 ±\pm 0.1631
Direct Mutation0.5152 ±\pm 0.13240.4085 ±\pm 0.10940.3163 ±\pm 0.18960.2882 ±\pm 0.1871
Habitats0.4162 ±\pm 0.13090.6615 ±\pm 0.35640.2987 ±\pm 0.14090.4456 ±\pm 0.0165
HopperIndependent Generation0.7585 ±\pm 0.13940.8000 ±\pm 0.20000.0384 ±\pm 0.03330.0373 ±\pm 0.0365
Direct Mutation0.9462 ±\pm 0.09321.0000 ±\pm 0.0000.0281 ±\pm 0.00720.0409 ±\pm 0.0023
Habitats0.8163 ±\pm 0.16240.8537 ±\pm 0.20250.2139 ±\pm 0.14640.1981 ±\pm 0.1172
CheetahIndependent Generation0.8867 ±\pm 0.00750.9602 ±\pm 0.01650.0516 ±\pm 0.00880.0349 ±\pm 0.0099
Direct Mutation0.9102 ±\pm 0.02030.8896 ±\pm 0.09570.0879 ±\pm 0.05740.1521 ±\pm 0.0573
Habitats0.9140 ±\pm 0.01130.9442 ±\pm 0.06900.1585 ±\pm 0.06980.2186 ±\pm 0.0602
Macro-averageIndependent Generation0.74000.74710.18990.1552
Direct Mutation0.84090.82220.21460.2180
Habitats0.77870.85330.33550.3825

Table 3. Complete Specialist Quality (SQ) and Behavioral Diversity (BD) results.

EnvironmentMethodGCAUCGC_{\mathrm{AUC}}Final GC
Card SandboxIndependent Generation211.33 ±\pm 36.5623.67 ±\pm 5.31
Direct Mutation244.33 ±\pm 38.6423.33 ±\pm 6.60
Habitats322.67 ±\pm 37.8926.00 ±\pm 2.83
Cart-PoleIndependent Generation7 ±\pm 51 ±\pm 1
Direct Mutation16 ±\pm 102 ±\pm 1
Habitats6 ±\pm 62 ±\pm 2
HopperIndependent Generation7 ±\pm 21 ±\pm 1
Direct Mutation2 ±\pm 40 ±\pm 1
Habitats16 ±\pm 143 ±\pm 3
CheetahIndependent Generation18 ±\pm 14 ±\pm 2
Direct Mutation21 ±\pm 74 ±\pm 2
Habitats29 ±\pm 37 ±\pm 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 GCAUCGC_{\mathrm{AUC}} 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 ±\pm 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 ±\pm 0.058, surpassing parity using half the training budget. Under the same protocol with size-matched libraries, this exceeds Direct Mutation (0.533 ±\pm 0.029) and Independent Generation (0.467 ±\pm 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.

Evolved backward locomotion

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 0.7959±0.05770.7959 \pm0.0577: 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 P1\mathcal{P}_1, number of evaluated generations TT, environment description EdescE_{\mathrm{desc}}, grounding threshold λ\lambda, and numerical regularizer ϵ>0\epsilon> 0.

Ensure: Final evaluated population PT\mathcal{P}_T, final survivor set VT\mathcal{V}_T, per-generation metrics, and evolutionary traces.

  1. for t=1,…,Tt = 1, \ldots, T do

  2. Train each newly initialized policy in Pt\mathcal{P}_t against its corresponding reward; keep inherited survivor policies fixed.

  3. Evaluate every policy against every population reward to construct FtF_t.

  4. Evaluate the random-policy baseline under every population reward.

  5. Independently normalize each column of FtF_t to obtain F~t\widetilde{F}_t.

  6. Compute SQt\mathrm{SQ}_t, BDt\mathrm{BD}_t, the grounded set Gt\mathcal{G}_t, and GCt\mathrm{GC}_t.

  7. Select the survivor set Vt\mathcal{V}_t using niche dominance and the random-policy baseline.

  8. if t<Tt < T then

  9. The Planner selects KtK_t and produces parent–directive pairs {(Pk,hk)}k=1Kt\{(\mathcal{P}_k, h_k)\}_{k=1}^{K_t}.

  10. Initialize the valid offspring set Ot←∅\mathcal{O}_t \gets\varnothing.

  11. for k=1,…,Ktk = 1, \ldots, K_t do

  12. Initialize the attempt counter ak←0a_k \gets0 and validity flag vk←falsev_k \gets\mathrm{false}.

  13. while ak<4∧vk=falsea_k < 4 \land v_k = \mathrm{false} do

  14. Synthesize a candidate reward Rchild,kR_{\mathrm{child},k} using the Mutator.

  15. Validate the candidate using static syntax checking and sandboxed execution.

  16. ak←ak+1a_k \gets a_k + 1.

  17. if Rchild,kR_{\mathrm{child},k} is valid then

  18. vk←truev_k \gets\mathrm{true}.

  19. end if

  20. end while

  21. if vk=truev_k = \mathrm{true} then

  22. Pair Rchild,kR_{\mathrm{child},k} with a newly initialized policy and add the pair to Ot\mathcal{O}_t.

  23. else

  24. Discard offspring slot kk.

  25. end if

  26. end for

  27. Update the population: Pt+1←Vt∪Ot\mathcal{P}_{t+1} \gets\mathcal{V}_t \cup\mathcal{O}_t.

  28. end if

  29. end for

  30. Compute GCAUC←∑t=1TGCt\mathrm{GC}_{\mathrm{AUC}} \gets\sum_{t=1}^{T} \mathrm{GC}_t.

  31. return PT\mathcal{P}_T, VT\mathcal{V}_T, and the recorded metrics.

Environment Specifications

As defined in Eq. (1), every synthesized objective is implemented as an executable function with the common interface

Ri(s,a,s′,info)→R.(8)R_i(s, a, s', \mathrm{info}) \to\mathbb{R}. \tag*{(8)}

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.

PropertyCard SandboxCart-PoleHopperCheetah
Observation spaceDiscrete ∣S∣=6,561|\mathcal{S}| = 6{,}561Continuous R5\mathbb{R}^{5}Continuous R15\mathbb{R}^{15}Continuous R17\mathbb{R}^{17}
Action spaceDiscrete, ∣A∣=9|\mathcal{A}| = 9Continuous R1\mathbb{R}^{1}Continuous R4\mathbb{R}^{4}Continuous R6\mathbb{R}^{6}
Policy optimizationTabular Q-learningPPOPPOPPO
Train episode horizon5001,0001,0001,000
Initial population NinitN_{\mathrm{init}}3444
Generations TT15666

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:

A={PASS,DRAW,PLAY0,PLAY1,PLAY2,TAKE0,TAKE1,TAKE2,DISCARD}.\mathcal{A} = \{\mathrm{PASS}, \mathrm{DRAW}, \mathrm{PLAY}_0, \mathrm{PLAY}_1, \mathrm{PLAY}_2, \mathrm{TAKE}_0, \mathrm{TAKE}_1, \mathrm{TAKE}_2, \mathrm{DISCARD}\}.

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 94=6,5619^4 = 6{,}561 possible values. Each of the hand and three table positions contains either 0 for an empty position or a card value in {1,…,8}\{1, \ldots, 8\}. The state index is encoded deterministically as

s=729h+81x0+9x1+x2,s = 729h + 81x_0 + 9x_1 + x_2,

where hh is the card value in hand and x0,x1,x2x_0, x_1, x_2 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 [−1,1][-1, 1]. 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 [−1,1][-1, 1]. 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 [−1,1][-1, 1]. 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 Ri(s,a,s′,info)R_i(s, a, s', \mathrm{info}) 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 Pt\mathcal{P}_t of size NtN_t, each policy πi\pi_i is evaluated under each reward function RjR_j. Let Gi,j(e)G_{i,j}^{(e)} denote the return obtained during evaluation rollout e∈{1,…,Eeval}e \in\{1,\ldots,E_{\mathrm{eval}}\}. For an episode containing HeH_e transitions, the return is the undiscounted cumulative synthesized reward:

Gi,j(e)=∑τ=0He−1Rj(sτ,aτ,sτ+1,info⁡τ).(9)G_{i,j}^{(e)} = \sum_{\tau=0}^{H_e-1} R_j(s_\tau,a_\tau,s_{\tau+1},\operatorname{info}_\tau). \tag*{(9)}

The empirical cross-fitness entry is the mean return across evaluation rollouts:

Ft[i,j]=1Eeval∑e=1EevalGi,j(e).(10)\mathbf{F}_t[i,j] = \frac{1}{E_{\mathrm{eval}}}\sum_{e=1}^{E_{\mathrm{eval}}}G_{i,j}^{(e)}. \tag*{(10)}

Although policy optimization internally uses a discount factor γ\gamma, 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 H=100H=100 steps for the Card Sandbox and H=1,000H=1{,}000 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:

F~t[i,j]=Ft[i,j]−min⁡1≤k≤NtFt[k,j]max⁡1≤k≤NtFt[k,j]−min⁡1≤k≤NtFt[k,j]+ϵ0.(11)\widetilde{\mathbf{F}}_t[i,j] = \frac{\mathbf{F}_t[i,j]-\min_{1\le k\le N_t}\mathbf{F}_t[k,j]}{\max_{1\le k\le N_t}\mathbf{F}_t[k,j]-\min_{1\le k\le N_t}\mathbf{F}_t[k,j]+\epsilon_0}. \tag*{(11)}

We use ϵ0=10−8\epsilon_0=10^{-8} 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:

SQt=1Nt∑i=1NtF~t[i,i].(12)\mathrm{SQ}_t = \frac{1}{N_t}\sum_{i=1}^{N_t}\widetilde{\mathbf{F}}_t[i,i]. \tag*{(12)}

Behavioral Diversity

Let

ft[i]=F~t[i,:]∈[0,1]Nt(13)\mathbf{f}_t[i] = \widetilde{\mathbf{F}}_t[i,:] \in[0,1]^{N_t} \tag*{(13)}

denote the within-generation cross-fitness profile of policy πi\pi_i. Before computing Behavioral Diversity, zero-norm profiles are excluded and the remaining profiles are reindexed. Let NtBDN_t^{\mathrm{BD}} 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:

BDt=2NtBD(NtBD−1)∑1≤i<j≤NtBD(1−ft[i]⋅ft[j]∥ft[i]∥2∥ft[j]∥2+ϵ0).(14)\mathrm{BD}_t = \frac{2}{N_t^{\mathrm{BD}}\left(N_t^{\mathrm{BD}}-1\right)} \sum_{1\le i<j\le N_t^{\mathrm{BD}}} \left(1-\frac{\mathbf{f}_t[i]\cdot\mathbf{f}_t[j]}{\lVert\mathbf{f}_t[i]\rVert_2\lVert\mathbf{f}_t[j]\rVert_2+\epsilon_0}\right). \tag*{(14)}

If NtBD<2N_t^{\mathrm{BD}}<2, we define BDt=0\mathrm{BD}_t=0.

Grounding criterion.

For each reward function RiR_i, we independently evaluate a uniformly random policy and estimate its mean and standard deviation of returns, μirand\mu_i^{\mathrm{rand}} and σirand\sigma_i^{\mathrm{rand}}. The learning-progress score of the paired trained policy is

Li=Ft[i,i]−μirandσirand+ϵ0.(15)L_i = \frac{\mathbf{F}_t[i,i] - \mu_i^{\mathrm{rand}}}{\sigma_i^{\mathrm{rand}} + \epsilon_0}. \tag*{(15)}

A reward is considered grounded when it executes successfully and satisfies

Li>λ.(16)L_i > \lambda. \tag*{(16)}

We use λ=0.5\lambda= 0.5 and denote the set of grounded individuals at generation tt by Gt\mathcal{G}_t.

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 i∈Gti \in\mathcal{G}_t, we use its normalized cross-fitness profile

ft[i]=F~t[i,:].(17)\mathbf{f}_t[i] = \widetilde{\mathbf{F}}_t[i,:]. \tag*{(17)}

Each coordinate is rounded to one decimal place, and duplicate quantized profiles are removed. The resulting per-generation profile set is

Ct={round⁡(ft[i],1):i∈Gt},(18)\mathcal{C}_t = \{\operatorname{round}(\mathbf{f}_t[i],1) : i \in\mathcal{G}_t\}, \tag*{(18)}

where rounding is applied element-wise. Grounded Behavioral Profile Coverage at generation tt is

GCt=∣Ct∣.(19)\mathrm{GC}_t = |\mathcal{C}_t|. \tag*{(19)}

We report final-generation coverage and coverage accumulated across the evolutionary trajectory:

GCfinal=GCT,GCAUC=∑t=1TGCt.(20)\mathrm{GC}_{\mathrm{final}} = \mathrm{GC}_T,\qquad\mathrm{GC}_{\mathrm{AUC}} = \sum_{t=1}^{T} \mathrm{GC}_t. \tag*{(20)}

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 Mplan\mathcal{M}_{\mathrm{plan}}, which inspects cross-fitness matrices and population-health metrics to produce structured breeding directives; and (2) low-level reward synthesis through the Mutator Mmutate\mathcal{M}_{\mathrm{mutate}}, 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 Mplan\mathcal{M}_{\mathrm{plan}}. It defines the Planner’s reasoning protocol, steering rules based on Specialist Quality SQt\mathrm{SQ}_t and Behavioral Diversity BDt\mathrm{BD}_t, 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_ids empty.

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 tt, Mplan\mathcal{M}_{\mathrm{plan}} 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 Hforbidden\mathcal{H}_{\mathrm{forbidden}}.

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:

  1. Keep the reward function as SIMPLE and interpretable as possible. Avoid unnecessary complexity.

  2. Define a clear and simple behavioral objective.

  3. Prefer simple, sparse, or discrete rewards, such as +1.0 for goal progress, -1.0 for invalid actions, and 0.0 otherwise, when sufficient.

  4. Use continuous reward shaping only when necessary to guide the agent toward the objective.

  5. Avoid combining many reward components unless essential.

  6. 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, Mmutate\mathcal{M}_{\mathrm{mutate}} 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.

HyperparameterCard SandboxContinuous control
Policy optimizerTabular Q-learningPPO (Brax/JAX)
Learning rate0.05Cart-Pole/Cheetah: 3×10−43 \times10^{-4}; Hopper: 6×10−46 \times10^{-4}
Discount factor γ\gamma0.950.99
Exploration or clippingϵ\epsilon-greedy, 1.0 →\to 0.01 decayPPO clip ratio ϵ=0.2\epsilon= 0.2
Training budget per new policy20,000 episodes100,000 environment steps
Evaluation rollouts EevalE_{\mathrm{eval}}10 episodes10 episodes
Train episode horizon HH500 steps1,000 steps
GAE parameter λgae\lambda_{\mathrm{gae}}Not applicable0.95
PPO epochs per updateNot applicable10
Minibatch sizeNot applicable64

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-pp 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_plans containing parent_ids, reasoning, and mutation_hint. Mutator responses are parsed to extract executable Python code blocks.

  • Retry policy and transient error handling: The custom LLMClient wrapper 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 with max_workers = 5 for 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 FtF_t, 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

Sseeds={11116306,56229370,67374653}.(21)S_{\mathrm{seeds}} = \{11116306, 56229370, 67374653\}. \tag*{(21)}

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 (Mplan\mathcal{M}_{\mathrm{plan}}) and LLM-guided code mutation (Mmutate\mathcal{M}_{\mathrm{mutate}}), 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 tt, offspring reward functions are generated independently from the environment-description prompt, Mmutate(Edesc)\mathcal{M}_{\mathrm{mutate}}(E_{\mathrm{desc}}), without parent conditioning, crossover, or Planner directives. Historical duplicate avoidance through Hforbidden\mathcal{H}_{\mathrm{forbidden}} and niche-dominance survivor selection remain active, but offspring have no lineage-based dependence on previous generations.

Direct Mutation (DirectMutationOffspringStrategy). Surviving individuals in Vt\mathcal{V}_t are selected in round-robin order and passed directly to Mmutate\mathcal{M}_{\mathrm{mutate}} with a generic variation prompt. This preserves lineage-based reward inheritance and incremental mutation while removing population-level planning through Mplan\mathcal{M}_{\mathrm{plan}} and structured adaptation based on Specialist Quality or Behavioral Diversity.

Habitats (HabitatsOffspringStrategy). Habitats uses the complete two-stage architecture. The Offspring Planner Mplan\mathcal{M}_{\mathrm{plan}} inspects the normalized cross-fitness matrix F~t\widetilde{\mathbf{F}}_t and the population-health report (SQt\mathrm{SQ}_t, BDt\mathrm{BD}_t). It then produces structured breeding plans specifying parent selections, crossover targets, and mutation directives, which are executed by Mmutate\mathcal{M}_{\mathrm{mutate}}.

For both baselines, the number of offspring slots is set to Kt=∣Vt∣K_t = |\mathcal{V}_t|, allocating one offspring slot per survivor. Thus, before accounting for offspring slots discarded after failed validation, the target next-generation population size is 2∣Vt∣2|\mathcal{V}_t|. For Habitats, KtK_t 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 KtK_t offspring slots, each method uses between KtK_t and 4Kt4K_t 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 NtN_t, cross-fitness evaluation requires Nt2N_t^2 policy–reward evaluations per generation. Each policy πi\pi_i is evaluated under each reward RjR_j using the same number of rollouts and the same episode horizon across all methods. The evaluation horizon is H=100H = 100 for the Cardan Sandbox and H=1,000H = 1{,}000 for the MuJoCo environments.

Because population size NtN_t 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 Mmutate\mathcal{M}_{\mathrm{mutate}} 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 ±\pm 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 PTP_T. GCAUCGC_{\mathrm{AUC}} 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.

TaskObjective
Ascending SortPlay cards in non-decreasing order.
Descending SortPlay cards in non-increasing order.
Triplet MatchingConstruct groups of three cards with matching values.
Target SumSelect cards whose cumulative value reaches a specified target.
High-Card MaximizationMaximize the cumulative value of the cards played.
Low-Card MinimizationPreferentially play cards with the smallest available values.
Even–Odd PatternProduce sequences that alternate between even- and odd-valued cards.
Sandwich PairConstruct patterns of the form AA–BB–AA.
Rapid Clear DiscardEmpty the hand as quickly as possible.
Full-House Triple–PairConstruct 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 BMeta∈{1,000,2,000,5,000,10,000,20,000}B_{\mathrm{Meta}} \in\{1{,}000, 2{,}000, 5{,}000, 10{,}000, 20{,}000\} episodes, while Scratch is trained for BScratch=20,000B_{\mathrm{Scratch}} = 20{,}000 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 M∈{Habitats,Direct,Independent}M \in\{\text{Habitats}, \text{Direct}, \text{Independent}\}, evolution seed ss, and training budget B∈{1,000,2,000,5,000,10,000,20,000}B \in\{1{,}000, 2{,}000, 5{,}000, 10{,}000, 20{,}000\}, let WM,s,BW_{M,s,B}, TM,s,BT_{M,s,B}, and LM,s,BL_{M,s,B} 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

WRM,s,B=WM,s,B+12TM,s,BWM,s,B+TM,s,B+LM,s,B.(22)\mathrm{WR}_{M,s,B} = \frac{W_{M,s,B} + \frac{1}{2}T_{M,s,B}}{W_{M,s,B} + T_{M,s,B} + L_{M,s,B}}. \tag*{(22)}

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 0.467±0.0290.467 \pm0.029 and 0.483±0.0290.483 \pm0.029, respectively. At 10,000 episodes, Habitats reaches 0.617±0.0580.617 \pm0.058, compared with 0.533±0.0290.533 \pm0.029 for Direct Mutation and 0.467±0.0580.467 \pm0.058 for Independent Generation. Habitats at 10,000 episodes also exceeds both baseline libraries after 20,000 episodes, demonstrating more sample-efficient downstream reuse.

Downstream taskHabitats meta-policyScratch
1k2k5k10k20k20k
Ascending Sort3.27±1.303.27 \pm1.308.67±0.238.67 \pm0.239.13±1.509.13 \pm1.5010.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.00
Descending Sort−2.13±4.23-2.13 \pm4.235.35±4.335.35 \pm4.339.73±0.469.73 \pm0.4610.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.00
Triplet Matching0.00±0.000.00 \pm0.001.07±1.851.07 \pm1.856.13±2.896.13 \pm2.8910.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.00
Target Sum0.40±0.690.40 \pm0.694.33±1.104.33 \pm1.109.20±0.729.20 \pm0.7210.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.008.36±0.008.36 \pm0.00
High-Card Maximization3.49±3.733.49 \pm3.7327.35±0.0727.35 \pm0.0731.12±0.0531.12 \pm0.0531.12±0.0531.12 \pm0.0531.12±0.0531.12 \pm0.0530.70±0.0030.70 \pm0.00
Low-Card Minimization0.80±0.690.80 \pm0.696.53±1.456.53 \pm1.4510.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.00
Even–Odd Pattern2.20±2.202.20 \pm2.207.87±1.947.87 \pm1.9410.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.00
Sandwich Pair0.87±0.420.87 \pm0.423.73±2.253.73 \pm2.259.93±0.129.93 \pm0.1210.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.006.72±0.006.72 \pm0.00
Rapid Clear Discard−3.43±1.36-3.43 \pm1.36−2.40±2.28-2.40 \pm2.280.27±1.060.27 \pm1.066.33±0.826.33 \pm0.826.41±0.686.41 \pm0.686.80±0.006.80 \pm0.00
Full-House Triple–Pair0.00±0.000.00 \pm0.000.53±0.610.53 \pm0.614.56±3.634.56 \pm3.637.76±1.187.76 \pm1.187.96±1.047.96 \pm1.0410.00±0.0010.00 \pm0.00
Win rate vs. Scratch 20k0.0%±0.0%0.0\% \pm0.0\%3.3%±2.9%3.3\% \pm2.9\%46.7%±2.9%46.7\% \pm2.9\%61.7%±5.8%61.7\% \pm5.8\%61.7%±5.8%61.7\% \pm5.8\%–

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 ±\pm 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 taskDirect Mutation meta-policyScratch
1k2k5k10k20k20k
Ascending Sort0.67±2.310.67 \pm2.313.20±2.113.20 \pm2.1110.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.00
Descending Sort0.87±0.900.87 \pm0.902.07±3.582.07 \pm3.5810.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.00
Triplet Matching−2.53±4.39-2.53 \pm4.390.00±0.000.00 \pm0.003.33±1.423.33 \pm1.429.61±0.679.61 \pm0.679.61±0.679.61 \pm0.6710.00±0.0010.00 \pm0.00
Target Sum0.33±0.310.33 \pm0.311.07±1.851.07 \pm1.859.20±0.699.20 \pm0.6910.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.008.36±0.008.36 \pm0.00
High-Card Maximization0.21±0.360.21 \pm0.3612.45±7.6312.45 \pm7.6331.15±0.0531.15 \pm0.0531.15±0.0531.15 \pm0.0531.15±0.0531.15 \pm0.0530.70±0.0030.70 \pm0.00
Low-Card Minimization0.00±0.000.00 \pm0.001.07±1.851.07 \pm1.858.73±2.198.73 \pm2.1910.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.00
Even–Odd Pattern1.07±0.951.07 \pm0.951.64±2.771.64 \pm2.7710.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.00
Sandwich Pair0.40±0.530.40 \pm0.530.07±0.120.07 \pm0.129.33±0.619.33 \pm0.6110.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.006.72±0.006.72 \pm0.00
Rapid Clear Discard−13.70±8.36-13.70 \pm8.36−6.04±6.55-6.04 \pm6.552.25±1.942.25 \pm1.946.55±0.246.55 \pm0.246.78±0.026.78 \pm0.026.80±0.006.80 \pm0.00
Full-House Triple–Pair0.00±0.000.00 \pm0.000.00±0.000.00 \pm0.005.79±1.095.79 \pm1.097.57±1.507.57 \pm1.508.36±0.168.36 \pm0.1610.00±0.0010.00 \pm0.00
Win rate vs. Scratch 20k0.0%±0.0%0.0\% \pm0.0\%0.0%±0.0%0.0\% \pm0.0\%48.3%±2.9%48.3\% \pm2.9\%53.3%±2.9%53.3\% \pm2.9\%56.7%±2.9%56.7\% \pm2.9\%–

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 ±\pm 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 taskIndependent Generation meta-policyScratch
1k2k5k10k20k20k
Ascending Sort3.61±4.863.61 \pm4.867.07±5.087.07 \pm5.0810.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.00
Descending Sort4.00±4.064.00 \pm4.066.00±5.106.00 \pm5.1010.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.00
Triplet Matching−1.24±2.15-1.24 \pm2.15−1.24±2.15-1.24 \pm2.150.13±0.230.13 \pm0.230.27±0.230.27 \pm0.230.20±0.350.20 \pm0.3510.00±0.0010.00 \pm0.00
Target Sum2.60±6.012.60 \pm6.014.13±3.134.13 \pm3.138.80±2.088.80 \pm2.089.93±0.129.93 \pm0.129.93±0.129.93 \pm0.128.36±0.008.36 \pm0.00
High-Card Maximization4.89±8.464.89 \pm8.4615.35±15.2515.35 \pm15.2530.97±0.4230.97 \pm0.4230.97±0.4230.97 \pm0.4230.97±0.4230.97 \pm0.4230.70±0.0030.70 \pm0.00
Low-Card Minimization4.47±5.084.47 \pm5.085.27±5.025.27 \pm5.029.08±1.599.08 \pm1.5910.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.0010.00±0.0010.00 \pm0.00
Even–Odd Pattern5.40±4.815.40 \pm4.816.73±4.666.73 \pm4.669.80±0.359.80 \pm0.359.87±0.239.87 \pm0.239.87±0.239.87 \pm0.2310.00±0.0010.00 \pm0.00
Sandwich Pair−0.45±0.96-0.45 \pm0.961.67±2.891.67 \pm2.898.43±1.678.43 \pm1.679.69±0.539.69 \pm0.539.64±0.629.64 \pm0.626.72±0.006.72 \pm0.00
Rapid Clear Discard−15.57±8.90-15.57 \pm8.90−9.60±4.46-9.60 \pm4.462.17±3.222.17 \pm3.226.23±0.966.23 \pm0.966.07±1.236.07 \pm1.236.80±0.006.80 \pm0.00
Full-House Triple–Pair2.09±3.632.09 \pm3.631.17±2.031.17 \pm2.034.56±2.404.56 \pm2.408.49±0.098.49 \pm0.098.49±0.098.49 \pm0.0910.00±0.0010.00 \pm0.00
Win rate vs. Scratch 20k6.7%±11.5%6.7\% \pm11.5\%6.7%±7.6%6.7\% \pm7.6\%36.7%±15.3%36.7\% \pm15.3\%46.7%±5.8%46.7\% \pm5.8\%46.7%±5.8%46.7\% \pm5.8\%–

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 (x0,x1,x2)(x_0, x_1, x_2) denote the values occupying the three table positions and let hh 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 x0<x1<x2x_0 < x_1 < x_2, while The Peak Pattern instead required the non-monotonic configuration x0<x1>x2x_0 < x_1 > x_2. Other objectives emphasized arithmetic structure. The Summation Table required x0+x1=x2x_0 + x_1 = x_2, whereas The Table Product coupled the held card to the table through h=x0x1h = x_0x_1. The Magic Fifteen introduced a global constraint over the complete active configuration, h+x0+x1+x2=15h + x_0 + x_1 + x_2 = 15.

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, x0=x2≠x1x_0 = x_2 \ne x_1. 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 x0 mod x1=0x_0 \bmod x_1 = 0 and x1 mod x2=0x_1 \bmod x_2 = 0. 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, x1−x0=x2−x1x_1 - x_0 = x_2 - x_1. The Consecutive Run further specializes this structure by fixing the spacing to one: x1=x0+1x_1 = x_0 + 1 and x2=x1+1x_2 = x_1 + 1.

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.

HyperparameterCartpoleCheetahHopper
Policy optimizerPPO (Brax / JAX)
Learning rate3×10−43 \times10^{-4}3×10−43 \times10^{-4}6×10−46 \times10^{-4}
Discount factor γ\gamma0.970.950.997
Exploration or clippingPPO clip ratio ϵ=0.2\epsilon= 0.2
Training budget per new policy10,000,000 steps50,000,000 steps50,000,000 steps
Evaluation rollouts EevalE_{\mathrm{eval}}20 episodes20 episodes20 episodes
Train episode horizon HH1,000 steps1,000 steps1,000 steps
GAE parameter λgae\lambda_{\mathrm{gae}}0.950.950.95
PPO epochs per update41010
Minibatch size1,024512512
Number of minibatches323232
Parallel environments2,0482,0482,048
Unroll length52064
Entropy coefficient10−210^{-2}10−310^{-3}10−210^{-2}
Reward scaling10.010.010.0
Policy / value networkMLP (64, 64), Swish
Observation normalizationYesYesYes
Advantage normalizationYesYesYes

Table 9. Policy-training and evaluation hyperparameters for MuJoCo continuous control environments.

Results are reported as mean ±\pm 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 0.6109±0.27100.6109 \pm0.2710, compared with 0.2870±0.09910.2870 \pm0.0991 for Direct Mutation and 0.3791±0.14400.3791 \pm0.1440 for Independent Generation.

Extended evolutionary horizon in Card Sandbox

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 ±1\pm1 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.

Extended evolutionary horizon in Cart-Pole showing Specialist Quality and Behavioral Diversity over generations, with mean and final values

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

Extended evolutionary horizon in Cheetah

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

Extended evolutionary horizon in Hopper

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 ±\pm 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.

Language-model backbone ablation plots

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 ±1\pm1 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.

BackboneMean SQFinal SQMean BDFinal BD
Gemini 3.5 Flash0.9494 ±\pm 0.00020.9979 ±\pm 0.00070.4929 ±\pm 0.08010.4899 ±\pm 0.0888
Gemini 3.8 Flash0.9577 ±\pm 0.00260.9996 ±\pm 0.00060.4294 ±\pm 0.07290.3788 ±\pm 0.1127
Gemini 4 Argon0.9586 ±\pm 0.00200.9995 ±\pm 0.00070.7569 ±\pm 0.03680.7959 ±\pm 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 ±\pm standard deviation across three seeds. The highest mean in each column is shown in bold.

References

  1. [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. [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. [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. [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. [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. [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. [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. [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
  9. [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.
  10. [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
  11. [13]Jean-Baptiste Mouret and Jeff Clune. Illuminating search spaces by mapping elites, 2015. URL https://arxiv.org/abs/1504.04909.
  12. [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.
  13. [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.
  14. [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
  15. [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
  16. [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.
  17. [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.
  18. [20]John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms, 2017. URL https://arxiv.org/abs/1707.06347.
  19. [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.
  20. [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.
  21. [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.
  22. [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.

Paper details

vlnc:W_957k32cc
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 4

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents