Papers › SpanBERT: Improving Pre-training by Representing and Predicting Spans

SpanBERT: Improving Pre-training by Representing and Predicting Spans

24 Jul 2019TACL 2020 1arXiv:1907.10529archive 2025-07-28

Mandar Joshi, Danqi Chen, Yinhan Liu, Daniel S. Weld, Luke Zettlemoyer, Omer Levy

We present SpanBERT, a pre-training method that is designed to better represent and predict spans of text. Our approach extends BERT by (1) masking contiguous random spans, rather than random tokens, and (2) training the span boundary representations to predict the entire content of the masked span, without relying on the individual token representations within it. SpanBERT consistently outperforms BERT and our better-tuned baselines, with substantial gains on span selection tasks such as question answering and coreference resolution. In particular, with the same training data and model size as BERT-large, our single model obtains 94.6% and 88.7% F1 on SQuAD 1.1 and 2.0, respectively. We also achieve a new state of the art on the OntoNotes coreference resolution task (79.6\% F1), strong performance on the TACRED relation extraction benchmark, and even show gains on GLUE.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="1907.10529")

Code

Syntology Ran 3 of 15 code samples harvested from 2 repositories linked to this paper; 12 have no recorded run. Of those that ran: 3 ran · our draft was wrong.

By repository: official repository: 3 samples from 1 repository, 2 ran; community (archive-listed): 11 samples from 1 repository, 1 ran; 1 identical to code first harvested elsewhere. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

facebookresearch/SpanBERT officialmentioned in papermentioned on GitHubpytorch report
UnknownGenie/altered-BERT-KPE mentioned on GitHubpytorch report
amore-upf/masked-coreference mentioned on GitHubtfApache-2.0 report
mandarjoshi90/coref mentioned on GitHubtfApache-2.0 report
wooseok-AI/Korean_e2e_CR_BERT mentioned on GitHubtf report
zixinzeng-jennifer/spanbert_trans mentioned on GitHubpytorchNOASSERTION report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

15 samples harvested; 3 ran; 0 honoured the contract we drafted; 12 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

3ran · our draft was wrong
12unverified

Licence: 4 of the 15 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; each sample names its own and says which. Some samples are identical code Syntology first harvested from another repository; for those, this paper's copy is not located and its licence is not recorded. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

convert_examples_to_features facebookresearch/SpanBERT/code/run_tacred.py official repository ran · our draft was wrong licence not identified · pointer only · 3860f4e19d89be73 · report
convert_token facebookresearch/SpanBERT/code/run_tacred.py official repository ran · our draft was wrong fingerprinted licence not identified · pointer only · 1731b0e57e413f9d · report
convert_examples_to_features facebookresearch/SpanBERT/code/run_squad.py official repository unverified licence not identified · pointer only · da5d9e9f738be2ba · report
get_activation amore-upf/masked-coreference/bert/modeling.py community (archive-listed) ran · our draft was wrong Apache-2.0 (permissive) · 5681f7dd9b6e3679 · report
b_cubed amore-upf/masked-coreference/metrics.py community (archive-listed) unverified Apache-2.0 (permissive) · 599218961a8155ee · report
evaluate_conll amore-upf/masked-coreference/conll.py community (archive-listed) unverified Apache-2.0 (permissive) · ea92f536bea4cbd4 · report
f1 amore-upf/masked-coreference/metrics.py community (archive-listed) unverified Apache-2.0 (permissive) · 5dc251a1bb16c94f · report
gelu amore-upf/masked-coreference/bert/modeling.py community (archive-listed) unverified Apache-2.0 (permissive) · ecab128238ebf253 · report
get_assignment_map_from_checkpoint amore-upf/masked-coreference/bert/modeling.py community (archive-listed) unverified Apache-2.0 (permissive) · 50958618b65e514e · report
get_doc_key amore-upf/masked-coreference/conll.py community (archive-listed) unverified Apache-2.0 (permissive) · f300a33fe05fc609 · report
get_sentence_map amore-upf/masked-coreference/minimize.py community (archive-listed) unverified Apache-2.0 (permissive) · de32dc1a0c359c0d · report
normalize_word amore-upf/masked-coreference/minimize.py community (archive-listed) unverified Apache-2.0 (permissive) · 3b625164c1147fcf · report
official_conll_eval amore-upf/masked-coreference/conll.py community (archive-listed) unverified Apache-2.0 (permissive) · 5712dc7b00cdd758 · report
read_doc_keys amore-upf/masked-coreference/evaluate.py community (archive-listed) unverified Apache-2.0 (permissive) · edcb69a1bdf0f631 · report
simple_accuracy identical code first harvested elsewhere unverified licence of this copy not recorded · 3c241ecfe3749a6d · report

