betaFeedback

WorksComputer Science

GREMLIN: Generating Random Environments for Meta-Learning with Interacting Networks

Abstract

Can randomly parameterized neural environments supply useful experience for learning a reinforcement learning algorithm? We investigate this question using DiscoRL's rule-discovery framework, replacing human-designed training games with sixteen selected neural environments. Each game combines bounded vector dynamics with a random strategy-based reward and an independent outcome reward. After 224.8 million agent-environment steps, we froze the teacher and trained fresh agents. DQN outscored GREMLIN on most games, both generated and human-designed. GREMLIN nevertheless outperformed the untrained teacher on all 26 games, showing that generated experience can improve a learning rule. It remains unclear whether this approach can yield a competitive rule with longer meta-training.

Introduction

DiscoRL [1] learns reinforcement learning algorithms by training agents on a collection of games. GREMLIN asks whether random neural networks could supply those games: a potentially unlimited source of environments for learning how to learn. The experiment reported here is narrower: one learning rule trained on sixteen selected random neural environments.

Ordinary algorithms prescribe how experience changes an agent’s network. DQN [2] trains estimates of future reward towards a reward-plus-next-state-value target. DiscoRL instead learns a teacher: a neural rule that reads actions, rewards and agent predictions, then produces desired action probabilities and prediction outputs. Agent updates move outputs towards these targets. Differentiating through those updates trains the teacher to increase agent reward. This outer training is discovery, or meta-training. To evaluate a teacher, we freeze it and train new agents from scratch.

The released Disco103 rule [3] was discovered across 103 human-designed games. Its weights stay fixed while fresh agents learn, potentially with different observations, action counts and architectures. We use that implementation and Disco103 as a reference; GREMLIN starts from random teacher weights. We use low-dimensional states and small dense agents because our budget did not allow image-based meta-training with convolutional agents like those used in DiscoRL.

We ask whether training a teacher on neural games improves its ability to teach agents on human-designed tasks. Testing fresh agents on the sixteen training games measures learning within the bank; testing them on six separate human games measures transfer. With one discovery run, we can demonstrate a proof of concept but cannot establish how reliably discovery succeeds or whether it can produce a competitive rule.

Related work. Learned Policy Gradient (LPG) [4] is an earlier method for learning an RL update rule from simple, human-specified task families, including grid worlds, and transferring it to Atari. This is a precedent for learning a transferable rule, not for our environment generator. GROOVE [5] directly studies environment design for rule discovery: it adapts grid-world curricula using algorithmic regret, a performance gap relative to a reference algorithm. Our environments instead have randomly sampled neural dynamics and rewards, and are screened once before discovery rather than adapted to the evolving rule. Procen [6] randomizes levels within human-designed games; GREMLIN randomizes transition and reward functions within a specified neural family. Learned synthetic environments [7] are another distinct approach: their networks are optimized for target tasks, whereas ours are sampled and screened, not fitted.

Figure 1. GREMLIN workflow.

Random games with deliberate structure

Each game has a state s∈[−1,1]32s \in[-1,1]^{32}, four discrete actions, and exactly 128 steps per episode. The observation is (st,1−t/128)(s_t,1-t/128) for t=0,…,127t=0,\ldots,127, giving 33 inputs.

Dynamics and sampling

Action aa selects an eight-dimensional embedding eae_a. State, action embedding and fresh noise are projected separately into the first hidden layer:

ϵt∼N(0,I32),ht(1)=tanh⁡(gsWsst+gaWaeat+σWϵϵt),ht(2)=tanh⁡(ghWhht(1)),ut=tanh⁡(Woht(2)),st+1=(1−α)st+αut.\begin{aligned} \epsilon_t &\sim\mathcal{N}(0,I_{32}),\\ h_t^{(1)} &= \tanh(g_sW_ss_t+g_aW_ae_{a_t}+\sigma W_\epsilon\epsilon_t),\\ h_t^{(2)} &= \tanh(g_hW_hh_t^{(1)}),\\ u_t &= \tanh(W_oh_t^{(2)}),\\ s_{t+1} &= (1-\alpha)s_t+\alpha u_t. \end{aligned}

