Controlled Study Shows Decoder Sentence-Embedding Strength Comes from Pretraining
Summary:A research team compared encoder-only and decoder-based sentence embedding models at 0.5B and 1B parameters in Japanese and English, holding parameter count, tokenizer, training data, and training procedure constant. In the from-scratch setting, the encoder averaged better across the tested languages, scales, and decoder implementations at pretraining budgets up to 20B tokens; a decoder pretrained on 10T tokens, however, overtook its matched encoder after the same adaptation recipe. The results
Core Finding
This study does not reduce the encoder-versus-decoder choice to an architectural preference. Instead, it separates two factors: the attention architecture used to produce sentence embeddings and whether the model inherits large-scale pretraining. The authors perform paired comparisons at 0.5B and 1B parameters in Japanese and English while holding parameter count, tokenizer, training data, and training procedure constant.
Here, random initialization does not mean that the models remain untrained; it means that pretraining begins from random weights. Within budgets of up to 20B tokens, the encoder performs better on average across the tested languages, model sizes, and decoder implementations. A decoder pretrained on 10T tokens, however, overtakes its matched encoder after applying the same sentence-embedding adaptation recipe. The evidence therefore does not show that decoder architectures are inherently superior for sentence embeddings. Much of their apparent advantage comes from transferable pretraining.
Why the Controlled Design Matters
Conventional embedding leaderboards mix architecture, parameter count, corpus size, training objective, and pooling strategy. A 10T-token model beating a 1B model trained from scratch cannot establish that decoders are intrinsically better. This study instead uses a paired design to isolate architecture from transfer:
- The architecture comparison keeps parameter count, tokenizer, training data, and training procedure aligned while testing encoders and decoders under the same budget.
- The transfer comparison then introduces checkpoints with different pretraining scales to see whether inherited language capability outweighs the architectural gap.
- Testing two model scales, Japanese and English, and multiple decoder implementations reduces the risk that the conclusion applies to only one model or one language.
That makes the study more informative than a standard architecture ranking. However, the collected material does not disclose the exact models, datasets, sentence-level pretraining objectives, pooling methods, random seeds, or statistical significance. Full reproduction still requires the paper's experimental configuration.
Technical Mechanism: Why the Encoder Wins from Scratch
1. Bidirectional and causal visibility differ
A typical encoder uses bidirectional self-attention, allowing every token to aggregate context from both sides. A typical decoder applies a causal mask, so each position can attend only to itself and preceding tokens.
Causality does not automatically make a decoder embedding unusable. A final-token or EOS representation can summarize the complete preceding sentence. Other token positions, however, contain only prefix-conditioned information. If an implementation averages all token states, much of the representation cannot use right-side context. An encoder gives every token bidirectional context and is therefore generally easier to use with mean pooling for sentence-level representation.
For sequence length L and hidden width d, dense self-attention requires roughly O(L²d) work, while a naive attention matrix also consumes O(L²) memory. Fused kernels such as FlashAttention avoid materializing the full matrix without removing the quadratic arithmetic. Bidirectional and causal masks mainly alter visibility rather than the asymptotic cost. At typical sentence lengths, data quality, objective design, and pooling are likely to matter more than the asymptotic difference between the two attention masks.
2. Pretraining objectives are not identical to embedding objectives
A decoder's usual next-token objective learns local language patterns and generation behavior and can transfer broad linguistic knowledge, but it does not directly require semantically similar sentences to receive similar vectors. The adaptation stage must reshape the representation space through contrastive learning or another sentence-level objective.
An encoder can also be trained from scratch, but bidirectional structure and sentence-level objectives are generally more compatible with similarity learning. The study additionally reports that sentence-level language understanding is more closely associated with embedding quality than span-extraction ability. In other words, locating or extracting a text span and representing the meaning of an entire sentence are different capabilities; the former cannot substitute for the latter.
Core Results: Architecture and Transfer Are Separated
The paper provides two complementary evidence chains:
- When trained from scratch with budgets up to 20B tokens, the encoder averages better than the decoder, supporting the absence of an intrinsic decoder advantage for sentence-level encoding.
- A decoder pretrained on 10T tokens surpasses the encoder after the same adaptation recipe, showing that transfer from a mature checkpoint can reverse the architectural comparison.
- A model pretrained on 100B tokens achieves performance comparable to another pretrained on 18T tokens after adaptation, demonstrating that training-token count alone cannot fully explain quality.
- Sentence-level understanding is more closely related to embedding quality than span extraction, pointing toward more specific pretraining data and task design.
The third observation does not mean that pretraining scale is irrelevant. An 18T-token budget is roughly 180 times larger than a 100B-token budget, yet the adapted results are comparable. Differences in data composition and quality, training objectives, tokenization efficiency, optimization, or architecture-transfer effectiveness may contribute. The available information does not isolate which factor dominates.
Engineering Economics: Compute Changes the Decision
For a dense Transformer with N parameters and D training tokens, forward and backward training compute can be approximated as:
C_train ≈ 6ND
This ignores attention overhead, recomputation, and implementation details, but it exposes the scale. At a fixed parameter count, moving from 20B to 10T tokens represents a 500-fold increase in training volume. Training a decoder from scratch solely for sentence embeddings is therefore difficult to justify against a dedicated encoder. Reusing an existing 10T-token checkpoint shifts the expenditure from pretraining toward adaptation and inference.
The practical question is not simply which architecture is stronger, but what checkpoint the team already owns:
- Without an available pretrained checkpoint, the controlled results support training an encoder first.
- With a mature checkpoint, adapt it under the same recipe and let task-level evaluation decide.
- A large decoder checkpoint does not eliminate the need for ablations; EOS, mean pooling, and sentence-specific objectives should still be compared.
- Token budgets should not be treated as a single proxy for model quality; data mixture and objective design must also be tracked.
Benchmark Objectivity: Strong Controls, Limited Disclosure
The study has a clear methodological advantage over open leaderboard comparisons: it controls several major variables and covers both training from scratch and checkpoint transfer. Multiple decoder implementations and two languages also broaden the empirical scope.
The available material still cannot establish the size of the engineering benefit. Major gaps include:
- Absolute benchmark scores, per-language results, task variance, confidence intervals, and significance tests are not disclosed.
- An average lead can conceal regressions on individual datasets, model variants, or pooling strategies.
- Japanese and English at 0.5B and 1B do not automatically generalize to multilingual, code, long-document, medical, or enterprise-domain data.
- The association between sentence understanding and embedding quality requires correlation coefficients, probing methods, or ablations; correlation alone does not establish causality.
- Offline embedding metrics do not necessarily predict end-to-end retrieval. Recall, rerankers, vector dimensions, and index costs can change the final result.
Deployment Guidance for Developers
| Scenario | Recommendation | Required validation | |---|---|---| | Training from scratch within the paper's tested range | Use an encoder as the primary baseline | Compare at least three models under equal token and data budgets | | An encoder checkpoint is available | Adapt it and strengthen the sentence-level objective | Compare mean pooling, EOS pooling, and sentence-level contrastive training | | A large decoder checkpoint is available | Adapt it and compare fairly against an encoder | Inspect EOS behavior, normalization, and prefix-conditioned bias | | Production retrieval or clustering | Do not substitute leaderboard metrics for business evaluation | Add recall, clustering, throughput, memory, and p95-latency tests |
Before training, freeze the tokenizer, corpus, parameter scale, and optimization procedure, then run multiple random seeds. The evaluation matrix should cover Japanese, English, business domains, length distributions, and ambiguous inputs such as negation, questions, and code snippets. Mean, EOS, and weighted pooling should be measured separately.
Training cost and online cost also need to be separated. A sentence-embedding service normally performs one forward pass over known text rather than generating tokens one by one, so it does not require a generation-style KV-cache loop. A causal decoder still has naturally prefix-conditioned token states. Static corpora can be encoded offline and cached, leaving the online service to process incremental content. Batch size, vector dimensionality, index precision, and accelerator allocation should then follow measured throughput rather than model branding or pretraining-token counts.
The study's conclusion is not that encoders defeat decoders. It provides a more useful boundary: when training from scratch, an encoder is usually the better starting point; when a strong checkpoint is already available, transferred knowledge may matter more than nominal architecture. Either route still requires equal-budget comparisons and end-to-end task validation.
— END —Source: Hugging Face Daily Papers (2026-11-30)
Tags: #Sentence Embeddings #Encoder-Decoder Comparison #Pretraining Transfer #Representation Learning
Editorial & Fact-Checking Note: This article is compiled from primary research, official release documentation, and source papers by the ZICQ Newsroom pipeline with automated entity verification and human editorial review. If you notice any technical inaccuracy, please submit a correction via our corrections policy or email our editorial desk directly.
Community Comments