Random network distillation

Also known as: RND

On this page 7

Random network distillation (RND) is an exploration method in reinforcement learning that gives an agent an intrinsic reward for novel states. It measures novelty as the prediction error of a trained network that tries to imitate the output of a fixed, randomly initialized target network: states the agent has seen often are predicted well, while unfamiliar states produce large errors and therefore large bonuses.

RND was introduced in 2018 and became widely known for strong results on Montezuma’s Revenge, an Atari game with extremely sparse rewards. It belongs to the family of curiosity-driven methods for intrinsic motivation and is valued for being simple, cheap to compute and robust to several failure modes of earlier approaches.

How random network distillation computes novelty

RND computes novelty by distilling a random function into a learned predictor. Two neural networks receive the same observation. The target network has random weights that are never trained, so it maps each observation to an arbitrary but deterministic feature vector. The predictor network is trained by gradient descent to reproduce that vector, and the squared difference between the two outputs is the exploration bonus.

Because the predictor is trained only on observations the agent actually visits, its error falls in familiar regions of the state space and stays high elsewhere. The bonus thus behaves like a smooth, learned visit counter that works in high-dimensional observation spaces such as raw pixels, where literal counting is impossible.

ComponentRoleTrained
Target networkMaps observations to fixed random featuresNever
Predictor networkLearns to imitate the target featuresYes, on visited states
Prediction errorServes as the intrinsic rewardNot applicable
Observation normalizationKeeps inputs on a stable scaleRunning statistics only
Policy optimizerLearns from combined rewards, usually with PPOYes
Components of random network distillation

Why a random target avoids common curiosity failures

A fixed random target makes RND immune to stochastic noise that misleads forward-model curiosity. Earlier methods rewarded the error of predicting the next state, so a source of pure randomness, such as a television showing static, kept the error high forever and trapped the agent. In RND the target is a deterministic function of the current observation, so there is nothing inherently unpredictable to learn and every error can eventually shrink.

Prediction error in general comes from several sources. The design of RND removes the sources that do not reflect genuine novelty, which is the core reason for its robustness.

Error sourceEffect in forward-model curiosityEffect in RND
Lack of training dataSignals real noveltySignals real novelty
Stochastic transitionsCreates a permanent false bonusRemoved, target is deterministic
Model misspecificationInflates error everywhereLargely removed, same architecture
Learning dynamicsAdds noise to the bonusStill present, reduced by normalization
Sources of prediction error and how RND handles them

Training details that make RND work

RND depends on several implementation details that matter as much as the core idea. The original work trained the policy with proximal policy optimization and used two value heads, one for extrinsic and one for intrinsic returns, so each reward stream could use its own discount factor and episodic treatment.

  • Non-episodic intrinsic returns: the curiosity value is not reset when an episode ends, which encourages exploration across life losses.
  • Observation normalization: inputs to both networks are whitened and clipped, because a random target otherwise produces poorly scaled features.
  • Reward normalization: the intrinsic reward is divided by a running estimate of its standard deviation.
  • Predictor update fraction: only part of each batch updates the predictor, which slows the decay of the bonus when many parallel environments run.

Typical settings use an intrinsic coefficient lower than the extrinsic one, for example a 2 to 1 weighting in favor of task reward, with a higher extrinsic discount near 0.999 and an intrinsic discount near 0.99. Exact values depend on the environment and should be tuned.

HyperparameterTypical rangeWhat it affects
Extrinsic reward coefficient1 to 2Weight of the task objective
Intrinsic reward coefficient0.5 to 1Strength of exploration
Extrinsic discount0.99 to 0.999Horizon for task rewards
Intrinsic discount0.95 to 0.99Horizon for novelty seeking
Predictor update proportion0.25 to 1Speed at which the bonus fades
Key RND hyperparameters

RND compared with other exploration methods

RND sits between simple random exploration and complex model-based curiosity. It needs no environment model, no density estimator and no inverse dynamics model, which keeps its cost to two extra forward passes and one backward pass per batch.

MethodNovelty signalMain weakness
Epsilon-greedyNone, random actionsFails with sparse rewards
Count-based bonusVisit counts or pseudo-countsNeeds a density model in large spaces
Intrinsic curiosity moduleForward-model error in learned featuresVulnerable to stochastic distractors
Random network distillationError against a fixed random targetBonus can vanish too early
Go-ExploreArchive of reached statesRequires resettable environments
RND among exploration strategies

Limitations and practical pitfalls

The main limitation of RND is that its bonus is based on observations, not on meaningful progress. If irrelevant visual details change, such as a score counter or background animation, the agent may receive rewards for novelty that has no value for the task. The bonus also fades as the predictor generalizes, which can stop exploration before distant rewards are found.

  • Detachment: the agent may leave a promising area and lose the bonus that would lead it back.
  • Generalization collapse: a powerful predictor can learn the target everywhere, removing the signal.
  • Sensitivity to normalization: skipping observation whitening often makes the method fail silently.
  • No episodic memory: RND alone does not reward revisiting distinct states within one episode, which later methods added.

Later research addressed several of these weaknesses. Never Give Up combined an RND-style lifelong novelty signal with an episodic novelty module, and Agent57 built on that design to exceed a human benchmark on all 57 Atari games. In practice, RND remains a strong default baseline for sparse-reward problems, provided that observations are normalized and that the bonus is monitored so that it does not fade before the task reward is discovered.

Put simply

Imagine a student who tries to copy random doodles shown on cards. After seeing a card many times, the student copies it well. A new card is hard to copy. The size of the mistake shows how new the card is.

RND gives an AI agent the same test. The agent gets a small reward for reaching places it cannot copy yet. This pushes it to explore. It keeps exploring until it finds the real goal.

In practice

A robotics research group trains a simulated arm to open a drawer and pick up a block inside. The task reward arrives only when the block is lifted, so a standard PPO agent with random actions almost never succeeds and its success rate stays near zero after 20 million steps.

The team adds random network distillation on camera images, with normalized observations and an intrinsic coefficient of 0.5. The agent first explores the space around the arm, then the drawer handle, because touching and moving the drawer produces new observations with high bonus. Once the drawer opens, the block becomes visible and the extrinsic reward appears.

After 50 million steps, the RND agent completes the task in most evaluation episodes. The team also learns to mask a flickering light in the scene, which had produced misleading bonuses during early tests.