SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1905.05733 · 2019

Multi-step Retriever-Reader Interaction for Scalable Open-domain Question Answering

arXiv · PDF · Open in the Atlas

Code that ran

8 of 10 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, 1 violated it and 5 have no contract verdict; 2 failures of our instrument; 2 no recorded run), measured 2026-11-23; 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/1905.05733.json · badge: /api/ran/1905.05733.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
rajarshd/Multi-Step-Reasoning canonical (classifier label)
classifier basis: census
8 ran · 2 no recorded run
FunctionStatusWhere it lives
batchify Ran
ran on a synthesized input
rajarshd/Multi-Step-Reasoning/paragraph_encoder/model/vector.py
code served (permissive licence) · get_code("df76adfce12ed67e")
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 function. 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 torch

torch.manual_seed(0)

# The function batchify takes args, para_mode, and train_time
# It returns a lambda that calls batchify_ with those arguments
# batchify_ expects:
# - args: appears unused in the function body
# - batch: a list of examples, where each example is a tuple:
#   [doc_tensor, question_tensor, ..., num_occurances_value, id_value]
# - para_mode: appears unused
# - train_time: appears unused

# Create a minimal args object (unused but required)
args = {}

# Create sample batch data
# Each example: [doc_tensor, question_tensor, ..., num_occurances, id]
doc1 = torch.LongTensor([1, 2, 3, 4])
doc2 = torch.LongTensor([5, 6])

question1 = torch.LongTensor([10, 11, 12])
question2 = torch.LongTensor([20])

# Build batch: each item is [doc, question, ..., num_occurances, id]
batch = [
    [doc1, question1, 5, "id_1"],
    [doc2, question2, 3, "id_2"],
]

para_mode = "paragraph"
train_time = True

ARGS = {
    "args": args,
    "para_mode": para_mode,
    "train_time": train_time,
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
batchify_ Ran
ran on a synthesized input
rajarshd/Multi-Step-Reasoning/paragraph_encoder/model/vector.py
code served (permissive licence) · get_code("573ffde82de17f21")
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 torch

torch.manual_seed(0)

# Construct batch examples
# Each example: (doc_tensor, question_tensor, ..., num_occurrences, id)
example1 = (
    torch.LongTensor([1, 2, 3]),           # doc
    torch.LongTensor([4, 5]),              # question
    7,                                      # num_occurrences
    "id1"                                   # id
)

example2 = (
    torch.LongTensor([6, 7, 8, 9]),        # doc (different length)
    torch.LongTensor([10, 11, 12]),        # question (different length)
    5,                                      # num_occurrences
    "id2"                                   # id
)

batch = [example1, example2]

args_dict = {
    "args": None,
    "batch": batch,
    "para_mode": False,
    "train_time": True
}

ARGS = args_dict
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 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
get_model_args Ran
ran on a synthesized input
rajarshd/Multi-Step-Reasoning/msr/reader/config.py
code served (permissive licence) · get_code("e750e48bd95460f8")
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 Namespace. 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 argparse
import torch

torch.manual_seed(0)

ARGS = {
    'args': argparse.Namespace(
        # MODEL_ARCHITECTURE parameters
        model_type='rnn',
        embedding_dim=64,
        hidden_size=128,
        doc_layers=2,
        question_layers=2,
        rnn_type='lstm',
        concat_rnn_layers=True,
        question_merge='self_attn',
        use_qemb=True,
        use_in_question=True,
        use_pos=True,
        use_ner=True,
        use_lemma=True,
        use_tf=True,
        # MODEL_OPTIMIZER parameters
        fix_embeddings=False,
        optimizer='adamax',
        learning_rate=0.001,
        momentum=0.9,
        weight_decay=0.0,
        rnn_padding=False,
        dropout_rnn=0.3,
        dropout_rnn_output=0.3,
        dropout_emb=0.3,
        max_len=400,
        grad_clipping=10.0,
        tune_partial=0,
        # Additional fields that might be in args but not in MODEL_ARCHITECTURE | MODEL_OPTIMIZER
        batch_size=32,
        epochs=10,
    )
}
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 Namespace — a Namespace output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Namespace 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
override_model_args Ran
ran on a synthesized input
rajarshd/Multi-Step-Reasoning/msr/reader/config.py
code served (permissive licence) · get_code("1243693ad7946e42")
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 Namespace. 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 argparse
import logging

logging.basicConfig(level=logging.INFO)

# Create sample argparse.Namespace objects for old_args and new_args
old_args = argparse.Namespace(
    learning_rate=0.001,
    batch_size=32,
    epochs=10,
    model_hidden_dim=128,
    dropout=0.5,
    optimizer='adam'
)

new_args = argparse.Namespace(
    learning_rate=0.002,
    batch_size=32,
    epochs=20,
    optimizer='sgd',
    weight_decay=0.0001
)

ARGS = {
    'old_args': old_args,
    'new_args': new_args
}
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 Namespace — a Namespace output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Namespace 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
str2bool Ran
ran, violated the contract we drafted
rajarshd/Multi-Step-Reasoning/paragraph_encoder/config.py
code served (permissive licence) · get_code("8c0dec327bfce0f2")
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 bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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

ARGS = {
    'v': 'true'
}
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 bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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
vectorize Ran
ran on a synthesized input
rajarshd/Multi-Step-Reasoning/paragraph_encoder/model/vector.py
code served (permissive licence) · get_code("1819a5e33ac523fc")
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 torch
import numpy as np

torch.manual_seed(0)
np.random.seed(0)

class Args:
    def __init__(self):
        self.word_dict = {
            'the': 0,
            'quick': 1,
            'brown': 2,
            'fox': 3,
            'jumps': 4,
            'over': 5,
            'lazy': 6,
            'dog': 7
        }
        self.train_time = True
        self.neg_sample = 0.5

ex = {
    'document': ['the', 'quick', 'brown', 'fox'],
    'question': ['what', 'is', 'this'],
    'ans_occurance': 2,
    'id': 1
}

# Handle unknown words by adding them to word_dict
for word in ex['document'] + ex['question']:
    if word not in Args().word_dict:
        Args().word_dict[word] = len(Args().word_dict)

args_instance = Args()

# Rebuild ex with words that exist in word_dict
ex = {
    'document': ['the', 'quick', 'brown', 'fox'],
    'question': ['jumps', 'over', 'lazy'],
    'ans_occurance': 2,
    'id': 1
}

ARGS = {
    'args': args_instance,
    'ex': ex
}
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
weighted_avg Ran
ran; our contract draft was wrong, not the code
rajarshd/Multi-Step-Reasoning/msr/reader/layers.py
code served (permissive licence) · get_code("880a4e01d58b0591")
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 Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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

torch.manual_seed(0)

# x: batch * len * hdim
batch_size = 2
seq_len = 3
hdim = 4

x = torch.randn(batch_size, seq_len, hdim)

# weights: batch * len, sum(dim=1) = 1
weights = torch.softmax(torch.randn(batch_size, seq_len), dim=1)

ARGS = {
    "x": x,
    "weights": weights,
}
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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
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
weighted_avg Ran
ran; our contract draft was wrong, not the code
rajarshd/Multi-Step-Reasoning/paragraph_encoder/model/layers.py
code served (permissive licence) · get_code("29724763a4c084cb")
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 Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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

torch.manual_seed(0)

# x: batch * len * hdim
# weights: batch * len, sum(dim = 1) = 1

batch_size = 2
seq_len = 3
hdim = 4

x = torch.randn(batch_size, seq_len, hdim)
weights = torch.ones(batch_size, seq_len) / seq_len

ARGS = {
    "x": x,
    "weights": weights,
}
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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
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
uniform_weights Not yet run
unverified (harvested, no recorded run)
rajarshd/Multi-Step-Reasoning/msr/reader/layers.py
code served (permissive licence) · get_code("9f1455d03e97305c")
How it ran

no invocation recorded.

uniform_weights Not yet run
unverified (harvested, no recorded run)
rajarshd/Multi-Step-Reasoning/paragraph_encoder/model/layers.py
code served (permissive licence) · get_code("9c735215d357a2c9")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 4 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 3 later) and 4 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.

