SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2405.10974 · ICML · 2024

Bottleneck-Minimal Indexing for Generative Document Retrieval

Xin Du, Lixin Xiu, Kumiko Tanaka-Ishii

arXiv · PDF · Open in the Atlas

Code that ran

9 of 11 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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 8 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/2405.10974.json · badge: /api/ran/2405.10974.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
kduxin/Bottleneck-Minimal-Indexing canonical (classifier label)
classifier basis: census
9 ran · 2 no recorded run
FunctionStatusWhere it lives
chunker Ran
ran; our contract draft was wrong, not the code
kduxin/Bottleneck-Minimal-Indexing/BMIndexing/bert_embedding.py
code served (permissive licence) · get_code("cf90b576db7b4cc6")
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 zip_longest. 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
from itertools import zip_longest

# The chunker function takes:
# - iterable: any iterable to chunk
# - n: the chunk size (number of iterators)
# - fillvalue: optional fill value for incomplete chunks

# Create a simple iterable - a list of integers
iterable = [1, 2, 3, 4, 5, 6, 7, 8, 9]

# Set chunk size
n = 3

# Set fillvalue
fillvalue = None

ARGS = {
    'iterable': iterable,
    'n': n,
    'fillvalue': fillvalue
}
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 zip_longest — a zip_longest output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a zip_longest 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
clean_text Ran
ran; our contract draft was wrong, not the code
kduxin/Bottleneck-Minimal-Indexing/NCIRetriever/model.py
code served (permissive licence) · get_code("5d140ce18f0b48ed")
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)

# The function clean_text takes a single parameter 'text' which is a string
# It performs string replacements: removes newlines, double backticks, and double quotes
# So we need to pass a string with these characters present

ARGS = {
    "text": "Hello\nworld``with\"quotes\nand``more``text\"here"
}
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
convert_tf_weight_name_to_pt_weight_name Ran
ran; our contract draft was wrong, not the code
kduxin/Bottleneck-Minimal-Indexing/NCIRetriever/nci_transformers/modeling_tf_pytorch_utils.py
code served (permissive licence) · get_code("083639169ab3b8f0")
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 re

def convert_tf_weight_name_to_pt_weight_name(tf_name, start_prefix_to_remove=''):
    """Convert a TF 2.0 model variable name in a pytorch model weight name.

    Conventions for TF2.0 scopes -> PyTorch attribute names conversions:
        - '$1___$2' is replaced by $2 (can be used to duplicate or remove layers in TF2.0 vs PyTorch)
        - '_._' is replaced by a new level separation (can be used to convert TF2.0 lists in PyTorch nn.ModulesList)

    return tuple with:
        - pytorch model weight name
        - transpose: boolean indicating weither TF2.0 and PyTorch weights matrices are transposed with regards to each other
    """
    tf_name = tf_name.replace(':0', '')
    tf_name = re.sub('/[^/]*___([^/]*)/', '/\\1/', tf_name)
    tf_name = tf_name.replace('_._', '/')
    tf_name = re.sub('//+', '/', tf_name)
    tf_name = tf_name.split('/')
    tf_name = tf_name[1:]
    transpose = bool(tf_name[-1] == 'kernel' or 'emb_projs' in tf_name or 'out_projs' in tf_name)
    if tf_name[-1] == 'kernel' or tf_name[-1] == 'embeddings' or tf_name[-1] == 'gamma':
        tf_name[-1] = 'weight'
    if tf_name[-1] == 'beta':
        tf_name[-1] = 'bias'
    tf_name = '.'.join(tf_name)
    if start_prefix_to_remove:
        tf_name = tf_name.replace(start_prefix_to_remove, '', 1)
    return (tf_name, transpose)

ARGS = {
    'tf_name': '/model/layer_0/kernel:0',
    'start_prefix_to_remove': ''
}
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
detach_dict Ran
ran; our contract draft was wrong, not the code
kduxin/Bottleneck-Minimal-Indexing/NCIRetriever/model.py
code served (permissive licence) · get_code("ea31caa9a38cca23")
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 torch

torch.manual_seed(0)

# Construct a dictionary with mixed tensor and non-tensor values
test_dict = {
    'tensor_key': torch.randn(2, 4),
    'another_tensor': torch.randn(3, 4),
    'scalar_value': 42,
    'string_value': 'hello',
    'list_value': [1, 2, 3],
    'nested_dict': {'a': 1, 'b': 2}
}

ARGS = {
    'd': test_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 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
find_pruneable_heads_and_indices Ran
ran; our contract draft was wrong, not the code
kduxin/Bottleneck-Minimal-Indexing/NCIRetriever/nci_transformers/modeling_utils.py
code served (permissive licence) · get_code("6d254a1b39c650ff")
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)

# Small example values for the function parameters
heads_to_prune = [1, 3]  # List of head indices to prune
n_heads = 8  # Total number of heads in the model
head_size = 4  # Size of each head
already_pruned = {0, 2}  # Set of heads already pruned

ARGS = {
    "heads": heads_to_prune,
    "n_heads": n_heads,
    "head_size": head_size,
    "already_pruned_heads": already_pruned,
}
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
intarray_to_string Ran
ran; our contract draft was wrong, not the code
kduxin/Bottleneck-Minimal-Indexing/NCIRetriever/io.py
code served (permissive licence) · get_code("8ccd1445bde3ebe0")
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)

# The function intarray_to_string takes an index parameter and converts it to a string
# by joining its elements with '-'. The index should be iterable and contain numeric values.

# Construct a valid index - a simple list of integers works
index = [1, 2, 3, 4, 5]

