SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2604.27599 · 2026

One Pass, Any Order: Position-Invariant Listwise Reranking for LLM-Based Recommendation

Yongli Ren, Ethan Bito, Estrid He

arXiv · PDF · Open in the Atlas

Code that ran

18 of 21 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; 4 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 14 failures of our instrument; 3 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.27599.json · badge: /api/ran/2604.27599.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
ejbito/InvariRank canonical (classifier label)
classifier basis: census
18 ran · 3 no recorded run
FunctionStatusWhere it lives
build_candidate_interaction Ran
ran; our contract draft was wrong, not the code
ejbito/InvariRank/invarirank/interactions.py
code served (permissive licence) · get_code("c3a384dc22d47af5")
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 RelationalCandidateInteraction. 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 MockConfig:
    def __init__(self, interaction='relational', interaction_dim=256, interaction_hidden_dim=512, interaction_dropout=0.1, interaction_score_scale=0.1):
        self.interaction = interaction
        self.interaction_dim = interaction_dim
        self.interaction_hidden_dim = interaction_hidden_dim
        self.interaction_dropout = interaction_dropout
        self.interaction_score_scale = interaction_score_scale

config = MockConfig(
    interaction='relational',
    interaction_dim=128,
    interaction_hidden_dim=256,
    interaction_dropout=0.1,
    interaction_score_scale=0.1
)

input_dim = 64

