SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2604.16576 · 2026

On the Robustness of LLM-Based Dense Retrievers: A Systematic Analysis of Generalizability and Stability

Yixing Fan, Yongkang Li

arXiv · PDF · Open in the Atlas

Code that ran

6 of 12 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, 2 violated it and 0 have no contract verdict; 3 failures of our instrument; 6 no recorded run), measured 2026-11-23; 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.16576.json · badge: /api/ran/2604.16576.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
liyongkang123/Robust_LLM_Retriever_Eval canonical (classifier label)
classifier basis: census
6 ran · 6 no recorded run
FunctionStatusWhere it lives
analyze_spectral_norms Ran
ran; our contract draft was wrong, not the code
liyongkang123/Robust_LLM_Retriever_Eval/draw_spectral_norm.py
code served (permissive licence) · get_code("52a029392b311d5d")
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. 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 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 torch.nn as nn
import numpy as np

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.layer1 = nn.Linear(4, 3)
        self.layer2 = nn.Linear(3, 2)
        self.pooler = nn.Linear(2, 2)
        self.lm_head = nn.Linear(2, 1)
    
    def forward(self, x):
        x = self.layer1(x)
        x = self.layer2(x)
        x = self.pooler(x)
        x = self.lm_head(x)
        return x

model = SimpleModel()

ARGS = {
    'model': model,
    'exclude_patterns': ['pooler', 'lm_head']
}
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
get_diag_of_cov Ran
ran, violated the contract we drafted
liyongkang123/Robust_LLM_Retriever_Eval/isotropy_utils/isoscore_numpy.py
pointer only (licence: MIT); the stored copy get_code serves, from francois-meyer/cpt-geometry, is pointer only (licence: NONE) · get_code("b9edc5a66c170732")
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 francois-meyer/cpt-geometry, 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.

