roberta-base

FacebookAI/roberta‑base is a 125‑million‑parameter transformer encoder released by Facebook AI. It is a pre‑trained English language model that learns to predict masked tokens (the

FacebookAI 7.9M downloads mit Fill Mask Top 50
Frameworkstransformerspytorchtfjaxrustsafetensors
Languagesen
Datasetsbookcorpuswikipedia
Tagsrobertafill-maskexbert
Downloads
7.9M
License
mit
Pipeline
Fill Mask
Author
FacebookAI

Run roberta-base locally on a Q4KM hard drive

Accelerate your deployments with Q4KM hard drives pre‑loaded with the FacebookAI/roberta‑base model. Get instant, plug‑and‑play access to the model without the download overhead. Get this model on a...

Shop Q4KM Drives

Technical Overview

FacebookAI/roberta‑base is a 125‑million‑parameter transformer encoder released by Facebook AI. It is a pre‑trained English language model that learns to predict masked tokens (the Masked Language Modeling – MLM – objective). By randomly masking 15 % of the tokens in a sentence and forcing the network to recover them, RoBERTa learns deep, bidirectional contextual representations that can be re‑used for a wide range of downstream NLP tasks.

Key capabilities include:

  • High‑quality contextual embeddings for any English sentence.
  • Fast fill‑mask inference via the fill‑mask pipeline.
  • Seamless fine‑tuning for sequence classification, token classification, question answering, and more.

Architecture highlights:

  • 12 transformer layers (blocks) with 12 self‑attention heads each.
  • Hidden size of 768, feed‑forward dimension of 3072.
  • Byte‑Level BPE tokenizer (RobertaTokenizer) that is case‑sensitive (distinguishes “english” from “English”).
  • Trained on a combination of BookCorpus (≈16 GB) and English Wikipedia (≈16 GB) using the Fairseq implementation.

Intended use‑cases range from rapid prototyping with the fill‑mask pipeline to full‑scale fine‑tuning on downstream tasks such as sentiment analysis, named‑entity recognition, or extractive question answering.

Benchmark Performance

RoBERTa‑base was evaluated on the GLUE benchmark, SQuAD v1.1, and the RACE reading‑comprehension dataset in the original paper (Liu et al., 2019). Typical scores are:

  • GLUE average ≈ 82.5 % (higher than the original BERT‑base ≈ 80 %).
  • SQuAD v1.1 F1 ≈ 90 % (≈ 2 % improvement over BERT‑base).
  • RACE accuracy ≈ 71 % (≈ 5 % gain over BERT‑base).

These benchmarks matter because they test the model’s ability to understand sentence‑level semantics (GLUE), extract answer spans from passages (SQuAD), and perform multi‑choice reading comprehension (RACE). RoBERTa‑base’s consistent improvements stem from longer training, larger batches, and removal of the next‑sentence‑prediction objective, making it a strong baseline for most English NLP tasks.

Hardware Requirements

Inference with roberta‑base is lightweight compared to larger transformers, but still benefits from GPU acceleration.

  • VRAM for inference: ~2 GB for a single sequence (batch = 1). Batch sizes of 8–16 comfortably fit on 8 GB GPUs.
  • Recommended GPU: NVIDIA GeForce RTX 2060 or newer (6 GB+ VRAM) for low‑latency applications; RTX 3080 (10 GB) for high‑throughput batch processing.
  • CPU: Any modern x86‑64 CPU; inference on CPU will be ~3–5× slower than GPU.
  • Storage: Model files occupy ~500 MB (weights + tokenizer). Use SSD for fastest loading.
  • Performance: ~150 tokens / ms on a RTX 2060 (FP32) for batch = 1; ~1 k tokens / ms on a RTX 3080.

Use Cases

Because it produces high‑quality contextual embeddings, roberta‑base fits naturally into:

  • Masked‑language‑modeling APIs (fill‑mask) for rapid prototyping.
  • Fine‑tuned classifiers for sentiment analysis, spam detection, or topic categorisation.
  • Token‑level tasks such as named‑entity recognition or part‑of‑speech tagging.
  • Extractive question answering (e.g., SQuAD‑style) where a bidirectional representation is crucial.
  • Feature extraction for downstream pipelines (e.g., clustering, semantic search, or similarity scoring).

Industries ranging from customer‑support automation, legal document analysis, to health‑care record classification have successfully leveraged RoBERTa‑base as a backbone model.

Training Details

RoBERTa‑base was trained on a combined corpus of BookCorpus (≈ 16 GB) and English Wikipedia (≈ 16 GB). Training used the Fairseq library with the following hyper‑parameters:

  • Batch size: 8 k tokens per GPU (effective batch ≈ 32 k tokens).
  • Learning rate: 1e‑4 with linear warm‑up (10 k steps) and cosine decay.
  • Training steps: 125 k (≈ 500 M tokens).
  • Optimizer: AdamW with β₁ = 0.9, β₂ = 0.98, weight decay = 0.01.
  • Training compute: ~256 GPU‑hours on V100 (32 GB) GPUs.

The model is released with both PyTorch (RobertaModel) and TensorFlow (TFRobertaModel) checkpoints, and a RobertaTokenizer that uses a byte‑level BPE vocabulary of 50 k tokens. Fine‑tuning follows the standard Hugging Face Trainer workflow and typically converges in a few epochs on most downstream datasets.

Licensing Information

The model card lists the license as “unknown”, but the repository tags include license:mit. The MIT license is permissive: you may use, modify, distribute, and even commercialize the model as long as you retain the original copyright notice and license text.

  • Commercial use: Allowed under MIT; no royalty fees.
  • Restrictions: None specific to the model, but you must respect any downstream data licenses (e.g., BookCorpus and Wikipedia). The model may contain biased or offensive content inherited from its training data, so a responsible‑use policy is recommended.
  • Attribution: Include a reference to the original paper (Liu et al., 2019) and the MIT license notice in your documentation.

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