Pick the only sound pooling choice when an embedding model is built from a decoder-only LLM
Decoder-only embedders use last-token pool because causal masking gives only the final position full-sequence visibility; mean-pooling mixes vectors with mismatched context coverage.
Picture an assembly line where each worker only sees the parts that came before them. Worker 1 has seen one part. Worker 32 has seen everything. If you ask the line for a summary, you ask worker 32, the one who has seen the whole product. Averaging all the workers' opinions is silly because worker 1 was answering about one part while worker 32 was answering about the whole thing. Last-token pool asks worker 32. Mean pool averages every worker, which mixes apples and oranges.
Detailed answer & concept explanation~5 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
7 to 9 min: causal mask formula + per-position context coverage argument + why mean pool fails + last-token pool justification + instruction prefix interaction + 2026 decoder-only embedders + LLM2Vec escape hatch.
Real products, models, and research that use this idea.
- e5-mistral-7b-instruct (Microsoft, 2024) introduced the decoder-only last token with instruction pattern at scale.
- NV-Embed-v2 (NVIDIA, 2024) tops MTEB and uses last-token pooling on a Mistral-7B base.
- Linq-Embed-Mistral (Linq, 2024) is another last token pool Mistral derivative.
- GritLM-7B (Muennighoff et al., 2024) jointly trains generation and embedding with last-token pool on the embedding side.
- Some research lines (e.g. LLM2Vec) remove the causal mask and fine-tune bidirectionally, enabling mean pool, but this is invasive and rare in 2026 production.
What an interviewer would ask next. Try answering before peeking at the approach.
QWhat does removing the causal mask and re-finetuning a decoder buy you?
QWhy do decoder-only embedders often top MTEB despite the causal-mask awkwardness?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Reaching for mean pool because it is the encoder default. Mean pool requires bidirectional context, which decoder-only models do not provide; the early-position vectors are not comparable to the late-position ones.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.