SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2404.18812 · NeurIPS · 2024

Efficient Inverted Indexes for Approximate Retrieval over Learned Sparse Representations

Sebastian Bruch, Franco Nardini, Cosimo Rulli, Rossano Venturini

arXiv · PDF · Open in the Atlas

Code that ran

9 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, 0 violated it and 0 have no contract verdict; 9 failures of our instrument; 1 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/2404.18812.json · badge: /api/ran/2404.18812.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
castorini/anserini canonical (classifier label)
classifier basis: census
9 ran · 1 no recorded run
FunctionStatusWhere it lives
clean Ran
ran; our contract draft was wrong, not the code
castorini/anserini/src/main/python/openresearch/convert_openresearch_to_anserini_format.py
code served (permissive licence) · get_code("846465e7b7d1dbec")
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

ARGS = {
    "text": "hello\nworld\twith\nnewlines\tand\ttabs"
}
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
generate_flat_command Ran
ran; our contract draft was wrong, not the code
castorini/anserini/src/main/python/beir/build_beir_indexes.py
code served (permissive licence) · get_code("b86627f5e27eeabd")
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
import numpy as np

collection_base = '/tuna1/collections'
commitid_short = '505594'
date_abbreviated = '20221116'

def generate_flat_command(corpora):
    return f'nohup target/appassembler/bin/IndexCollection \\\n' + f'  -collection BeirFlatCollection \\\n' + f'  -input {collection_base}/beir-v1.0.0/corpus/{corpora} \\\n' + f'  -index indexes/lucene-index.beir-v1.0.0-{corpora}-flat.{date_abbreviated}.{commitid_short}/ \\\n' + f'  -generator DefaultLuceneDocumentGenerator \\\n' + f'  -threads 16 -storePositions -storeDocvectors -storeRaw -optimize \\\n' + f'  >& logs/log.beir-v1.0.0-{corpora}-flat.{date_abbreviated}.{commitid_short} &'

ARGS = {
    'corpora': 'trec-covid'
}
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 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
generate_multifield_command Ran
ran; our contract draft was wrong, not the code
castorini/anserini/src/main/python/beir/build_beir_indexes.py
code served (permissive licence) · get_code("bcc47ae4250c0a3d")
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.

collection_base = '/tuna1/collections'
commitid_short = '505594'
date_abbreviated = '20221116'

def generate_multifield_command(corpora):
    return f'nohup target/appassembler/bin/IndexCollection \\\n' + f'  -collection BeirMultifieldCollection \\\n' + f'  -input {collection_base}/beir-v1.0.0/corpus/{corpora} \\\n' + f'  -index indexes/lucene-index.beir-v1.0.0-{corpora}-multifield.{date_abbreviated}.{commitid_short}/ \\\n' + f'  -generator DefaultLuceneDocumentGenerator \\\n' + f'  -threads 16 -fields title -storePositions -storeDocvectors -storeRaw -optimize \\\n' + f'  >& logs/log.beir-v1.0.0-{corpora}-multifield.{date_abbreviated}.{commitid_short} &'

ARGS = {
    'corpora': 'trec-covid'
}
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
generate_splade_command Ran
ran; our contract draft was wrong, not the code
castorini/anserini/src/main/python/beir/build_beir_indexes.py
code served (permissive licence) · get_code("28e82b3dfa78c8c0")
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

torch.manual_seed(0)

collection_base = '/tuna1/collections'
commitid_short = '505594'
date_abbreviated = '20221116'

def generate_splade_command(corpora):
    return f'nohup target/appassembler/bin/IndexCollection \\\n' + f'  -collection JsonVectorCollection \\\n' + f'  -generator DefaultLuceneDocumentGenerator \\\n' + f'  -input {collection_base}/beir-v1.0.0/splade_distil_cocodenser_medium/{corpora} \\\n' + f'  -index indexes/lucene-index.beir-v1.0.0-{corpora}-splade_distil_cocodenser_medium.{date_abbreviated}.{commitid_short}/ \\\n' + f'  -threads 16 -impact -pretokenized -optimize \\\n' + f'  >& logs/log.beir-v1.0.0-{corpora}-splade_distil_cocodenser_medium.{date_abbreviated}.{commitid_short} &'

