SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2024.findings-acl.608 · ACL Findings · 2024

LLM Factoscope: Uncovering LLMs' Factual Discernment through Measuring Inner States

Yue Zhao, Kai Chen, Jinwen He, Yujia Gong, Zijin Lin, Cheng'an Wei

Open in the Atlas

Code that ran

13 of 17 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; 3 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 3 failures of our instrument; 4 no recorded run), measured 2026-11-24; 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/2024.findings-acl.608.json · badge: /api/ran/2024.findings-acl.608.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
JenniferHo97/llm_factoscope canonical (classifier label)
classifier basis: census
13 ran · 4 no recorded run
FunctionStatusWhere it lives
activations_dict_to_array Ran
ran on a synthesized input
JenniferHo97/llm_factoscope/ecco/lm.py
code served (permissive licence) · get_code("43f07e7f84dec0c8")
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 4, dtype family float, shape (2, 3, 4, 5) 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

# Create a sample activations_dict with layer keys and numpy array values
# The function expects:
# - keys: layer ids as strings ('0', '1', etc.)
# - values: tensors/arrays of shape (batch, position, neurons)

# Let's create a small example with:
# - batch size: 2
# - position: 5 (token positions)
# - neurons: 4
# - 3 layers

activations_dict = {
    '0': np.random.randn(2, 5, 4),  # (batch, position, neurons)
    '1': np.random.randn(2, 5, 4),  # (batch, position, neurons)
    '2': np.random.randn(2, 5, 4),  # (batch, position, neurons)
}

ARGS = {
    'activations_dict': activations_dict
}
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 4, dtype family float, shape (2, 3, 4, 5) — shape (2, 3, 4, 5) 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
center_gram Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
JenniferHo97/llm_factoscope/ecco/svcca_lib/cka_lib.py
pointer only (licence: MIT); the stored copy get_code serves, from Alxmrphi/correcting_CKA_alignment, is pointer only (licence: NONE) · get_code("7a3daac7c3a534a6")
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 Alxmrphi/correcting_CKA_alignment, 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. A run is recorded.

compute_ccas Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
JenniferHo97/llm_factoscope/ecco/svcca_lib/cca_core.py
code served (permissive licence) · get_code("01472465bed8b268")
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

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

# Create small positive definite symmetric matrices for X
num_neurons_x = 4
num_neurons_y = 3

# Create positive definite matrices by constructing them as A @ A.T
A_x = np.random.randn(num_neurons_x, num_neurons_x)
sigma_xx = A_x @ A_x.T

A_y = np.random.randn(num_neurons_y, num_neurons_y)
sigma_yy = A_y @ A_y.T

# Create cross-covariance matrices
sigma_xy = np.random.randn(num_neurons_x, num_neurons_y)
sigma_yx = sigma_xy.T

# Small epsilon for numerical stability
epsilon = 1e-6