ARGS = {
    "index": index
}
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
prune_conv1d_layer Ran
ran; our contract draft was wrong, not the code
kduxin/Bottleneck-Minimal-Indexing/NCIRetriever/nci_transformers/modeling_utils.py
code served (permissive licence) · get_code("2ecf9d52d1413149")
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 Conv1D. 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
from torch import nn

torch.manual_seed(0)

class Conv1D(nn.Module):
    """
    1D-convolutional layer as defined by Radford et al. for OpenAI GPT (and also used in GPT-2).

    Basically works like a linear layer but the weights are transposed.

    Args:
        nf (:obj:`int`): The number of output features.
        nx (:obj:`int`): The number of input features.
    """

    def __init__(self, nf, nx):
        super().__init__()
        self.nf = nf
        w = torch.empty(nx, nf)
        nn.init.normal_(w, std=0.02)
        self.weight = nn.Parameter(w)
        self.bias = nn.Parameter(torch.zeros(nf))

    def forward(self, x):
        size_out = x.size()[:-1] + (self.nf,)
        x = torch.addmm(self.bias, x.view(-1, x.size(-1)), self.weight)
        x = x.view(*size_out)
        return x

# Create a Conv1D layer with distinct dimensions
# nx=4 (input features), nf=3 (output features)
layer = Conv1D(nf=3, nx=4)

# Create an index tensor to select which output features to keep
# We'll keep 2 out of 3 features
index = torch.LongTensor([0, 2])

ARGS = {
    "layer": layer,
    "index": index,
    "dim": 1
}
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 Conv1D — a Conv1D output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Conv1D 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
prune_linear_layer Ran
ran; our contract draft was wrong, not the code
kduxin/Bottleneck-Minimal-Indexing/NCIRetriever/nci_transformers/modeling_utils.py
code served (permissive licence) · get_code("b3504e72ce1153fe")
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 Linear. 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
from torch import nn

torch.manual_seed(0)

# Create a simple linear layer
# Using distinct dimensions: input_features=3, output_features=4
layer = nn.Linear(in_features=3, out_features=4, bias=True)

# Create index tensor to select which output features to keep
# Selecting 2 out of 4 output features
index = torch.LongTensor([0, 2])

# The dimension to prune on (0 for output dimension, 1 for input dimension)
dim = 0

ARGS = {
    "layer": layer,
    "index": index,
    "dim": dim,
}
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 Linear — a Linear output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Linear 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
softmax Ran
ran, honoured the contract we drafted
kduxin/Bottleneck-Minimal-Indexing/NCIRetriever/model.py
pointer only (licence: MIT); the stored copy get_code serves, from mayank2498/Skip-Gram-model-using-numpy, is pointer only (licence: NONE) · get_code("c0cf1196424d4f71")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from mayank2498/Skip-Gram-model-using-numpy, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

encode Not yet run
unverified (harvested, no recorded run)
kduxin/Bottleneck-Minimal-Indexing/BMIndexing/bert_embedding.py
code served (permissive licence) · get_code("9cacde1e22f5c412")
How it ran

no invocation recorded.

gen_query Not yet run
unverified (harvested, no recorded run)
kduxin/Bottleneck-Minimal-Indexing/BMIndexing/genq.py
code served (permissive licence) · get_code("54fe86d917d7ff48")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 5 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 1 the same month, 3 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
softmax 12 other papers
7 dated earlier, 1 the same month, 4 later
1411.2738 (2014-11)
word2vec Parameter Learning Explained
1803.05337 (2018-03)
Learning to Recognize Musical Genre from Audio
1906.05394 (2019-06)
Neural Arabic Question Answering
and 9 more not named here
find_pruneable_heads_and_indices 11 other papers
10 dated earlier, 1 later
2004.10964 (2020-04)
Don't Stop Pretraining: Adapt Language Models to Domains and Tasks
2021.emnlp-main.154 (2021 (year only))
Reconstruction Attack on Instance Encoding for Language Understanding
2104.08066 (2021-04)
Effect of Visual Extensions on Natural Language Understanding in Vision-and-Language Models
and 8 more not named here
prune_conv1d_layer 2 other papers
1 dated earlier, 1 later
2021.emnlp-main.154 (2021 (year only))
Reconstruction Attack on Instance Encoding for Language Understanding
2602.22581 (2026-02)
IBCircuit: Towards Holistic Circuit Discovery with Information Bottleneck
convert_tf_weight_name_to_pt_weight_name 1 other paper
1 dated earlier
2021.emnlp-main.154 (2021 (year only))
Reconstruction Attack on Instance Encoding for Language Understanding
prune_linear_layer 1 other paper
1 dated earlier
2021.emnlp-main.154 (2021 (year only))
Reconstruction Attack on Instance Encoding 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

We apply an information-theoretic perspective to reconsider generative document retrieval (GDR), in which a document x ∈ X is indexed by t ∈ T , and a neural autoregressive model is trained to map queries Q to T . GDR can be considered to involve information transmission from documents X to queries Q, with the requirement to transmit more bits via the indexes T . By applying Shannon's rate-distortion theory, the optimality of indexing can be analyzed in terms of the mutual information, and the design of the indexes T can then be regarded as a bottleneck in GDR. After reformulating GDR from this perspective, we empirically quantify the bottleneck underlying GDR. Finally, using the NQ320K and MARCO datasets, we evaluate our proposed bottleneckminimal indexing method in comparison with various previous indexing methods, and we show that it outperforms those methods.

For agents

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

get_harvested_code_for_paper("2405.10974")
get_code_for_paper("2405.10974")
have("2405.10974")

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

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

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

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

Connect an agent — have() is free.