Both hidden layers have width 128; the proposal has 32 coordinates. The last tanh and linear interpolation keep the state in [−1,1]32[-1,1]^{32}. For every dynamics, strategy and outcome network, weights with nn inputs have independent entries Wij∼N(0,1/n)W_{ij}\sim\mathcal{N}(0,1/n) and zero biases. In the first dynamics layer, n=32n=32 for state and noise and n=8n=8 for the action embedding. Each action embedding has eight independent standard-normal coordinates.

Gains are drawn once per game (see Table 1). Log-uniform on [l,u][l,u] means sampling ln⁡x\ln x uniformly, equivalently density p(x)=1/[xln⁡(u/l)]p(x)=1/[x\ln(u/l)] on that interval.

QuantityDistribution
Inertia coefficient α\alphaLog-uniform on [1/16,1][1/16,1]
State and hidden gains gs,ghg_s,g_hEach log-uniform on [0.5,2][0.5,2]
Action gain gag_aLog-uniform on [0.25,4][0.25,4]
Noise gain σ\sigmaZero with probability 0.75; otherwise log-uniform on [0.01,0.1][0.01,0.1]

Table 1. Per-game dynamics parameters.

Starting states are uniform in a game-specific box: its centre cc has independent coordinates uniform on [−0.5,0.5][-0.5,0.5], and its shared half-width bb is log-uniform on [0.05,0.5][0.05,0.5].

Reward: a random strategy and a random outcome

The strategy anchor is a sampled 32→64→64→432 \to64 \to64 \to4 network with tanh hidden layers and linear outputs. For a given state, it selects the action with the highest output score. Following that action gives zero anchor reward; any other action gives −1-1. An independent 32→64→64→132 \to64 \to64 \to1 network ff, with tanh after every layer, scores the raw next state. The two components have equal weight:

rt=−121{at≠πanchor(st)}+12f(st+1),f(st+1)∈[−1,1].r_t = -\frac{1}{2}\mathbb{1}\{a_t \ne\pi_{\mathrm{anchor}}(s_t)\} + \frac{1}{2}f(s_{t+1}), \qquad f(s_{t+1}) \in[-1,1].

Total reward lies in [−1,0.5][-1,0.5]. The outcome term can compensate for anchor disagreement through the states subsequently reached, so the anchor is not guaranteed to maximize total return over subsequent transitions. Neither reward network is trained.

We hold each dynamics/outcome draw fixed while trying up to 32 independent anchors. A strategy is rejected if any action exceeds 75% of choices on 256 reset states. The first passing anchor is retained; if none passes, the candidate is rejected.

This deliberately designed family aims to provide a useful signal within our budget. Rewards reading several past states and continuous actions remain untested: we could not afford meta-training ablations of all alternatives.

From candidates to a training bank

We want games in which learning can outperform simple action patterns. For each candidate, we train Double DQN [8] twice, with independent seeds, for 65,536 interactions per learner, then evaluate its final greedy policy. The learners use the same network, optimizer and exploration schedule as the DQN baseline described below, but use the Double-DQN target. The references are the best of four constant actions and the best repeating action schedule, selected on 64 paired calibration episodes.

We compare each learner with each reference on 64 episodes and keep a game only if each average advantage is positive in 95% or more of 2,000 redraws with replacement of 64 episodes among them.

To avoid relying on a single ranking, we selected sixteen games from the first 48 passes:

  1. Eight with the largest advantage over simple policies. For each game, take the smallest observed mean gain across the two seeds and two references, then choose the eight highest values.

  1. Four that passed the strategy-anchor comparison. Among the remaining games, identify those where both Double-DQN seeds also beat the anchor in discounted mixed-reward return, using the same 64 paired evaluation episodes and resampling test. Five qualified, and we sampled four uniformly.

  1. Four random remaining passes. Sample four uniformly without replacement from the remaining passes, broadening the mix without claiming uniform coverage of game space.

All sixteen games passed a short Double-DQN screen, so the bank may favor the related DQN baseline. On a game where following the anchor already beats the constant and repeating policies, learning which action pays immediately may suffice to pass. Only the four beyond-anchor slots require more than matching the anchor, and even beating it does not establish that exploration or long-horizon credit assignment was necessary. We have not compared selectors through separate teacher-training runs.

Learning and evaluating the rule

We follow DiscoRL’s discovery procedure [1], with smaller agents and a smaller training budget. Thirty-two agents train in parallel; each is replaced after a sampled lifetime of 100k, 250k, 500k or 1M agent–environment steps (sampling weights 8:4:2:18:4:2:1). DiscoRL used 20M, 50M, 100M or 200M steps. We chose shorter lifetimes primarily for budget reasons. We expected agents learning from small state vectors to need fewer steps than agents learning from images, but did not establish convergence.

