convbert
A BERT variant that mixes self-attention with span-based dynamic convolution.
Language · 617 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
- 106.3M
- Operations
- 617
- 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
- m3870
- Graph hash
- ff9b98761d27452ffc195622abfd67cbeb10ae516bdf5f871dfdc3840856a0d3
- Skeleton hash
- 763e430f3080257bfcf177f670de6d7639facf49af91686fc581d5f58b931272
- Architecture hash
- 12aee47907ec82109634943e6a1f9b3830eea3f416fa94ddd899d190660c494e
- Diagram SHA-256
- c7638df22f598793e92a8913598daefc6cb5e16a37a69cc1aadf5858e262dacb
- 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
ConvBERT is a BERT-style language model in which some self-attention heads are replaced by a span-based dynamic convolution. The paper starts from the point that BERT relies heavily on the global self-attention block, which brings a large memory footprint and computation cost. The authors observe that some heads only need to learn local dependencies, so part of that computation is redundant. The convolution heads model those local dependencies directly, and together with the remaining self-attention heads they form a mixed attention block.
The paper reports that ConvBERT outperforms BERT and its variants in various downstream tasks, with lower training cost and fewer model parameters. It also reports a GLUE score of 86.4 for the ConvBERTbase model, 0.7 higher than ELECTRAbase, while using less than 1/4 of the training cost.
Key idea. ConvBERT replaces some of BERT's self-attention heads with span-based dynamic convolution, forming a mixed attention block for global and local context.
- ConvBERT
- span-based dynamic convolution
- dynamic convolution
- mixed attention
- ConvBertForMaskedLM
- masked language modeling
- natural language understanding
AI-written summary, based on the model's documentation and checked automatically against it; not reviewed by a person. Corrections welcome.