Verbatim-Sum 24M (verbatim-sum-24m)

verbatim-sum-24m is a 20.47 MB (19.76 MB ONNX model + 0.71 MB tokenizer) neural extractive summarizer built for length-controlled, single-paragraph summaries (for example 50, 60, 70, or 100 words) with 0% hallucination guaranteed.

Because every output sentence is selected verbatim from the source document by a document-level neural scorer, names, numbers, dates, and quotes are preserved intact. It runs in 31 to 78 ms on standard Linux VPS CPUs (88.9 MB RAM RSS, no PyTorch required), 38 to 62 ms in the browser on WebGPU, and 240 ms in browser CPU-only WASM.

Key specifications

  • Parameters: 23,996,673 (all-MiniLM-L6-v2 6-layer encoder, d=384, plus a 1-layer 6-head Inter-Sentence Transformer and document-context fusion head)
  • Deployable bundle: 20.47 MB (verbatim-sum-24m.onnx: 19.76 MB, tokenizer.json: 0.71 MB)
  • Quantization: Symmetric 4-bit MatMulNBits (block_size=32, accuracy_level=1 MLAS INT8 CPU kernels and native WGSL WebGPU shaders) + per-row INT8 Gather embeddings + SDPA graph optimization (17 redundant IsNaN and duplicate Where nodes removed with 0.0000000 numerical difference)
  • Hallucination rate: 0.0% (1,200 / 1,200 unseen test documents verified 100% verbatim)
  • License: Apache 2.0

Benchmark results

Unseen test evaluation (1,200 multi-domain documents)

Trained on 40,302 oracle-labeled documents (1,200 validation, 1,200 unseen test) combining greedy BERTSUM joint ROUGE-1+2 oracles and continuous soft per-sentence ROUGE targets. verbatim-sum-24m beats the matched-budget Lead baseline on all 6 unseen domains:

Domain Test docs Lead ROUGE-1 Verbatim-Sum 24M ROUGE-1 Lift (R1) ROUGE-2 ROUGE-L
Policy (BillSum) 137 35.82 40.93 +5.12 18.35 26.56
Dialogue (DialogSum) 120 29.28 33.38 +4.11 13.43 26.84
News (XSum) 146 17.82 21.10 +3.28 3.69 14.62
Science (PubMed) 46 28.97 30.52 +1.55 8.08 16.63
News (CNN/DailyMail) 702 31.21 31.73 +0.52 12.02 21.87
News (BBC News) 49 58.09 58.60 +0.51 45.87 41.27
All 1,200 unseen docs 1,200 30.92 32.70 +1.78 13.10 22.61
  • Stemmed rouge-score (600 unseen test docs): ROUGE-1 36.34 (+3.35 over Lead 32.99), ROUGE-2 15.01, ROUGE-L 24.42 (+2.47 over Lead 21.95).
  • Word count accuracy: 4.73 words MAE across dynamic 30 to 140 word targets (3.35 words MAE at a fixed 60-word target).

Runtime latency (typical 200 to 350 word article, 60-word target)

Runtime Warm latency Footprint Faithfulness
Browser WebGPU (onnxruntime-web@1.23.2, Intel Arc) 38 to 62 ms 20.47 MB download 100% verbatim
Linux / Python CPU (6 threads, ONNX Runtime) 31 to 62 ms 88.9 MB RAM RSS 100% verbatim
Linux / Python CPU (4 threads) 39 to 50 ms 88.9 MB RAM RSS 100% verbatim
Linux / Python CPU (2 threads, small VPS) 63 to 78 ms 88.9 MB RAM RSS 100% verbatim
Browser CPU-only (4-thread SIMD WASM) 240 ms 20.47 MB download 100% verbatim

Quickstart

1. Clone and run on any Linux VPS (CPU-only)

git clone https://huggingface.co/Uddipan242/verbatim-sum-24m
cd verbatim-sum-24m
pip install -r requirements-inference.txt
python runtime/python/server.py --host 0.0.0.0 --port 8080

Call the HTTP API:

curl -X POST http://127.0.0.1:8080/api/summarize \
  -H "Content-Type: application/json" \
  -d '{"text": "Your article text...", "words": 60}'

Or run the CLI directly:

python runtime/python/extractive_summarizer.py --words 60 --file article.txt

2. Python library with huggingface_hub

from huggingface_hub import snapshot_download
import sys

repo_dir = snapshot_download("Uddipan242/verbatim-sum-24m")
sys.path.insert(0, f"{repo_dir}/runtime/python")
from extractive_summarizer import ExtractiveSummarizer

summarizer = ExtractiveSummarizer(repo_dir)
result = summarizer.summarize(article_text, target_words=60)
print(result["summary"])
print(result["word_count"], result["latency_ms"], result["faithfulness"])

3. Browser WebGPU and CPU WASM

With python runtime/python/server.py --port 8080 running, open:

  • http://localhost:8080/runtime/web/index.html (automatic WebGPU, fallback to WASM)
  • http://localhost:8080/runtime/web/index.html?backend=wasm (browser CPU-only multi-threaded SIMD WASM)
  • http://localhost:8080/runtime/web/index.html?backend=api (routes directly to the VPS CPU API)

The pure-JavaScript WordPiece tokenizer and sentence splitter in runtime/web/extractive_summarizer.js are verified at 100.0% (156 / 156) exact parity against Python tokenizers.

How it works

  1. Splits the source document into sentences using an abbreviation-, decimal-, and quote-safe splitter.
  2. Packs sentences into 512-token document windows ([CLS] S1 [SEP] [CLS] S2 [SEP] ...) with alternating segment IDs and 4 global position features (normalized position, lead-3 indicator, log word length, and numeric/quote flag).
  3. Runs a single ONNX forward pass per window to produce per-sentence salience logits and L2-normalized semantic embeddings.
  4. Selects an optimal subset via beam search maximizing word-weighted salience while penalizing semantic redundancy (cosine MMR), orphaned leading pronouns, and deviation from the requested word count, then assembles selected sentences in chronological order.

Intended use and limitations

  • Intended use: Fast, zero-hallucination extractive paragraph summaries of English news, sports, financial, technical, legal, and general articles on low-cost CPUs or client-side browsers.
  • Limitations: English-only (bert-base-uncased WordPiece vocabulary). Because outputs are strictly verbatim extracts, the model does not paraphrase across sentences; very long single sentences may cause final word counts to vary by a few words around the target.
Downloads last month
23
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Uddipan242/verbatim-sum-24m

Datasets used to train Uddipan242/verbatim-sum-24m

Evaluation results

  • ROUGE-1 (unstemmed, 1,200 docs) on Multi-domain unseen test split (6 corpora, 1,200 docs)
    self-reported
    32.700
  • ROUGE-2 (unstemmed, 1,200 docs) on Multi-domain unseen test split (6 corpora, 1,200 docs)
    self-reported
    13.100
  • ROUGE-L (unstemmed, 1,200 docs) on Multi-domain unseen test split (6 corpora, 1,200 docs)
    self-reported
    22.610
  • ROUGE-1 (stemmed rouge-score, 600 docs) on Multi-domain unseen test split (6 corpora, 1,200 docs)
    self-reported
    36.340
  • ROUGE-L (stemmed rouge-score, 600 docs) on Multi-domain unseen test split (6 corpora, 1,200 docs)
    self-reported
    24.420
  • Verbatim grounding (0% hallucination) on Multi-domain unseen test split (6 corpora, 1,200 docs)
    self-reported
    100.000