AIAny
AI Model2022
Icon for item

DistilBERT (distilbert-base-uncased)

A compact pretrained bidirectional Transformer distilled from BERT base for masked language modeling and downstream NLP fine-tuning. Trained via knowledge distillation on BookCorpus and English Wikipedia, it reduces size/latency (≈67M params) while preserving BERT-like representations.

Introduction

Distillation makes strong language representations cheaper: this model trades parameter count and inference latency for a close approximation of BERT's internal features, so you can run typical sentence-level NLP tasks (classification, token labeling, QA embeddings) with much lower compute.

Key Capabilities
  • Knowledge-distilled BERT representations: trained to match BERT base logits and hidden states via a triple-objective (distillation loss, masked language modeling, cosine loss), so fine-tuned variants often approach BERT-level accuracy with smaller footprint.
  • Small, uncased Transformer backbone (≈67M parameters): lower memory and faster inference than BERT base, so it’s useful for CPU or latency-sensitive deployment and large-scale feature extraction.
  • Off-the-shelf masked-language and feature-extraction support: compatible with Hugging Face Transformers pipelines (fill-mask, text-classification, embeddings) and available in PyTorch/TF runtimes.
  • Standard pretraining data and behavior: pretrained on BookCorpus + English Wikipedia with WordPiece 30k vocabulary and the usual 15% masking scheme, so it integrates smoothly into existing BERT-style workflows.
Who It's For and Trade-offs

Great fit if you need a BERT-like encoder but want lower inference cost, e.g., production classifiers, token-labeling systems, embedding generation for retrieval, or quick prototyping on limited hardware. Look elsewhere if you require the absolute top GLUE/SQuAD performance (BERT-large or current larger encoder models) or if you need causal/text-generation capabilities (use GPT-family models for that). Note also that it inherits biases from its teacher and pretraining corpora; expect similar demographic and occupational biases and evaluate accordingly.

Where It Fits

Practical alternative to BERT base when throughput or deployment constraints matter; not a replacement for autoregressive generators. Often chosen as a baseline or backbone when teams want faster iteration and reduced cloud cost while preserving a bidirectional encoder architecture.

Information

  • Websitehuggingface.co
  • OrganizationsHugging Face
  • AuthorsVictor Sanh, Lysandre Debut, Julien Chaumond, Thomas Wolf
  • Published date2022/03/02

Categories

More Items

Hugging Face
AI Model2022

Pretrained uncased English BERT base model for masked language modeling and next-sentence prediction. ~110M parameters, pretrained on BookCorpus and English Wikipedia; commonly fine-tuned for classification, token labeling, and question answering.

Hugging Face
AI Model2022

Autoregressive transformer that generates English text from a prompt and can be fine-tuned for downstream NLP tasks. This is the 124M-parameter GPT-2 checkpoint (causal LM, byte-level BPE, 1024-token context) hosted on Hugging Face.

Hugging Face
AI Model2026

A 4B-parameter on-device general-purpose LLM for chat, writing, translation, coding and agentic workflows with native 1,000,000-token context. Uses a hybrid attention design to enable long-context efficiency, pretrained on ~20T tokens, and compatible with vLLM, llama.cpp, Ollama and LM Studio.