SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2407.18940 · EMNLP · 2024

LitSearch: A Retrieval Benchmark for Scientific Literature Search

Danqi Chen, Tianyu Gao, Tanya Goyal, Mengzhou Xia, Alexis Chevalier, Anirudh Ajith

arXiv · PDF · Open in the Atlas

Code that ran

7 of 7 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 0 have no contract verdict; 7 failures of our instrument; 0 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/2407.18940.json · badge: /api/ran/2407.18940.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
princeton-nlp/litsearch canonical (classifier label)
classifier basis: census
7 ran · 0 no recorded run
FunctionStatusWhere it lives
calculate_recall Ran
ran; our contract draft was wrong, not the code
princeton-nlp/litsearch/utils/utils.py
code served (permissive licence) · get_code("d953118b232c64d9")
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 float, 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
import numpy as np

# Set seed for reproducibility
torch.manual_seed(0)

# Create sample arguments for calculate_recall function
# retrieved: List[int] - a list of retrieved document IDs
retrieved = [1, 3, 5, 7, 9]

# relevant_docs: List[int] - a list of relevant document IDs
relevant_docs = [1, 2, 3, 4, 5]

ARGS = {
    "retrieved": retrieved,
    "relevant_docs": relevant_docs
}
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 float, 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
clean_response Ran
ran; our contract draft was wrong, not the code
princeton-nlp/litsearch/eval/reranking/rerank.py
code served (permissive licence) · get_code("f9930f0c5ed5d20e")
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 str. 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

def clean_response(response: str):
    new_response = ''
    for c in response:
        new_response += c if c.isdigit() else ' '
    new_response = new_response.strip()
    return new_response

ARGS = {
    'response': 'hello 123 world 456 test'
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
create_prompt_messages Ran
ran; our contract draft was wrong, not the code
princeton-nlp/litsearch/eval/reranking/rerank.py
code served (permissive licence) · get_code("8d65f2f75a40f35a")
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 torch
import numpy as np

# Construct the item dict with required structure
item = {
    'query': 'What are the latest advances in machine learning?',
    'documents': [
        {
            'content': 'Title: Deep Learning Advances Content: This paper discusses recent breakthroughs in neural networks and transformer architectures for natural language processing and computer vision applications.'
        },
        {
            'content': 'Title: Reinforcement Learning Content: We present novel methods for training agents using reinforcement learning with applications to robotics and game playing.'
        },
        {
            'content': 'Title: Graph Neural Networks Content: This work explores the use of graph neural networks for semi-supervised learning on structured data with improved scalability.'
        },
        {
            'content': 'Title: Few-Shot Learning Content: We introduce techniques for training models with limited labeled examples using meta-learning approaches.'
        }
    ]
}

# Define the ARGS dictionary with all required parameters
ARGS = {
    'item': item,
    'rank_start': 0,
    'rank_end': 2,
    'index_type': 'title_abstract'
}
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 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
get_index_name Ran
ran; our contract draft was wrong, not the code
princeton-nlp/litsearch/eval/retrieval/build_index.py
code served (permissive licence) · get_code("12e85238e973e6d2")
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 str. 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 os
import argparse

parser = argparse.ArgumentParser()
parser.add_argument('--dataset_path', type=str, default='/path/to/dataset')
parser.add_argument('--key', type=str, default='index_key')

args = parser.parse_args([
    '--dataset_path', '/home/user/my_dataset',
    '--key', 'embeddings'
])

ARGS = {
    'args': 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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
read_json Ran
ran; our contract draft was wrong, not the code
princeton-nlp/litsearch/utils/utils.py
code served (permissive licence) · get_code("266ec98878d442f8")
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 json
import tempfile
import os

# Create temporary JSON file for testing
temp_dir = tempfile.mkdtemp()
json_file = os.path.join(temp_dir, "test.json")

# Write test data to JSON file
test_data = [
    {"id": 1, "name": "Alice", "value": 42},
    {"id": 2, "name": "Bob", "value": 99},
    {"id": 3, "name": "Charlie", "value": 7}
]

with open(json_file, 'w') as f:
    json.dump(test_data, f)

# Define ARGS dictionary with all parameters
ARGS = {
    "filename": json_file,
    "silent": False
}
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
read_txt Ran
ran; our contract draft was wrong, not the code
princeton-nlp/litsearch/utils/utils.py
code served (permissive licence) · get_code("ff8c06125817aa41")
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 str. 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

# Create a temporary file with some text content
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
temp_file.write("Hello, this is test content for the read_txt function.")
temp_file.close()

# Define ARGS with the filename parameter
ARGS = {
    'filename': temp_file.name
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
remove_duplicate Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
princeton-nlp/litsearch/eval/reranking/rerank.py
code served (permissive licence) · get_code("765325bbb716f8dc")
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

torch.manual_seed(0)

# The function remove_duplicate takes a response parameter and removes duplicates
# while preserving order. It iterates through elements and checks membership.
# The parameter should be an iterable (list, tuple, etc.) of hashable items.

# Create a simple list with some duplicate elements
response = [1, 2, 3, 2, 4, 1, 5, 3]

ARGS = {
    "response": response
}
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

Also present in other papers' code

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

FunctionAlso present inEarliest-datedOthers named
remove_duplicate 1 other paper
1 later
2505.20128 (2025-05)
Iterative Self-Incentivization Empowers Large Language Models as Agentic Searchers

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

Literature search questions, such as "Where can I find research on the evaluation of consistency in generated summaries?" pose significant challenges for modern search engines and retrieval systems. These questions often require a deep understanding of research concepts and the ability to reason across entire articles. In this work, we introduce LitSearch, a retrieval benchmark comprising 597 realistic literature search queries about recent ML and NLP papers. Lit-Search is constructed using a combination of (1) questions generated by GPT-4 based on paragraphs containing inline citations from research papers and (2) questions manually written by authors about their recently published papers. All LitSearch questions were manually examined or edited by experts to ensure high quality. We extensively benchmark state-ofthe-art retrieval models and also evaluate two LLM-based reranking pipelines. We find a significant performance gap between BM25 and state-of-the-art dense retrievers, with a 24.8% absolute difference in recall@5. The LLMbased reranking strategies further improve the best-performing dense retriever by 4.4%. Additionally, commercial search engines and research tools like Google Search perform poorly on LitSearch, lagging behind the best dense retriever by up to 32 recall points. Taken together, these results show that LitSearch is an informative new testbed for retrieval systems while catering to a real-world use case. 1 Author-written Question: Invite ACL'23/ICLR'24 authors to write a question for their own papers Inline-citation Question: Sample an inline citation and prompt GPT-4 to write a question (Figure 2) Target Paper Target Paper Which method involves training additional prompt tokens for every layer during the fine-tuning of language models? Can you find a research paper that uses structured pruning techniques to scale down language models, where the original model being pruned has billions of parameters?

For agents

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

get_harvested_code_for_paper("2407.18940")
get_code_for_paper("2407.18940")
have("2407.18940")

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

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

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

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

Connect an agent — have() is free.