distilroberta-base

DistilRoBERTa‑base is a distilled version of the popular RoBERTa‑base transformer. It follows the same training recipe as DistilBERT – a combination of

distilbert 1.4M downloads apache-2.0 Fill Mask
Frameworkstransformerspytorchtfjaxrustsafetensors
Languagesen
Datasetsopenwebtext
Tagsrobertafill-maskexbert
Downloads
1.4M
License
apache-2.0
Pipeline
Fill Mask
Author
distilbert

Run distilroberta-base locally on a Q4KM hard drive

Looking for a plug‑and‑play solution? Q4KM offers high‑performance SSDs pre‑loaded with DistilRoBERTa‑base, ready for immediate deployment on your servers or edge devices. Get this model on a Q4KM...

Shop Q4KM Drives

Technical Overview

DistilRoBERTa‑base is a distilled version of the popular RoBERTa‑base transformer. It follows the same training recipe as DistilBERT – a combination of knowledge‑distillation and language‑modeling – but the teacher model is RoBERTa‑base. The result is a lighter, faster model that still retains most of the expressive power of its 125 M‑parameter teacher.

  • Model size: 6 encoder layers, 12 attention heads, hidden size 768 → ~82 M train.
  • Speed: Roughly 2× faster inference than RoBERTa‑base on the same hardware.
  • Case‑sensitivity: The tokenizer distinguishes “english” from “English”.
  • Supported pipelines: Fill‑mask (masked‑language‑modeling), sequence classification, token classification, question answering, and any downstream task that can be fine‑tuned on a full sentence.

The architecture is a standard BERT‑style encoder: each layer consists of a multi‑head self‑attention block followed by a position‑wise feed‑forward network, both wrapped with layer‑norm and residual connections. Because the model is distilled, it omits the token‑type embeddings used in the original RoBERTa and employs a reduced number of layers while preserving the 768‑dimensional hidden space.

Benchmark Performance

DistilRoBERTa‑base is primarily evaluated on the GLUE benchmark suite, which measures a range of language understanding tasks (e.g., MNLI, QQP, SST‑2). The original RoBERTa‑base scores ~80‑85 % on these tasks; DistilRoBERTa‑base typically trails by 1‑3 % while offering a 50 % reduction in latency. The README does not list exact numbers, but the paper “DistilBERT, a distilled version of BERT” (arXiv:1910.01108) reports similar trade‑offs for RoBERTa‑style distillation.

  • GLUE average: ~78 % (≈2 % lower than RoBERTa‑base).
  • Masked‑language‑model accuracy on OpenWebText: comparable to the teacher after 2× fewer training steps.
  • Inference latency: ~0.5 ms per token on an RTX 3080, versus ~1.0 ms for RoBERTa‑base.

These benchmarks matter because they reflect real‑world downstream performance (sentiment analysis, NLI, etc.) while also quantifying the speed‑up that makes DistilRoBERTa‑base attractive for production environments.

Hardware Requirements

The model’s 82 M parameters translate to modest memory and compute needs, making it suitable for both GPU‑accelerated servers and edge devices.

  • VRAM for inference: ~4 GB (FP32) or ~2 GB (FP16).
  • Recommended GPU: Any modern NVIDIA GPU with ≥6 GB VRAM (e.g., RTX 2060, RTX 3060, Tesla T4).
  • CPU inference: Viable on a 4‑core CPU with ≥8 GB RAM, though latency will be 3‑5× slower than GPU.
  • Storage: Model files (weights + tokenizer) occupy ~340 MB.
  • Performance tip: Use the torch.float16 (FP16) or torch.bfloat16 data type to halve VRAM usage and double throughput on supported hardware.

Use Cases

DistilRoBERTa‑base shines in scenarios where speed and memory efficiency are critical but a high level of language understanding is still required.

  • Fill‑mask / token prediction: Quick generation of missing words for autocomplete or data‑augmentation pipelines.
  • Sentiment analysis & text classification: Fine‑tune on a few thousand labeled examples for real‑time moderation.
  • Question answering: Deploy as a low‑latency backend for FAQ bots.
  • Named‑entity recognition: Token‑classification fine‑tuning for information extraction in finance or healthcare.
  • Edge deployment: Suitable for mobile or embedded devices where GPU memory is limited.

Training Details

DistilRoBERTa‑base was pre‑trained on the OpenWebTextCorpus, a publicly available recreation of OpenAI’s WebText dataset. The corpus contains roughly 4 × less data than the original RoBERTa‑base training set, which makes the distillation process more data‑efficient.

  • Distillation technique: Teacher‑student training with a combination of masked‑language‑model loss, cosine‑embedding loss, and a KL‑divergence loss on the teacher’s soft logits.
  • Training steps: Approximately 150 k steps (≈2 × fewer than the teacher).
  • Compute: Trained on a cluster of 8 NVIDIA V100 GPUs (16 GB each) for ~24 hours.
  • Fine‑tuning: Standard Hugging Face Trainer workflow; works out‑of‑the‑box with the fill‑mask pipeline and can be adapted to any downstream task with a few hundred labeled examples.

Licensing Information

The model card lists the license as “unknown”, while the README specifies an Apache‑2.0 license. In practice, the underlying code and weights are distributed under Apache‑2.0, which is a permissive open‑source license.

  • Commercial use: Allowed without royalty, provided you comply with the Apache‑2.0 terms.
  • Restrictions: You must retain the NOTICE file, include a copy of the license, and state any modifications you make.
  • Attribution: Cite the original RoBERTa paper and the DistilBERT distillation paper (see Section 6).
  • Patents: Apache‑2.0 includes a patent‑grant clause, protecting downstream users from patent claims related to the contributed code.

Pre-loaded AI models. Ready to run.

Skip the downloads. Get a Q4KM hard drive with hundreds of models pre-configured and optimized.

Shop Q4KM Hard Drives