SAVRN
Search Contact SAVRN

Open-weight model · Question answering

Extractive-QA_BERT_body

by Elisabet Sulú elisabetconese/Extractive-QA_BERT_body

Extractive-QA_BERT_body is an open-weight model for question answering from Elisabet Sulú, 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.

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.

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

Runs On

What it takes to serve Extractive-QA_BERT_body (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.

Extractive-QA_BERT_body on every accelerator the SAVRN Index prices, at every precision

Model Card

By Elisabet Sulú, published under apache-2.0, revision ff386ca135c4.

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…

Read Elisabet Sulú's full model card

BERT-base-uncased Fine-Tuned for Extractive Question Answering (SQuAD v1.1)

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.


Model Details

  • Base Architecture: BERT-base (bert-base-uncased)
  • Model Type: BertForQuestionAnswering
  • Layers: 12 Transformer encoder blocks
  • Hidden Dimension: 768
  • Attention Heads: 12
  • Parameters: 108,893,186 trainable parameters (~110M total)
  • Framework: PyTorch & Hugging Face transformers

Training Data & Preprocessing

The model was trained on a deterministic subsample of SQuAD v1.1 (rajpurkar/squad):

  • Subsample Size: 15,000 question-context pairs sampled deterministically with seed 42 from the training split.
  • Sliding Window Strategy: Long contexts exceeding BERT's sequence limit were tokenized using a sliding window:
  • Maximum sequence length: 384 tokens
  • Document stride: 128 tokens
  • Truncation: only_second (context tokens truncated, questions kept intact)
  • Unanswerable / out-of-slice spans: Routed to index [CLS] (position 0)
  • Windowed Features: The 15,000 source examples expanded to 15,141 training feature windows.

Hyperparameters & Training Configuration

  • Epochs: 2
  • Per-Device Batch Size: 4 (to ensure memory stability on 384-token sequences without CUDA OOM)
  • Total Training Steps: 7,570 optimizer steps
  • Optimizer: Two-learning-rate AdamW (build_two_lr_adamw):
  • Task Head (QA outputs, 1,538 params): Learning rate = 1e-3
  • Transformer Body (108,891,648 params): Learning rate = 2e-5
  • Precision: FP16 mixed precision
  • Random Seed: 42 (deterministic CuDNN backend)
  • Wall-Clock Training Time: ~704.1 seconds (~11.7 minutes)

Evaluation Results

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 logit pruning, maximum answer span length of 30 tokens):

Adaptation Method Trainable Parameters Parameter Ratio Training Time (s) Exact Match (%) F1 Score (%)
Feature-based (frozen body) 1,538 0.001% 171.5s 16.23% 25.26
Partial fine-tuning (top-2 layers) 14,177,282 13.02% 235.2s 49.60% 62.80
Full fine-tuning (this model) 108,893,186 100.00% 704.1s 73.59% 82.70%

Sample Predictions

Below are sample outputs produced on the validation split:

[
  {
    "id": "56be4db0acb8001400a502ed",
    "prediction": "Carolina Panthers",
    "gold": ["Carolina Panthers", "Carolina Panthers", "Carolina Panthers"]
  },
  {
    "id": "56be4db0acb8001400a502ee",
    "prediction": "Santa Clara, California",
    "gold": ["Santa Clara, California", "Levi's Stadium", "Levi's Stadium in the San Francisco Bay Area at Santa Clara, California."]
  },
  {
    "id": "56be4db0acb8001400a502f0",
    "prediction": "gold",
    "gold": ["gold", "gold", "gold"]
  },
  {
    "id": "56be8e613aeaaa14008c90d2",
    "prediction": "February 7, 2016",
    "gold": ["February 7, 2016", "February 7", "February 7, 2016"]
  }
]

Intended Use

  • Task: Extractive question answering in English. Given a question and a reference passage, the model extracts the continuous sub-string (span) that answers the question.
  • Input: A query string (question) and a text passage (context).
  • Target Audience: Researchers, students, and practitioners exploring transformer adaptation methods, resource-efficient training, or lightweight extractive QA deployments.

