SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1909.04120 · 2019

Span Selection Pre-training for Question Answering

arXiv · PDF · Open in the Atlas

Code that ran

6 of 6 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 6 have no contract verdict; 0 failures of our instrument; 0 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/1909.04120.json · badge: /api/ran/1909.04120.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
IBM/span-selection-pretraining canonical (classifier label)
classifier basis: census
6 ran · 0 no recorded run
FunctionStatusWhere it lives
expand_files Ran
ran on a synthesized input
IBM/span-selection-pretraining/util/line_corpus.py
code served (permissive licence) · get_code("d6b89c7b58978a8d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import tempfile
import shutil

# Create a temporary directory structure for testing
temp_dir = tempfile.mkdtemp()

# Create some test files
test_file1 = os.path.join(temp_dir, "test1.jsonl")
test_file2 = os.path.join(temp_dir, "test2.jsonl.gz")

# Create subdirectory with files
sub_dir = os.path.join(temp_dir, "subdir")
os.makedirs(sub_dir, exist_ok=True)
test_file3 = os.path.join(sub_dir, "test3.jsonl")

# Write some dummy content
with open(test_file1, 'w') as f:
    f.write("dummy")
with open(test_file2, 'w') as f:
    f.write("dummy")
with open(test_file3, 'w') as f:
    f.write("dummy")

# Prepare arguments
input_files = [temp_dir, test_file1]
file_pattern = '*.jsonl*'
completed_files = [test_file2]

ARGS = {
    'input_files': input_files,
    'file_pattern': file_pattern,
    'completed_files': completed_files
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
find_answer_starts Ran
ran on a synthesized input
IBM/span-selection-pretraining/sspt/rc_data.py
code served (permissive licence) · get_code("0f9f2dcb10508687")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

# Analyze the function:
# - doc_toks: a list or sequence that supports len() and slicing
# - ans_toks: a list or sequence that supports len() and equality comparison with slices
# The function searches for ans_toks as a subsequence within doc_toks

# Create example token lists (using integers to represent tokens)
doc_toks = [1, 2, 3, 4, 5, 2, 3, 4, 6, 7]
ans_toks = [2, 3, 4]

ARGS = {
    "doc_toks": doc_toks,
    "ans_toks": ans_toks
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
jsonl_files Ran
ran on a synthesized input
IBM/span-selection-pretraining/util/line_corpus.py
code served (permissive licence) · get_code("85c7c7b7f3166299")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import tempfile
import shutil

# Create a temporary directory structure for testing
temp_dir = tempfile.mkdtemp()
test_dir = os.path.join(temp_dir, "test_data")
os.makedirs(test_dir, exist_ok=True)

# Create some test files
test_file1 = os.path.join(test_dir, "data1.jsonl")
test_file2 = os.path.join(test_dir, "data2.jsonl.gz")
test_file3 = os.path.join(test_dir, "subdir", "data3.jsonl")

os.makedirs(os.path.dirname(test_file3), exist_ok=True)

# Write minimal content to files
with open(test_file1, 'w') as f:
    f.write('{"key": "value"}\n')

with open(test_file2, 'w') as f:
    f.write('test')

with open(test_file3, 'w') as f:
    f.write('{"key": "value"}\n')

# Define arguments for jsonl_files function
ARGS = {
    'input_files': test_dir,
    'completed_files': None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
jsonl_lines Ran
ran on a synthesized input
IBM/span-selection-pretraining/util/line_corpus.py
code served (permissive licence) · get_code("652308c8c6436531")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned generator. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tempfile
import os
import json

# Create a temporary directory with test JSONL files
temp_dir = tempfile.mkdtemp()

# Create a test JSONL file
test_jsonl_file = os.path.join(temp_dir, "test.jsonl")
with open(test_jsonl_file, 'w') as f:
    f.write(json.dumps({"text": "line 1"}) + "\n")
    f.write(json.dumps({"text": "line 2"}) + "\n")

# Create a subdirectory with another JSONL file
sub_dir = os.path.join(temp_dir, "subdir")
os.makedirs(sub_dir, exist_ok=True)
test_jsonl_file2 = os.path.join(sub_dir, "test2.jsonl")
with open(test_jsonl_file2, 'w') as f:
    f.write(json.dumps({"text": "line 3"}) + "\n")

ARGS = {
    "input_files": temp_dir,
    "completed_files": None,
    "limit": 0,
    "report_every": 100000
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type generator — a generator output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a generator output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
make_batch Ran
ran on a synthesized input
IBM/span-selection-pretraining/sspt/rc_data.py
code served (permissive licence) · get_code("d8293148b27d48c6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import torch

torch.manual_seed(0)

class Feature:
    def __init__(self, input_ids, segment_ids, start_positions, end_positions, answer_type=None, qid=None, passage_text=None, token_offsets=None):
        self.input_ids = input_ids
        self.segment_ids = segment_ids
        self.start_positions = start_positions
        self.end_positions = end_positions
        self.answer_type = answer_type
        self.qid = qid
        self.passage_text = passage_text
        self.token_offsets = token_offsets

# Create sample features
feature1 = Feature(
    input_ids=np.array([101, 2054, 2003, 102], dtype=np.long),
    segment_ids=np.array([0, 0, 0, 0], dtype=np.long),
    start_positions=np.array([1, 2], dtype=np.long),
    end_positions=np.array([2, 3], dtype=np.long),
    answer_type=1,
    qid="q1",
    passage_text="What is the answer?",
    token_offsets=[(0, 3), (4, 8)]
)

feature2 = Feature(
    input_ids=np.array([101, 2054, 102], dtype=np.long),
    segment_ids=np.array([0, 0, 0], dtype=np.long),
    start_positions=np.array([1], dtype=np.long),
    end_positions=np.array([2], dtype=np.long),
    answer_type=0,
    qid="q2",
    passage_text="Question here",
    token_offsets=[(0, 3)]
)

features = [feature1, feature2]

ARGS = {
    "features": features,
    "fp16": False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
normalize Ran
ran on a synthesized input
IBM/span-selection-pretraining/sspt/rc_data.py
code served (permissive licence) · get_code("05976f47d8d6e84a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import re

# Construct arguments for the normalize function
toks = ["Hello", "WORLD", "test", "123", "foo"]
filter_pattern = re.compile(r'^\d+$')  # Pattern to filter out pure digits

ARGS = {
    "toks": toks,
    "filter_pattern": filter_pattern
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 6 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

BERT (Bidirectional Encoder Representations from Transformers) and related pre-trained Transformers have provided large gains across many language understanding tasks, achieving a new state-of-the-art (SOTA). BERT is pre-trained on two auxiliary tasks: Masked Language Model and Next Sentence Prediction. In this paper we introduce a new pre-training task inspired by reading comprehension to better align the pre-training from memorization to understanding. Span Selection Pre-Training (SSPT) poses cloze-like training instances, but rather than draw the answer from the model's parameters, it is selected from a relevant passage. We find significant and consistent improvements over both BERT-BASE and BERT-LARGE on multiple reading comprehension (MRC) datasets. Specifically, our proposed model has strong empirical evidence as it obtains SOTA results on Natural Questions, a new benchmark MRC dataset, outperforming BERT-LARGE by 3 F1 points on short answer prediction. We also show significant impact in HotpotQA, improving answer prediction F1 by 4 points and supporting fact prediction F1 by 1 point and outperforming the previous best system. Moreover, we show that our pre-training approach is particularly effective when training data is limited, improving the learning curve by a large amount.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("1909.04120")
get_code_for_paper("1909.04120")
have("1909.04120")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/1909.04120.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/1909.04120.svg)](https://syntology.ai/paper/1909.04120)

Connect an agent — have() is free.