question-answering · SQuAD v2 abstention · text · WASM q8 · 82.1 MB · CC-BY-4.0

TinyRoBERTa-SQuAD2

A distilled 6-layer RoBERTa extractive question-answering model (deepset/tinyroberta-squad2 via onnx-community/tinyroberta-squad2-ONNX) running 100% locally in WebAssembly. Unlike SQuAD v1 extractors that guess a span even when the text never mentions the answer, TinyRoBERTa-SQuAD2 routes probability mass to the <s> null token so your app can honestly abstain instead of fabricating citations.

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

At a glance

Task & architecture
question-answering · 6-layer RoBERTa · 512-token window
Runtime & backend
Transformers.js 3.7.5 · WebAssembly (WASM)
Quantisation & size
q8 · 82.14 MB (82,141,214 B onnx/model_quantized.onnx)
License & SQuAD v2
CC-BY-4.0 · 78.86 EM / 82.04 F1

1 · Initialise TinyRoBERTa-SQuAD2 locally

License notice: Model weights are distributed under CC-BY-4.0 (upstream deepset/tinyroberta-squad2, converted to ONNX by onnx-community/tinyroberta-squad2-ONNX). Inference runs off the main thread in a FIFO Web Worker using pipeline("question-answering", "onnx-community/tinyroberta-squad2-ONNX", { device: "wasm", dtype: "q8" }).

2 · Pick a domain preset or upload your own text

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

Initialise TinyRoBERTa-SQuAD2 above to extract grounded answer spans or detect unanswerable questions.

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 live vanilla ES modules powering this route — no build step, no bundler, no hidden API calls.

View worker.js
View qa-core.mjs