All models

Recurrent Independent Mechanisms

Recurrent network of nearly independent modules that communicate through attention, built for the copying task.

Time series · 8,549 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

This diagram has 8,549 operations (225 KB) and is drawn when you ask.

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
8.1M
Operations
8,549
Framework
PyTorch
Recurrent
Yes
Published
ICLR 2021
Cited by
142 (as of 29 October 2026)
Authors
Anirudh Goyal, Alex Lamb, Jordan Hoffmann and others
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m19784
Graph hash
a2f915936bdd089f9c74f434c44ee562ae0f63aeb1c74dff4da48375d074cc80
Skeleton hash
d92fee4007e71823392b318b5c5dcda8b440a9d4b72de70eb331abc64bf01555
Architecture hash
c94d95fb15dddcfbef07c63da11229012ce3c80fdec7fd295ce1a632adeece95
Diagram SHA-256
ca1a9ffbd98ca2b69d7704b3977b1fb73e78052c27b1b7c3ceacf109b51fd96f
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

Recurrent Independent Mechanisms (RIMs) is a recurrent architecture that divides its state among several groups of recurrent cells, each running with nearly independent dynamics. The groups communicate only sparingly, through an attention bottleneck, and each is updated only at the time steps where it is most relevant. The motivation is that modular structure reflecting the dynamics of an environment can generalize better and stay robust when a change affects only a few of the underlying causes.

The paper summary in a second PyTorch implementation spells out the mechanics: the modules are LSTMs or GRUs, and their total number is fixed. At each time step an input attention mechanism scores the modules, the highest-scoring ones become active, and the rest receive an all-zero input. A second attention mechanism, called communication attention, then updates the active modules, which may read from inactive modules as well as active ones.

The paper reports that this design leads the modules to specialize, and that generalization improves on tasks where some factors of variation differ systematically between training and evaluation. The authors' repository contains the adding and copying synthetic tasks from the paper, along with code to reproduce the Atari results. This model is the copying-task network, which that repository trains and tests with the command ./experiment_copying.sh 600 6 4 50 200.

Key idea. The paper proposes a recurrent architecture whose groups of cells run nearly independently, communicate sparingly through attention and update only when most relevant.

  • Recurrent Independent Mechanisms
  • RIMs
  • RIM
  • modular recurrent network
  • independent mechanisms
  • copying task
  • sparse communication
  • attention bottleneck
  • systematic generalization

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{goyal2020recurrentindependentmechanisms,
      title={Recurrent Independent Mechanisms}, 
      author={Anirudh Goyal and Alex Lamb and Jordan Hoffmann and Shagun Sodhani and Sergey Levine and Yoshua Bengio and Bernhard Schölkopf},
      year={2020},
      eprint={1909.10893},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/1909.10893}, 
}