Hippius
mainsafetensorsPublicmit

archive/xlm-roberta-base

sha256:74e1da998276094eed1fffeb0661b4303eddc7189763535f182b2736f70d5433·Indexed 26d ago

Parameters

—

Total size

1.1 GB

Files

23

Quantization

—

README.md

5.5 KB

Mirror. This is an unmodified copy of FacebookAI/xlm-roberta-base at commit e73636d4f797, mirrored by Hippius on 2026-10-29. Large files were checked against Hugging Face's published SHA-256 before upload (1 verified). License: mit. All credit to the original authors.

XLM-RoBERTa (base-sized model)

XLM-RoBERTa model pre-trained on 2.5TB of filtered CommonCrawl data containing 100 languages. It was introduced in the paper Unsupervised Cross-lingual Representation Learning at Scale by Conneau et al. and first released in this repository.

Disclaimer: The team releasing XLM-RoBERTa did not write a model card for this model so this model card has been written by the Hugging Face team.

Model description

XLM-RoBERTa is a multilingual version of RoBERTa. It is pre-trained on 2.5TB of filtered CommonCrawl data containing 100 languages.

RoBERTa is a transformers model pretrained on a large corpus in a self-supervised fashion. This means it was pretrained on the raw texts only, with no humans labelling them in any way (which is why it can use lots of publicly available data) with an automatic process to generate inputs and labels from those texts.

More precisely, it was pretrained with the Masked language modeling (MLM) objective. Taking a sentence, the model randomly masks 15% of the words in the input then run the entire masked sentence through the model and has to predict the masked words. This is different from traditional recurrent neural networks (RNNs) that usually see the words one after the other, or from autoregressive models like GPT which internally mask the future tokens. It allows the model to learn a bidirectional representation of the sentence.

This way, the model learns an inner representation of 100 languages that can then be used to extract features useful for downstream tasks: if you have a dataset of labeled sentences for instance, you can train a standard classifier using the features produced by the XLM-RoBERTa model as inputs.

Intended uses & limitations

You can use the raw model for masked language modeling, but it's mostly intended to be fine-tuned on a downstream task. See the model hub to look for fine-tuned versions on a task that interests you.

Note that this model is primarily aimed at being fine-tuned on tasks that use the whole sentence (potentially masked) to make decisions, such as sequence classification, token classification or question answering. For tasks such as text generation, you should look at models like GPT2.

Usage

You can use this model directly with a pipeline for masked language modeling:

>>> from transformers import pipeline
>>> unmasker = pipeline('fill-mask', model='xlm-roberta-base')
>>> unmasker("Hello I'm a <mask> model.")

[{'score': 0.10563907772302628,
  'sequence': "Hello I'm a fashion model.",
  'token': 54543,
  'token_str': 'fashion'},
 {'score': 0.08015287667512894,
  'sequence': "Hello I'm a new model.",
  'token': 3525,
  'token_str': 'new'},
 {'score': 0.033413201570510864,
  'sequence': "Hello I'm a model model.",
  'token': 3299,
  'token_str': 'model'},
 {'score': 0.030217764899134636,
  'sequence': "Hello I'm a French model.",
  'token': 92265,
  'token_str': 'French'},
 {'score': 0.026436051353812218,
  'sequence': "Hello I'm a sexy model.",
  'token': 17473,
  'token_str': 'sexy'}]

Here is how to use this model to get the features of a given text in PyTorch:

from transformers import AutoTokenizer, AutoModelForMaskedLM

tokenizer = AutoTokenizer.from_pretrained('xlm-roberta-base')
model = AutoModelForMaskedLM.from_pretrained("xlm-roberta-base")

# prepare input
text = "Replace me by any text you'd like."
encoded_input = tokenizer(text, return_tensors='pt')

# forward pass
output = model(**encoded_input)

BibTeX entry and citation info

@article{DBLP:journals/corr/abs-1911-02116,
  author    = {Alexis Conneau and
               Kartikay Khandelwal and
               Naman Goyal and
               Vishrav Chaudhary and
               Guillaume Wenzek and
               Francisco Guzm{\'{a}}n and
               Edouard Grave and
               Myle Ott and
               Luke Zettlemoyer and
               Veselin Stoyanov},
  title     = {Unsupervised Cross-lingual Representation Learning at Scale},
  journal   = {CoRR},
  volume    = {abs/1911.02116},
  year      = {2019},
  url       = {http://arxiv.org/abs/1911.02116},
  eprinttype = {arXiv},
  eprint    = {1911.02116},
  timestamp = {Mon, 11 Nov 2019 18:38:09 +0100},
  biburl    = {https://dblp.org/rec/journals/corr/abs-1911-02116.bib},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}

Model architecture

config.json
Architecture
XLMRobertaForMaskedLM
Model type
xlm-roberta
Hidden size
768
Layers
12
Attention heads
12
FFN size
3,072
Vocab size
250,002
Context window
514

Files

23 items
  • 6643a2fed942

    75.5 MB

  • f1aa8181367e

    72.0 MB

  • 3c8a2ebfd7f3

    71.1 MB

  • dc995737ba9f

    71.0 MB

  • ba7ecc3e6336

    67.6 MB

  • 2c40a52c8d00

    67.0 MB

  • 27a273cacb1f

    66.8 MB

  • beaede60c4ba

    66.7 MB

  • b7625b6a0626

    66.3 MB

  • 1236a4cc498f

    65.9 MB

  • 99d9a63d58a7

    65.5 MB

  • 5be4343a0967

    64.7 MB

  • 1564478c743b

    64.4 MB

  • d1ee6cfe5f2e

    64.3 MB

  • 53eaa52f5165

    64.2 MB

  • f6d414dfc51b

    50.9 MB

  • tokenizer.json

    a898ea754338

    8.7 MB

  • sentencepiece.bpe.model

    cfc8146abe2a

    4.8 MB

  • model.safetensors

    4f50c60e1f08

    44.3 KB

    safetensors

  • README.md

    df0d7ee41d02

    5.5 KB

  • hippius-provenance.json

    3959064582e0

    832 B

  • config.json

    d66ed8cd4f2a

    615 B

  • tokenizer_config.json

    994f46754c5b

    25 B