ARGS = {
    'corpora': 'dbpedia'
}
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
get_id_years Ran
ran; our contract draft was wrong, not the code
castorini/anserini/src/main/python/openresearch/convert_openresearch_to_anserini_format.py
code served (permissive licence) · get_code("3b56b2ae2bc939da")
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 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 gzip
import json
import tempfile
import os

# Create temporary gzip files with sample JSON data
temp_dir = tempfile.mkdtemp()

# Create first gzip file
file_path_1 = os.path.join(temp_dir, 'data_1.jsonl.gz')
with gzip.open(file_path_1, 'wt') as f:
    for i in range(5):
        obj = {'id': f'paper_{i}', 'year': 2000 + i}
        f.write(json.dumps(obj) + '\n')

# Create second gzip file
file_path_2 = os.path.join(temp_dir, 'data_2.jsonl.gz')
with gzip.open(file_path_2, 'wt') as f:
    for i in range(5, 10):
        obj = {'id': f'paper_{i}', 'year': 2000 + i}
        f.write(json.dumps(obj) + '\n')

# Create third gzip file with some entries missing 'year'
file_path_3 = os.path.join(temp_dir, 'data_3.jsonl.gz')
with gzip.open(file_path_3, 'wt') as f:
    for i in range(10, 15):
        obj = {'id': f'paper_{i}', 'year': 2000 + i}
        f.write(json.dumps(obj) + '\n')
    # Add entry without year
    obj_no_year = {'id': 'paper_no_year'}
    f.write(json.dumps(obj_no_year) + '\n')

ARGS = {
    'file_paths': [file_path_1, file_path_2, file_path_3],
    'train_fraction': 0.6
}
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 1, 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
get_ids Ran
ran; our contract draft was wrong, not the code
castorini/anserini/src/main/python/openresearch/convert_pubmed_dblp_to_anserini_format.py
code served (permissive licence) · get_code("9cd632164c3a2c37")
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 set. 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)

# Analyze the function:
# - start: int (used in range)
# - end: int (used in range)
# - year_ids: dict-like (indexed by year values from range(start, end+1))
#   Each year_ids[year] is iterable (extended into result list)

# Create a small year_ids dictionary
# Years 2020-2022 with lists of IDs
year_ids = {
    2020: [1, 2, 3],
    2021: [4, 5],
    2022: [6, 7, 8, 9]
}

ARGS = {
    "start": 2020,
    "end": 2022,
    "year_ids": year_ids
}
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 set — a set output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a set 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
load_candidate_from_stream Ran
ran; our contract draft was wrong, not the code
castorini/anserini/src/main/python/msmarco_compare.py
code served (permissive licence) · get_code("44dabd5275dfdd74")
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 dict. 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 io

# Create a stream with candidate passage data
# Format: query_id\tpassage_id\trank
stream_content = """1\t101\t1
1\t102\t2
1\t103\t3
2\t201\t1
2\t202\t2
3\t301\t1
"""

# Convert string to a file-like object
f = io.StringIO(stream_content)

