nystromformer
A Transformer that approximates self-attention with the Nyström method at O(n) cost in sequence length.
Language · 468 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
- 109.1M
- Operations
- 468
- Framework
- PyTorch
- Recurrent
- No
- Source
- transformers 5.18.0
- License
- Apache-2.0
- 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
- m7830
- Graph hash
- b31c1798e43f295c13366c8a08b0603ac7b83f327683dcacb7776ddba5eca6c9
- Skeleton hash
- 2123fb474c320b92302a3d112bb76ed3ef41dd349f378d3201cb26c538fd0259
- Architecture hash
- 4029ddb3f53e212cbf00b716676dd11183a72512429b98c9da2127b3fd367d6b
- Diagram SHA-256
- 3547dfc94486408fa81b6e839e0f8f0b22c4a46727b276fd4cdb09885bdd98be
- TorchLens version
- 2.35.3
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
How this diagram was made
transformers.AutoModelForMaskedLM.from_config()
What it is
Nyströmformer is a Transformer model that approximates standard self-attention with the Nyström method, which brings the cost of attention to O(n) in the sequence length. The motivation is that the quadratic complexity of self-attention in the input sequence length has limited its application to longer sequences. With the approximation, the authors write, the model can be applied to longer sequences with thousands of tokens.
On the GLUE benchmark and IMDB reviews at standard sequence length, the paper reports that Nyströmformer performs comparably to standard self-attention, and slightly better in a few cases. On the longer sequence tasks of the Long Range Arena (LRA) benchmark, the paper reports that it performs favorably relative to other efficient self-attention methods.
Key idea. Nyströmformer adapts the Nyström method to approximate standard self-attention with O(n) complexity in the sequence length.
- nystromformer
- nyströmformer
- nystrom method
- nystrom attention
- efficient self-attention
- linear complexity attention
- long sequence transformer
- masked language modeling
AI-written summary, based on the model's documentation and checked automatically against it; not reviewed by a person. Corrections welcome.