# google-research/electra

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

Repository: https://github.com/google-research/electra
Canonical: https://ross.abutalabs.com/products/electra
Language: Python
License: Apache-2.0
License Family: permissive
Topics: nlp, deep-learning, tensorflow
Archived: true
Last push: 2024-03-23T03:59:14+00:00

## Health v2 (maintenance only)
Score: 10/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 2367, "days_push": 893, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases, archived
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2367, forks 347 (observed 2026-08-28T04:06:41.600185+00:00)

## What it is
ELECTRA is a research library from Google for self-supervised pre-training of transformer text encoders using a discriminator-based objective that replaces masked tokens with generated fakes. It includes pre-training and fine-tuning code plus released small/base/large English models, and the Electric energy-based cloze variant.

## Use cases
- pre-train a small transformer language model on a single GPU
- fine-tune a pretrained encoder for text classification on GLUE
- build a question answering model on SQuAD
- train a sequence tagging model for text chunking
- score text with pseudo-likelihoods to re-rank speech recognition or machine translation outputs

## When to choose
- you want strong encoder pre-training with limited compute
- you need a small efficient BERT alternative for classification, QA, or tagging
- you are reproducing or extending ELECTRA/Electric research

## When to avoid
- you need a maintained production NLP framework or recent model releases
- you want multilingual or generative (decoder) models
- you prefer PyTorch over TensorFlow

## Facets
- artifact type: library
- maturity: maintenance
- function: machine-learning, deep-learning, nlp, llm-training
- domain: deep-learning, machine-learning
- platform: python
- tags: transformers, pre-training, language-models, tensorflow, research-code, discriminative-pretraining, natural-language-processing, gpu, linux

## Member repositories
- google-research/electra (main) score 10

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:41.600185+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:35:57.525006+00:00, confidence not recorded.
  - readme: https://github.com/google-research/electra (fetched 2026-08-28T04:06:41.600185+00:00, sha 24775a85ef36)
- Data as of 2026-08-30T08:39:29.467469+00:00.