Tasks

Coreference ResolutionLinguistic AcceptabilityNatural Language InferenceOpen-Domain Question AnsweringParaphrase IdentificationQuestion AnsweringRelation ClassificationRelation ExtractionSemantic Textual SimilaritySentiment Analysis

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Coreference Resolution OntoNotes SpanBERT F1 79.6 #11 of 26 Archive leaderboard report
Linguistic Acceptability CoLA SpanBERT Accuracy 64.3% #25 of 43 Archive leaderboard report
Natural Language Inference MultiNLI SpanBERT Matched 88.1 #16 of 67 Archive leaderboard report
Natural Language Inference QNLI SpanBERT Accuracy 94.3% #17 of 43 Archive leaderboard report
Natural Language Inference RTE SpanBERT Accuracy 79.0% #40 of 90 Archive leaderboard report
Open-Domain Question Answering SearchQA SpanBERT F1 84.8 #14 of 14 Archive leaderboard report
Paraphrase Identification Quora Question Pairs SpanBERT Accuracy 89.5 #13 of 31 Archive leaderboard report
Paraphrase Identification Quora Question Pairs SpanBERT F1 71.9 #13 of 31 Archive leaderboard report
Question Answering NaturalQA SpanBERT F1 82.5 #3 of 4 Archive leaderboard report
Question Answering NewsQA SpanBERT F1 73.6 #16 of 18 Archive leaderboard report
Question Answering SQuAD1.1 SpanBERT (single model) EM 88.8 #13 of 213 Archive leaderboard report
Question Answering SQuAD1.1 SpanBERT (single model) F1 94.6 #13 of 213 Archive leaderboard report
Question Answering SQuAD1.1 SpanBERT (single model) Hardware Burden 586G #13 of 213 Archive leaderboard report
Question Answering SQuAD2.0 SpanBERT EM 85.7 #120 of 286 Archive leaderboard report
Question Answering SQuAD2.0 SpanBERT F1 88.7 #120 of 286 Archive leaderboard report
Question Answering SQuAD2.0 dev SpanBERT F1 86.8 #6 of 13 Archive leaderboard report
Question Answering TriviaQA SpanBERT F1 83.6 #48 of 56 Archive leaderboard report
Relation Classification TACRED SpanBERT F1 70.8 #7 of 17 Archive leaderboard report
Relation Extraction Re-TACRED SpanBERT F1 85.3 #5 of 9 Archive leaderboard report
Relation Extraction TACRED SpanBERT-large F1 70.8 #22 of 40 Archive leaderboard report
Semantic Textual Similarity MRPC SpanBERT Accuracy 90.9% #8 of 45 Archive leaderboard report
Semantic Textual Similarity STS Benchmark SpanBERT Pearson Correlation 0.899 #21 of 66 Archive leaderboard report
Sentiment Analysis SST-2 Binary classification SpanBERT Accuracy 94.8 #29 of 87 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

AdamAttentionAttention DropoutBERTDense ConnectionsDropoutLayer NormalizationLinear LayerLinear Warmup With Linear DecayMulti-Head AttentionResidual ConnectionSoftmaxWeight DecayWordPiece

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections