SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2608.08024 · 2026

Prompt Embedding Probes (PEP): Hallucination Detection in LLMs from Hidden States

Valentin Malykh, Zakhar Mrykhin

arXiv · PDF · Open in the Atlas

Code that ran

5 of 5 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 5 failures of our instrument; 0 no recorded run), measured 2026-11-21; 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/2608.08024.json · badge: /api/ran/2608.08024.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
zazamrykh/internal_probing canonical (classifier label)
classifier basis: census
5 ran · 0 no recorded run
FunctionStatusWhere it lives
compute_experiment_metrics Ran
ran; our contract draft was wrong, not the code
zazamrykh/internal_probing/src/metrics/computation.py
code served (permissive licence) · get_code("6621bea80b66a964")
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 logging
from typing import Any, Dict, List

# Set up logging
logging.basicConfig(level=logging.INFO)

# Define the arguments for compute_experiment_metrics
predictions = [0.1, 0.3, 0.2, 0.4, 0.15, 0.35]
ground_truth = [1.0, 0.0, 1.0, 0.0, 1.0, 0.0]
metrics_config = {
    'compute_auc': True,
    'compute_accuracy': True
}

ARGS = {
    'predictions': predictions,
    'ground_truth': ground_truth,
    'metrics_config': metrics_config
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
sklearn — 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_tokens Ran
ran; our contract draft was wrong, not the code
zazamrykh/internal_probing/src/dataset/squad_eval.py
pointer only (licence: MIT); the stored copy get_code serves, from saptarshi059/cdqa-project, is pointer only (licence: NONE) · get_code("aa6bc32d9c17a2f1")
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 saptarshi059/cdqa-project, 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.

make_qid_to_has_ans Ran
ran; our contract draft was wrong, not the code
zazamrykh/internal_probing/src/dataset/squad_eval.py
code served (permissive licence) · get_code("e91c44f5680827e2")
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 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
import numpy as np

# Construct a minimal dataset matching the expected structure
dataset = [
    {
        'paragraphs': [
            {
                'qas': [
                    {
                        'id': 'q1',
                        'answers': [{'text': 'answer1', 'answer_start': 0}]
                    },
                    {
                        'id': 'q2',
                        'answers': []
                    }
                ]
            },
            {
                'qas': [
                    {
                        'id': 'q3',
                        'answers': [{'text': 'answer3', 'answer_start': 5}]
                    }
                ]
            }
        ]
    },
    {
        'paragraphs': [
            {
                'qas': [
                    {
                        'id': 'q4',
                        'answers': []
                    }
                ]
            }
        ]
    }
]

ARGS = {
    'dataset': dataset
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, 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
normalize_answer Ran
ran; our contract draft was wrong, not the code
zazamrykh/internal_probing/src/dataset/squad_eval.py
pointer only (licence: MIT); the stored copy get_code serves, from saptarshi059/cdqa-project, is pointer only (licence: NONE) · get_code("6a96435eba311b08")
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 saptarshi059/cdqa-project, 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.

plot_history_grid Ran
ran; our contract draft was wrong, not the code
zazamrykh/internal_probing/src/metrics/visualization.py
code served (permissive licence) · get_code("55e115ddba7afabe")
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 math
from typing import Any, Dict, List, Mapping, Optional, Sequence, Union
import matplotlib.pyplot as plt

# Create sample history data
history = [
    {"epoch": 1, "loss": 0.5, "accuracy": 0.7, "val_loss": 0.6},
    {"epoch": 2, "loss": 0.4, "accuracy": 0.75, "val_loss": 0.55},
    {"epoch": 3, "loss": 0.3, "accuracy": 0.8, "val_loss": 0.5},
    {"epoch": 4, "loss": 0.25, "accuracy": 0.85, "val_loss": 0.48},
]

x_list = ["epoch"]
y_list = ["loss", "accuracy", "val_loss"]

ARGS = {
    "history": history,
    "x_list": x_list,
    "y_list": y_list,
    "ncols": 3,
    "figsize_per_ax": (5.5, 3.6),
    "marker": "o",
    "linewidth": 1.5,
    "sharey": False,
    "suptitle": "Training History",
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib — 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

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 0 later) and 2 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
normalize_answer 37 other papers
37 dated earlier · 1 only as an assembly brick
1808.07042 (2018-08)
CoQA: A Conversational Question Answering Challenge
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1902.01718 (2019-02)
End-to-End Open-Domain Question Answering with BERTserini
and 34 more not named here
get_tokens 25 other papers
25 dated earlier
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1902.01718 (2019-02)
End-to-End Open-Domain Question Answering with BERTserini
1908.08962 (2019-08)
Well-Read Students Learn Better: On the Importance of Pre-training Compact Models
and 22 more not named here
make_qid_to_has_ans 9 other papers
9 dated earlier
1810.04805 (2018-10)
BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
1908.08962 (2019-08)
Well-Read Students Learn Better: On the Importance of Pre-training Compact Models
1910.01244 (2019-10)
Linking artificial and human neural representations of language
and 6 more not named here

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

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) can generate fluent and useful responses, but they remain prone to hallucinations. This motivates efficient methods for detecting unreliable outputs at inference time. In this paper, we study answerlevel hallucination detection in a white-box setting based on hidden states of a frozen LLM, and introduce Prompt Embedding Probes, a parameter-efficient extension of standard linear probes that augments the input with a small number of learnable prompt embeddings. We evaluate PEP on TriviaQA, GSM8K, and MedQA using Qwen3 models of multiple scales. The results show that learnable prompt embeddings improve hidden-state-based hallucination detection in the main in-distribution setting relative to standard linear probes. We further study the method in a to-be-generated (TBG) setting for pre-generation hallucination prediction, in cross-model transfer experiments, and under out-of-distribution evaluation. PEP remains effective in the TBG and cross-model settings, while robust transfer across substantially different datasets remains difficult. These results suggest that prompt-based adaptation can strengthen probe-based hallucination detection while keeping the backbone frozen and adding only a small number of trainable parameters.

For agents

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

get_harvested_code_for_paper("2608.08024")
get_code_for_paper("2608.08024")
have("2608.08024")

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

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

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

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

Connect an agent — have() is free.