# Construct ARGS dictionary
ARGS = {
    "sigma_xx": sigma_xx,
    "sigma_xy": sigma_xy,
    "sigma_yx": sigma_yx,
    "sigma_yy": sigma_yy,
    "epsilon": epsilon,
    "verbose": False,
}
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
compute_primary_attributions_scores Ran
ran on a synthesized input
JenniferHo97/llm_factoscope/ecco/attribution.py
code served (permissive licence) · get_code("0f55c1c8c7f7c354")
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 (2, 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
import torch.nn as nn
from functools import partial
from typing import Dict, Any

torch.manual_seed(0)

# Create a minimal transformer model that satisfies the function's usage
class MinimalTransformerModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.embedding = nn.Embedding(100, 4)
        self.linear = nn.Linear(4, 10)  # 10 output logits
        
    def forward(self, inputs_embeds=None, decoder_inputs_embeds=None, **kwargs):
        if inputs_embeds is None:
            inputs_embeds = self.embedding(torch.tensor([[1, 2, 3]]))
        
        # Process inputs through linear layer
        output = self.linear(inputs_embeds)
        
        # Create a mock output object with logits attribute
        class Output:
            def __init__(self, logits):
                self.logits = logits
        
        # Return shape (batch, seq_len, vocab_size)
        return Output(output)

# Create model
model = MinimalTransformerModel()

# Create forward_kwargs with embeddings
# Shape: (batch_size=2, seq_len=3, embedding_dim=4)
batch_size = 2
seq_len = 3
embedding_dim = 4

inputs_embeds = torch.randn(batch_size, seq_len, embedding_dim, requires_grad=True)

forward_kwargs = {
    'inputs_embeds': inputs_embeds,
    'attention_mask': torch.ones(batch_size, seq_len),
}

# Create prediction_id (target class index)
prediction_id = torch.tensor(5)  # Target logit index

ARGS = {
    'attr_method': 'saliency',
    'model': model,
    'forward_kwargs': forward_kwargs,
    'prediction_id': prediction_id,
    'aggregation': 'L2',
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
captum, torch, transformers — 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 (2, 4) — shape (2, 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
gram_linear Ran
ran, honoured the contract we drafted
JenniferHo97/llm_factoscope/ecco/svcca_lib/cka_lib.py
pointer only (licence: MIT); the stored copy get_code serves, from Alxmrphi/correcting_CKA_alignment, is pointer only (licence: NONE) · get_code("1f536f0d38e06865")
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 Alxmrphi/correcting_CKA_alignment, 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. A run is recorded.

gram_rbf Ran
ran, honoured the contract we drafted
JenniferHo97/llm_factoscope/ecco/svcca_lib/cka_lib.py
code served (permissive licence) · get_code("f268a387116c3cd5")
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 2, dtype family float, shape (5, 5) 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

np.random.seed(0)

# Create a small feature matrix: num_examples x num_features
# Using distinct dimensions: 5 examples, 3 features
x = np.random.randn(5, 3)

ARGS = {
    "x": x,
    "threshold": 1.0,
}
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 2, dtype family float, shape (5, 5) — shape (5, 5) 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
load_data Ran
ran on a synthesized input
JenniferHo97/llm_factoscope/prepare_save_data_h5.py
code served (permissive licence) · get_code("c608212b0451e8dd")
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 3, 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
import h5py
import os
import tempfile
import shutil

# Create temporary directory structure with HDF5 files
temp_dir = tempfile.mkdtemp()
features_dir = os.path.join(temp_dir, 'features')
os.makedirs(features_dir)

model_name = 'test_model'
data_name = 'test_data'

model_data_dir = os.path.join(features_dir, model_name, f'{data_name}_dataset')
os.makedirs(model_data_dir)

# Create correct_data.h5
correct_file_path = os.path.join(model_data_dir, 'correct_data.h5')
with h5py.File(correct_file_path, 'w') as f:
    f.create_dataset('correct_activation_values', data=np.random.randn(10, 4))

# Create false_data.h5
false_file_path = os.path.join(model_data_dir, 'false_data.h5')
with h5py.File(false_file_path, 'w') as f:
    f.create_dataset('false_activation_values', data=np.random.randn(8, 4))

# Create unrelative_data.h5
unrelative_file_path = os.path.join(model_data_dir, 'unrelative_data.h5')
with h5py.File(unrelative_file_path, 'w') as f:
    f.create_dataset('unrelative_activation_values', data=np.random.randn(6, 4))

# Change to temp directory so relative paths work
original_cwd = os.getcwd()
os.chdir(temp_dir)

ARGS = {
    'model_name': 'test_model',
    'data_name': 'test_data'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
h5py, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 3, 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
load_dataset Ran
ran on a synthesized input
JenniferHo97/llm_factoscope/prepare_save_data_h5.py
code served (permissive licence) · get_code("52dc77becfdc03e5")
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 h5py
import os
import tempfile
import shutil

# Create a temporary directory structure with HDF5 files
temp_dir = tempfile.mkdtemp()
features_dir = os.path.join(temp_dir, 'features')
model_dir = os.path.join(features_dir, 'test_model')
data_dir = os.path.join(model_dir, 'test_data_dataset')
os.makedirs(data_dir)

# Create correct_data.h5
correct_file_path = os.path.join(data_dir, 'correct_data.h5')
with h5py.File(correct_file_path, 'w') as f:
    f.create_dataset('correct_activation_values', data=np.random.randn(10, 4))
    f.create_dataset('correct_final_output_rank', data=np.random.randint(0, 100, (10,)))
    f.create_dataset('correct_word_id_topk_rank', data=np.random.randint(0, 1000, (10, 5)))
    f.create_dataset('correct_topk_rank_prob', data=np.random.rand(10, 5))

# Create false_data.h5
false_file_path = os.path.join(data_dir, 'false_data.h5')
with h5py.File(false_file_path, 'w') as f:
    f.create_dataset('false_activation_values', data=np.random.randn(20, 4))
    f.create_dataset('false_final_output_rank', data=np.random.randint(0, 100, (20,)))
    f.create_dataset('false_word_id_topk_rank', data=np.random.randint(0, 1000, (20, 5)))
    f.create_dataset('false_topk_rank_prob', data=np.random.rand(20, 5))

# Create unrelative_data.h5
unrelative_file_path = os.path.join(data_dir, 'unrelative_data.h5')
with h5py.File(unrelative_file_path, 'w') as f:
    f.create_dataset('unrelative_activation_values', data=np.random.randn(15, 4))
    f.create_dataset('unrelative_final_output_rank', data=np.random.randint(0, 100, (15,)))
    f.create_dataset('unrelative_word_id_topk_rank', data=np.random.randint(0, 1000, (15, 5)))
    f.create_dataset('unrelative_topk_rank_prob', data=np.random.rand(15, 5))

# Change to temp directory so relative paths work
original_dir = os.getcwd()
os.chdir(temp_dir)

ARGS = {
    'model_name': 'test_model',
    'data_name': 'test_data'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
h5py, 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
positivedef_matrix_sqrt Ran
ran, honoured the contract we drafted
JenniferHo97/llm_factoscope/ecco/svcca_lib/cca_core.py
code served (permissive licence) · get_code("ea98389a1755bb3f")
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 2, dtype family float, shape (4, 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 numpy as np

# Create a small positive definite symmetric matrix
# Using a simple construction: A @ A.T is always positive definite
np.random.seed(0)
base_matrix = np.random.randn(4, 4)
positive_def_matrix = base_matrix @ base_matrix.T

# Verify it's positive definite by checking eigenvalues
eigenvalues = np.linalg.eigvalsh(positive_def_matrix)
assert np.all(eigenvalues > 1e-10), "Matrix must be positive definite"

ARGS = {
    "array": positive_def_matrix
}
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 2, dtype family float, shape (4, 4) — shape (4, 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
process_activation_data Ran
ran on a synthesized input
JenniferHo97/llm_factoscope/prepare_save_data_h5.py
code served (permissive licence) · get_code("81b20ce82c3ff090")
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 (100,) 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

# Create sample activation data
all_data = np.random.randn(100).astype(np.float32)

# The function computes its own mean and std, so we can pass any values
# but they will be overwritten by the function logic
mean = 0.0
std = 1.0

ARGS = {
    "all_data": all_data,
    "mean": mean,
    "std": std,
}
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 (100,) — shape (100,) 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
remove_small Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
JenniferHo97/llm_factoscope/ecco/svcca_lib/cca_core.py
code served (permissive licence) · get_code("ffcbd13c7094948e")
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 small covariance matrices for testing
# sigma_xx: variance matrix for x (4x4)
sigma_xx = np.array([
    [1.5, 0.2, 0.1, 0.0],
    [0.2, 2.0, 0.3, 0.1],
    [0.1, 0.3, 0.8, 0.0],
    [0.0, 0.1, 0.0, 0.05]
], dtype=np.float32)

# sigma_yy: variance matrix for y (3x3)
sigma_yy = np.array([
    [1.2, 0.1, 0.0],
    [0.1, 1.8, 0.2],
    [0.0, 0.2, 0.06]
], dtype=np.float32)

# sigma_xy: crossvariance matrix (4x3)
sigma_xy = np.array([
    [0.5, 0.2, 0.1],
    [0.3, 0.6, 0.2],
    [0.1, 0.1, 0.3],
    [0.02, 0.01, 0.01]
], dtype=np.float32)

# sigma_yx: conjugate transpose of sigma_xy (3x4)
sigma_yx = sigma_xy.T

# epsilon: cutoff threshold
epsilon = 0.1

ARGS = {
    "sigma_xx": sigma_xx,
    "sigma_xy": sigma_xy,
    "sigma_yx": sigma_yx,
    "sigma_yy": sigma_yy,
    "epsilon": epsilon
}
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
reshape_activations_to_3d Ran
ran on a synthesized input
JenniferHo97/llm_factoscope/ecco/activations.py
code served (permissive licence) · get_code("b073b6fa51ee74c7")
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 3, dtype family float, shape (3, 4, 10) 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

# Create a small activations tensor with shape (batch, layer, neuron, position)
# Using distinct sizes: batch=2, layer=3, neuron=4, position=5
batch_size = 2
num_layers = 3
num_neurons = 4
num_positions = 5

activations = np.random.randn(batch_size, num_layers, num_neurons, num_positions)

ARGS = {
    "activations": activations
}
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 3, dtype family float, shape (3, 4, 10) — shape (3, 4, 10) 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
reshape_hidden_states_to_3d Ran
ran on a synthesized input
JenniferHo97/llm_factoscope/ecco/activations.py
code served (permissive licence) · get_code("f5c635d4b9126d96")
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 3, dtype family float, shape (2, 15, 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 4D tensor with shape (layer, batch, position, d_model)
# Using distinct sizes: 2 layers, 3 batch, 5 position, 4 d_model
hidden_states = torch.randn(2, 3, 5, 4)

ARGS = {
    "hidden_states": hidden_states
}
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 3, dtype family float, shape (2, 15, 4) — shape (2, 15, 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
cca Not yet run
unverified (harvested, no recorded run)
JenniferHo97/llm_factoscope/ecco/analysis.py
code served (permissive licence) · get_code("9554e4b1a055abf6")
How it ran

no invocation recorded.

pwcca Not yet run
unverified (harvested, no recorded run)
JenniferHo97/llm_factoscope/ecco/analysis.py
code served (permissive licence) · get_code("4676dae385f553bd")
How it ran

no invocation recorded.

sample_output_token Not yet run
unverified (harvested, no recorded run)
JenniferHo97/llm_factoscope/ecco/lm.py
code served (permissive licence) · get_code("03438fbe1b572ce9")
How it ran

no invocation recorded.

svcca Not yet run
unverified (harvested, no recorded run)
JenniferHo97/llm_factoscope/ecco/analysis.py
code served (permissive licence) · get_code("937523cb17e6a3dc")
How it ran

no invocation recorded.

Also present in other papers' code

Of 17 samples lifted from this paper's linked repositories, 17 carry a function identity and 0 do not. Of the 17 distinct functions with an identity, 6 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 0 the same month, 0 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
compute_ccas 6 other papers
5 dated earlier, 1 same year, order not determinable
1706.05806 (2017-06)
SVCCA: Singular Vector Canonical Correlation Analysis for Deep Learning Dynamics and Interpretability
1806.05759 (2018-06)
Insights on representational similarity in neural networks with canonical correlation
1905.00414 (2019-05)
Similarity of Neural Network Representations Revisited
and 3 more not named here
positivedef_matrix_sqrt 6 other papers
5 dated earlier, 1 same year, order not determinable
1706.05806 (2017-06)
SVCCA: Singular Vector Canonical Correlation Analysis for Deep Learning Dynamics and Interpretability
1806.05759 (2018-06)
Insights on representational similarity in neural networks with canonical correlation
1905.00414 (2019-05)
Similarity of Neural Network Representations Revisited
and 3 more not named here
remove_small 6 other papers
5 dated earlier, 1 same year, order not determinable
1706.05806 (2017-06)
SVCCA: Singular Vector Canonical Correlation Analysis for Deep Learning Dynamics and Interpretability
1806.05759 (2018-06)
Insights on representational similarity in neural networks with canonical correlation
1905.00414 (2019-05)
Similarity of Neural Network Representations Revisited
and 3 more not named here
gram_linear 4 other papers
3 dated earlier, 1 same year, order not determinable
2007.01195 (2020-07)
Hierarchically Organized Latent Modules for Exploratory Search in Morphogenetic Systems
2107.11228 (2021-07)
Taxonomizing local versus global structure in neural network loss landscapes
2309.01265 (2023-09)
SOAR: Scene-debiasing Open-set Action Recognition
and 1 more not named here
center_gram 3 other papers
2 dated earlier, 1 same year, order not determinable
1905.00414 (2019-05)
Similarity of Neural Network Representations Revisited
2007.01195 (2020-07)
Hierarchically Organized Latent Modules for Exploratory Search in Morphogenetic Systems
2405.01012 (2024-05)
Correcting Biased Centered Kernel Alignment Measures in Biological and Artificial Neural Networks
gram_rbf 1 other paper
1 dated earlier
2309.01265 (2023-09)
SOAR: Scene-debiasing Open-set Action Recognition

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-24.

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) have revolutionized various domains with extensive knowledge and creative capabilities. However, a critical issue with LLMs is their tendency to produce outputs that diverge from factual reality. This phenomenon is particularly concerning in sensitive applications such as medical consultation and legal advice, where accuracy is paramount. Inspired by human lie detectors using physiological responses, we introduce the LLM Factoscope, a flexible and extendable pipeline that leverages the inner states of LLMs for factual detection. Our investigation reveals distinguishable patterns in LLMs' inner states when generating factual versus non-factual content. We demonstrate its effectiveness across various architectures, achieving over 96% accuracy on our custom-collected factual detection dataset. Our work opens a new avenue for utilizing LLMs' inner states for factual detection and encourages further exploration into LLMs' inner workings for enhanced reliability and transparency.

For agents

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

get_harvested_code_for_paper("2024.findings-acl.608")
get_code_for_paper("2024.findings-acl.608")
have("2024.findings-acl.608")

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

curl https://syntology.ai/api/ran/2024.findings-acl.608.json

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

[![Syntology run record](https://syntology.ai/api/ran/2024.findings-acl.608.svg)](https://syntology.ai/paper/2024.findings-acl.608)

Connect an agent — have() is free.