normalize_diagonal Ran
ran, violated the contract we drafted
liyongkang123/Robust_LLM_Retriever_Eval/isotropy_utils/isoscore_numpy.py
code served (permissive licence) · get_code("8b4fb7a187d33e21")
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 ndarray, ndim 1, dtype family float, shape (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 numpy as np

# Analyze the function:
# - normalize_diagonal takes cov_diag as input
# - Uses len(cov_diag) to get n
# - Uses np.linalg.norm(cov_diag) to compute norm
# - Performs element-wise operations: multiplication, sqrt, division
# - So cov_diag should be a numpy array (1D or can be treated as array-like)

# Create a small numpy array for cov_diag
cov_diag = np.array([1.0, 2.0, 3.0, 4.0])

ARGS = {
    "cov_diag": cov_diag
}
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 ndarray, ndim 1, dtype family float, shape (4,) — shape (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
partition_score Ran
ran, honoured the contract we drafted
liyongkang123/Robust_LLM_Retriever_Eval/isotropy_utils/existing_scores.py
code served (permissive licence) · get_code("4a8de46cfd435dbc")
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 float64, ndim 0, 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 numpy as np

# Create a small isotropic point cloud
# The function expects a 2D array where points are rows
# Shape: (n_points, n_dims)
np.random.seed(0)
points = np.random.randn(5, 4).astype(np.float64)

ARGS = {
    "points": points
}
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 float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
remove_identical_ids Ran
ran; our contract draft was wrong, not the code
liyongkang123/Robust_LLM_Retriever_Eval/eval_attack.py
code served (permissive licence) · get_code("59073197852b3fff")
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

# The function removes entries from a nested dict where qid == pid
# results is a dict mapping qid (query id) to rels (another dict of pids with values)
# The function iterates through results and pops entries where qid matches a pid key

ARGS = {
    "results": {
        "q1": {1: 0.9, 2: 0.8, 3: 0.7},  # q1 maps to dict of pids
        "q2": {"q2": 0.95, 4: 0.6},       # q2 has itself as a pid - should be removed
        "q3": {5: 0.5, 6: 0.4},
    }
}
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
save_attacked_queries Ran
ran; our contract draft was wrong, not the code
liyongkang123/Robust_LLM_Retriever_Eval/attack_queries_penha.py
code served (permissive licence) · get_code("abf44238df547f42")
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 json
import random
import os
import pandas as pd
import tempfile

class MockConfig:
    def __init__(self):
        self.dataset = "test_dataset"
        self.split = "dev"
        self.seed = 42
        self.attack_method = "synonym_replacement"
        self.attack_word_change_rate = 0.3

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

# Define variations: each entry is [query_id, raw_query, attacked_query, attack_method]
variations = [
    [0, "what is python", "what is programming language", "synonym_replacement"],
    [0, "what is python", "what is snake language", "synonym_replacement"],
    [1, "how to learn", "how to acquire knowledge", "synonym_replacement"],
    [1, "how to learn", "how to study", "synonym_replacement"],
    [2, "best practices", "optimal methods", "synonym_replacement"],
]

# Define original queries
original_queries = {
    "0": "what is python",
    "1": "how to learn",
    "2": "best practices",
}

config = MockConfig()

ARGS = {
    "variations": variations,
    "original_queries": original_queries,
    "output_root": temp_dir,
    "config": config,
    "subdir": "attacked_text/query",
    "include_wordrate": False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — 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_attacked_queries_path Not yet run
unverified (harvested, no recorded run)
liyongkang123/Robust_LLM_Retriever_Eval/eval_attack.py
code served (permissive licence) · get_code("0076f5d1801f5224")
How it ran

no invocation recorded.

load_attacked_queries Not yet run
unverified (harvested, no recorded run)
liyongkang123/Robust_LLM_Retriever_Eval/eval_attack.py
code served (permissive licence) · get_code("ca9d5c1e553d6cd2")
How it ran

no invocation recorded.

load_model_hf Not yet run
unverified (harvested, no recorded run)
liyongkang123/Robust_LLM_Retriever_Eval/utils/load_model.py
code served (permissive licence) · get_code("f684968bb36ccc46")
How it ran

no invocation recorded.

pca_normalization Not yet run
unverified (harvested, no recorded run)
liyongkang123/Robust_LLM_Retriever_Eval/isotropy_utils/isoscore_numpy.py
code served (permissive licence) · get_code("5e0a2765ed1280c0")
How it ran

no invocation recorded.

query_attack_main Not yet run
unverified (harvested, no recorded run)
liyongkang123/Robust_LLM_Retriever_Eval/eval_attack_data_statistics.py
code served (permissive licence) · get_code("41b943b9b9ca9ff6")
How it ran

no invocation recorded.

varex_score Not yet run
unverified (harvested, no recorded run)
liyongkang123/Robust_LLM_Retriever_Eval/isotropy_utils/existing_scores.py
code served (permissive licence) · get_code("e3b26af1fc2ab62c")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 4 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 1 the same month, 1 later) and 8 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
get_diag_of_cov 2 other papers
1 dated earlier, 1 later
2411.00680 (2024-11)
Zipfian Whitening
2608.23358 (2026-08)
The Geometry of Low-Resource Language Representations
load_model_hf 1 other paper
1 the same month
2604.23396 (2026-04)
Lost in <i>Decoding?</i> Reproducing and Stress-Testing the Look-Ahead Prior in Generative Retrieval
normalize_diagonal 1 other paper
1 dated earlier
2411.00680 (2024-11)
Zipfian Whitening
pca_normalization 1 other paper
1 dated earlier
2411.00680 (2024-11)
Zipfian Whitening

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

Decoder-only large language models (LLMs) are increasingly replacing BERT-style architectures as the backbone for dense retrieval, achieving substantial performance gains and broad adoption. However, the robustness of these LLM-based retrievers remains underexplored. In this paper, we present the first systematic study of the robustness of state-of-the-art open-source LLM-based dense retrievers from two complementary perspectives: generalizability and stability. For generalizability, we evaluate retrieval effectiveness across four benchmarks spanning 30 datasets, using linear mixed-effects models to estimate marginal mean performance and disentangle intrinsic model capability from dataset heterogeneity. Our analysis reveals that while instruction-tuned models generally excel, those optimized for complex reasoning often suffer a "specialization tax," exhibiting limited generalizability in broader contexts. For stability, we assess model resilience against both unintentional query variations (e.g., paraphrasing, typos) and malicious adversarial attacks (e.g., corpus poisoning). We find that LLM-based retrievers show improved robustness against typos and corpus poisoning compared to encoder-only baselines, yet remain vulnerable to semantic perturbations like synonymizing. Further analysis shows that embedding geometry (e.g., angular uniformity) provides predictive signals for lexical stability and suggests that scaling model size generally improves robustness. These findings inform future robustness-aware retriever design and principled benchmarking. Our code is publicly available at https://github.com/liyongkang123/Robust_LLM_Retriever_Eval. CCS Concepts: • Information systems → Retrieval models and ranking; • Computing methodologies → Natural language processing.

For agents

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

get_harvested_code_for_paper("2604.16576")
get_code_for_paper("2604.16576")
have("2604.16576")

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

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

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

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

Connect an agent — have() is free.