SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2604.23396 · 2026

Lost in <i>Decoding?</i> Reproducing and Stress-Testing the Look-Ahead Prior in Generative Retrieval

Maarten De Rijke, Yubao Tang, Yongkang Li, Kidist Mekonnen, Simon Lupart

arXiv · PDF

Code that ran

6 of 13 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 1 has no contract verdict; 5 failures of our instrument; 7 no recorded run), measured 2026-11-22; 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/2604.23396.json · badge: /api/ran/2604.23396.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
kidist-amde/lost-in-decoding canonical (classifier label)
classifier basis: census
6 ran · 7 no recorded run
FunctionStatusWhere it lives
cand_overlap_at_k Ran
ran; our contract draft was wrong, not the code
kidist-amde/lost-in-decoding/cross_lingual/plan_diagnostics.py
code served (permissive licence) · get_code("e60a7fd26a85fd56")
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
import numpy as np
from typing import Dict, List

# Create sample run data: {qid: {docid: score}}
run_a = {
    "q1": {
        "doc1": 0.9,
        "doc2": 0.8,
        "doc3": 0.7,
        "doc4": 0.6,
        "doc5": 0.5,
    },
    "q2": {
        "doc1": 0.85,
        "doc2": 0.75,
        "doc3": 0.65,
        "doc4": 0.55,
        "doc5": 0.45,
    },
    "q3": {
        "docA": 0.9,
        "docB": 0.8,
        "docC": 0.7,
    },
}

run_b = {
    "q1": {
        "doc1": 0.95,
        "doc2": 0.7,
        "doc6": 0.6,
        "doc7": 0.5,
        "doc8": 0.4,
    },
    "q2": {
        "doc1": 0.88,
        "doc3": 0.78,
        "doc4": 0.68,
        "doc9": 0.58,
        "doc10": 0.48,
    },
    "q3": {
        "docA": 0.92,
        "docD": 0.82,
        "docE": 0.72,
    },
}

ARGS = {
    "run_a": run_a,
    "run_b": run_b,
    "topk": 3,
}
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 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
prepare_translated_query_dir Ran
ran; our contract draft was wrong, not the code
kidist-amde/lost-in-decoding/cross_lingual/baseline_translate.py
code served (permissive licence) · get_code("305e9e86014cdab7")
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 PosixPath. 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
from pathlib import Path

# Create a temporary directory for output
temp_dir = tempfile.mkdtemp()
output_dir = Path(temp_dir)

# Create sample translated queries dictionary
translated = {
    "1": "What is machine learning?",
    "2": "How does neural network work?",
    "3": "Explain deep learning concepts",
    "10": "Query with\ttab and\nnewline characters",
}

ARGS = {
    "translated": translated,
    "output_dir": output_dir,
}
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 PosixPath — a PosixPath output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PosixPath 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
run_json_to_trec Ran
ran; our contract draft was wrong, not the code
kidist-amde/lost-in-decoding/cross_lingual/retrieval_engine.py
code served (permissive licence) · get_code("b8d56674c2bd7402")
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 tempfile

# Create a temporary directory for output
temp_dir = tempfile.mkdtemp()
output_path = os.path.join(temp_dir, "run.trec")

# Construct the run dict: {qid: {pid: score, ...}}
run = {
    "1": {
        "doc_001": 0.95,
        "doc_002": 0.87,
        "doc_003": 0.72,
    },
    "2": {
        "doc_004": 0.91,
        "doc_005": 0.83,
    },
    "3": {
        "doc_001": 0.88,
        "doc_006": 0.79,
        "doc_007": 0.65,
        "doc_008": 0.54,
    },
}

run_id = "test_run"

ARGS = {
    "run": run,
    "output_path": output_path,
    "run_id": run_id,
}
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
summary_stats Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
kidist-amde/lost-in-decoding/cross_lingual/plan_diagnostics.py
code served (permissive licence) · get_code("03d8c77cb047e466")
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 numpy as np
from typing import Dict, List

# The function takes a single parameter: values, which is a List[float]
# Looking at the function body, it:
# 1. Checks if values is empty
# 2. Converts values to a numpy array
# 3. Computes statistics on the array

# Create test data - a simple list of floats
test_values = [1.5, 2.3, 3.7, 4.2, 5.1, 6.8, 7.4, 8.9, 9.2, 10.1]