Quickstart / How to Use

from transformers import pipeline

qa_pipeline = pipeline(
    "question-answering",
    model="path_to_model/qa_full",
    tokenizer="path_to_model/qa_full"
)

question = "Where was Super Bowl 50 played?"
context = "Super Bowl 50 took place at Levi's Stadium in Santa Clara, California."

result = qa_pipeline(question=question, context=context)
print(f"Answer: {result['answer']}")
print(f"Confidence score: {result['score']:.4f}")
# Output:
# Answer: Santa Clara, California

Limitations

  1. Extractive Only: The model identifies spans verbatim within the context passage. It cannot synthesize, paraphrase, or generate abstractive responses.
  2. SQuAD v1.1 Constraint (Answer-Present): SQuAD v1.1 assumes all questions have an answer in the provided text. The model does not support unanswerable question detection (as found in SQuAD v2.0).
  3. Subsampled Training: The model was trained on a 15,000-example subset of SQuAD v1.1 rather than the full ~87.6k training set. Consequently, while it achieves a strong 82.70% F1, training on the complete dataset would yield higher metrics (~88% F1 for BERT-base).
  4. Context Length Truncation: While sliding window inference allows covering long documents, answer spans that cross window seams or exceed 384 tokens without stride coverage may suffer degradation.
  5. Language & Casing: The model was pretrained on lowercased English text (uncased) and is unsuitable for multilingual texts or applications sensitive to letter casing.

References

  1. Devlin, J., Chang, M.-W., Lee, K., and Toutanova, K. (2019). BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. arXiv:1810.04805 §5.3.
  2. Rajpurkar, P., Zhang, J., Lopyrev, K., and Liang, P. (2016). SQuAD: 100,000+ Questions for Machine Comprehension of Text. arXiv:1606.05250.
  3. Hugging Face Documentation. Fine-tuning a pretrained model. Hugging Face Transformers Training Documentation.

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
elisabetconese/Extractive-QA_BERT_body
Publisher
Elisabet Sulú
Task
Question answering
Modality
Text
Library
Not stated by the source
Parameters
109M parameters
Languages
en
Revision
ff386ca135c442b458179205f320f4544abd01e9
First published
2026-09-26
Last updated
2026-09-26

Files and Weights

11 files, 436.4 MB in total. The weights are 2 files totalling 435.6 MB in bin, safetensors.

Weights2 files · 435.6 MB
Configuration4 files · 59.1 KB
Tokenizer2 files · 712.0 KB
Documentation1 file · 6.7 KB
Repository2 files · 7.7 KB
Every file
FileTypeSizeSHA-256
model.safetensorsWeights435.6 MB 74e5407c1581
training_args.binWeights5.2 KB 2ebd07c95b89
config.jsonConfiguration762 B —
metrics.jsonConfiguration162 B —
pred_samples.jsonConfiguration2.0 KB —
training_log.jsonConfiguration56.2 KB —
README.mdDocumentation6.7 KB —
.DS_StoreRepository6.1 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 Elisabet Sulú

Released by Elisabet Sulú through its official repository on Hugging Face. Read the license.

Built From

Evaluations

Each result is shown as reported, with the conditions its reporter stated. None is a SAVRN measurement. A comparison lines two results up only when their configuration, unit and setup are all stated and identical.

BenchmarkConditionsResultReported byRevisionDate
SQuAD v1.1 Task Question AnsweringMetric Exact MatchComparison conditions not established 73.59 elisabetconese
Publisher reported
Evaluated revision not stated —
SQuAD v1.1 Task Question AnsweringMetric F1Comparison conditions not established 82.7 elisabetconese
Publisher reported
Evaluated revision not stated —

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 Extractive-QA_BERT_body

How much GPU memory does Extractive-QA_BERT_body 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 Extractive-QA_BERT_body 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 Extractive-QA_BERT_body commercially?

Yes. Extractive-QA_BERT_body 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 Extractive-QA_BERT_body'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

bert-base-squad-qa

Dalila Ku

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…

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