bert-generation
A BERT-based decoder for sequence-to-sequence text generation.
Language · 584 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
- 354.5M
- Operations
- 584
- 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
- m3641
- Graph hash
- daaa371e61f994022726229d4f62ec708df9dd78d9411d9f7401b175b81ed47e
- Skeleton hash
- 1922b69e9c842b0d37fd3f371625e85185d843fdbb56f2ff80f445f018cc7053
- Architecture hash
- 4f36d0bcb08ab057e89f9a021a4f98b28bd5dfa2de703eca42413ac7bf31b455
- Diagram SHA-256
- f79704c0b83852ed8760bc5d7dc5742e2e773316d438b4daa0bdaaa9d2849b05
- 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.AutoModelForCausalLM.from_config()
What it is
BertGeneration is BERT adapted for generative tasks. It reuses pretrained BERT checkpoints for sequence-to-sequence tasks, where one piece of text goes in and another comes out, by placing them in an encoder-decoder model.
The library splits the model into BertGenerationEncoder and BertGenerationDecoder, which should be used together for sequence-to-sequence tasks. The decoder side adds cross attention layers, and BERT's cls token serves as the beginning-of-sequence token and its sep token as the end-of-sequence token. For summarization, sentence splitting, sentence fusion and translation, the input needs no special tokens.
Key idea. BertGeneration reuses pretrained BERT checkpoints for sequence-to-sequence generation by pairing them in an encoder-decoder model.
- BertGeneration
- bert-generation
- BERT for generation
- BertGenerationDecoder
- BertGenerationEncoder
- sequence-to-sequence
- text generation
AI-written summary, based on the model's documentation and checked automatically against it; not reviewed by a person. Corrections welcome.