ARGS = {
    'config': config,
    'input_dim': input_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 RelationalCandidateInteraction — a RelationalCandidateInteraction output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a RelationalCandidateInteraction 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
candidate_id Ran
ran; our contract draft was wrong, not the code
ejbito/InvariRank/invarirank/prompts.py
code served (permissive licence) · get_code("f97677f8570c1943")
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
from collections.abc import Mapping
from typing import Any

# The function takes two parameters:
# 1. item: Mapping[str, Any] - a dict-like object that is checked for keys
# 2. fallback: int - an integer used as fallback

# Create a valid Mapping with one of the expected keys
item_dict = {
    'item_id': 12345
}

# Create fallback int
fallback_value = 999

ARGS = {
    'item': item_dict,
    'fallback': fallback_value
}
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
ensure_dir Ran
ran; our contract draft was wrong, not the code
ejbito/InvariRank/invarirank/training.py
code served (permissive licence) · get_code("7e8c38139d9ac58c")
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

# The function takes a path (str or Path) and creates directories
# We'll use a temporary directory path as a string

with tempfile.TemporaryDirectory() as tmpdir:
    test_path = str(Path(tmpdir) / "test_dir" / "nested" / "path")

ARGS = {
    "path": test_path
}
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
evaluate_at_k Ran
ran; our contract draft was wrong, not the code
ejbito/InvariRank/experiments/evaluation/metrics.py
code served (permissive licence) · get_code("6655d3145e66c701")
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 math
from collections.abc import Iterable, Mapping, Sequence
from typing import Any

# Create test data for evaluate_at_k
recommendations = {
    "user1": ["item1", "item2", "item3", "item4"],
    "user2": ["item2", "item4", "item1"],
    "user3": ["item5", "item6"]
}

ground_truth = {
    "user1": ["item1", "item3", "item5"],
    "user2": ["item2", "item4"],
    "user3": ["item6", "item7"]
}

k = 3

ARGS = {
    "recommendations": recommendations,
    "ground_truth": ground_truth,
    "k": k
}
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
global_preference_inconsistency Ran
ran, honoured the contract we drafted
ejbito/InvariRank/experiments/evaluation/preference.py
code served (permissive licence) · get_code("792fd2c13deb2736")
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
from collections.abc import Mapping, Sequence

torch.manual_seed(0)

# Construct observations: a sequence of mappings with 'input' and 'output' keys
# Each contains sequences of strings (item IDs)

observations = [
    {
        'input': ['item_a', 'item_b', 'item_c'],
        'output': ['item_b', 'item_a', 'item_c']
    },
    {
        'input': ['item_a', 'item_b', 'item_c'],
        'output': ['item_a', 'item_c', 'item_b']
    },
    {
        'input': ['item_a', 'item_b', 'item_c'],
        'output': ['item_c', 'item_b', 'item_a']
    }
]

ARGS = {
    'observations': observations
}
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
hit_rate_at_k Ran
ran, honoured the contract we drafted
ejbito/InvariRank/experiments/evaluation/metrics.py
code served (permissive licence) · get_code("d91d03fb0d2fc06a")
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
from collections.abc import Mapping, Sequence, Iterable

torch.manual_seed(0)

# Create valid arguments for hit_rate_at_k function
# The function expects:
# - recommendations: Mapping[Any, Sequence[Any]] - maps user IDs to sequences of recommended item IDs
# - ground_truth: Mapping[Any, Iterable[Any]] - maps user IDs to iterables of relevant item IDs
# - k: int - the cutoff for top-k evaluation

recommendations = {
    "user1": ["item_a", "item_b", "item_c", "item_d"],
    "user2": [1, 2, 3, 4],
    "user3": ["x", "y", "z"],
}

ground_truth = {
    "user1": {"item_a", "item_e"},  # item_a is in recommendations[:k], so hit
    "user2": {2, 5, 6},              # 2 is in recommendations[:k], so hit
    "user3": {"x", "y", "m", "n"},  # x and y are in recommendations[:k], so hit
}

k = 2

ARGS = {
    "recommendations": recommendations,
    "ground_truth": ground_truth,
    "k": k,
}
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
item_fields Ran
ran; our contract draft was wrong, not the code
ejbito/InvariRank/invarirank/prompts.py
code served (permissive licence) · get_code("892aae0040720850")
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.

# Analyze the function to understand what arguments it needs
# item_fields takes one parameter: item (a Mapping[str, Any])

# The function uses:
# - item.get() method to access keys like 'title', 'name', 'year', 'release_year', 'rating', 'genres', 'categories'
# - str() conversion on values
# - ', '.join() on genres/categories (expects iterable of items that can be str()'d)
# - candidate_id() function which expects item dict and a fallback int

# Build a sample item dict with various fields
item = {
    'item_id': 12345,
    'title': 'Inception',
    'year': 2010,
    'rating': 8.8,
    'genres': ['Sci-Fi', 'Action', 'Thriller'],
    'name': 'Alternative Title',
    'release_year': 2011,
    'categories': ['Category1', 'Category2']
}

ARGS = {
    'item': item
}
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
listwise_collator Ran
ran; our contract draft was wrong, not the code
ejbito/InvariRank/invarirank/training.py
code served (permissive licence) · get_code("c060abb0abd4293e")
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

torch.manual_seed(0)

# The function expects a batch which is a list of dicts
# It checks that len(batch) == 1, so we need exactly one element
# It returns batch[0], which is a dict[str, Any]

sample_dict = {
    "query": torch.randn(2, 4),
    "documents": torch.randn(3, 4),
    "relevance_scores": torch.tensor([1.0, 0.5, 0.2]),
    "doc_ids": [101, 102, 103],
    "metadata": {"source": "test"}
}

batch = [sample_dict]

ARGS = {
    "batch": batch
}
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
load_template Ran
ran; our contract draft was wrong, not the code
ejbito/InvariRank/invarirank/prompts.py
code served (permissive licence) · get_code("235d0ccc9ee9dd9b")
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 json
import tempfile
from pathlib import Path

# Define INVARIRANK_TEMPLATE as a dict that would be used by the function
INVARIRANK_TEMPLATE = {
    "prompt": "This is a template",
    "version": "1.0"
}

# Create a temporary JSON file to use as a test template
temp_dir = tempfile.mkdtemp()
temp_json_path = Path(temp_dir) / "test_template.json"
with open(temp_json_path, 'w', encoding='utf-8') as f:
    json.dump({"prompt": "test", "model": "gpt-3"}, f)

# Set up arguments for the function
ARGS = {
    "name_or_path": str(temp_json_path),
    "default_name": "invarirank"
}
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
marginal_position_exposure Ran
ran; our contract draft was wrong, not the code
ejbito/InvariRank/experiments/evaluation/position_bias.py
code served (permissive licence) · get_code("776af5b4244f944d")
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 collections.abc import Mapping
from typing import Any

torch.manual_seed(0)

# Construct a valid users mapping argument
users = {
    "user_1": {
        "permutations": [
            {
                "permutation_index": 0,
                "input_candidate_item_ids": [101, 102, 103, 104, 105],
                "reranked_item_ids": [102, 101, 105, 103, 104]
            },
            {
                "permutation_index": 1,
                "input_candidate_item_ids": [201, 202, 203, 204],
                "reranked_item_ids": [203, 201, 202, 204]
            }
        ]
    },
    "user_2": {
        "permutations": [
            {
                "permutation_index": 0,
                "input_candidate_item_ids": [301, 302, 303],
                "reranked_item_ids": [302, 303, 301]
            }
        ]
    }
}

ARGS = {
    "users": users,
    "k": 5,
    "include_values": False
}
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
method_from_config Ran
ran; our contract draft was wrong, not the code
ejbito/InvariRank/invarirank/config.py
code served (permissive licence) · get_code("c127a43848d15fe3")
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.

class MockConfig:
    def __init__(self, attention_mask='causal', position_ids='standard', interaction='none'):
        self.attention_mask = attention_mask
        self.position_ids = position_ids
        self.interaction = interaction

config = MockConfig(attention_mask='causal', position_ids='standard', interaction='none')

ARGS = {'config': config}
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
order_user_ids Ran
ran; our contract draft was wrong, not the code
ejbito/InvariRank/experiments/evaluation/sampling.py
code served (permissive licence) · get_code("c4ac6c200cfb9f23")
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 random
from collections.abc import Sequence

ARGS = {
    "user_ids": [1, 2, 3, 4, 5],
    "sample": True,
    "seed": 42
}
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 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
position_bias_metrics_path Ran
ran; our contract draft was wrong, not the code
ejbito/InvariRank/experiments/evaluation/position_bias.py
code served (permissive licence) · get_code("18aaf88796801c06")
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.

ARGS = {
    'dataset': 'msmarco',
    'retriever': 'bm25',
    'candidate_file_stem': 'candidates',
    'reranker_file_stem': 'reranker_scores',
    'k': 10
}
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
recall_at_k Ran
ran, honoured the contract we drafted
ejbito/InvariRank/experiments/evaluation/metrics.py
code served (permissive licence) · get_code("20d2254a15485774")
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.

# Setup code for recall_at_k function

ARGS = {
    "recommendations": {
        "user_1": ["item_a", "item_b", "item_c", "item_d"],
        "user_2": ["item_x", "item_y", "item_z"],
        "user_3": ["item_1", "item_2", "item_3", "item_4", "item_5"],
    },
    "ground_truth": {
        "user_1": ["item_b", "item_d", "item_e"],
        "user_2": ["item_x", "item_y"],
        "user_3": ["item_2", "item_4"],
    },
    "k": 3,
}
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 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
resolve_dtype Ran
ran; our contract draft was wrong, not the code
ejbito/InvariRank/invarirank/modeling.py
code served (permissive licence) · get_code("f97a2e08f775f1b8")
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 dtype. 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 resolve_dtype takes a single parameter: dtype_name (str)
# It looks up the dtype_name in a dictionary of aliases and returns the corresponding torch dtype
# Valid inputs are strings like 'float32', 'fp32', 'float16', 'fp16', 'bfloat16', 'bf16'

ARGS = {
    'dtype_name': 'float32'
}
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 dtype — a dtype output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dtype 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
sample_permutation Ran
ran, honoured the contract we drafted
ejbito/InvariRank/invarirank/training.py
code served (permissive licence) · get_code("750d88b81ce8918f")
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 random

ARGS = {
    "count": 5,
    "deterministic": True,
    "seed": 42,
}
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 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
select_device Ran
ran; our contract draft was wrong, not the code
ejbito/InvariRank/invarirank/modeling.py
code served (permissive licence) · get_code("1b3da8d667ff6ca4")
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 device. 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

torch.manual_seed(0)

ARGS = {
    'requested': 'cpu'
}
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 device — a device output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a device 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
select_user_ids Ran
ran; our contract draft was wrong, not the code
ejbito/InvariRank/experiments/evaluation/sampling.py
code served (permissive licence) · get_code("51956f680bfe0400")
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 random
from collections.abc import Sequence

# Define ARGS dict with valid arguments for select_user_ids
ARGS = {
    "user_ids": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
    "max_users": 5,
    "sample": True,
    "seed": 42
}
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 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
load_tokenizer Not yet run
unverified (harvested, no recorded run)
ejbito/InvariRank/invarirank/modeling.py
code served (permissive licence) · get_code("6d2f32351f12ba2b")
How it ran

no invocation recorded.

pairwise_preference_instability Not yet run
unverified (harvested, no recorded run)
ejbito/InvariRank/experiments/evaluation/preference.py
code served (permissive licence) · get_code("fa5041287e45f1db")
How it ran

no invocation recorded.

preference_consistency_metrics Not yet run
unverified (harvested, no recorded run)
ejbito/InvariRank/experiments/evaluation/preference.py
code served (permissive licence) · get_code("db3a38a24e82111c")
How it ran

no invocation recorded.

Also present in other papers' code

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

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

Large language models (LLMs) are increasingly used for recommendation reranking, but their listwise predictions can depend on the order in which candidates are presented. This creates a mismatch between the set-based nature of recommendation and the sequence-based computation of decoder-only LLMs, where permuting an otherwise identical candidate set can change item scores and final rankings. Such order sensitivity makes LLM-based rerankers difficult to rely on, since rankings may reflect prompt serialization rather than user preference. We propose InvariRank, a permutation-invariant listwise reranking framework that addresses this dependence at the architectural level. InvariRank blocks crosscandidate attention with a structured attention mask, and negates position-induced scoring changes through shared positional framing under Rotary Positional Embeddings (RoPE). Combined with a listwise learning-to-rank objective, the model scores all candidates in a single forward pass, avoiding permutation-based invariance training objectives which require multiple permutations of a candidate set. Experiments on recommendation benchmarks show that InvariRank maintains competitive ranking effectiveness while producing stable rankings across candidate permutations. The results suggest that architectural invariance is a practical route to reliable and efficient LLM-based recommendation reranking. The source code is at https://github.com/ejbito/InvariRank. • Information systems → Recommender systems; Retrieval models and ranking.

For agents

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

get_harvested_code_for_paper("2604.27599")
get_code_for_paper("2604.27599")
have("2604.27599")

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

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

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

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

Connect an agent — have() is free.