Skip to content
StackDecode
AI & ML Atlas
Reinforcement LearningtechniqueAnimated walkthrough

Experience Replay

Stores past transitions and trains on random samples of them.

The idea

Consecutive experiences are strongly correlated, which destabilises neural-network training, and each experience would be used only once. A replay buffer keeps many past transitions; sampling random mini-batches breaks the correlation and reuses valuable data many times, making learning more stable and sample-efficient.

Watch it run

The pipeline lights up one step at a time. Use the controls to pause or step through it.

  1. 1Store each (s, a, r, s′, done) in a fixed-size buffer.
  2. 2Overwrite the oldest entries when it is full.
  3. 3Sample a random mini-batch.
  4. 4Train on it, then continue acting.
1/4

Step by step

  1. 1Store each (s, a, r, s′, done) in a fixed-size buffer.
  2. 2Overwrite the oldest entries when it is full.
  3. 3Sample a random mini-batch.
  4. 4Train on it, then continue acting.

Where it is used

DQN, DDPG, SAC and other off-policy methods.

Watch out for

Old data comes from outdated policies, so it is only valid for off-policy learning.

Related