bertweet-base

BERTweet‑base is the first publicly released large‑scale language model that has been pre‑trained **exclusively on English Twitter data**. By leveraging the RoBERTa training recipe—masked language modeling with a large‑scale byte‑pair encoding (BPE) tokenizer—BERTweet learns the idiosyncrasies of micro‑blogging: hashtags, emojis, misspellings, and the short‑form style that dominates the platform. The model is exposed through the

vinai 281K downloads mit Fill Mask
Frameworkstransformerspytorchtfjax
Tagsrobertafill-mask
Downloads
281K
License
mit
Pipeline
Fill Mask
Author
vinai

Run bertweet-base locally on a Q4KM hard drive

Q4KM now ships hard‑drive bundles pre‑loaded with the bertweet‑base model, delivering instant, plug‑and‑play access for on‑premise analytics. Accelerate your social‑media pipelines without bandwidth...

Shop Q4KM Drives

Technical Overview

BERTweet‑base is the first publicly released large‑scale language model that has been pre‑trained **exclusively on English Twitter data**. By leveraging the RoBERTa training recipe—masked language modeling with a large‑scale byte‑pair encoding (BPE) tokenizer—BERTweet learns the idiosyncrasies of micro‑blogging: hashtags, emojis, misspellings, and the short‑form style that dominates the platform. The model is exposed through the fill‑mask pipeline, making it ready for masked‑token prediction, but it can be fine‑tuned for any downstream task such as sentiment analysis, named‑entity recognition (NER), part‑of‑speech (POS) tagging, irony detection, and more.

Key features and capabilities

  • Twitter‑specific vocabulary: 50 k BPE tokens trained on 850 M tweets (≈ 16 B tokens, 80 GB of raw text).
  • RoBERTa‑style architecture: 12 transformer layers, 768 hidden dimensions, 12 attention heads, ~125 M parameters.
  • Robust to noisy text: Handles emojis, URLs, user mentions, and unconventional punctuation without preprocessing.
  • Multi‑task readiness: Demonstrated state‑of‑the‑art results on POS tagging, NER, sentiment, and irony benchmarks (see Benchmark Performance).
  • Cross‑framework support: Available for PyTorch, TensorFlow, and JAX; compatible with Hugging Face Transformers and Azure deployment pipelines.

Architecture highlights

  • Base‑size RoBERTa architecture (12 layers, 768 hidden units, 12 heads).
  • Masked language modeling (MLM) objective with a 15 % token masking rate.
  • Training corpus: 845 M tweets from 01/2012–08/2019 plus 5 M COVID‑19‑related tweets, ensuring coverage of both pre‑pandemic and pandemic language shifts.
  • Tokenizer: BPE with a 50 k vocabulary, trained on the same tweet corpus; includes special tokens for <url>, <user>, and emojis.
  • Layer‑norm and dropout settings follow the original RoBERTa configuration (layer‑norm epsilon = 1e‑5, dropout = 0.1).

Intended use cases

  • Social‑media monitoring: sentiment, brand perception, and crisis detection.
  • Content moderation: hate‑speech, harassment, and misinformation detection on short‑form text.
  • Research on micro‑blogging language dynamics (e.g., meme propagation, slang evolution).
  • Chatbot and virtual‑assistant pre‑training for informal conversational style.
  • Fine‑tuning for domain‑specific tweet classification (e.g., political stance, product feedback).

Benchmark Performance

Because BERTweet is built for the noisy, short‑form domain of Twitter, the most relevant benchmarks are those that evaluate performance on **social‑media text**. The original BERTweet paper reports state‑of‑the‑art scores on four widely used tweet‑level tasks:

  • POS tagging: 97.8 % accuracy (higher than RoBERTa‑base on the same dataset).
  • NER (entity extraction): 90.2 % F1 score, surpassing BERT‑base by ~3 % absolute.
  • Sentiment classification: 86.5 % accuracy on the Sentiment140 benchmark.
  • Irony detection: 84.1 % F1 on the SemEval‑2018 irony dataset.

These benchmarks matter because they directly reflect the model’s ability to understand **semantic nuance, hashtag semantics, and emoticon cues** that are unique to Twitter. Compared with generic BERT or RoBERTa models, BERTweet‑base consistently outperforms them on tweet‑specific tasks while matching their performance on standard GLUE‑style benchmarks. This gap demonstrates the value of domain‑specific pre‑training.


Hardware Requirements

Inference VRAM

  • Base‑size BERTweet requires roughly 4 GB of GPU memory for a single‑sentence inference pass (batch size = 1, sequence length ≤ 128).
  • For batch inference (e.g., 32 sentences) or longer sequences (≤ 256 tokens), allocate 8–10 GB VRAM.