For generated games, the agent’s shared network is 33→6433 \to64 (ReLU) →64\to64 (linear). Its outputs include four action scores, converted to probabilities by softmax, and a 600-dimensional prediction vector trained using the teacher’s targets.

We meta-trained GREMLIN for 224.8M agent–environment steps: 181.8M to train agents and 43.0M in separate rollouts to assess agent performance for teacher updates. We clipped each agent’s meta-gradient to a maximum norm of 1 and averaged the resulting per-agent Adam updates. Discovery used about 616 GPU-hours on eight shared A5000s, including synchronization and checkpoint transfers. Disco103 used 2,048 dedicated TPUv3 cores for 60 hours [1]; the hardware and workloads differ, so these are not comparable units of compute. Even Disco57 reached its best reported rule at about 600M steps per Atari game, or roughly 34.2B across 57 games, compared with our 224.8M agent steps [1]. DiscoRL trained convolutional agents directly from images, whereas our agents received low-dimensional state vectors and were expected to learn with less experience.

For evaluation we freeze each rule and train fresh agents for 4M interactions, with an early readout at 500k. We measure mean undiscounted episode return. Initial uses the teacher’s initialization weights to train an agent; comparing it with GREMLIN measures the change attributable to this discovery run. A separate baseline does not learn at all: it draws each action uniformly, independently at every decision. We estimate its mean over 1,024 independently seeded complete episodes per game.

All three learned rules use Adam at 0.01. As in discovery, each batch contains 86 replayed and 10 fresh trajectories of 28 transitions, from a buffer of up to 1,024 trajectories. DQN uses a 64/64 ReLU Q-network, Adam at 0.0003, discount 0.99 and Huber loss, with one update per 16 steps. It uses a 32,768-transition replay buffer, batches of 128 after 4,096 steps of warm-up, and copies the target network every 2,048 steps. Its exploration probability decays linearly from 1 to 0.05 over the first 32,768 steps.

Results

The generated tasks supplied usable experience

We test all sixteen training games with two independent agent seeds per method and a budget of 4M steps per learner, with 32 endpoint assessment episodes each. Learned-rule agents sample actions; DQN selects its highest-valued action. We also assess the fixed anchor under the complete mixed reward.

The final system improves mean final return on all sixteen games. DQN remains ahead on every training game: discovery used the generated experience, but did not reach conventional-algorithm performance. In this two-seed comparison, GREMLIN’s mean final return exceeds Disco103’s on nine of sixteen games.

In Figure 2, zero means uniform-random actions and one means DQN’s mean return at 4M. Within each game we subtract the random-policy mean and divide by the gap between DQN and random. This puts returns from games with very different reward ranges on a common scale.

Figure 2. The rightmost group was not used for discovery. Circles and crosses average over games and agent seeds. The lower end of each bar averages the lower of the two scores in each game; the upper end averages the higher scores. These are not confidence intervals.

The initial teacher scores within 0.01 of random in all three group means, as expected from a randomly initialized teacher. GREMLIN closes 97% of the random-to-DQN gap on the ranked games, 98% on the beyond-anchor games and 88% on the random passes. On the beyond-anchor games, DQN’s advantage over the anchor is expected from curriculum selection. GREMLIN also exceeds the anchor on all four, but takes longer: its group score rises from 0.74 at 500k to 0.98 at 4M, whereas DQN is already at 0.99 at 500k.

We repeated the comparison on four games drawn uniformly from the 32 screened passes not used for discovery. GREMLIN improved over initialization on all four, exceeded DQN’s mean on one and averaged 96% of the random-to-DQN gap. GREMLIN scored comparably on the held-out and randomly selected training games; this suggests generalization within the screened family, but says little about how much of game space the generator covers. It may cover too narrow a range of learning problems. The remaining gap to DQN on most held-out games and all six human-designed games could reflect limited task diversity, too little meta-training, or both.

Human-task gains are uneven and below DQN

We test the same four methods on Acrobot-v1 and discrete LunarLander-v3 using native state vectors, and on Atari v5 Breakout, Space Invaders, Qbert and Seaquest using RAM observations. Each method has five independently initialized agents per game, trained for 4M agent steps on every task. Final scores average 100 evaluation episodes per agent. Learned rules use sampled actions and DQN is greedy, as in the generated comparison.

