SAVRN
Search Contact SAVRN

Open-weight model · Question answering

mobilebert-uncased-squad-v1

by Qingqing Cao csarron/mobilebert-uncased-squad-v1

MobileBERT is a thin version of BERTLARGE, while equipped with bottleneck structures and a carefully designed balance between self-attentions and feed-forward networks.

Parameters25M
Context512
Weights197.1 MB
Licensemit
AccessOpen weights
Monthly Downloads4.7k

Runs On

What it takes to serve mobilebert-uncased-squad-v1 (25M 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.0 GB 0.1 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
8-bit 0.0 GB 0.0 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
4-bit 0.0 GB 0.0 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 Qingqing Cao, published under mit, revision a55778db96b8.

MobileBERT is a thin version of BERTLARGE, while equipped with bottleneck structures and a carefully designed balance between self-attentions and feed-forward networks. This model was fine-tuned from the HuggingFace checkpoint google/mobilebert-uncased on SQuAD1.1. CPU: Intel(R) Core(TM) i7-6800K CPU @ 3.40GHz Memory: 32 GiB GPUs: 2 GeForce GTX 1070, each with 8GiB memory GPU driver: 418.87.01, CUDA: 10.1 It took about 3 hours to finish. Note that the above results didn't involve any hyperparameter search.

Read Qingqing Cao's full model card

MobileBERT fine-tuned on SQuAD v1

MobileBERT is a thin version of BERT_LARGE, while equipped with bottleneck structures and a carefully designed balance between self-attentions and feed-forward networks.

This model was fine-tuned from the HuggingFace checkpoint google/mobilebert-uncased on SQuAD1.1.

Details

Dataset Split # samples
SQuAD1.1 train 90.6K
SQuAD1.1 eval 11.1k

Fine-tuning

  • Python: 3.7.5

  • Machine specs:

CPU: Intel(R) Core(TM) i7-6800K CPU @ 3.40GHz

Memory: 32 GiB

GPUs: 2 GeForce GTX 1070, each with 8GiB memory

GPU driver: 418.87.01, CUDA: 10.1

  • script:

```shell # after install https://github.com/huggingface/transformers

cd examples/question-answering mkdir -p data

wget -O data/train-v1.1.json https://rajpurkar.github.io/SQuAD-explorer/dataset/train-v1.1.json

wget -O data/dev-v1.1.json https://rajpurkar.github.io/SQuAD-explorer/dataset/dev-v1.1.json

export SQUAD_DIR=pwd/data

python run_squad.py \ --model_type mobilebert \ --model_name_or_path google/mobilebert-uncased \ --do_train \ --do_eval \ --do_lower_case \ --train_file $SQUAD_DIR/train-v1.1.json \ --predict_file $SQUAD_DIR/dev-v1.1.json \ --per_gpu_train_batch_size 16 \ --per_gpu_eval_batch_size 16 \ --learning_rate 4e-5 \ --num_train_epochs 5.0 \ --max_seq_length 320 \ --doc_stride 128 \ --warmup_steps 1400 \ --output_dir $SQUAD_DIR/mobilebert-uncased-warmup-squad_v1 2>&1 | tee train-mobilebert-warmup-squad_v1.log ```

It took about 3 hours to finish.

Results

Model size: 95M

Metric # Value # Original (Table 5)
EM 82.6 82.9
F1 90.0 90.0

Note that the above results didn't involve any hyperparameter search.

Example Usage

from transformers import pipeline

qa_pipeline = pipeline(
    "question-answering",
    model="csarron/mobilebert-uncased-squad-v1",
    tokenizer="csarron/mobilebert-uncased-squad-v1"
)

predictions = qa_pipeline({
    'context': "The game was played on February 7, 2016 at Levi's Stadium in the San Francisco Bay Area at Santa Clara, California.",
    'question': "What day was the game played on?"
})

print(predictions)
# output:
# {'score': 0.7754058241844177, 'start': 23, 'end': 39, 'answer': 'February 7, 2016'}

Created by Qingqing Cao | GitHub | Twitter

Made with in New York.

Configuration

Architecture
MobileBertForQuestionAnswering
Context length (tokens)
512
Layers
24
Hidden size
512
Feed-forward size
512
Attention heads
4
Vocabulary size
30,522
Model type
mobilebert

Identity and Version

Repository
csarron/mobilebert-uncased-squad-v1
Publisher
Qingqing Cao
Task
Question answering
Modality
Text
Library
transformers
Parameters
25M parameters
Languages
en
Revision
a55778db96b874cd5b2629199000cc8c52b5738a
First published
2022-03-02
Last updated
2023-04-05

Files and Weights

9 files, 197.3 MB in total. The weights are 3 files totalling 197.1 MB in bin, safetensors.

Weights3 files · 197.1 MB
Configuration2 files · 877 B
Tokenizer2 files · 231.6 KB
Documentation1 file · 5.2 KB
Repository1 file · 399 B
Every file
FileTypeSizeSHA-256
model.safetensorsWeights98.5 MB 51c8d94cc7cc
pytorch_model.binWeights98.6 MB 46bffb7cb1bc
training_args.binWeights1.7 KB ac1c1b49f5f5
config.jsonConfiguration765 B
special_tokens_map.jsonConfiguration112 B
README.mdDocumentation5.2 KB
.gitattributesRepository399 B
tokenizer_config.jsonTokenizer85 B
vocab.txtTokenizer231.5 KB

License and Download

License
mit
Access
Open weights, no gate
Download size
197.1 MB
Download from Qingqing Cao

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

Built From

Memory Requirements

PrecisionWeights in memory
As published197.1 MB
16-bit0.0 GB
8-bit0.0 GB
4-bit0.0 GB

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

Questions About mobilebert-uncased-squad-v1

How much GPU memory does mobilebert-uncased-squad-v1 need?

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

What is the cheapest GPU to run mobilebert-uncased-squad-v1 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 mobilebert-uncased-squad-v1 commercially?

Yes. mobilebert-uncased-squad-v1 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 mobilebert-uncased-squad-v1's context length?

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

Similar Models

Model · Question answering

mobilebert-uncased-squad-v2

Qingqing Cao

MobileBERT is a thin version of BERTLARGE, while equipped with bottleneck structures and a carefully designed balance between self-attentions and feed-forward networks. This model was fine-tuned from the HuggingFace checkpoint google/mobilebert-uncased on SQuAD2.0. CPU: Intel(R) Core(TM) i7-6800K CPU @ 3.40GHz Memory: 32 GiB GPUs: 2 GeForce GTX 1070, each with 8GiB memory GPU driver: 418.87.01, CUDA: 10.1 It took about 3.5 hours to finish. Note that the above results didn't involve any hyperparameter search.

Open weights mit 25M parameters 512 tokens transformers

Model · Question answering

minilm-uncased-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. 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 everyone!

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

Model · Question answering

bert-medium-squad2-distilled

Deepset

Haystack version 1.x distillation feature was used for training. deepset/bert-large-uncased-whole-word-masking-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. - 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 mit 41M parameters 512 tokens transformers

Model · Question answering

splinter-base

Tel Aviv University

Splinter-base is the pretrained model discussed in the paper Few-Shot Question Answering by Pretraining Span Selection (at ACL 2021). Its original repository can be found here. The model is case-sensitive. Note: This model doesn't contain the pretrained weights for the QASS layer (see paper for details), and therefore the QASS layer is randomly initialized upon loading it. For the model with those weights, see tau/splinter-base-qass. Splinter is a model that is pretrained in a self-supervised fashion for few-shot question answering. 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…

Open weights apache-2.0 512 tokens transformers