FunctionAlso present inEarliest-datedOthers named
str2bool 5 other papers
5 later
2006.03511 (2020-06)
Unsupervised Translation of Programming Languages
2010.03009 (2020-10)
GATE: Graph Attention Transformer Encoder for Cross-lingual Relation and Event Extraction
2021.acl-long.164 (2021 (year only))
BERTAC: Enhancing Transformer-based Language Models with Adversarially Pretrained Convolutional Neural Networks
and 2 more not named here
weighted_avg 3 other papers
1 dated earlier, 2 later
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
2021.acl-long.164 (2021 (year only))
BERTAC: Enhancing Transformer-based Language Models with Adversarially Pretrained Convolutional Neural Networks
2205.09665 (2022-05)
Automated Crossword Solving
get_model_args 1 other paper
1 later
2021.acl-long.164 (2021 (year only))
BERTAC: Enhancing Transformer-based Language Models with Adversarially Pretrained Convolutional Neural Networks
uniform_weights 1 other paper
1 dated earlier
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding

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-23.

Repositories linked to this paper

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

Abstract

This paper introduces a new framework for open-domain question answering in which the retriever and the reader iteratively interact with each other. The framework is agnostic to the architecture of the machine reading model, only requiring access to the token-level hidden representations of the reader. The retriever uses fast nearest neighbor search to scale to corpora containing millions of paragraphs. A gated recurrent unit updates the query at each step conditioned on the state of the reader and the reformulated query is used to re-rank the paragraphs by the retriever. We conduct analysis and show that iterative interaction helps in retrieving informative paragraphs from the corpus. Finally, we show that our multi-step-reasoning framework brings consistent improvement when applied to two widely used reader architectures DrQA and BiDAF on various large open-domain datasets --- TriviaQA-unfiltered, QuasarT, SearchQA, and SQuAD-Open.

For agents

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

get_harvested_code_for_paper("1905.05733")
get_code_for_paper("1905.05733")
have("1905.05733")

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

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

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

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

Connect an agent — have() is free.