Attention
Self-attention and attention mechanisms used in transformers, modules, and related reference pages.
Module type
Model
- DeepSeek-V4-Flash
A lighter DeepSeek-V4 serving profile that keeps the same conceptual stack while prioritizing faster deployment paths.
- DeepSeek-V4-Pro
The larger DeepSeek-V4 reasoning model, built around long-context attention, MoE routing, and coupled post-training and serving choices.
- GLM-5
A large open-weights GLM model that pairs sparse-attention and mixture-of-experts routing with an agentic-engineering training story.
- GLM-5.2
A later GLM line member that extends sparse-attention mixture-of-experts architecture with a solid 1M-token context and long-horizon coding emphasis.
- GPT-3
A large decoder-only language model that made in-context prompting and few-shot text generation a mainstream reference point.
- Llama 3
Meta's open-weight Llama-family decoder-only transformer release, spanning dense and instruction-tuned checkpoints with long-context support.
- Mixtral 8x22B
A larger open-weights Mixtral sparse mixture-of-experts model with 141 billion total parameters, about 39 billion active per token, and a 64,000-token context window under Apache 2.0.
- Mixtral 8x7B
The first open-weights Mixtral sparse mixture-of-experts model with 46.7 billion total parameters, about 12.9 billion active per token, and a 32,768-token context window under Apache 2.0.
- Qwen3-0.6B
The smallest dense Qwen3 open-weight checkpoint: a 0.6-billion-parameter causal language model with 32,768-token context, Apache 2.0 licensing, and post-training for reasoning and instruction following.
- Qwen3.5-0.8B
The smallest published Qwen3.5 open-weights checkpoint with multimodal inputs, a hybrid decoder stack, and a 262,144-token native context window.
- Qwen3.6-27B
The dense Qwen 3.6 open-weights model with a 27-billion-parameter stack, multimodal inputs, and a 262,144-token native context window.
- Qwen3.6-35B-A3B
The sparse-expert Qwen 3.6 open-weights model with 35 billion total parameters, about 3 billion active per token, multimodal inputs, and a 262,144-token native context window.
Module
- Attention
How transformer blocks mix information across token positions using query, key, and value projections.
- Bidirectional Attention
An attention pattern that lets each token read context on both sides when the model is allowed to see the full sequence.
- Block-Sparse Attention
An attention variant that divides the attention map into token blocks and computes scores only for selected block regions instead of every token pair.
- Causal Attention
An attention pattern that lets each token read earlier tokens and itself, but not later tokens, so the model can predict text one step at a time.
- Compressed Sparse Attention
A DeepSeek-V4 attention variant that mixes compression and sparse access so very long prompts stay tractable.
- Cross-Attention
An attention pattern where queries come from one stream while keys and values come from a different memory source.
- Gated DeltaNet
A sequence-mixing module that updates a compact recurrent memory state with input-dependent gating and delta-rule writes instead of materializing a full attention matrix.
- Grouped-Query Attention
An attention variant that reduces key-value cache memory by sharing key-value heads across query groups.
- Heavily Compressed Attention
A DeepSeek-V4 long-context attention path that relies on a more aggressively compressed memory view when full-detail history is too costly.
- Linear Attention
An attention variant that replaces explicit softmax dot-product attention with kernel or feature-map formulations that scale near-linearly with sequence length.
- Local Attention
A broad attention pattern that lets each query look only at a nearby neighborhood instead of the full sequence.
- Manifold-Constrained Hyper-Connections
A DeepSeek-V4 block-level wiring change that gives layers a richer shared path without making every update fully dense.
- Multi-Head Attention
The baseline attention design that gives every query head its own key-value head pair.
- Multi-Head Latent Attention
An attention variant that compresses key-value cache storage into a low-rank latent space while keeping distinct query heads.
- Multi-Query Attention
An attention variant that shares one key-value head across all query heads to minimize key-value cache memory.
- Sliding-Window Attention
An attention variant that restricts each query to a fixed local window of key positions instead of the full sequence.
- Sparse Attention
An attention variant that computes scores only for a subset of token pairs instead of every query-key combination.
Concept
- Key-value cache
Saved key and value tensors from earlier tokens that let later generation steps reuse attention state instead of recomputing the full prefix.
- Prefill
The prompt-processing stage that reads the full input once, builds the first attention state, and sets up generation before any reply token appears.
- Prefill/decode split
The serving setup that separates prompt processing from token-by-token generation because the two stages stress hardware, memory, and latency in different ways.
- Self-attention
How a token reads other tokens from the same sequence so a transformer can mix context before producing the next representation.
Paper
- Attention Is All You Need
The 2017 paper that introduced the transformer, using self-attention as the main way tokens mix information in encoder-decoder sequence models.
- BERT Paper
The paper that introduced deep bidirectional transformer encoders trained with masked language modeling and fine-tuned for language understanding tasks.
- DeepSeek-V4
A technical report that bundles DeepSeek-V4 architecture, long-context attention, post-training methods, and serving systems into one connected release.
Glossary
- Autoregressive Generation
A generation paradigm that produces outputs one discrete step at a time, each step conditioned on everything generated so far.
- Decode
The repeated next-token stage that reuses the KV cache and turns inter-token latency into the main reader experience after prefill finishes.
- KV cache
The saved key and value tensors a decoder keeps from earlier tokens so later tokens can reuse attention state instead of recomputing the full prefix.
- Token
The smallest unit of text a language model reads and predicts—usually a word piece, not always a whole word. Each token ID maps to a dense vector through vector embedding of model hidden size before attention runs.