HyperRNN
HyperRNN is a recurrent network whose weights are generated at each timestep by a smaller hypernetwork.
Language · 10,303 operations Checked
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
- Task
- Language
- Parameters
- 4.9M
- Operations
- 10,303
- Framework
- PyTorch
- Recurrent
- Yes
- Published
- ICLR 2017
- Paper
- HyperNetworks
- Cited by
- 84 (as of 30 October 2026)
- Authors
- David Ha, Andrew Dai, Quoc V. Le
- Source
- labml-nn 0.5.1
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m17432
- Graph hash
- 3106696f5ddd988d57fab6499f2a03cd2c12ad295f01a8fbd948096146c60362
- Skeleton hash
- dce89a7565253c567a8f987081b6003215f458dec848cd16486f145a18b01057
- Architecture hash
- 77769f4d1a00634368231e0dded015999e364eb1a8a8816aab59277d13e32490
- Diagram SHA-256
- d189271d2b80c2144ae77c17b2c12a717530f9ba40b8c4fe42d2d036cec694ad
- 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
HyperRNN is a recurrent network whose weights are produced, step by step, by a second and smaller recurrent network. The paper calls the small one a hypernetwork and the larger one the main network. An ordinary RNN reuses the same weights at every timestep. Here the weights can change over timesteps and adapt to the input sequence, which the paper describes as a relaxed form of weight-sharing.
At every timestep the HyperRNN cell outputs a vector, and that vector is used to generate the weights of the main RNN for the same timestep. Building a full weight matrix this way used too much memory, so the practical version instead linearly scales the rows of a single weight matrix. The paper's experiments use the LSTM form, called HyperLSTM. For character-level language modeling on Penn Treebank it trains networks with 1000 units to predict the next character, with a HyperLSTM cell of 128 units and a signal size of 4.
On that task the paper reports that HyperLSTM outperformed both a larger and a deeper LSTM and performed similarly to an LSTM with layer normalization. The authors relate the idea to HyperNEAT, an evolutionary method, and name the main difference: their hypernetworks are trained end-to-end with gradient descent together with the main network.
Key idea. The paper shows that a small recurrent hypernetwork can generate non-shared weights for an LSTM at each timestep, relaxing the weight-sharing of ordinary recurrent networks.
- HyperRNN
- HyperLSTM
- HyperNetworks
- hypernetwork
- dynamic hypernetwork
- weight generation
- relaxed weight sharing
- recurrent neural network
- character-level language modeling
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{ha2016hypernetworks,
title={HyperNetworks},
author={David Ha and Andrew Dai and Quoc V. Le},
year={2016},
eprint={1609.09106},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/1609.09106},
}