Recommended GPU specifications

  • Any modern NVIDIA GPU with ≥ 6 GB VRAM (e.g., RTX 2060, GTX 1080 Ti) is sufficient for low‑throughput use.
  • High‑throughput or production environments benefit from 12 GB+ cards such as RTX 3060 Ti, RTX A5000, or A100 (40 GB) for multi‑batch processing.

CPU requirements

  • CPU‑only inference is possible but slower; a modern 8‑core CPU (e.g., AMD Ryzen 7 5800X or Intel i7‑10700K) can achieve ~30 tokens / second.
  • For large‑scale batch jobs, consider a server‑grade CPU with ≥ 16 cores and high‑speed RAM.

Storage needs

  • The model checkpoint (config, tokenizer, weights) occupies ~500 MB on disk.
  • Optional fine‑tuned checkpoints add a few hundred megabytes each.

Performance characteristics

  • Latency: ~15 ms per request on a RTX 3060 for a 128‑token input.
  • Throughput: ~600 tokens / second per GPU when using batch size = 32.
  • Scales linearly with additional GPUs using Hugging Face’s accelerate or DeepSpeed.

Use Cases

Primary intended applications

  • Real‑time sentiment monitoring for brands and political campaigns.
  • Automated moderation of toxic or hateful content on Twitter‑like platforms.
  • Event detection and crisis management (e.g., natural disasters, pandemics) via rapid analysis of tweet streams.
  • Academic research on language change, meme diffusion, and public opinion mining.

Real‑world examples

  • Customer‑experience analytics: A retail chain uses BERTweet‑base to classify daily tweet sentiment about product launches, achieving a 25 % reduction in manual labeling effort.
  • Public‑health surveillance: Health agencies monitor COVID‑19‑related tweets for emerging symptoms; BERTweet’s COVID‑19‑specific pre‑training improves detection of novel symptom mentions.
  • Financial market sentiment: Hedge funds ingest tweet data to gauge market mood; BERTweet’s high‑accuracy sentiment predictions feed into algorithmic trading signals.

Industries & domains

  • Marketing & advertising
  • Media monitoring & PR
  • Healthcare & epidemiology
  • Finance & investment
  • Academic & social‑science research

Integration possibilities

  • Deploy as a REST API using Hugging Face Inference Endpoints (compatible with Azure, as indicated by the deploy:azure tag).
  • Wrap in a PyTorch Lightning module for easy fine‑tuning on custom tweet datasets.
  • Export to ONNX for low‑latency inference in edge devices or mobile applications.

Training Details

Methodology

  • Pre‑training objective: Masked Language Modeling (MLM) with a 15 % token masking rate, following RoBERTa’s “dynamic masking” approach.
  • Optimization: AdamW with β₁ = 0.9, β₂ = 0.98, weight decay = 0.01, learning‑rate warm‑up over the first 6 % of steps, then linear decay.
  • Batch size: 8 384 tokens per GPU (effective batch size ≈ 64 k tokens across 8 GPUs).
  • Training steps: ~2 M updates (≈ 30 epochs over the 16 B token corpus).

Dataset

  • 850 M English tweets (≈ 16 B word tokens, 80 GB raw text).
  • Temporal span: 01/2012 – 08/2019 (845 M tweets) plus 5 M COVID‑19‑related tweets (early 2020).
  • Pre‑processing: removal of retweet markers, URL normalization, user‑mention tokenization (<user>), and emoji preservation.

Compute requirements

  • Training performed on a cluster of 8 × NVIDIA V100 GPUs (32 GB VRAM each).
  • Total wall‑clock time: ~5 days (≈ 120 GPU‑hours).
  • Peak memory usage per GPU: ~12 GB (including optimizer states).

Fine‑tuning capabilities

  • All standard Hugging Face fine‑tuning scripts (text classification, token classification, question answering) work out‑of‑the‑box.
  • Typical fine‑tuning on a downstream tweet classification task converges within 2–3 epochs on a single RTX 3090.
  • Because the tokenizer is tweet‑specific, you should retain the original vocab.txt when fine‑tuning to avoid OOV issues.

For the full list of files (config, tokenizer, model weights) see the Hugging Face repository. Community discussions and troubleshooting tips are available in the Hugging Face discussions page.


Licensing Information

BERTweet‑base is released under the MIT License (see the model card and the README). The MIT license is permissive: it grants you the right to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software, provided that the original copyright notice and license text are included in all copies or substantial portions of the software.

Commercial use

  • Yes – you may embed BERTweet in commercial products, SaaS platforms, or proprietary pipelines without paying royalties.
  • When redistributing the model (e.g., as part of a larger package), you must retain the MIT license file.

Restrictions & requirements

  • No warranty is provided; the model is offered “as‑is”.
  • There is no “copyleft” requirement – you can re‑license derivative works under a different license, as long as the original MIT notice remains.
  • For academic publications, the authors request that you cite the BERTweet paper.

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