SAVRN
Search Contact SAVRN

Open-weight model · Question answering

bert-base-squad-qa

by Dalila Ku Dalila-Ku/bert-base-squad-qa

bert-base-squad-qa is an open-weight model for question answering from Dalila Ku, released under Apache License 2.0. It has 109M parameters and a 512-token context. At 16-bit it needs about 0.3 GB of GPU memory, which fits on 1x MI300X from $1.85 an hour, at the lowest prices in the SAVRN Index.

Fine-tuning of bert-base-uncased for extractive Question Answering, delivered as part of assignment U2T01 (Adapting BERT for NLP tasks — Trends in Data Science, Unit 2, Universidad Politécnica de Yucatán).

Parameters109M
Context512
Weights435.6 MB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads—

Runs On

What it takes to serve bert-base-squad-qa (109M 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.2 GB 0.3 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
8-bit 0.1 GB 0.1 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
4-bit 0.1 GB 0.1 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 Oct 9, 2026.

bert-base-squad-qa on every accelerator the SAVRN Index prices, at every precision

Model Card

By Dalila Ku, published under apache-2.0, revision e45c35b67d9f.

Fine-tuning of bert-base-uncased for extractive Question Answering, delivered as part of assignment U2T01 (Adapting BERT for NLP tasks — Trends in Data Science, Unit 2, Universidad Politécnica de Yucatán). bert-base-uncased with a qaoutputs head that predicts, per token, the probability of being the start and the end of the answer span within the given context. (rajpurkar/squad), subsampled to 15,000 examples from the official train split (as required by the assignment), with a 90/10 split used for training/ validation. SQuAD's official validation set (10,570 questions, never seen during training) was reserved as the final test set. - Preprocessing uses a sliding window (stride) since…

Read Dalila Ku's full model card

Fine-tuning of bert-base-uncased for extractive Question Answering, delivered as part of assignment U2T01 (Adapting BERT for NLP tasks — Trends in Data Science, Unit 2, Universidad Politécnica de Yucatán).

Model description

bert-base-uncased with a qa_outputs head that predicts, per token, the probability of being the start and the end of the answer span within the given context.

Training data

  • Dataset: SQuAD v1.1 (rajpurkar/squad), subsampled to 15,000 examples from the official train split (as required by the assignment), with a 90/10 split used for training/ validation. SQuAD's official validation set (10,570 questions, never seen during training) was reserved as the final test set.
  • Preprocessing uses a sliding window (stride) since contexts can exceed the maximum input length; each window is labeled with the start/end position of the answer inside that window, or (0, 0) if the answer does not fit.

Training procedure

Two adaptation methods were trained and compared; full fine-tuning is the delivered model, since it is necessary (not optional) for this task — partial fine-tuning underperforms by a wide margin.

Hyperparameter Value
Base model bert-base-uncased (110M params)
Method Full fine-tuning (BERT body + head, jointly)
Learning rate (head) 1e-3
Learning rate (BERT body) 2e-5
Epochs 3
Batch size 16 (train) / 32 (eval)
Seed 42
Trainable parameters 108,893,186
Training time 13.5 min (single T4 GPU)

Compared alternative (not delivered): partial fine-tuning, freezing the entire BERT body except its last 2 encoder layers (14,177,282 trainable params, 5.9 min).

Evaluation results

Metrics: official SQuAD Exact Match (EM) and word-level F1.

Method Val EM Val F1 Test EM Test F1
Partial fine-tuning (last 2 layers + head) 39.53% 55.05% 45.91% 59.45%
Full fine-tuning (delivered) 59.27% 73.79% 71.16% 81.06%

The 21.61-point F1 gap on test is by far the largest gap of the four tasks in this project (roughly 5x the gap seen in classification, NER, or POS), reflecting that extractive QA requires jointly reasoning over the question and locating a span in the context — something only 2 unfrozen layers cannot capture well.

Note on scale: this model was trained on 15k examples rather than the full 87.6k SQuAD train set, so its 81.06 test F1 is below the ~88 F1 reported in the literature for BERT-base trained on the full dataset — a result consistent with the reduced amount of training data.

Intended uses & limitations

  • Intended use: extractive question answering over short English passages, in the style of SQuAD v1.1, for coursework/research.
  • Limitations: trained on only 15k (of 87.6k) SQuAD examples, so accuracy is meaningfully below full-dataset BERT-base benchmarks. Only answers questions whose answer is a contiguous span present in the given context (no "no answer" case, as in SQuAD v1.1, and no closed-book/generative QA). Single seed, 3 epochs, no extensive hyperparameter search.

References

  • Devlin, J., Chang, M. W., Lee, K., & Toutanova, K. (2018). BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. arXiv:1810.04805. https://arxiv.org/abs/1810.04805
  • Rajpurkar, P., Zhang, J., Lopyrev, K., & Liang, P. (2016). SQuAD: 100,000+ Questions for Machine Comprehension of Text.
  • Hugging Face. Fine-tune a pretrained model. https://huggingface.co/docs/transformers/training
  • Dataset: rajpurkar/squad

Configuration

Architecture
BertForQuestionAnswering
Context length (tokens)
512
Layers
12
Hidden size
768
Feed-forward size
3,072
Attention heads
12
Vocabulary size
30,522
Model type
bert

Identity and Version

Repository
Dalila-Ku/bert-base-squad-qa
Publisher
Dalila Ku
Task
Question answering
Modality
Text
Library
Not stated by the source
Parameters
109M parameters
Languages
en
Revision
e45c35b67d9f7fd7f700924b1c23010cfee45c0d
First published
2026-09-27
Last updated
2026-09-27

Files and Weights

6 files, 436.3 MB in total. The weights are 1 file totalling 435.6 MB in safetensors.

Weights1 file · 435.6 MB
Configuration1 file · 762 B
Tokenizer2 files · 712.0 KB
Documentation1 file · 4.0 KB
Repository1 file · 1.5 KB
Every file
FileTypeSizeSHA-256
model.safetensorsWeights435.6 MB b5782e8e2cf1
config.jsonConfiguration762 B —
README.mdDocumentation4.0 KB —
.gitattributesRepository1.5 KB —
tokenizer.jsonTokenizer711.7 KB —
tokenizer_config.jsonTokenizer351 B —

License and Download

License
apache-2.0
Access
Open weights, no gate
Download size
435.6 MB
Download from Dalila Ku

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

Built From

Memory Requirements

PrecisionWeights in memory
As published435.6 MB
16-bit0.2 GB
8-bit0.1 GB
4-bit0.1 GB

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

Questions About bert-base-squad-qa

How much GPU memory does bert-base-squad-qa need?

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

What is the cheapest GPU to run bert-base-squad-qa 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 bert-base-squad-qa commercially?

Yes. bert-base-squad-qa is released under Apache License 2.0. The Apache License 2.0 is a permissive open-source license. It permits commercial use, modification and redistribution. It requires keeping the license and copyright notices and any NOTICE file, stating significant changes, and it includes an express patent grant from contributors.

What is bert-base-squad-qa's context length?

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

Similar Models

Model · Question answering

electra-base-squad2

Deepset

Evaluated on the SQuAD 2.0 dev set with the official eval script. 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. Vaishali Pal vaishali.pal [at] deepset.ai 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 everyone!

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

Model · Question answering

Extractive-QA_BERT_body

Elisabet Sulú

This repository contains the weights and tokenizer for bert-base-uncased fully fine-tuned on SQuAD v1.1 (Stanford Question Answering Dataset) for extractive question answering. The model was adapted using end-to-end full fine-tuning with a differential two-learning-rate optimizer scheme as part of an academic comparative study on BERT adaptation paradigms. The model was trained on a deterministic subsample of SQuAD v1.1 (rajpurkar/squad): - Task Head (QA outputs, 1,538 params): Learning rate = 1e-3 Evaluation was performed on the complete official SQuAD v1.1 validation split (10,570 examples, spanning 10,753 feature windows) using an optimized post-processing pipeline (top-15 start/end…

Open weights apache-2.0 109M parameters 512 tokens

Model · Question answering

bert-base-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. - 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 everyone!

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

Model · Question answering

gelectra-base-germanquad

Deepset

We trained a German question answering model with a gelectra-base 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 = 6536answers, 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 109M parameters 512 tokens transformers

Model · Question answering

bert-base-cased-squad2

Deepset

This is a BERT base cased model trained on SQuAD v2 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 108M parameters 512 tokens transformers

Model · Question answering

bert-base-uncased-squad-v1

Qingqing Cao

This model was fine-tuned from the HuggingFace BERT base uncased checkpoint 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 2 hours to finish. Note that the above results didn't involve any hyperparameter search.

Open weights mit 109M parameters 512 tokens transformers