ARGS = {
    'values': test_values
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
tok_jaccard_at_k Ran
ran; our contract draft was wrong, not the code
kidist-amde/lost-in-decoding/cross_lingual/plan_diagnostics.py
code served (permissive licence) · get_code("fb01a776f67be3a9")
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
import numpy as np

# Construct valid arguments for tok_jaccard_at_k
# The function expects two dicts mapping query IDs to lists of token IDs (sorted by descending score)
# and a topk parameter for the cutoff

torch.manual_seed(0)

# tokens_a: dict mapping query ID strings to lists of token IDs
tokens_a = {
    "q1": [10, 20, 30, 40, 50, 60, 70, 80, 90, 100],
    "q2": [15, 25, 35, 45, 55, 65, 75, 85, 95, 105],
    "q3": [12, 22, 32, 42, 52, 62, 72, 82, 92, 102],
}

# tokens_b: dict mapping query ID strings to lists of token IDs
# Some overlap with tokens_a, some different tokens
tokens_b = {
    "q1": [10, 21, 30, 41, 50, 61, 70, 81, 90, 101],
    "q2": [16, 25, 36, 45, 56, 65, 76, 85, 96, 105],
    "q3": [12, 23, 32, 43, 52, 63, 72, 83, 92, 103],
}

topk = 5

ARGS = {
    "tokens_a": tokens_a,
    "tokens_b": tokens_b,
    "topk": topk,
}
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 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
translate_queries_with_log Ran
ran on a synthesized input
kidist-amde/lost-in-decoding/cross_lingual/baseline_translate.py
code served (permissive licence) · get_code("2f7d900bcce2b8d0")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 tempfile
from pathlib import Path
from unittest.mock import MagicMock, patch

# Create a temporary directory for output
temp_dir = tempfile.TemporaryDirectory()
output_dir = Path(temp_dir.name)

# Create mock translator that returns translated queries
class MockTranslator:
    def __init__(self, model_type='nllb', device='cpu'):
        self.model_type = model_type
        self.device = device
    
    def translate_queries(self, queries, src_lang, tgt_lang, batch_size):
        # Return a dict with translations for all input queries
        return {qid: f"translated_{query}" for qid, query in queries.items()}

# Create test queries dict
queries = {
    "1": "Bonjour comment allez-vous",
    "2": "Quelle est votre nom",
    "3": "Où est la bibliothèque"
}

# Mock the CachedTranslator import
def mock_cached_translator(*args, **kwargs):
    return MockTranslator(*args, **kwargs)

ARGS = {
    "queries": queries,
    "language": "fr",
    "output_dir": output_dir,
    "model_type": "nllb",
    "batch_size": 32,
    "device": "cpu"
}

# Patch the import so the function can use CachedTranslator
import sys
from unittest.mock import MagicMock
mock_module = MagicMock()
mock_module.CachedTranslator = MockTranslator
sys.modules['cross_lingual'] = MagicMock()
sys.modules['cross_lingual.utils'] = MagicMock()
sys.modules['cross_lingual.utils.translator'] = mock_module
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cross_lingual — 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
compute_metrics Not yet run
unverified (harvested, no recorded run)
kidist-amde/lost-in-decoding/cross_lingual/evaluate.py
code served (permissive licence) · get_code("93b61cc5e4023f00")
How it ran

no invocation recorded.

compute_per_query_metrics Not yet run
unverified (harvested, no recorded run)
kidist-amde/lost-in-decoding/cross_lingual/evaluate.py
code served (permissive licence) · get_code("76aa0a521bd28bfa")
How it ran

no invocation recorded.

download_mmarco_queries Not yet run
unverified (harvested, no recorded run)
kidist-amde/lost-in-decoding/cross_lingual/data_loader.py
code served (permissive licence) · get_code("0973d122a80995a8")
How it ran

no invocation recorded.

load_mmarco_queries Not yet run
unverified (harvested, no recorded run)
kidist-amde/lost-in-decoding/cross_lingual/data_loader.py
code served (permissive licence) · get_code("1c781c9ba57efa73")
How it ran

no invocation recorded.

load_model_hf Not yet run
unverified (harvested, no recorded run)
kidist-amde/lost-in-decoding/robustness/utils/load_model.py
code served (permissive licence) · get_code("f684968bb36ccc46")
How it ran

no invocation recorded.

save_metrics Not yet run
unverified (harvested, no recorded run)
kidist-amde/lost-in-decoding/cross_lingual/evaluate.py
code served (permissive licence) · get_code("1bf3d3612db6e207")
How it ran

no invocation recorded.

validate_qid_overlap Not yet run
unverified (harvested, no recorded run)
kidist-amde/lost-in-decoding/cross_lingual/data_loader.py
code served (permissive licence) · get_code("1646462d410c836d")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 1 the same month, 0 later) and 12 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_model_hf 1 other paper
1 the same month
2604.16576 (2026-04)
On the Robustness of LLM-Based Dense Retrievers: A Systematic Analysis of Generalizability and Stability

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

Generative retrieval (GR) ranks documents by autoregressively generating document identifiers. Because many GR methods rely on trie-constrained beam search, they are vulnerable to early pruning of relevant prefixes under finite-beam decoding. Planning Ahead in Generative Retrieval (PAG) mitigates this failure mode by using simultaneous decoding to compute a document-level look-ahead prior that guides subsequent sequential decoding. We reproduce PAG at inference time and stress-test its decoding behavior. Using the authors' released checkpoint and identifier/trie artifacts under the reported decoding setup, we reproduce the main effectiveness results on MS MARCO Dev and TREC-DL 2019/2020, and corroborate the reported beam-size-latency trade-off in our hardware setting. Beyond reproduction, we introduce plan drift diagnostics that quantify how intent-preserving query variations, including misspellings, reordering, synonym substitutions, paraphrases, and naturality shifts, alter the planner's top-𝑛 candidate set and highestweight planner tokens, and how these changes affect guided decoding. We find that PAG's planning signal is brittle under lexical surface-form variation: intent-preserving typos can trigger plan collapse, where the planned candidate pool shifts enough that the look-ahead bonus provides little useful guidance, effectively reverting decoding toward weaker unguided search. We further evaluate fixed-index cross-lingual robustness using non-English mMARCO queries against an English index, and assess query-side mitigation strategies that require no re-indexing; query translation provides the strongest recovery in our setting. Overall, our results confirm PAG's reported effectiveness and the benefit of planning-guided decoding under the released inference setup, while showing that these gains depend on the stability of the planning signal under realistic query variation and query-document mismatch. Code available at https://github.com/kidist-amde/lost-in-decoding. • Information systems → Retrieval models and ranking; Learning to rank; Language models.

For agents

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

get_harvested_code_for_paper("2604.23396")
get_code_for_paper("2604.23396")
have("2604.23396")

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

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

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

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

Connect an agent — have() is free.