SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2105.00855 · 2021

Computationally Efficient Optimization of Plackett-Luce Ranking Models for Relevance and Fairness

arXiv · PDF · Open in the Atlas

Code that ran

6 of 8 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 6 failures of our instrument; 2 no recorded run), measured 2026-11-22; 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/2105.00855.json · badge: /api/ran/2105.00855.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
HarrieO/2021-SIGIR-plackett-luce canonical (classifier label)
classifier basis: census
6 ran · 2 no recorded run
FunctionStatusWhere it lives
cutoff_ranking Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
HarrieO/2021-SIGIR-plackett-luce/utils/ranking.py
code served (permissive licence) · get_code("ed08820c5234d6b5")
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 int, shape (3,) 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

# Construct a small scores array
# The function uses: scores.shape[0], np.argpartition, np.argsort, indexing
scores = np.array([0.9, 0.3, 0.7, 0.5, 0.1, 0.8])

# Construct cutoff parameter
cutoff = 3

ARGS = {
    "scores": scores,
    "cutoff": cutoff,
}
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 int, shape (3,) — shape (3,) 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
init_model Ran
ran; our contract draft was wrong, not the code
HarrieO/2021-SIGIR-plackett-luce/utils/nnmodel.py
code served (permissive licence) · get_code("3c841c9debacfb6e")
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 Sequential. 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 tensorflow as tf

model_params = {
    'hidden units': [8, 16, 32]
}

