SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2605.08863 · 2026

Max-pooling Network Revisited: Analyzing the Role of Semantic Probability in Multiple Instance Learning for Hallucination Detection

Issei Sato, Shota Fujikawa

arXiv · PDF · Open in the Atlas

Code that ran

16 of 18 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; 14 failures of our instrument; 2 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/2605.08863.json · badge: /api/ran/2605.08863.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
FUJI1229/Hallucination_Detection canonical (classifier label)
classifier basis: census
16 ran · 2 no recorded run
FunctionStatusWhere it lives
accuracy_at_quantile Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
FUJI1229/Hallucination_Detection/gen/generation/uncertainty/utils/eval_utils.py
code served (permissive licence) · get_code("c425058e87c88adb")
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 sample data for the function
np.random.seed(0)

# accuracies: array of boolean or float values indicating correctness
# Should be a 1D array of values between 0 and 1 (or boolean)
accuracies = np.array([1.0, 0.0, 1.0, 1.0, 0.0, 1.0, 1.0, 0.0])

# uncertainties: array of uncertainty scores, same length as accuracies
# Should be a 1D array of values
uncertainties = np.array([0.1, 0.9, 0.2, 0.3, 0.8, 0.15, 0.25, 0.95])

# quantile: a float between 0 and 1 representing the quantile threshold
quantile = 0.5

ARGS = {
    "accuracies": accuracies,
    "uncertainties": uncertainties,
    "quantile": quantile,
}
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
auroc Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
FUJI1229/Hallucination_Detection/gen/generation/uncertainty/utils/eval_utils.py
code served (permissive licence) · get_code("7454cc265b181dec")
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 numpy as np
from sklearn import metrics

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

# Create small binary classification data
# y_true: binary labels (0 or 1)
# y_score: predicted probabilities or decision scores
y_true = np.array([0, 1, 1, 0, 1, 0])
y_score = np.array([0.1, 0.9, 0.8, 0.2, 0.7, 0.3])