DiscoRL’s published Atari evaluation [1] uses a large CNN and four image frames and 200M reported environment steps per learner. Our Atari budget is 4M agent decisions (nominally 16M emulator frames); step units are not assumed identical. Our agents instead receive a single RAM vector (128 bytes scaled to [0,1][0, 1]) and choose from each game’s own action set once every four emulator frames. On each frame the emulator has a 25% chance of repeating the previous action. All six human tasks use the same dense agent architecture, with task-specific input and action dimensions and no added clock.

The improvement is not limited to generated training games. GREMLIN’s mean final return exceeds both uniform-random play and Initial on all six human tasks. On LunarLander and Seaquest, all five trained-rule agents exceed all five initial-rule agents. Space Invaders illustrates how unreliable this improvement can be: three GREMLIN seeds score 271–284, near DQN’s mean of 297, while two score only 19 and 34, below the initial rule.

The evaluation budget changes what learning is visible. GREMLIN is almost always unsuccessful on Acrobot at 500k steps (mean return −499), but four of five agents learn to reach its goal by 4M (mean return −227). On LunarLander its mean rises from −53 to 47. Disco103’s Qbert mean also rises from 327 to 874. DQN appears close to a plateau by 500k on Acrobot (−88 to −82) and Space Invaders (291 to 297), but not across the panel: on LunarLander its mean rises from 76 to 188.

GREMLIN remains below DQN’s mean final return on all six human tasks and below Disco103 on five; its mean exceeds Disco103’s on Breakout. Disco103 itself exceeds DQN on Qbert and Seaquest, so neither reference uniformly dominates the other. These comparisons show gains outside the discovery bank, not an advantage over established algorithms.

TaskInitialGREMLINDisco103DQN
Acrobot−498.72±1.02-498.72 \pm1.02 (−497.22-497.22)−227.08±152.66-227.08 \pm152.66 (−149.31-149.31)−97.19±3.40-97.19 \pm3.40 (−92.86-92.86)−82.49±2.92-82.49 \pm2.92 (−78.04-78.04)
LunarLander−184.60±10.75-184.60 \pm10.75 (−166.94-166.94)47.38±22.6447.38 \pm22.64 (83.0983.09)93.66±24.7193.66 \pm24.71 (110.59110.59)188.23±73.89188.23 \pm73.89 (265.91265.91)
Breakout RAM1.42±0.111.42 \pm0.11 (1.531.53)3.48±2.823.48 \pm2.82 (6.736.73)1.55±0.521.55 \pm0.52 (2.462.46)9.18±1.099.18 \pm1.09 (10.4010.40)
Space Invaders RAM149.96±6.46149.96 \pm6.46 (161.30161.30)178.08±138.73178.08 \pm138.73 (283.90283.90)219.77±56.89219.77 \pm56.89 (289.80289.80)297.13±45.74297.13 \pm45.74 (347.30347.30)
Qbert RAM160.75±10.25160.75 \pm10.25 (177.00177.00)281.85±133.05281.85 \pm133.05 (449.75449.75)873.60±466.52873.60 \pm466.52 (1656.501656.50)408.95±115.57408.95 \pm115.57 (559.25559.25)
Seaquest RAM74.88±3.3774.88 \pm3.37 (78.2078.20)189.48±26.32189.48 \pm26.32 (220.60220.60)440.52±93.93440.52 \pm93.93 (558.00558.00)388.52±185.14388.52 \pm185.14 (587.20587.20)

Table 2. Raw human-task returns at 4M: mean ± sample standard deviation over five agents, with the best agent in parentheses.

Figure 3. Raw episode returns; each game has its own axis. Small points show individual agents at 4M. The red band is ±2 standard errors of the uniform-random mean across 1,024 episodes.

Limitations and research directions

Task coverage. Our games reward agreement with a state-dependent strategy at every step, alongside a random state score, and reset after 128 steps. Human episode limits are 500 steps for Acrobot, 1,000 for LunarLander and 27,000 action decisions for Atari; episodes can end earlier. Unlike our generated games, these tasks can end in response to an action and have no added clock. The human tasks also have 3–18 actions rather than four, and some have larger or sparser rewards than our generated games. What matters for transfer is whether discovery exposes the teacher to the learning problems these tasks pose. In Acrobot, for example, an agent must build momentum before it can reach the goal and end the per-step penalty. Our dense rewards and short episodes may offer few examples where long-horizon reasoning is needed. The late gain on Acrobot shows the rule can learn this behaviour, not if it is efficient at doing so.

