question-answering · 12-layer RoBERTa-Base · SQuAD v2 abstention · WASM q8 · 125.26 MB · CC-BY-4.0

RoBERTa-Base SQuAD2

The full 12-layer, 125M-parameter RoBERTa-Base extractive question-answering model (deepset/roberta-base-squad2 via onnx-community/roberta-base-squad2-ONNX) running 100% locally in WebAssembly. With twice the encoder depth of 6-layer distilled readers, RoBERTa-Base SQuAD2 excels on multi-clause technical RFCs, legal indemnity provisions, clinical notes, and subtle entity-swap traps — routing unsupported queries to the <s> null token so your app can honestly abstain.

deepset/roberta-base-squad2 onnx-community/roberta-base-squad2-ONNX question-answering Transformers.js 3.7.5 · WASM q8 · 125.26 MB CC-BY-4.0

At a glance

Task & architecture
question-answering · 12-layer RoBERTa-Base (125M) · 512-token window
Runtime & backend
Transformers.js 3.7.5 · WebAssembly (WASM)
Quantisation & size
q8 · 125.26 MB (125,257,626 B onnx/model_quantized.onnx)
License & SQuAD v2
CC-BY-4.0 · 79.93 EM / 82.95 F1

1 · Initialise RoBERTa-Base SQuAD2 locally

License notice: Model weights are licensed under CC-BY-4.0 (upstream deepset/roberta-base-squad2, quantized ONNX export by onnx-community/roberta-base-squad2-ONNX). Inference runs off the main thread in a FIFO Web Worker using pipeline("question-answering", "onnx-community/roberta-base-squad2-ONNX", { device: "wasm", dtype: "q8" }) paired with a shared-model logit pass for exact <s> null probability.

2 · Pick a multi-clause preset or upload your own text

Drop a local .txt or .md document here (stays 100% on-device, max 256 KB).

Initialise RoBERTa-Base SQuAD2 above to extract grounded answer spans or detect subtle unanswerable traps.

Waiting for model

—

Ask a question once the model is ready to compare top span probability against SQuAD v2 null probability P(<s>).

Top Span Score—
Null P(<s>)—
Char Offsets—
Latency (WASM)—
Tokens / Window—
Finite Check—

Highlighted Source Passage

Exact character offsets highlighted via semantic <mark> nodes (or left clean when abstained).

Top-K Candidate Spans vs <s> Null

Click any candidate span to highlight its exact location in the source passage.

Use-case ladder

Show the code

Inspect the exact vanilla ES module functions powering this route — no build step, no bundler, no hidden API calls.

View worker.js · ensureLoaded() (lines 76–118)
View roberta-qa-core.mjs · decideAbstention() (lines 189–216)