SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.15627 · 2024

Benchmarking Uncertainty Quantification Methods for Large Language Models with LM-Polygraph

arXiv · PDF · Open in the Atlas

Code that ran

2 of 4 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; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 0 failures of our instrument; 2 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2406.15627.json · badge: /api/ran/2406.15627.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
jinhaoduan/shifting-attention-to-relevance canonical (classifier label)
classifier basis: census
2 ran · 2 no recorded run
FunctionStatusWhere it lives
sar Ran
ran, honoured the contract we drafted
jinhaoduan/shifting-attention-to-relevance/src/compute_uncertainty.py
code served (permissive licence) · get_code("baf52bd8c74211f8")
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) and returned list, 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 torch

torch.manual_seed(0)

# Build cached_data with the required structure
num_samples = 2
num_tokens_per_sample = 3
num_generations = 4

# Create token_wise_entropy tensors for each sample and generation
likelihoods = []
for sample_idx in range(num_samples):
    token_entropies = []
    for gen_idx in range(num_generations):
        # Each generation has num_tokens_per_sample entropy values
        entropy = torch.randn(num_tokens_per_sample).abs()
        token_entropies.append(entropy)
    likelihoods.append({'token_wise_entropy': token_entropies})

# Create token_importance: one importance vector per (sample, generation) pair
token_importance = []
for sample_idx in range(num_samples):
    for gen_idx in range(num_generations):
        # Importance vector should match token_wise_entropy length
        importance = torch.randn(num_tokens_per_sample).abs() + 0.1
        token_importance.append(importance)

# Create sentence_similarities: similarity matrix for each sample
sentence_similarities = []
for sample_idx in range(num_samples):
    # Similarity matrix: num_generations x num_generations
    similarity = torch.randn(num_generations, num_generations).abs()
    sentence_similarities.append(similarity)

cached_data = {
    'likelihoods': likelihoods,
    'token_importance': token_importance,
    'sentence_similarities': sentence_similarities
}

ARGS = {
    'cached_data': cached_data,
    't': 0.001,
    'num_generation': None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — 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 float — 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
sentence_sar Ran
ran, honoured the contract we drafted
jinhaoduan/shifting-attention-to-relevance/src/compute_uncertainty.py
code served (permissive licence) · get_code("9ec4f3a16dcdb560")
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) and returned list, 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 torch

torch.manual_seed(0)

# Build cached_data with the required structure
# The function expects:
# - likelihoods: list of dicts, each with 'token_wise_entropy' key
# - sentence_similarities: list of lists/arrays of similarity scores

# Create token_wise_entropy tensors for 2 samples, each with 3 tokens
likelihoods = [
    {
        'token_wise_entropy': [
            torch.tensor([0.5, 0.3, 0.2, 0.1]),  # token 0
            torch.tensor([0.4, 0.2, 0.1, 0.3]),  # token 1
            torch.tensor([0.2, 0.5, 0.1, 0.2]),  # token 2
        ]
    },
    {
        'token_wise_entropy': [
            torch.tensor([0.3, 0.4, 0.2, 0.1]),  # token 0
            torch.tensor([0.5, 0.2, 0.2, 0.1]),  # token 1
            torch.tensor([0.1, 0.3, 0.4, 0.2]),  # token 2
        ]
    }
]

# Create sentence_similarities: list of similarity scores for each sample
# Each sample has 3 tokens, so 3 similarity scores
sentence_similarities = [
    [0.8, 0.6, 0.7],  # similarities for sample 0
    [0.9, 0.5, 0.6],  # similarities for sample 1
]

cached_data = {
    'likelihoods': likelihoods,
    'sentence_similarities': sentence_similarities,
}

ARGS = {
    'cached_data': cached_data,
    't': 0.001,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — 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 float — 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
get_neg_loglikelihoods Not yet run
unverified (harvested, no recorded run)
jinhaoduan/shifting-attention-to-relevance/src/get_likelihoods.py
code served (permissive licence) · get_code("f21d9ce0471b640a")
How it ran

no invocation recorded.

get_token_wise_entropies Not yet run
unverified (harvested, no recorded run)
jinhaoduan/shifting-attention-to-relevance/src/get_likelihoods.py
code served (permissive licence) · get_code("eb882324991f4da4")
How it ran

no invocation recorded.

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 4 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 0 later) and 0 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
sar 2 other papers
1 dated earlier, 1 same year, order not determinable
2307.01379 (2023-07)
Shifting Attention to Relevance: Towards the Predictive Uncertainty Quantification of Free-Form Large Language Models
2024.acl-long.276 (2024 (year only))
Shifting Attention to Relevance: Towards the Predictive Uncertainty Quantification of Free-Form Large Language Models
sentence_sar 2 other papers
1 dated earlier, 1 same year, order not determinable
2307.01379 (2023-07)
Shifting Attention to Relevance: Towards the Predictive Uncertainty Quantification of Free-Form Large Language Models
2024.acl-long.276 (2024 (year only))
Shifting Attention to Relevance: Towards the Predictive Uncertainty Quantification of Free-Form Large Language Models
get_neg_loglikelihoods 1 other paper
1 same year, order not determinable
2024.acl-long.276 (2024 (year only))
Shifting Attention to Relevance: Towards the Predictive Uncertainty Quantification of Free-Form Large Language Models
get_token_wise_entropies 1 other paper
1 same year, order not determinable
2024.acl-long.276 (2024 (year only))
Shifting Attention to Relevance: Towards the Predictive Uncertainty Quantification of Free-Form Large Language Models

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

The rapid proliferation of large language models (LLMs) has stimulated researchers to seek effective and efficient approaches to deal with LLM hallucinations and low-quality outputs. Uncertainty quantification (UQ) is a key element of machine learning applications in dealing with such challenges. However, research to date on UQ for LLMs has been fragmented in terms of techniques and evaluation methodologies. In this work, we address this issue by introducing a novel benchmark that implements a collection of state-of-the-art UQ baselines and offers an environment for controllable and consistent evaluation of novel UQ techniques over various text generation tasks. Our benchmark also supports the assessment of confidence normalization methods in terms of their ability to provide interpretable scores. Using our benchmark, we conduct a large-scale empirical investigation of UQ and normalization techniques across eleven tasks, identifying the most effective approaches. Code: https://github.com/IINemo/lm-polygraph Benchmark: https://huggingface.co/LM-Polygraph

For agents

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

get_harvested_code_for_paper("2406.15627")
get_code_for_paper("2406.15627")
have("2406.15627")

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

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

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

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

Connect an agent — have() is free.