ARGS = {
    'model_params': model_params
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential 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
metrics_based_on_samples Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
HarrieO/2021-SIGIR-plackett-luce/utils/plackettluce.py
code served (permissive licence) · get_code("f078e0bc377b4be5")
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

# Analyze the function to understand parameter requirements:
# - sampled_rankings: used as .shape[1] and indexed with [sampled_rankings]
#   Should be a 2D array of indices
# - weight_per_rank: indexed with [None, :cutoff], shape should be (cutoff,) or longer
# - addition_per_rank: indexed with [:cutoff], shape should be (cutoff,) or longer
# - weight_per_doc: indexed with [sampled_rankings], should be 1D array of weights

# Set random seed for reproducibility
np.random.seed(0)

# Create sampled_rankings: 2D array of document indices
# Shape: (batch_size=2, cutoff=4) - contains indices into weight_per_doc
sampled_rankings = np.array([
    [0, 1, 2, 3],
    [3, 2, 1, 0]
], dtype=np.int64)

# cutoff will be sampled_rankings.shape[1] = 4
cutoff = sampled_rankings.shape[1]

# weight_per_doc: 1D array of weights for each document
# Must have enough elements to index with all values in sampled_rankings
# Max index is 3, so we need at least 4 elements
weight_per_doc = np.array([0.5, 0.7, 0.3, 0.9, 0.2], dtype=np.float64)

# weight_per_rank: weights per rank position
# Shape should be at least (cutoff,) = (4,)
weight_per_rank = np.array([1.0, 0.8, 0.6, 0.4, 0.2], dtype=np.float64)

# addition_per_rank: values to add per rank position
# Shape should be at least (cutoff,) = (4,)
addition_per_rank = np.array([0.1, 0.05, 0.02, 0.01, 0.0], dtype=np.float64)

ARGS = {
    "sampled_rankings": sampled_rankings,
    "weight_per_rank": weight_per_rank,
    "addition_per_rank": addition_per_rank,
    "weight_per_doc": weight_per_doc
}
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
multiple_cutoff_rankings Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
HarrieO/2021-SIGIR-plackett-luce/utils/ranking.py
code served (permissive licence) · get_code("690317103b07f615")
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 numpy as np

# Create a small scores matrix: 5 samples, 8 documents
np.random.seed(0)
scores = np.random.randn(5, 8).astype(np.float32)

# Define cutoff value
cutoff = 3

# Define invert flag
invert = True

# Define noise_tiebreak flag
noise_tiebreak = False

ARGS = {
    "scores": scores,
    "cutoff": cutoff,
    "invert": invert,
    "noise_tiebreak": noise_tiebreak
}
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 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
pairwise Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
HarrieO/2021-SIGIR-plackett-luce/algorithms/pairwise.py
code served (permissive licence) · get_code("6d78cc79dd180c09")
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 (3,) 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

# Construct valid arguments for the pairwise function
# The function expects:
# - labels: a 1D array of shape (n_docs,) with comparable numeric values
# - scores: a 1D array of shape (n_docs,) with numeric values

# Create a small example with 3 documents
# Labels represent relevance scores - we need some to be greater than others
labels = np.array([3.0, 1.0, 2.0], dtype=np.float64)

# Scores represent model predictions
scores = np.array([0.5, 0.3, 0.8], dtype=np.float64)

ARGS = {
    "labels": labels,
    "scores": scores
}
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 (3,) — shape (3,) 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
rank_and_invert Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
HarrieO/2021-SIGIR-plackett-luce/utils/ranking.py
code served (permissive licence) · get_code("79dd69bae0762626")
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 2, 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 numpy as np

# Set random seed for reproducibility
np.random.seed(0)

# Create sample scores array
scores = np.array([0.9, 0.7, 0.85, 0.6, 0.95], dtype=np.float32)

# Create optional tiebreakers array (same shape as scores)
tiebreakers = np.array([1, 3, 2, 0, 4], dtype=np.int32)

ARGS = {
    "scores": scores,
    "tiebreakers": tiebreakers
}
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 tuple, ndim 2, dtype family int — 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_dataset_from_json_info Not yet run
unverified (harvested, no recorded run)
HarrieO/2021-SIGIR-plackett-luce/utils/dataset.py
code served (permissive licence) · get_code("d6eadb338b7f321e")
How it ran

no invocation recorded.

sample_rankings Not yet run
unverified (harvested, no recorded run)
HarrieO/2021-SIGIR-plackett-luce/utils/plackettluce.py
code served (permissive licence) · get_code("0f95a4019ff1e0e9")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 4 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 4 later) and 4 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_dataset_from_json_info 1 other paper
1 later
2204.10872 (2022-04)
Learning-to-Rank at the Speed of Sampling: Plackett-Luce Gradient Estimation With Minimal Computational Complexity
init_model 1 other paper
1 later
2204.10872 (2022-04)
Learning-to-Rank at the Speed of Sampling: Plackett-Luce Gradient Estimation With Minimal Computational Complexity
rank_and_invert 1 other paper
1 later
2204.10872 (2022-04)
Learning-to-Rank at the Speed of Sampling: Plackett-Luce Gradient Estimation With Minimal Computational Complexity
sample_rankings 1 other paper
1 later
2204.10872 (2022-04)
Learning-to-Rank at the Speed of Sampling: Plackett-Luce Gradient Estimation With Minimal Computational Complexity

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

Recent work has proposed stochastic Plackett-Luce (PL) ranking models as a robust choice for optimizing relevance and fairness metrics. Unlike their deterministic counterparts that require heuristic optimization algorithms, PL models are fully differentiable. Theoretically, they can be used to optimize ranking metrics via stochastic gradient descent. However, in practice, the computation of the gradient is infeasible because it requires one to iterate over all possible permutations of items. Consequently, actual applications rely on approximating the gradient via sampling techniques. In this paper, we introduce a novel algorithm: PL-Rank, that estimates the gradient of a PL ranking model w.r.t. both relevance and fairness metrics. Unlike existing approaches that are based on policy gradients, PL-Rank makes use of the specific structure of PL models and ranking metrics. Our experimental analysis shows that PL-Rank has a greater sample-efficiency and is computationally less costly than existing policy gradients, resulting in faster convergence at higher performance. PL-Rank further enables the industry to apply PL models for more relevant and fairer real-world ranking systems.

For agents

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

get_harvested_code_for_paper("2105.00855")
get_code_for_paper("2105.00855")
have("2105.00855")

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

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

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

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

Connect an agent — have() is free.