Training and agent capacity. The teacher may learn slowly or unstably. Separately, applying a useful rule with an unsuitable agent learning rate or insufficient capacity can limit performance. A rule might improve from random initialization towards basic competence without surpassing conventional algorithms.

Designed distribution and replication. Without meta-training ablations, we cannot attribute success to the anchor, selection or inertia. Richer environments could help or make discovery harder: this proof of concept does not establish that scaling the current design works. Compute-matched discoveries on unscreened neural games and simple procedural tasks would help distinguish the value of this generator from rule learning on inexpensive tasks more generally. An important comparison is breadth versus repetition: revisit a fixed bank or keep supplying new games under the same selection rule, matching discovery steps.

Conclusion

Deliberately structured random neural games supplied experience from which a more useful learning rule emerged in this run. DQN still led on most games, and the improvement could saturate below it. Further experiments with a larger meta-training budget could show whether GREMLIN continues to improve and how far that improvement carries over to human-designed games.

Use of generative AI

Generative AI tools assisted with software implementation, running experiments, and writing the manuscript.

References

  1. [1]Junhyuk Oh, Gregory Farquhar, Iurii Kemaev, Dan A. Calian, Matteo Hessel, Luisa Zintgraf, Satinder Singh, Hado van Hasselt, and David Silver. Discovering state-of-the-art reinforcement learning algorithms. Nature, 648:312–319, 2025. doi: 10.1038/s41586-025-09761-x. URL https://doi.org/10.1038/s41586-025-09761-x.
  2. [2]Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A. Rusu, Joel Veness, Marc G. Bellemare, Alex Graves, Martin Riedmiller, Andreas K. Fidjeland, Georg Ostrovski, Stig Petersen, Charles Beattie, Amir Sadik, Ioannis Antonoglou, Helen King, Dharshan Kumaran, Daan Wierstra, Shane Legg, and Demis Hassabis. Human-level control through deep reinforcement learning. Nature, 518:529–533, 2015. doi: 10.1038/nature14236. URL https://doi.org/10.1038/nature14236.
  3. [3]Google DeepMind. DiscoRL public implementation and released Disco103 parameters, 2025. URL https://github.com/google-deepmind/disco_rl/tree/9059a29f7121d60948f25ef165e08e050e9399c8. Pinned revision 9059a29f.
  4. [4]Junhyuk Oh, Matteo Hessel, Wojciech M. Czarnecki, Zhongwen Xu, Hado van Hasselt, Satinder Singh, and David Silver. Discovering reinforcement learning algorithms. In NeurIPS, 2020. URL https://proceedings.neurips.cc/paper/2020/hash/0b96d81f0494fde5428c7aea243c9157-Abstract.html.arxiv.org/abs/2007.08794
  5. [5]Matthew T. Jackson, Minqi Jiang, Jack Parker-Holder, Risto Vuorio, Chris Lu, Gregory Farquhar, Shimon Whiteson, and Jakob N. Foerster. Discovering general reinforcement learning algorithms with adversarial environment design. In Advances in Neural Information Processing Systems, volume 36, pages 79980–79998, 2023. URL https://proceedings.neurips.cc/paper_files/paper/2023/hash/fce2d8a485746176aac7b5650db2679d-Abstract-Conference.html.arxiv.org/abs/2310.02782
  6. [6]Karl Cobbe, Christopher Hesse, Jacob Hilton, and John Schulman. Leveraging procedural generation to benchmark reinforcement learning. In ICML, 2020. URL https://arxiv.org/abs/1912.01588.
  7. [7]Fabio Ferreira, Thomas Nierhoff, Andreas Saelinger, and Frank Hutter. Learning synthetic environments and reward networks for reinforcement learning. In ICLR, 2022. URL https://arxiv.org/abs/2202.02790.
  8. [8]Hado van Hasselt, Arthur Guez, and David Silver. Deep reinforcement learning with Double Q-learning. In AAAI, 2016. URL https://arxiv.org/abs/1509.06461.

Paper details

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

views · 0

downloads · 0

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

  • Computer Science

Generative AI tools

View statement
Looking for related papers…
Contents