SNAIL
A meta-learner built from dilated causal convolutions and causal attention over example-label sequences.
113 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
- Parameters
- 3.2M
- Operations
- 113
- Framework
- PyTorch
- Recurrent
- No
- Published
- ICLR 2018
- Cited by
- 961 (as of 16 October 2026)
- Authors
- Nikhil Mishra, Mostafa Rohaninejad, Xi Chen, Pieter Abbeel
- 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
- m2687
- Graph hash
- c1186780b142a4c6f2d0f95cfed0e308d9ed2e11ffa80a9b72cedeeb0c574dc1
- Skeleton hash
- d4597c1ab4c1172761758d2e2cc4bbd7f42e57001c98d1b1ac8496268b018664
- Architecture hash
- d2272cc8444eafa580e4714cde6936ce2254dd063eef736b273058510db1d770
- Diagram SHA-256
- fb5bc874a32b6f0ed9814c4beccaebd66b794a83963655760defe6346cdb0e81
- 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
SNAIL, the Simple Neural Attentive Learner, is a meta-learner: a network that is shown a handful of labelled examples of a new task and then classifies a fresh one, having learned a general strategy across many similar tasks. The pitch is that most meta-learners of the time were heavily hand-designed, whereas SNAIL is a generic sequence model made of two simple ingredients, temporal convolutions and soft attention. The two complement each other: convolutions give high-bandwidth access to a finite context, attention gives pinpoint access to an unbounded one, so the convolutions build the context and causal attention reads from it.
A dense block is a single causal 1D convolution with a chosen dilation rate, kernel size 2 and a gated activation, whose output is concatenated to its input. A TC block stacks dense blocks with exponentially growing dilation until the receptive field covers the sequence. An attention block does one causally masked key-value lookup and again concatenates the result to its input.
In the supervised setting the input is a sequence of example-label pairs followed by one unlabelled example, and the output is the prediction for that last item. For an N-way, K-shot episode the N times K pairs are fed in random order, and accuracy is read off the final timestep. The paper evaluates on 5-way and 20-way Omniglot and 5-way mini-ImageNet, training SNAIL and its embedding network end to end. The traced model is a third-party PyTorch port; its README reports 98.31% on 5-way 1-shot Omniglot against the paper's 99.07%.
Key idea. SNAIL shows that interleaving dilated causal temporal convolutions with causal soft attention yields a generic meta-learner that reaches state-of-the-art results in both supervised and reinforcement learning tasks.
- SNAIL
- Simple Neural Attentive Meta-Learner
- meta-learning
- few-shot learning
- temporal convolution
- attention
- Omniglot
- mini-ImageNet
- one-shot
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{mishra2018simpleneuralattentivemetalearner,
title={A Simple Neural Attentive Meta-Learner},
author={Nikhil Mishra and Mostafa Rohaninejad and Xi Chen and Pieter Abbeel},
year={2018},
eprint={1707.03141},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://arxiv.org/abs/1707.03141},
}