ARGS = {
    'y_true': y_true,
    'y_score': y_score,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — 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
bootstrap Ran
ran; our contract draft was wrong, not the code
FUJI1229/Hallucination_Detection/gen/generation/uncertainty/utils/eval_utils.py
code served (permissive licence) · get_code("4b00bf597ecfdaac")
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 function. 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 scipy.stats

def dummy_function(data):
    """A simple statistic function - computes mean"""
    return np.mean(data)

# Create sample data as a numpy array
sample_data = np.array([1.2, 2.3, 1.8, 2.1, 1.9, 2.4, 2.0, 1.7])

# Create RNG
rng = np.random.default_rng(42)

ARGS = {
    'function': dummy_function,
    'rng': rng,
    'n_resamples': 1000
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
detect_total_layers Ran
ran, honoured the contract we drafted
FUJI1229/Hallucination_Detection/gen/generation/generate_answers.py
code served (permissive licence) · get_code("480af14a6e2aa6e6")
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 int, ndim 0, dtype family int, 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

torch.manual_seed(0)

# The function expects 'generations' to be a dict where:
# - Keys are example identifiers
# - Values are dicts with a 'generated_answer' key
# - 'generated_answer' is a list of dicts with 'h_out' key
# - 'h_out' should be a tensor or convertible to tensor with shape[1] accessible

ARGS = {
    'generations': {
        'example_1': {
            'generated_answer': [
                {
                    'h_out': torch.randn(2, 4)  # batch=2, hidden_dim=4
                }
            ]
        },
        'example_2': {
            'generated_answer': [
                {
                    'h_out': None
                },
                {
                    'h_out': torch.randn(3, 5)  # different batch, different hidden 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 int, ndim 0, dtype family int, 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
find_best_f1_threshold Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
FUJI1229/Hallucination_Detection/Detection/validate.py
code served (permissive licence) · get_code("fb2ed0cf7ace8b91")
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 numpy as np

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

# Create synthetic binary classification data
# y_true: binary labels (0 or 1)
y_true = np.array([0, 1, 1, 0, 1, 0, 1, 1, 0, 0])

# y_score: predicted probabilities or scores (continuous values between 0 and 1)
y_score = np.array([0.1, 0.9, 0.8, 0.2, 0.85, 0.15, 0.95, 0.75, 0.05, 0.25])

ARGS = {
    "y_true": y_true,
    "y_score": y_score,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — 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_reference Ran
ran; our contract draft was wrong, not the code
FUJI1229/Hallucination_Detection/gen/generation/uncertainty/utils/utils.py
code served (permissive licence) · get_code("e62229838ce8acff")
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

# Construct a valid example dict for the function
# The function expects either 'answers' key or 'reference' key at top level
# If 'answers' exists, it uses that directly
# If 'answers' doesn't exist, it looks for 'reference' which contains 'answers'

example = {
    'answers': {
        'text': ['answer1', 'answer2'],
        'answer_start': [0, 10]
    },
    'id': 'example_id_123'
}

ARGS = {
    'example': example
}
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
get_semantic_ids Ran
ran, honoured the contract we drafted
FUJI1229/Hallucination_Detection/gen/generation/compute_entailment.py
code served (permissive licence) · get_code("9d183134ceb534dd")
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 torch
import torch.nn as nn

torch.manual_seed(0)

class MockModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 2)
    
    def check_implication(self, s1, s2, question):
        # Returns 2 if strings are semantically equivalent, otherwise returns 0 or 1
        # For testing, we'll return 2 only for identical strings
        if s1 == s2:
            return 2
        return 0

strings_list = ["cat is animal", "animal is cat", "dog barks", "dog is pet"]
model = MockModel()
question = "What is an animal?"

ARGS = {
    "strings_list": strings_list,
    "model": model,
    "question": question
}
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 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
idx2prob Ran
ran; our contract draft was wrong, not the code
FUJI1229/Hallucination_Detection/Detection/utils.py
code served (permissive licence) · get_code("e23804c483b0df16")
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 numpy as np

# Create a semantic_ids_dict with multiple entries
# Each entry maps a topic ID to a list of semantic IDs
semantic_ids_dict = {
    0: [1, 2, 1, 3, 1, 2, 1, 2, 3, 4],  # More than used_sample items
    1: [5, 6, 5],  # Fewer than used_sample items
    2: [7, 7, 7, 7, 8, 9, 10, 11, 12],  # More than used_sample items
}

ARGS = {
    'semantic_ids_dict': semantic_ids_dict,
    'used_sample': 6
}
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 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_jsonl_data Ran
ran; our contract draft was wrong, not the code
FUJI1229/Hallucination_Detection/Detection/utils.py
code served (permissive licence) · get_code("b129f0c4ed366d02")
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 os
import tempfile

# Create a temporary JSONL file for testing
temp_dir = tempfile.mkdtemp()
temp_jsonl_path = os.path.join(temp_dir, "test_data.jsonl")

# Write some test data to the JSONL file
test_entries = [
    {"id": "entry_1", "value": 0.95, "semantic_ids": [1, 2, 3]},
    {"id": "entry_2", "value": 0.87, "semantic_ids": [4, 5, 6]},
    {"id": "entry_3", "value": 0.92, "semantic_ids": [7, 8, 9]},
]

with open(temp_jsonl_path, 'w', encoding='utf-8') as f:
    for entry in test_entries:
        f.write(json.dumps(entry) + '\n')

# Define ARGS for the function
ARGS = {
    "path": temp_jsonl_path,
    "key_name": "value"
}
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
load_pickle_data Ran
ran; our contract draft was wrong, not the code
FUJI1229/Hallucination_Detection/Detection/utils.py
code served (permissive licence) · get_code("800ef62e13fbc93b")
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 os
import pickle
import tempfile

# Create a temporary directory and pickle file for testing
temp_dir = tempfile.mkdtemp()
test_data = {
    'h_out': [[1, 2, 3], [4, 5, 6]],
    'hidden_states': [0.1, 0.2, 0.3],
    'metadata': {'key': 'value'}
}

# Write the pickle file
pickle_path = os.path.join(temp_dir, 'test_data.pkl')
with open(pickle_path, 'wb') as f:
    pickle.dump(test_data, f)

ARGS = {
    'path': pickle_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 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_pickle_data Ran
ran; our contract draft was wrong, not the code
FUJI1229/Hallucination_Detection/gen/generation/eval_correctness.py
code served (permissive licence) · get_code("7ac24230b0f8b0d3")
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 os
import pickle
import tempfile

# Create a temporary directory and file for testing
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test_data.pkl")

# Create sample data and pickle it
sample_data = {
    "key1": "value1",
    "key2": [1, 2, 3],
    "key3": {"nested": "dict"}
}

with open(temp_file, 'wb') as f:
    pickle.dump(sample_data, f)

ARGS = {
    "path": temp_file
}
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
load_pickle_data Ran
ran; our contract draft was wrong, not the code
FUJI1229/Hallucination_Detection/gen/generation/generate_answers.py
code served (permissive licence) · get_code("f4b9dfc997266ff2")
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 os
import pickle
import tempfile

# Create a temporary directory and file for testing
temp_dir = tempfile.mkdtemp()
temp_pickle_file = os.path.join(temp_dir, "test_data.pkl")

# Create sample data and save it to a pickle file
sample_data = {
    "key1": "value1",
    "key2": [1, 2, 3],
    "key3": {"nested": "dict"}
}

with open(temp_pickle_file, 'wb') as f:
    pickle.dump(sample_data, f)

# Define ARGS with the path to the pickle file
ARGS = {
    "path": temp_pickle_file
}
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
md5hash Ran
ran; our contract draft was wrong, not the code
FUJI1229/Hallucination_Detection/gen/generation/compute_entailment.py
code served (permissive licence) · get_code("a7132c6a5c4b94e4")
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 int, 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 hashlib

# The function takes a single parameter: string
# It encodes the string to UTF-8, computes MD5 hash, and converts to int
# So we need to provide a valid string argument

ARGS = {
    "string": "hello world"
}
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 int, 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
split_dataset Ran
ran; our contract draft was wrong, not the code
FUJI1229/Hallucination_Detection/gen/generation/uncertainty/utils/utils.py
code served (permissive licence) · get_code("eb7cd0b37505f35f")
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 torch

torch.manual_seed(0)

# Create a minimal dataset that satisfies the function's requirements
# The function expects a list-like object where each element has an 'answers' key
# with a 'text' key that contains a list

dataset = [
    {'answers': {'text': ['answer1', 'answer2']}},  # answerable
    {'answers': {'text': []}},  # unanswerable
    {'answers': {'text': ['answer3']}},  # answerable
    {'answers': {'text': []}},  # unanswerable
    {'answers': {'text': ['answer4', 'answer5', 'answer6']}},  # answerable
]

ARGS = {
    'dataset': dataset
}
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 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
test Ran
ran; our contract draft was wrong, not the code
FUJI1229/Hallucination_Detection/Detection/validate.py
code served (permissive licence) · get_code("9d031ee05ad849e1")
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 torch
import torch.nn as nn
import numpy as np
import os
import tempfile

torch.manual_seed(0)

# Create a minimal model that satisfies the function's usage
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 2)
    
    def forward(self, hidden_states=None, labels=None):
        # hidden_states is a list with one tensor
        hidden = hidden_states[0]
        # Output shape should allow .item() calls
        logits = self.linear(hidden.mean(dim=0, keepdim=True))
        scores = torch.sigmoid(logits)
        return {
            'logits': logits[:, 0],
            'scores': scores[:, 0]
        }

# Create test data
# hidden_list: list of lists of tensors
# Each element is a list of hidden state tensors
hidden_list = [
    [torch.randn(3, 4), torch.randn(2, 4)],  # short sequences
    [torch.randn(15, 4), torch.randn(20, 4)],  # middle sequences
    [torch.randn(40, 4), torch.randn(50, 4)]   # long sequences
]

# label_list: list of lists of labels (0 or 1)
label_list = [
    [0, 1],
    [1, 0],
    [0, 1]
]

# Create args object with necessary attributes
class Args:
    def __init__(self):
        self.save_dir = tempfile.gettempdir()

args_obj = Args()

# Create model
model = MinimalModel()

# Device (CPU only)
device = 'cpu'

# Threshold for classification
threshold = 0.5

# Layer index
idx_layer = 0

ARGS = {
    'args': args_obj,
    'model': model,
    'hidden_list': hidden_list,
    'label_list': label_list,
    'idx_layer': idx_layer,
    'th': threshold,
    'device': device,
    'show_progress': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, numpy, pandas, seaborn, sklearn, torch, tqdm — 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
validate Ran
ran; our contract draft was wrong, not the code
FUJI1229/Hallucination_Detection/Detection/validate.py
code served (permissive licence) · get_code("03eccb939862ffca")
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 torch
import torch.nn as nn
import numpy as np

torch.manual_seed(0)

# Create a minimal model that satisfies the function's requirements
class DummyModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 1)
    
    def forward(self, hidden_states=None, labels=None):
        # hidden_states is a list with one tensor of shape (1, 4)
        hidden = hidden_states[0]
        score = torch.sigmoid(self.linear(hidden))
        output = {
            'scores': score.squeeze(),
            'loss': torch.tensor(0.5)
        }
        return output

# Create model instance
model = DummyModel()

# Create dummy hidden states list - list of lists of tensors
# Each element represents samples, containing multiple hidden states
hidden_list = [
    [torch.randn(1, 4), torch.randn(1, 4)],  # Sample 0 with 2 hidden states
    [torch.randn(1, 4), torch.randn(1, 4)]   # Sample 1 with 2 hidden states
]

# Create label list - list of lists of binary labels
label_list = [
    [0, 1],  # Labels for sample 0
    [1, 0]   # Labels for sample 1
]

# idx_layer parameter (appears in function signature but not used in body)
idx_layer = 0

# Device (CPU only)
device = 'cpu'

# Args dict with all parameters
ARGS = {
    'args': None,  # args object not used in function body, can be None
    'model': model,
    'hidden_list': hidden_list,
    'label_list': label_list,
    'idx_layer': idx_layer,
    'device': device,
    'show_progress': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn, torch, tqdm — 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
build_layer_entries Not yet run
unverified (harvested, no recorded run)
FUJI1229/Hallucination_Detection/gen/generation/generate_answers.py
code served (permissive licence) · get_code("8c1b641c05d76e54")
How it ran

no invocation recorded.

get_parser Not yet run
unverified (harvested, no recorded run)
FUJI1229/Hallucination_Detection/gen/generation/uncertainty/utils/utils.py
code served (permissive licence) · get_code("a1c8064070046722")
How it ran

no invocation recorded.

Also present in other papers' code

Of 18 samples lifted from this paper's linked repositories, 18 carry a function identity and 0 do not. Of the 17 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 0 later) and 13 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
accuracy_at_quantile 1 other paper
1 dated earlier
2406.15927 (2024-06)
Semantic Entropy Probes: Robust and Cheap Hallucination Detection in LLMs
bootstrap 1 other paper
1 dated earlier
2406.15927 (2024-06)
Semantic Entropy Probes: Robust and Cheap Hallucination Detection in LLMs
md5hash 1 other paper
1 dated earlier
2406.15927 (2024-06)
Semantic Entropy Probes: Robust and Cheap Hallucination Detection in LLMs
split_dataset 1 other paper
1 dated earlier
2406.15927 (2024-06)
Semantic Entropy Probes: Robust and Cheap Hallucination Detection in LLMs

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

Hallucination detection has become increasingly important for improving the reliability of large language models (LLMs). Recently, hybrid approaches such as HaMI, which combine semantic consistency with internal model states via Multiple Instance Learning (MIL), have achieved state-of-the-art performance. However, these methods incur substantial computational overhead due to repeated sampling and costly semantic similarity computations. In this work, we first provide a theoretical analysis of HaMI in terms of decision margins, revealing that scaling internal states with semantic consistency leads to an enlarged decision margin. Motivated by this insight, we revisit classical sentence classification models from a margin enlargement perspective, aggregating token-level features via max pooling and directly estimating sentence scores using a lightweight MLP. Without requiring semantic consistency computations, our approach achieves substantial efficiency improvements while maintaining competitive performance with state-of-the-art baselines through adaptive aggregation of internal feature representations. Code is available at https://github.com/FUJI1229/Hallucination_Detection.

For agents

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

get_harvested_code_for_paper("2605.08863")
get_code_for_paper("2605.08863")
have("2605.08863")

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

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

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

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

Connect an agent — have() is free.