SAVRN
Search Contact SAVRN

Open-weight model · Question answering

xlm-roberta-base-squad2-distilled

by Deepset deepset/xlm-roberta-base-squad2-distilled

Haystack's distillation feature was used for training. deepset/xlm-roberta-large-squad2 was used as the teacher model. Haystack is an AI orchestration framework to build customizable, production-ready LLM applications.

Parameters277M
Context514
Weights2.2 GB
Licensemit
AccessOpen weights
Monthly Downloads3k

Runs On

What it takes to serve xlm-roberta-base-squad2-distilled (277M parameters): the memory its weights need at each precision, and the cheapest way to rent enough data-center GPUs to hold them.

PrecisionWeightsMemory neededCheapest setupPer hourAlso fits
16-bit 0.6 GB 0.7 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
8-bit 0.3 GB 0.3 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
4-bit 0.1 GB 0.2 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00

Memory is the weights at that precision plus 20% for the runtime and a short context; a long context needs more. Prices are the lowest on-demand hourly rates in the SAVRN Index, read Sep 18, 2026.

Model Card

By Deepset, published under mit, revision c1bbfe57bc33.

Haystack's distillation feature was used for training. deepset/xlm-roberta-large-squad2 was used as the teacher model. Haystack is an AI orchestration framework to build customizable, production-ready LLM applications. You can use this model in Haystack to do extractive question answering on documents. To load and run the model with Haystack: For a complete example with an extractive question answering pipeline that scales over many documents, check out the corresponding Haystack tutorial. Evaluated on the SQuAD 2.0 dev set Timo Möller: [email protected] deepset is the company behind the production-ready open-source AI framework Haystack. We also have a Discord community open to…

Read Deepset's full model card

Multilingual XLM-RoBERTa base distilled for Extractive QA on various languages

  • Haystack's distillation feature was used for training. deepset/xlm-roberta-large-squad2 was used as the teacher model.

Overview

Language model: deepset/xlm-roberta-base-squad2-distilled
Language: Multilingual
Downstream-task: Extractive QA
Training data: SQuAD 2.0
Eval data: SQuAD 2.0
Code: See an example extractive QA pipeline built with Haystack
Infrastructure: 1x Tesla v100

Hyperparameters

batch_size = 56
n_epochs = 4
max_seq_len = 384
learning_rate = 3e-5
lr_schedule = LinearWarmup
embeds_dropout_prob = 0.1
temperature = 3
distillation_loss_weight = 0.75

Usage

In Haystack

Haystack is an AI orchestration framework to build customizable, production-ready LLM applications. You can use this model in Haystack to do extractive question answering on documents. To load and run the model with Haystack:

# After running pip install haystack-ai "transformers[torch,sentencepiece]"

from haystack import Document
from haystack.components.readers import ExtractiveReader

docs = [
    Document(content="Python is a popular programming language"),
    Document(content="python ist eine beliebte Programmiersprache"),
]

reader = ExtractiveReader(model="deepset/xlm-roberta-base-squad2-distilled")
reader.warm_up()

question = "What is a popular programming language?"
result = reader.run(query=question, documents=docs)
# {'answers': [ExtractedAnswer(query='What is a popular programming language?', score=0.5740374326705933, data='python', document=Document(id=..., content: '...'), context=None, document_offset=ExtractedAnswer.Span(start=0, end=6),...)]}

For a complete example with an extractive question answering pipeline that scales over many documents, check out the corresponding Haystack tutorial.

In Transformers

from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline

model_name = "deepset/xlm-roberta-base-squad2-distilled"

# a) Get predictions
nlp = pipeline('question-answering', model=model_name, tokenizer=model_name)
QA_input = {
    'question': 'Why is model conversion important?',
    'context': 'The option to convert models between FARM and transformers gives freedom to the user and let people easily switch between frameworks.'
}
res = nlp(QA_input)

# b) Load model & tokenizer
model = AutoModelForQuestionAnswering.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)

Performance

Evaluated on the SQuAD 2.0 dev set

"exact": 74.06721131980123%
"f1": 76.39919553344667%

Authors

Timo Möller: [email protected]
Julian Risch: [email protected]
Malte Pietsch: [email protected]
Michel Bartels: [email protected]

About us

deepset is the company behind the production-ready open-source AI framework Haystack.

Some of our other work: - Distilled roberta-base-squad2 (aka "tinyroberta-squad2") - German BERT, GermanQuAD and GermanDPR, German embedding model - deepset Cloud, deepset Studio

Get in touch and join the Haystack community

For more info on Haystack, visit our GitHub repo and Documentation. We also have a Discord community open to everyone!

Twitter | LinkedIn | Discord | GitHub Discussions | Website | YouTube

By the way: we're hiring!

Configuration

Architecture
XLMRobertaForQuestionAnswering
Context length (tokens)
514
Layers
12
Hidden size
768
Feed-forward size
3,072
Attention heads
12
Vocabulary size
250,002
Model type
xlm-roberta

Identity and Version

Repository
deepset/xlm-roberta-base-squad2-distilled
Publisher
Deepset
Task
Question answering
Modality
Text
Library
transformers
Parameters
277M parameters
Languages
xlm-roberta
Revision
c1bbfe57bc3335c37960a48c5628ba26d7e9e3b7
First published
2022-03-02
Last updated
2024-09-26

Files and Weights

9 files, 2.2 GB in total. The weights are 2 files totalling 2.2 GB in bin, safetensors.

