Input: (question, context) — output: character spans in context that
support the answer, with confidence scores.
The model uses the full 8192-token ModernBERT context, so long paper chunks
are handled without aggressive truncation. On the current all-row ACL gold
benchmark, this 150M-parameter model achieves the best committed word-level F1
among the evaluated extractors.
Quick Start
python
1from transformers import AutoModel
23model = AutoModel.from_pretrained(4"KRLabsOrg/acl-verbatim-modernbert",5 trust_remote_code=True,6)78question ="What is ModernBERT?"9context =(10"ModernBERT is a long-context encoder for NLP. "11"It supports sequences up to 8192 tokens. "12"Unlike earlier BERT variants, it uses rotary position embeddings."13)1415result = model.process(16 question=question,17 context=context,18 threshold=0.2,19 return_sentence_metrics=True,20)2122for span in result["spans"]:23print(f"[{span['score']:.2f}] {span['text']}")
Example output:
[0.93] ModernBERT is a long-context encoder for NLP.
[0.87] It supports sequences up to 8192 tokens.
Parameters
arg
default
notes
question
—
Query string
context
—
Passage to search for supporting spans
threshold
0.2
Probability cutoff for marking a token as evidence. Use 0.2 for balanced F1, 0.5 for high precision
max_length
8192
Max tokens per window (ModernBERT supports 8192)
doc_stride
256
Overlap between windows for long contexts
min_span_chars
10
Drop predicted spans shorter than this many characters
merge_gap_chars
20
Merge adjacent predicted spans separated by ≤ this many characters
return_sentence_metrics
False
Also return per-sentence mean evidence score
min_span_chars and merge_gap_chars together clean up token-level
fragmentation: without them, binary token labels often produce a "shotgun" of
3–10-character pseudo-spans that hurt span-level metrics. The defaults are what
we use in our evaluation.
Return shape
python
1{2"spans":[3{"start":int,"end":int,"text":str,"score":float},4...5],6"sentences":[# only when return_sentence_metrics=True7{"start":int,"end":int,"text":str,"score":float},8...9],10}
Spans are character offsets into the input context. They are merged across
sliding windows, so callers do not need to deduplicate.
Raw Inference
If you prefer to skip the .process() helper and do the post-processing
yourself:
Label 0 is "outside", label 1 is "evidence" (binary scheme).
Training
item
value
base model
Alibaba-NLP/gte-reranker-modernbert-base
dataset
KRLabsOrg/acl-verbatim-spans (encoder config)
label scheme
binary (0 outside, 1 evidence)
max_length
8192
doc_stride
256
batch size
8
learning rate
2e-5
epochs
5
best checkpoint
silver-dev F1 = 0.642 at epoch 3.21
We started from Alibaba-NLP/gte-reranker-modernbert-base rather than
vanilla answerdotai/ModernBERT-base because the reranker backbone has
already been post-trained on query/passage relevance — the semantic prior it
provides gives a large head start on query-conditioned span extraction.
Scored on the canonical/test split of KRLabsOrg/acl-verbatim-spans
(20 queries × 5 retrieved chunks: 100 rows total, 47 relevant rows with 78
gold spans, and 53 irrelevant negative rows) with the shared span metrics in
acl_verbatim.eval.span_metrics. Irrelevant rows have empty gold spans, so
false-positive extracted text lowers precision.
These are all-row scores: irrelevant retrieved chunks are included as negative
examples and false-positive evidence on those rows lowers precision.
Threshold / post-processing ablation
The released default is threshold=0.2, min-span length 10, and merge gap 20.
Additional threshold ablations can be regenerated with
acl_verbatim/span_training/evaluate_token_cls.py. The threshold=0.2 +
merge configuration is the default in model.process().
See the acl-verbatim repo for
the full benchmark harness, LLM extractor scripts, and qualitative analysis.
Intended Use
Query-conditioned evidence highlighting over scientific text
Re-ranking or filtering of retrieval outputs for extractive QA
Dataset annotation assistance
Local alternative to LLM extractors for evidence selection
Limitations
Trained on ACL Anthology markdown; transfer to other scientific domains
(biomedical, legal, patents) is not evaluated.
Silver supervision inherits noise from the LLM teacher and the retriever.
Recall in particular reflects teacher behaviour: the model rarely extracts
a passage the teacher would have skipped.
The gold benchmark is small (20 queries, 100 query--chunk rows, 47 relevant
chunks, 78 gold spans) and single-annotator; confidence intervals on the
headline numbers are wide.
Tables and figures are represented through their caption text; the model
has no structural awareness of tabular data.
Any-overlap recall (0.500) lags the LLM extractors rerun here, meaning the
model sometimes predicts nothing on chunks that contain relevant evidence.
For high-recall applications, lower threshold further or combine with an
LLM fallback.
Citation
bibtex
1@misc{Recski:2026,
2 title={ACL-Verbatim: hallucination-free question answering for research},
3 author={Gábor Recski and Szilveszter Tóth and Nadia Verdha and István Boros and Ádám Kovács},
4 year={2026},
5 eprint={2605.21102},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL},
8 url={https://arxiv.org/abs/2605.21102},
9}