← All entries
Paper2020#584

ELECTRA: Pre-training Text Encoders as Discriminators Rather Than Generators

Summary

Replaced token detection: a small MLM generator fills 15% masks; the discriminator classifies every token as original vs replaced (MLE generator, not adversarial). Learns from all positions. ELECTRA-Small (14M, 4 days on 1 V100) GLUE 79.9 vs BERT-Small 75.1 and GPT 78.8. ELECTRA-Base 85.1 vs BERT-Base 82.2. ELECTRA-400K Large (335M, ~1/4 RoBERTa compute) GLUE 89.0 vs RoBERTa-500K 88.9; ELECTRA-1.75M 89.5 and SQuAD 2.0 test 88.7/91.4. ICLR 2020. Code https://github.com/google-research/electra.

Venue
arXiv / Stanford University / Google Brain
Purpose
Pre-train encoders more sample-efficiently by discriminating generator-replaced tokens instead of reconstructing a 15% MLM subset
Scale
Small/Base: Wikipedia+BooksCorpus 3.3B tokens. Large: XLNet mix 33B tokens (Wiki/Books + ClueWeb/CommonCrawl/Gigaword), batch 2048, 400k or 1.75M steps. Eval GLUE (median of 10 FT runs) and SQuAD 1.1/2.0.
Time period
2020-03-23 (arXiv 2003.10555 v1). Comment: ICLR 2020. HF paper publishedAt 2020-03-23.
Added
Oct 1, 2026
Research status
done

From the source

Published
Mar 23, 2020
arXiv categories
cs.CL
Author comment
ICLR 2020

Fetched Oct 3, 2026 from arXiv. These numbers change; the curated fields above do not come from here.

Abstract (from arXiv)

Masked language modeling (MLM) pre-training methods such as BERT corrupt the input by replacing some tokens with [MASK] and then train a model to reconstruct the original tokens. While they produce good results when transferred to downstream NLP tasks, they generally require large amounts of compute to be effective. As an alternative, we propose a more sample-efficient pre-training task called replaced token detection. Instead of masking the input, our approach corrupts it by replacing some tokens with plausible alternatives sampled from a small generator network. Then, instead of training a model that predicts the original identities of the corrupted tokens, we train a discriminative model that predicts whether each token in the corrupted input was replaced by a generator sample or not. Thorough experiments demonstrate this new pre-training task is more efficient than MLM because the task is defined over all input tokens rather than just the small subset that was masked out. As a result, the contextual representations learned by our approach substantially outperform the ones learned by BERT given the same model size, data, and compute. The gains are particularly strong for small models; for example, we train a model on one GPU for 4 days that outperforms GPT (trained using 30x more compute) on the GLUE natural language understanding benchmark. Our approach also works well at scale, where it performs comparably to RoBERTa and XLNet while using less than 1/4 of their compute and outperforms them when using the same amount of compute.

Tags

electrareplaced-token-detectionbertgluesquadiclrgooglestanfordpretraining

Topics

pretraining, replaced token detection, BERT

Research notes

  • Primary: arxiv abs (cs.CL). License: arXiv.org perpetual non-exclusive on HTML at check. Clark/Manning Stanford (CIFAR Fellow); Luong/Le Google Brain. Correspondence kevclark@cs.stanford.edu. Code on HTML https://github.com/google-research/electra (2,367 stars at check; Apache-2.0; archived). HF paper page 0 upvotes; 43 unofficial linked models not copied into hf_* fields. Discord posted the ICLR 2020 OpenReview PDF (id=r1xMH1BtvB); cataloged from the matching arXiv abs. Trains on public Wikipedia/BooksCorpus/ClueWeb/CommonCrawl/Gigaword rather than a new hosted corpus, so no datasets_local row. License field left blank per catalog convention.

Similar entries