SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2503.14043 · 2025

Beyond Next Token Probabilities: Learnable, Fast Detection of Hallucinations and Data Contamination on LLM Output Distributions

arXiv · PDF · Open in the Atlas

Code that ran

5 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; 0 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 0 failures of our instrument; 7 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/2503.14043.json · badge: /api/ran/2503.14043.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
barsguy/llm-output-signatures-network canonical (classifier label)
classifier basis not recorded on the link
5 ran · 7 no recorded run
FunctionStatusWhere it lives
get_nth_best_run Ran
ran on a synthesized input
barsguy/llm-output-signatures-network/fine_tune_main.py
code served (permissive licence) · get_code("4970063a2730e3a9")
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 Mock. 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 wandb
from unittest.mock import Mock, MagicMock

# Create mock run objects
mock_run_1 = Mock()
mock_run_1.state = 'finished'
mock_run_1.config = {'probe_model': 'LOS-Net'}
mock_run_1.summary = {'accuracy': 0.95}

mock_run_2 = Mock()
mock_run_2.state = 'finished'
mock_run_2.config = {'probe_model': 'LOS-Net'}
mock_run_2.summary = {'accuracy': 0.88}

mock_run_3 = Mock()
mock_run_3.state = 'finished'
mock_run_3.config = {'probe_model': 'LOS-Net'}
mock_run_3.summary = {'accuracy': 0.92}

mock_run_4 = Mock()
mock_run_4.state = 'finished'
mock_run_4.config = {'probe_model': 'OTHER-Net'}
mock_run_4.summary = {'accuracy': 0.98}

# Create mock sweep with runs
mock_sweep = Mock()
mock_sweep.runs = [mock_run_1, mock_run_2, mock_run_3, mock_run_4]

# Create mock API
mock_api = Mock()
mock_api.sweep = Mock(return_value=mock_sweep)

# Patch wandb.Api to return our mock
wandb.Api = Mock(return_value=mock_api)

# Create mock logger
mock_logger = Mock()
mock_logger.info = Mock()