ARGS = {
    "f": f
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
load_metrics Ran
ran; our contract draft was wrong, not the code
castorini/anserini/src/main/python/compare_runs.py
code served (permissive licence) · get_code("8ea53853b253e05d")
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 dict. 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 metrics data in the expected format
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
temp_file.write("NDCG\tq1\t0.85\n")
temp_file.write("NDCG\tq2\t0.92\n")
temp_file.write("NDCG\tall\t0.88\n")
temp_file.write("MAP\tq1\t0.75\n")
temp_file.write("MAP\tq2\t0.81\n")
temp_file.write("MRR\tq1\t0.95\n")
temp_file.close()

ARGS = {
    'file': 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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
load_reference_from_stream Ran
ran; our contract draft was wrong, not the code
castorini/anserini/src/main/python/msmarco_compare.py
code served (permissive licence) · get_code("b09cad901d138056")
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 dict. 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 io

# The function reads from a stream (file-like object)
# It expects lines with tab-separated values where:
# - l[0] is query_id (int)
# - l[2] is passage_id (int)

stream_content = """1\tpassage_0\t101
1\tpassage_1\t102
2\tpassage_0\t201
3\tpassage_2\t302
3\tpassage_1\t301
"""

f = io.StringIO(stream_content)

ARGS = {
    "f": f
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
load_reference Not yet run
unverified (harvested, no recorded run)
castorini/anserini/src/main/python/msmarco_compare.py
code served (permissive licence) · get_code("52e247dd5467b4bb")
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 10 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 0 later) and 7 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
load_reference 5 other papers
5 dated earlier
1611.09268 (2016-11)
MS MARCO: A Human Generated MAchine Reading COmprehension Dataset
2110.05789 (2021-10)
Learning Discrete Representations via Constrained Clustering for Effective and Efficient Dense Retrieval
2022.emnlp-main.727 (2022 (year only))
CODER: An efficient framework for improving retrieval through COntextual Document Embedding Reranking
and 2 more not named here
load_candidate_from_stream 4 other papers
4 dated earlier
1611.09268 (2016-11)
MS MARCO: A Human Generated MAchine Reading COmprehension Dataset
2022.emnlp-main.727 (2022 (year only))
CODER: An efficient framework for improving retrieval through COntextual Document Embedding Reranking
2209.00179 (2022-09)
Universal Vision-Language Dense Retrieval: Learning A Unified Representation Space for Multi-Modal Retrieval
and 1 more not named here
load_reference_from_stream 4 other papers
4 dated earlier
1611.09268 (2016-11)
MS MARCO: A Human Generated MAchine Reading COmprehension Dataset
2022.emnlp-main.727 (2022 (year only))
CODER: An efficient framework for improving retrieval through COntextual Document Embedding Reranking
2209.00179 (2022-09)
Universal Vision-Language Dense Retrieval: Learning A Unified Representation Space for Multi-Modal Retrieval
and 1 more not named here

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

Learned sparse representations form an attractive class of contextual embeddings for text retrieval. That is so because they are effective models of relevance and are interpretable by design. Despite their apparent compatibility with inverted indexes, however, retrieval over sparse embeddings remains challenging. That is due to the distributional differences between learned embeddings and term frequency-based lexical models of relevance such as BM25. Recognizing this challenge, a great deal of research has gone into, among other things, designing retrieval algorithms tailored to the properties of learned sparse representations, including approximate retrieval systems. In fact, this task featured prominently in the latest BigANN Challenge at NeurIPS 2023, where approximate algorithms were evaluated on a large benchmark dataset by throughput and recall. In this work, we propose a novel organization of the inverted index that enables fast yet effective approximate retrieval over learned sparse embeddings. Our approach organizes inverted lists into geometrically-cohesive blocks, each equipped with a summary vector. During query processing, we quickly determine if a block must be evaluated using the summaries. As we show experimentally, single-threaded query processing using our method, Seismic, reaches sub-millisecond per-query latency on various sparse embeddings of the Ms Marco dataset while maintaining high recall. Our results indicate that Seismic is one to two orders of magnitude faster than state-of-the-art inverted index-based solutions and further outperforms the winning (graph-based) submissions to the BigANN Challenge by a significant margin. • Information systems → Retrieval models and ranking.

For agents

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

get_harvested_code_for_paper("2404.18812")
get_code_for_paper("2404.18812")
have("2404.18812")

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

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

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

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

Connect an agent — have() is free.