New method · Language and computation
A small extra training task helps RTD encoders retain information useful for embeddings
ModernELECTRA adds a token-reconstruction task to replaced-token training. Its English model scores 86.0 on GLUE and 51.1 on MTEB English; the multilingual model’s results are more mixed.
In brief
- ModernELECTRA trains an encoder to spot replaced words and also recover each word from the hidden states at the edges of a nearby window.
- The English model scores 86.0 on GLUE, above the listed comparable-size baselines; on MTEB English it scores 51.1, close to similarly sized models.
- The multilingual model scores 85.1 on GLUE and 67.8 on XTREME’s covered languages, but trails mmBERT-small on both XTREME averages and on multilingual MTEB overall.
- The multilingual model’s weakest results are especially apparent on languages and writing systems absent from its training data.
- The authors did not run a controlled comparison to isolate whether the added reconstruction task caused the embedding results.
The background
A language encoder turns a sentence into a series of internal representations, which can then be used for tasks such as classification or search. In search, a system may turn a whole sentence or document into one vector—a list of numbers—and compare vectors to find related texts.
In replaced-token detection, a small language model suggests substitute words, and an encoder learns to tell which words were changed. This gives it a training signal at every word, but that signal asks whether a word was replaced, not which word it was or what its neighbours mean. The original ELECTRA paper describes this setup and its motivation. (s1)1
A benchmark is a collection of tests used to compare systems. MTEB tests text-vector models on different kinds of tasks, rather than assuming success on one task means success on all of them. The original MTEB paper introduced it to broaden evaluation across embedding tasks. (s2)2
What the researchers did
The authors start with a separately trained language model that suggests replacement words. They freeze it, use it to corrupt text, and train the main encoder to identify replacements. This main encoder is the part they release.
They add boundary-window reconstruction: for each eligible word, they choose a short window around it and ask the encoder to recover the original word using only the hidden states at the window’s two edges. The target word itself is not used for this prediction, and the target remains the clean, original word even if it was replaced in the input. The reconstruction task shares the same corrupted input and encoder pass as replacement detection.
The authors combine the two training losses, with a weight of 0.003 on reconstruction. They also gradually lower the replacement model’s sampling temperature, making its suggestions more plausible as training proceeds, and increase the training context from 512 to 2048 to 8192 tokens. The English encoder has 8 layers; the multilingual encoder has 16 layers and was trained on data covering 46 languages.
The paper also presents FlashDeBERTa, a fused implementation of DeBERTa’s attention mechanism. It is designed to avoid storing large tables of attention scores, which otherwise become costly for long text inputs.
What they found
On GLUE, a suite of language-understanding tests, the English EdgeCoder-31M scores 86.0. The paper compares this with 83.5 for Ettin-Enc-32m and 84.6 for MiniLM-L12; these baseline numbers are copied from earlier work. The multilingual EdgeCoder-Multilingual-61M scores 85.1, compared with 84.7 for the much larger mmBERT-small.
On MTEB English, after the same kind of contrastive fine-tuning, EdgeCoder-31M scores 51.1 across the seven reported categories. The paper describes this as comparable to similar-size models: MiniLM-L12 scores 51.3, Ettin-Enc-32m scores 50.9, and BERT-small scores 51.1. So the English model is close to, but does not exceed, every listed peer on this embedding measure.
The multilingual model’s MTEB results show a clearer weakness. Its average across the eight categories is 43.8, below mmBERT-small’s 50.7; its bitext score is 25.0 compared with 50.5, and its reranking score is 54.5 compared with 66.1. The paper notes that these tasks include languages beyond the model’s training coverage, and that the English-only fine-tuning does not provide cross-language alignment for bitext mining.
On XTREME, which tests transfer from English training to other languages, the multilingual model averages 67.8 over the 26 benchmark languages included in its training coverage, compared with 70.0 for mmBERT-small. Across all XTREME languages, it scores 62.7 compared with mmBERT-small’s 68.1. It does better than mmBERT-small on one reported covered-language task: UDPOS, a word-tagging test, where its score is 77.9 compared with 72.4.
The FlashDeBERTa benchmark reports that, at 4096 tokens, its forward pass is 10.2 times faster and uses 93% less memory than the reference implementation. The reference implementation runs out of memory at 8192 tokens, while FlashDeBERTa processes that length in 0.87 seconds using 1.2 GB. These are implementation benchmarks, separate from the encoder quality results.
Of 21 head-to-head comparisons the paper prints, 7 favour its own contribution, 13 go against it and 1 is level.
- Compared with mmBERT-small, 8 results: 2 favour the paper, 6 go against it.
- Compared with EdgeCoder-Multilingual-61M, 5 results: 1 favours the paper, 4 go against it.
- Compared with MiniLM-L12, 3 results: 2 favour the paper, 0 go against it and 1 is level.
- Compared with EdgeCoder-31M, 2 results: 1 favours the paper, 1 goes against it.
| What was measured | Result | Compared with | Difference |
|---|---|---|---|
| EdgeCoder-31M | |||
| GLUE scoreThe two scores stated are for EdgeCoder-31M and EdgeCoder-Multilingual-61M, respectively. | 86.0 | ||
| GLUE score, compared with Ettin-Enc-32m | 83.5 | Ettin-Enc-32m: 83.5 | 0.0 (0.0%) |
| GLUE score, compared with MiniLM-L12 | 84.6 | MiniLM-L12: 84.6 | 0.0 (0.0%) |
| MTEB English v2 mean type scoreAfter the reported embedding evaluation protocol. | 51.1 | ||
| EdgeCoder-Multilingual-61M | |||
| GLUE scoreThe two scores stated are for EdgeCoder-31M and EdgeCoder-Multilingual-61M, respectively. | 85.1 | ||
| EdgeCoder-31M and EdgeCoder-Multilingual-61M | |||
| Approximate pre-training token count per modelThe abstract says each model is trained on about this amount. | 1 T tokens | ||
| mmBERT-small | |||
| Size ratio relative to EdgeCoder-Multilingual-61MAbstract comparison of parameter size. | 2.3 × | EdgeCoder-Multilingual-61M | |
| FlashDeBERTa | |||
| Forward-pass speed-up over the reference implementation at 4096 tokens4096-token sequence length; comparison against the reference implementation. | 10 × | reference implementation | |
| Memory reduction versus the reference implementation at 4096 tokens4096-token sequence length; comparison against the reference implementation. | 93 % | reference implementation | |
| EdgeCoder-31M discriminator | |||
| Number of encoder layers | 8 layers | ||
| Total parameters | 31.0 M | ||
| EdgeCoder-Multilingual-61M discriminator | |||
| Number of encoder layers | 16 layers | ||
Show 28 more results
| What was measured | Result | Compared with | Difference |
|---|---|---|---|
| EdgeCoder-Multilingual-61M discriminator | |||
| Total parameters | 61.0 M | ||
| Total training tokensSum of discriminator training runs shown in the table. | 1,085 B | ||
| English training corpus | |||
| Total real tokens across three stagesReal tokens exclude padding. | 1,010.1 B | ||
| Multilingual training data read | |||
| Total real tokens across three stagesReal tokens exclude padding; multilingual Phase-2 data is an expected draw from the shuffled decay mix. | 1,085.1 B | ||
| EdgeCoder-31M discriminator | |||
| Total training tokensSum of discriminator training runs shown in the table. | 1,012 B | ||
| EdgeCoder-31M | |||
| GLUE dev averageBest development score of hyperparameter sweep; single seed. | 86.0 | MiniLM-L12: 84.6 | +1.4 (+1.7%) |
| MTEB English v2 mean across categoriesBackbone fine-tuned once on MS MARCO; scores are test-split category means. | 51.1 % | MiniLM-L12: 51.3 | -0.2 |
| MiniLM-L12 | |||
| GLUE dev averageBaseline number copied from Ettin; same stated protocol family. | 84.6 | EdgeCoder-31M: 86.0 | -1.4 (-1.6%) |
| MTEB English v2 mean across categoriesBaseline result copied from Ettin; backbones fine-tuned once on MS MARCO. | 51.3 % | EdgeCoder-31M: 51.1 | +0.2Goes against the paper |
| EdgeCoder-Multilingual-61M | |||
| GLUE dev averageBest development score of hyperparameter sweep; single seed. | 85.1 | mmBERT-small: 84.7 | +0.4 (+0.5%) |
| MTEB English v2 mean across categoriesBackbone fine-tuned once on MS MARCO. | 50.4 % | mmBERT-small: 52.1 | -1.7Goes against the paper |
| MTEB Multilingual average across eight categoriesOne MS MARCO fine-tuning epoch; MTEB Multilingual covers more languages than the model's 46-language pre-training corpus. | 43.8 % | mmBERT-small: 50.7 | -6.9Goes against the paper |
| MTEB Multilingual bitext scoreAfter one MS MARCO fine-tuning epoch. | 25.0 % | mmBERT-small: 50.5 | -25.5Goes against the paper |
| MTEB Multilingual reranking scoreAfter one MS MARCO fine-tuning epoch; table average excludes the three instruction-reranking tasks noted in its caption. | 54.5 % | mmBERT-small: 66.1 | -11.6Goes against the paper |
| XTREME average on the 26 covered benchmark languagesFine-tuned on English; one seed; checkpoint and learning rate selected on English development data. | 67.8 | mmBERT-small: 70.0 | -2.2 (-3.1%)Goes against the paper |
| XTREME average over all benchmark languagesFine-tuned on English; one seed; includes languages absent from pre-training. | 62.7 | mmBERT-small: 68.1 | -5.4 (-7.9%)Goes against the paper |
| UDPOS token accuracy on covered languagesZero-shot transfer after English fine-tuning. | 77.9 % | mmBERT-small: 72.4 | +5.5 |
| WikiANN entity F1 over all benchmark languagesIncludes languages absent from pre-training. | 45.5 % | Multilingual MiniLM: 55.2 | -9.7Goes against the paper |
| UDPOS token accuracy over all benchmark languagesIncludes languages absent from pre-training. | 64.3 % | Multilingual MiniLM: 77.8 | -13.5Goes against the paper |
| mmBERT-small | |||
| GLUE dev averageMultilingual baseline copied from mmBERT. | 84.7 | EdgeCoder-Multilingual-61M: 85.1 | -0.4 (-0.5%) |
| MTEB English v2 mean across categoriesBaseline result copied from mmBERT. | 52.1 % | EdgeCoder-Multilingual-61M: 50.4 | +1.7Goes against the paper |
| MTEB Multilingual average across eight categoriesBaseline result copied from mmBERT. | 50.7 % | EdgeCoder-Multilingual-61M: 43.8 | +6.9Goes against the paper |
| XTREME average on the 26 languages covered by EdgeCoder pre-trainingBaseline evaluated through the reported common pipeline. | 70.0 | EdgeCoder-Multilingual-61M: 67.8 | +2.2 (+3.2%)Goes against the paper |
| XTREME average over all benchmark languagesBaseline evaluated through the reported common pipeline. | 68.1 | EdgeCoder-Multilingual-61M: 62.7 | +5.4 (+8.6%)Goes against the paper |
| FlashDeBERTa | |||
| Forward-pass speed-up over reference at 4096 tokensDeBERTa-v3-base, batch size 4, BF16, NVIDIA L4 GPU. | 10.2 × | reference implementation | |
| Forward-pass activation-memory reduction at 4096 tokensDeBERTa-v3-base, batch size 4, BF16, NVIDIA L4 GPU. | 93 % | reference implementation | |
| Forward-pass runtime at 8192 tokensDeBERTa-v3-base benchmark context; reference implementation runs out of memory at this length. | 0.87 s | reference implementation | |
| Memory use at 8192 tokensReference implementation runs out of memory at this length. | 1.2 GB | reference implementation | |
What to be careful about
The authors say they did not run a controlled experiment comparing the proposed recipe with an otherwise identical encoder trained without the reconstruction task. Their evidence that the new task closes the usual embedding weakness of replaced-token training is therefore indirect: they compare their models’ results with earlier reports and other encoders.
The evaluation is not equally strong for every claim. GLUE and XTREME use a single seed, and the paper warns that small differences can be noise. Some GLUE and MTEB baseline scores are copied from other papers, so even with similar protocols, small gaps should be treated cautiously.
The MTEB results follow one contrastive fine-tuning pass on MS MARCO, so they measure how the pre-trained encoders perform after that fixed step, not a fully developed embedding product. The multilingual benchmark also includes languages outside the model’s 46-language training coverage.
The authors state that languages absent from training, especially those written in scripts not represented in its training data, are not supported. Results across all XTREME languages are weaker than results on the covered subset, particularly on word-level tasks.
How it fits with other research
ELECTRA’s original replaced-token objective trains an encoder to distinguish original words from plausible generated replacements at each position. ModernELECTRA keeps that objective but adds a different signal: reconstructing a word from the hidden states at neighbouring window boundaries. This changes what the encoder is asked to preserve while it learns to detect replacements. (s1)1
MTEB was designed to test embeddings across several kinds of tasks, because a model that performs well on one embedding task may not be equally useful for another. That is relevant here: the English model is close to similar-size baselines, while the multilingual model’s performance varies substantially by category. (s2)2
Who can use it
The released encoders are intended as compact backbones for language tasks, including classification and embedding use. The authors also describe FlashDeBERTa as usable with existing DeBERTa-v2 and DeBERTa-v3 checkpoints, without retraining those checkpoints.
Terms explained
- Replaced-token detection (RTD)
- A training task where an encoder learns to identify whether each input word is original or was substituted by a language model.
- Boundary-window reconstruction
- The extra training task in this paper: recover a word using only the encoder’s internal representations at the two edges of a nearby window.
- Hidden state
- An encoder’s internal representation of a word after processing its context.
- Embedding
- A list of numbers representing a piece of text, used to compare it with other text.
- GLUE
- A group of language-understanding tests; the paper reports an average score across its tasks.
- MTEB
- The Massive Text Embedding Benchmark, a collection of tests for text representations used in tasks such as retrieval and reranking.
- XTREME
- A benchmark for testing how well language models transfer from English training to other languages.
- Contrastive fine-tuning
- Training that adjusts text representations to bring related examples closer and distinguish them from unrelated examples.
- Bitext mining
- Finding sentences in different languages that express the same meaning.
- Reranking
- Reordering a set of search results so the most relevant items appear first.
Questions this paper answers
What is ModernELECTRA boundary-window reconstruction?
It is an extra training task that asks the encoder to recover each eligible original word using only the hidden states at the edges of a nearby window. The task is combined with replaced-token detection.
How does EdgeCoder-31M perform on GLUE and MTEB English?
It scores 86.0 on GLUE. On MTEB English, it scores 51.1 across the reported categories, close to several similar-size encoders.
How does EdgeCoder-Multilingual-61M compare with mmBERT-small?
It scores 85.1 on GLUE, compared with 84.7 for mmBERT-small. It trails mmBERT-small on the XTREME average for covered languages and on the MTEB Multilingual average.
What is FlashDeBERTa, and what speed result does the paper report?
FlashDeBERTa is a fused implementation of DeBERTa attention intended to reduce memory use on long inputs. At 4096 tokens, the paper reports a forward pass 10.2 times faster than the reference implementation.
The paper in detail
Everything below is recorded from the paper and matched against its text.
What the paper claims, in its own terms
- Shown
The auxiliary objective reconstructs each token's original identity from the final-layer states at two window boundaries.
Holds when: The sampled window strictly contains the token; boundary states are the only discriminator states used for the target reconstruction.
- Shown
The English and multilingual encoders obtain GLUE averages of 86.0 and 85.1, respectively.
Holds when: Reported evaluation uses the paper's stated GLUE protocol and single-seed runs.
- Shown
EdgeCoder-31M outperforms the listed comparable-size English baselines on the reported GLUE average.
Holds when: Reported GLUE evaluation.
- Shown
EdgeCoder-31M reaches MTEB English v2 performance in the range of similarly sized MLM encoders.
Holds when: Each backbone is fine-tuned once on MS MARCO before evaluation.
- Shown
FlashDeBERTa substantially improves speed and memory use over the reference implementation at a 4096-token length.
Holds when: Reported DeBERTa-v3-base benchmark.
- Shown
The RTD and window losses retain a trade-off controlled by the window-loss weight.
Holds when: The paper reports that increasing the weight weakens RTD and GLUE but improves MTEB.
The method, step by step
- Pre-train an MLM generator from scratch, then freeze it.
- Select masked positions in the input and sample generator replacements at the scheduled temperature.
- Run the corrupted sequence through the discriminator encoder.
- Train RTD on every non-padding token position.
- For each eligible token, sample a feasible 3–12-token window containing it strictly inside; interpolate the two boundary hidden states by relative offset and reconstruct the original clean token.
- Sum RTD loss and boundary-window loss with window-loss weight 0.003; discard the training heads after pre-training.
- Train with a short-to-long context curriculum, then release the discriminator encoder.
- Use FlashDeBERTa fused kernels for disentangled attention.
New in this paper
- Boundary-window reconstruction as an auxiliary task for RTD encoders, reconstructing all eligible tokens from only the two boundary states of sampled windows.
- FlashDeBERTa fused implementation of DeBERTa disentangled attention described in this paper.
- The specific combination of frozen generator, hard-negative temperature curriculum, and three-stage length curriculum in this training recipe.
Taken from earlier work
- The discriminator backbone uses DeBERTa-v2/v3 disentangled relative attention.
- The fixed pre-trained generator and decreasing sampling temperature follow Fast-ELECTRA's ideas.
- The boundary-only bottleneck is related to SpanBERT's span-boundary objective, but this paper changes the inputs, targets, and position handling.
- FlashDeBERTa's kernel structure derives from FlagAttention; distance lookup and banded gradient accumulation are adapted from DisentangledFlash.
- Token embedding factorization follows ALBERT.
Assumptions
- The generator's sampled replacements provide suitable RTD negatives, with their hardness controlled by temperature.
- A 512-token context is sufficient for the frozen generator to produce locally plausible replacements during long-context training.
- Boundary states of the discriminator can learn to encode neighbourhood token identities when used to reconstruct targets across sampled offsets.
- The selected window-loss weight 0.003 is a practical operating point balancing GLUE and MTEB performance.
Terms as the paper defines them
- replaced-token detection (RTD)
- A discriminator is trained to identify, at each token position, whether a generator replaced the original token.
- boundary-window reconstruction
- For each token, reconstruct its clean identity using only the discriminator hidden states at the two boundaries of a sampled window containing that token.
- Mean len.
- The mean number of non-padding tokens in each row.
- Mean (Type)
- The mean score across the seven MTEB English categories.
- Avg
- The mean score over the eight displayed MTEB Multilingual categories.
- diagnostic temperature
- The fixed temperature used to compute RTD diagnostics, separate from the changing training corruption temperature.
Methods, datasets and ideas it names
- boundary-window reconstructionMethod · Introduced here
An auxiliary task reconstructing each token's clean identity from the discriminator hidden states at two boundaries of a sampled window.
- replaced-token detection (RTD)Method · Used
A discriminator objective that decides whether a generator replaced each token.
- frozen generatorMethod · Used
A separately pre-trained MLM generator whose parameters remain fixed while it proposes replacement tokens.
- FlashDeBERTaTool · Introduced here
A fused GPU-kernel implementation of DeBERTa disentangled attention that avoids storing dense sequence-length-squared score matrices.
- DeBERTa-v2/v3Method · Used
The encoder architecture used for both generator and discriminator networks.
- disentangled relative attentionMethod · Used
Attention using content-to-position and position-to-content terms and relative-position embeddings.
- DeBERTaV3 tokenizerTool · Used
The tokenizer reused for the English model.
- mDeBERTa-v3 tokenizerTool · Used
The tokenizer reused for the multilingual model.
- mDeBERTa-v3Method · Used
The paper's multilingual tokenizer source and a referenced encoder family.
- span-boundary objective (SBO)Method · Compared against
A span-oriented objective that predicts masked-span tokens from representations at the span boundaries and a position embedding.
- Fast-ELECTRAMethod · Extended
Earlier work whose fixed language-model generator and descending sampling-temperature ideas this paper adopts.
- MTEBDataset · Used
A benchmark suite used to evaluate embedding tasks in English and multilingual settings.
- GLUEDataset · Used
A benchmark used to evaluate natural-language understanding.
- XTREMEDataset · Used
A benchmark used to evaluate zero-shot cross-lingual transfer.
- MS MARCODataset · Used
The data used for contrastive fine-tuning of the encoders as sentence-embedding models.
- StableAdamWTool · Used
The optimizer used for training.
- FlagAttentionMethod · Used
Prior work from which the FlashDeBERTa kernel structure is derived.
- DisentangledFlashMethod · Used
Prior work whose distance lookup and banded gradient accumulation are adapted.
- 512→2048→8192 length curriculumMethod · Used
A three-stage data and training setup that increases maximum sequence length from 512 to 2048 to 8192.
- English corpusDataset · Introduced here
A corpus of about 1.0T tokens from fourteen sources used to train the English model.
- multilingual corpusDataset · Introduced here
A corpus combining the English corpus with multilingual data sources.
- FineWeb-2Dataset · Used
A multilingual web-text source used for 45 non-English languages.
- FinePDFs-EduDataset · Used
An educational and technical PDF text source used in both English and multilingual data.
- peS2oDataset · Used
An open-access scientific paper and abstract source included in the English corpus.
Limits the authors state
- The paper reports no systematic controlled ablation because training a discriminator without the window loss on the same data exceeded its budget.
- MTEB scores reflect the backbone after one contrastive fine-tuning pass, rather than a fully trained embedding model.
- XTREME results use one seed, and the paper notes that differences of about one point may be noise.
- GLUE and MTEB baselines are copied from other papers, and protocol details differ, so small score differences should not be over-interpreted.
- The multilingual model targets 46 languages and does not support languages outside this set, especially languages using scripts absent from pre-training.
- The evaluation does not isolate the effect of the multilingual model's Phase-2 mixed-decay-run design from model size and data.
How the evidence was gathered
- Samples or repeats
- GLUE and XTREME results use one seed (42); discriminators are trained on about 1.01T English and 1.085T multilingual real tokens. MTEB fine-tuning uses one epoch on 1M triplets and an effective batch of 1024 triplets.
- Uncertainty reported
- No
- Significance tested
- No
- Notes
- The paper states that benchmark results are single runs unless otherwise noted; several comparison baselines are copied from prior papers, and the authors caution against over-interpreting small differences.
Code and data
- Code from the authors: https://github.com/Knowledgator/FlashDeBERTa (Apache 2.0)
- Model from the authors: https://huggingface.co/knowledgator/EdgeCoder-31M
- Model from the authors: https://huggingface.co/knowledgator/EdgeCoder-Multilingual-61M
- Data: https://huggingface.co/datasets/sentence-transformers/msmarco-co-condenser-margin-mse-sym-mnrl-mean-v1
Questions the paper leaves open
- How does the window-loss weight affect results in a controlled ablation?
- How do different window-width ranges affect performance?
- How does boundary interpolation compare with concatenating the boundary states?
- What is the isolated effect of the multilingual Phase-2 mixed decay run, apart from model size and data?
Sources
Paper details
- Title
- ModernELECTRA: Replaced-Token Detection with Boundary-Window Reconstruction for Compact Encoders that Classify and Embed
- Authors
- Mykhailo Shtopko, Ihor Stepanov, Dmytro Vodianytskyi, Oleksandr Lukashov
- Published
- 23 November 2026
- Version read
- v1
- Field
- Language and computation
- arXiv
- 2611.31495
This explanation was written for this site from the paper's own source. 103 passages and figures recorded from the paper were matched against its own text; 20 that could not be matched were left off this page. It does not judge whether the paper is right, and most papers on arXiv have not been peer reviewed. Read the paper before relying on a result.