ARGS = {
    'project_name': 'test_project',
    'sweep_name': 'test_sweep',
    'metric': 'accuracy',
    'n': 2,
    'higher_is_better': True,
    'logger': mock_logger
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
wandb — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Mock — a Mock 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
get_runs_for_sweep Ran
ran on a synthesized input
barsguy/llm-output-signatures-network/fine_tune_main.py
code served (permissive licence) · get_code("afdb20657a9d7e91")
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 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 wandb
from unittest.mock import Mock, MagicMock

# Create mock objects to simulate wandb API behavior
mock_run_1 = Mock()
mock_run_1.state = 'finished'
mock_run_1.config = {'probe_model': 'LOS-Net'}

mock_run_2 = Mock()
mock_run_2.state = 'finished'
mock_run_2.config = {'probe_model': 'LOS-Net'}

mock_run_3 = Mock()
mock_run_3.state = 'finished'
mock_run_3.config = {'probe_model': 'other_model'}

mock_run_4 = Mock()
mock_run_4.state = 'running'
mock_run_4.config = {'probe_model': 'LOS-Net'}

mock_sweep = Mock()
mock_sweep.runs = [mock_run_1, mock_run_2, mock_run_3, mock_run_4]

mock_api = Mock()
mock_api.sweep = Mock(return_value=mock_sweep)

# Patch wandb.Api to return our mock
wandb.Api = Mock(return_value=mock_api)

ARGS = {
    'project_name': 'test_project',
    'sweep_name': 'test_sweep',
    'metric': 'accuracy'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
wandb — 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_train_val_test_indices Ran
ran on a synthesized input
barsguy/llm-output-signatures-network/utils/dataset_preprocess.py
code served (permissive licence) · get_code("c110fa41723729e6")
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
import torch

# Create stratified splits - list of numpy arrays containing indices
# We'll create 4 splits, each containing different indices
np.random.seed(0)

split_1 = np.array([0, 1, 2, 3])
split_2 = np.array([4, 5, 6, 7])
split_3 = np.array([8, 9, 10, 11])
split_4 = np.array([12, 13, 14, 15])

splits = [split_1, split_2, split_3, split_4]

ARGS = {
    "splits": splits
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, tqdm — 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
imdb_preprocess Ran
ran on a synthesized input
barsguy/llm-output-signatures-network/utils/datasets_HD_helper.py
code served (permissive licence) · get_code("ef3284be195437cf")
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 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
import numpy as np

torch.manual_seed(0)

# Create small test data
reviews = [
    "This movie was absolutely terrible and boring.",
    "I loved this film, it was amazing and entertaining!"
]

labels = [0, 1]  # 0 for negative, 1 for positive

# Create args - this is a dict or similar object
# Looking at the function, args is not actually used in the function body,
# so we can pass a simple dict or None
class Args:
    pass

args = Args()

# Model names to test - the function branches on model_name
model_name_phi = "phi-2"
model_name_llama = "llama-3-8b"

ARGS = {
    "args": args,
    "model_name": model_name_phi,
    "reviews": reviews,
    "labels": labels
}
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 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
pad_tensor Ran
ran on a synthesized input
barsguy/llm-output-signatures-network/utils/dataset_preprocess.py
code served (permissive licence) · get_code("3cc2afd1c95778eb")
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 Tensor, ndim 2, dtype family float, shape (5, 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 torch

torch.manual_seed(0)

# Create a small tensor of shape [N, d] where N=2, d=4
tensor = torch.randn(2, 4)

# N_max should be larger than current N to trigger padding
N_max = 5

# pad_value can be any float or int
pad_value = 0.0

ARGS = {
    "tensor": tensor,
    "N_max": N_max,
    "pad_value": pad_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 Tensor, ndim 2, dtype family float, shape (5, 4) — shape (5, 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
get_num_seeds_for_sweep Not yet run
unverified (harvested, no recorded run)
barsguy/llm-output-signatures-network/fine_tune_main.py
code served (permissive licence) · get_code("7a086ff3395f2a02")
How it ran

no invocation recorded.

llm_mri Not yet run
unverified (harvested, no recorded run)
barsguy/llm-output-signatures-network/create_DC_datasets.py
code served (permissive licence) · get_code("b8b70cfab30c554e")
How it ran

no invocation recorded.

load_data_imdb Not yet run
unverified (harvested, no recorded run)
barsguy/llm-output-signatures-network/utils/datasets_HD_helper.py
code served (permissive licence) · get_code("71a664d99eac7712")
How it ran

no invocation recorded.

load_data_triviaqa Not yet run
unverified (harvested, no recorded run)
barsguy/llm-output-signatures-network/utils/datasets_HD_helper.py
code served (permissive licence) · get_code("325cfa108e4a7506")
How it ran

no invocation recorded.

load_model_and_validate_gpu Not yet run
unverified (harvested, no recorded run)
barsguy/llm-output-signatures-network/utils/LLM_helpers.py
pointer only (licence: MIT); the stored copy get_code serves, from BarSGuy/ACT-ViT, is pointer only (licence: NONE) · get_code("bf97ae5da2485dee")
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 BarSGuy/ACT-ViT, 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. No invocation recorded.

stratified_split Not yet run
unverified (harvested, no recorded run)
barsguy/llm-output-signatures-network/utils/dataset_preprocess.py
code served (permissive licence) · get_code("8654a44b89d8eac3")
How it ran

no invocation recorded.

whitebox_mri Not yet run
unverified (harvested, no recorded run)
barsguy/llm-output-signatures-network/create_DC_datasets.py
code served (permissive licence) · get_code("70264f24780c24b7")
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, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 11 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_and_validate_gpu 1 other paper
1 later
2510.00296 (2025-10)
Beyond Token Probes: Hallucination Detection via Activation Tensors with ACT-ViT

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 automated detection of hallucinations and training data contamination is pivotal to the safe deployment of Large Language Models (LLMs). These tasks are particularly challenging in settings where no access to model internals is available. Current approaches in this setup typically leverage only the probabilities of actual tokens in the text, relying on simple task-specific heuristics. Crucially, they overlook the information contained in the full sequence of next-token probability distributions. We propose to go beyond hand-crafted decision rules by learning directly from the complete observable output of LLMs -- consisting not only of next-token probabilities, but also the full sequence of next-token distributions. We refer to this as the LLM Output Signature (LOS), and treat it as a reference data type for detecting hallucinations and data contamination. To that end, we introduce LOS-Net, a lightweight attention-based architecture trained on an efficient encoding of the LOS, which can provably approximate a broad class of existing techniques for both tasks. Empirically, LOS-Net achieves superior performance across diverse benchmarks and LLMs, while maintaining extremely low detection latency. Furthermore, it demonstrates promising transfer capabilities across datasets and LLMs. Full code is available at https://github.com/BarSGuy/Beyond-next-token-probabilities.

For agents

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

get_harvested_code_for_paper("2503.14043")
get_code_for_paper("2503.14043")
have("2503.14043")

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

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

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

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

Connect an agent — have() is free.