Weights2 files · 2.2 GB
Configuration2 files · 1.0 KB
Tokenizer2 files · 9.1 MB
Documentation1 file · 5.1 KB
Other1 file · 5.1 MB
Repository1 file · 1.2 KB
Every file
FileTypeSizeSHA-256
model.safetensorsWeights1.1 GB 167806fd25d3
pytorch_model.binWeights1.1 GB a570d4f09042
config.jsonConfiguration767 B
special_tokens_map.jsonConfiguration239 B
README.mdDocumentation5.1 KB
sentencepiece.bpe.modelOther5.1 MB cfc8146abe2a
.gitattributesRepository1.2 KB
tokenizer.jsonTokenizer9.1 MB
tokenizer_config.jsonTokenizer363 B

License and Download

License
mit
Access
Open weights, no gate
Download size
2.2 GB
Download from Deepset

Released by Deepset through its official repository on Hugging Face. Read the license.

Built From

  • Trained on (disclosed) squad_v2

Memory Requirements

PrecisionWeights in memory
As published2.2 GB
16-bit0.6 GB
8-bit0.3 GB
4-bit0.1 GB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About xlm-roberta-base-squad2-distilled

How much GPU memory does xlm-roberta-base-squad2-distilled need?

About 0.7 GB at 16-bit and 0.2 GB at 4-bit: the weights (277M parameters) plus a working margin. A long context needs more.

What is the cheapest GPU to run xlm-roberta-base-squad2-distilled on?

At 16-bit, 1x MI300X from $1.85 an hour; at 4-bit, 1x MI300X from $1.85 an hour, at the lowest on-demand prices the SAVRN Index lists.

Can I use xlm-roberta-base-squad2-distilled commercially?

Yes. xlm-roberta-base-squad2-distilled is released under MIT License. The MIT License is a short permissive license. It permits commercial use, modification and redistribution, provided the copyright notice and permission notice are included.

What is xlm-roberta-base-squad2-distilled's context length?

514 tokens, from the maximum position embeddings in its published configuration.

Similar Models

Model · Question answering

xlm-roberta-base-squad2

Deepset

Haystack is an AI orchestration framework to build customizable, production-ready LLM applications. You can use this model in Haystack to do extractive question answering on documents. To load and run the model with Haystack: For a complete example with an extractive question answering pipeline that scales over many documents, check out the corresponding Haystack tutorial. Evaluated on the SQuAD 2.0 dev set with the official eval script. "exact": 33.67279167589108 "total": 4517 "exact": 48.739495798319325 "total": 1190 Timo Möller: timo.moeller [at] deepset.ai deepset is the company behind the production-ready open-source AI framework Haystack. We also have a Discord community open to…

Open weights cc-by-4.0 277M parameters 514 tokens transformers

Model · Question answering

mdeberta-v3-base-squad2

Tim

It has been finetuned for 3 epochs on SQuAD2.0. DeBERTa improves the BERT and RoBERTa models using disentangled attention and enhanced mask decoder. With those two improvements, DeBERTa out perform RoBERTa on a majority of NLU tasks with 80GB training data. In DeBERTa V3, we further improved the efficiency of DeBERTa using ELECTRA-Style pre-training with Gradient Disentangled Embedding Sharing. Compared to DeBERTa, our V3 version significantly improves the model performance on downstream tasks. You can find more technique details about the new model from our paper. Please check the official repository for more implementation details and updates. mDeBERTa is multilingual version of DeBERTa…

Open weights mit 278M parameters 512 tokens transformers

Model · Question answering

flan-t5-base-squad2

Sebastian Husch Lee

This is the flan-t5-base model, fine-tuned using the SQuAD2.0 dataset. It's been trained on question-answer pairs, including unanswerable questions, for the task of Extractive Question Answering. UPDATE: With transformers version 4.31.0 the useremotecode=True is no longer necessary. NOTE: The token must be manually added to the beginning of the question for this model to work properly. It uses the token to be able to make "no answer" predictions. The t5 tokenizer does not automatically add this special token which is why it is added manually. The following hyperparameters were used during training: - learningrate: 2e-05 - trainbatchsize: 16 - evalbatchsize: 8 - gradientaccumulationsteps: 6…

Open weights mit 223M parameters transformers

Pretrained model on English language using a masked language modeling (MLM) objective. It was introduced in this paper and first released in this repository. This model is cased: it makes a difference between english and English. Differently to other BERT models, this model was trained with a new technique: Whole Word Masking. In this case, all of the tokens corresponding to a word are masked at once. The overall masking rate remains the same. The training is identical -- each masked WordPiece token is predicted independently. After pre-training, this model was fine-tuned on the SQuAD dataset with one of our fine-tuning scripts. See below for more information regarding this fine-tuning.…

Open weights apache-2.0 334M parameters 512 tokens transformers

Model · Question answering

gelectra-large-germanquad

Deepset

We trained a German question answering model with a gelectra-large model as its basis. - The dataset is GermanQuAD, a new, German language dataset, which we hand-annotated and published online. - The training dataset is one-way annotated and contains 11518 questions and 11518 answers, while the test dataset is three-way annotated so that there are 2204 questions and with 2204·3−76 = 6536 answers, because we removed 76 wrong answers. See https://deepset.ai/germanquad for more details and dataset download in SQuAD format. Haystack is an AI orchestration framework to build customizable, production-ready LLM applications. You can use this model in Haystack to do extractive question answering on…

Open weights mit 335M parameters 512 tokens transformers

This is a berta-large model, fine-tuned using the SQuAD2.0 dataset for the task of question answering. Haystack is an AI orchestration framework to build customizable, production-ready LLM applications. You can use this model in Haystack to do extractive question answering on documents. To load and run the model with Haystack: For a complete example with an extractive question answering pipeline that scales over many documents, check out the corresponding Haystack tutorial. deepset is the company behind the production-ready open-source AI framework Haystack. We also have a Discord community open to everyone!

Open weights cc-by-4.0 335M parameters 512 tokens transformers