SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2505.14406 · EMNLP · 2025

Pierce the Mists, Greet the Sky: Decipher Knowledge Overshadowing via Knowledge Circuit Analysis

Kun Wang, Xuming Hu, Xin Zou, Yibo Yan, Xinfeng Li, Jiahao Huo, Haoming Huang

arXiv · PDF · Open in the Atlas

Code that ran

7 of 7 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; 1 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 5 failures of our instrument; 0 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/2505.14406.json · badge: /api/ran/2505.14406.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
halfmorepiece/PhantomCircuit community
Papers with Code archive
7 ran · 0 no recorded run
FunctionStatusWhere it lives
_is_eos_token Ran
ran, violated the contract we drafted
halfmorepiece/PhantomCircuit/co_xsub_identifier.py
code served (permissive licence) · get_code("011699c99d460851")
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 bool, 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 torch
import torch.nn as nn

class MockTokenizer:
    def __init__(self, eos_token):
        self.eos_token = eos_token

class MockModel(nn.Module):
    def __init__(self, tokenizer=None):
        super().__init__()
        self.tokenizer = tokenizer

# Test case 1: Model with tokenizer that has eos_token
tokenizer_with_eos = MockTokenizer(eos_token='<|endoftext|>')
model_with_tokenizer = MockModel(tokenizer=tokenizer_with_eos)

# Test case 2: Model without tokenizer attribute (uses default)
model_without_tokenizer = MockModel(tokenizer=None)

# Test token string - using the default eos_token
token_str = '<|endoftext|>'

ARGS = {
    'token_str': token_str,
    'model': model_with_tokenizer
}
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 bool, 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
clean_prompt_tokens Ran
ran; our contract draft was wrong, not the code
halfmorepiece/PhantomCircuit/co_xsub_identifier.py
code served (permissive licence) · get_code("942e288739fc5fad")
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 torch.nn as nn

torch.manual_seed(0)

class MockTokenizer:
    def __init__(self):
        self.eos_token = '<|endoftext|>'

class MockModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.tokenizer = MockTokenizer()

prompt_tokens = ['hello', 'world', '<|endoftext|>', 'foo', '<|endoftext|>', 'bar']
model = MockModel()

ARGS = {
    'prompt_tokens': prompt_tokens,
    'model': model
}
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 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
compute_logprob_variance_across_masks Ran
ran; our contract draft was wrong, not the code
halfmorepiece/PhantomCircuit/co_xsub_identifier.py
code served (permissive licence) · get_code("ff663579f9e9503f")
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
import torch.nn as nn
import numpy as np

torch.manual_seed(0)

# Build a minimal model that satisfies the function's requirements
class MinimalLanguageModel(nn.Module):
    def __init__(self, vocab_size=100, hidden_dim=4):
        super().__init__()
        self.vocab_size = vocab_size
        self.hidden_dim = hidden_dim
        self.embedding = nn.Embedding(vocab_size, hidden_dim)
        self.linear = nn.Linear(hidden_dim, vocab_size)
    
    def forward(self, tokens):
        # tokens shape: (batch, seq_len)
        # output shape: (batch, seq_len, vocab_size)
        embedded = self.embedding(tokens)
        logits = self.linear(embedded)
        return logits
    
    def to_tokens(self, text, prepend_bos=False):
        # Convert text to token indices
        # Simple: hash each character and map to vocab
        token_ids = [hash(c) % self.vocab_size for c in text]
        tokens = torch.tensor(token_ids, dtype=torch.long)
        return tokens
    
    def to_string(self, token_indices):
        # Convert token indices back to strings
        # Simple: map index back to characters
        if isinstance(token_indices, list):
            return [f"token_{idx}" for idx in token_indices]
        return f"token_{token_indices}"

# Build model
model = MinimalLanguageModel(vocab_size=100, hidden_dim=4)
model.eval()

# Build tokenizer (minimal stand-in)
class MinimalTokenizer:
    def convert_tokens_to_string(self, tokens):
        return ''.join(str(t) for t in tokens)

tokenizer = MinimalTokenizer()

# Create prompt tokens (list of token strings or indices)
prompt_tokens = ["hello", "world", "test"]

# Get original predictions by calling get_top_k_predictions
def safe_to_tokens(model, prompt):
    return model.to_tokens(prompt, prepend_bos=False)

def get_top_k_predictions(prompt_text, model, tokenizer, top_k=10):
    tokens = safe_to_tokens(model, prompt_text)
    if tokens.dim() == 1:
        tokens = tokens.unsqueeze(0)
    model_device = next(model.parameters()).device
    tokens = tokens.to(model_device)
    with torch.no_grad():
        logits = model(tokens)
    next_token_logits = logits[:, -1, :]
    log_probs = torch.log_softmax(next_token_logits, dim=-1)
    top_k_log_probs, top_k_indices = torch.topk(log_probs, top_k, dim=-1)
    top_k_tokens = []
    for idx in top_k_indices[0]:
        token_str = model.to_string([idx.item()])
        if isinstance(token_str, list):
            token_str = token_str[0]
        top_k_tokens.append(token_str)
    predictions = []
    for token_str, log_prob_val in zip(top_k_tokens, top_k_log_probs[0]):
        predictions.append((token_str, log_prob_val.item()))
    return predictions

# Generate original predictions list
prompt_text = "hello world test"
original_predictions_list = get_top_k_predictions(prompt_text, model, tokenizer, top_k=5)

# Define arguments for compute_logprob_variance_across_masks
ARGS = {
    "prompt_tokens": prompt_tokens,
    "model": model,
    "tokenizer": tokenizer,
    "original_predictions_list": original_predictions_list,
    "top_k": 5
}
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 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_top_k_predictions Ran
ran; our contract draft was wrong, not the code
halfmorepiece/PhantomCircuit/co_xsub_identifier.py
code served (permissive licence) · get_code("4e43ea55d6c051ca")
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 2, 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

torch.manual_seed(0)

class MockModel(nn.Module):
    def __init__(self, vocab_size=100, hidden_dim=4):
        super().__init__()
        self.vocab_size = vocab_size
        self.hidden_dim = hidden_dim
        self.embedding = nn.Embedding(vocab_size, hidden_dim)
        self.linear = nn.Linear(hidden_dim, vocab_size)
    
    def forward(self, tokens):
        """
        Input: tokens of shape (batch_size, seq_len)
        Output: logits of shape (batch_size, seq_len, vocab_size)
        """
        x = self.embedding(tokens)
        logits = self.linear(x)
        return logits
    
    def to_tokens(self, prompt, prepend_bos=False):
        """Convert prompt string to token tensor"""
        token_ids = [hash(prompt) % self.vocab_size for _ in range(3)]
        return torch.tensor(token_ids, dtype=torch.long)
    
    def to_string(self, token_indices):
        """Convert token indices to strings"""
        return [f"token_{idx}" for idx in token_indices]


class MockTokenizer:
    def __init__(self):
        self.vocab_size = 100
    
    def encode(self, text):
        return [1, 2, 3]
    
    def decode(self, tokens):
        return "decoded text"


prompt_text = "hello world"
model = MockModel(vocab_size=100, hidden_dim=4)
tokenizer = MockTokenizer()
top_k = 10

ARGS = {
    "prompt_text": prompt_text,
    "model": model,
    "tokenizer": tokenizer,
    "top_k": top_k,
}
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 2, 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
identify_xsub_by_phantomcircuit Ran
ran; our contract draft was wrong, not the code
halfmorepiece/PhantomCircuit/co_xsub_identifier.py
code served (permissive licence) · get_code("de73d191312197fe")
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 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)

class SimpleTokenizer:
    def __init__(self):
        self.eos_token = '<|endoftext|>'
    
    def convert_tokens_to_string(self, tokens):
        return ''.join(tokens)

class SimpleModel(nn.Module):
    def __init__(self, vocab_size=100, hidden_dim=4):
        super().__init__()
        self.embedding = nn.Embedding(vocab_size, hidden_dim)
        self.linear = nn.Linear(hidden_dim, vocab_size)
        self.tokenizer = SimpleTokenizer()
        self.vocab_size = vocab_size
    
    def forward(self, tokens):
        # tokens shape: (batch, seq_len)
        embedded = self.embedding(tokens)  # (batch, seq_len, hidden_dim)
        logits = self.linear(embedded)  # (batch, seq_len, vocab_size)
        return logits
    
    def to_tokens(self, prompt, prepend_bos=False):
        # Simple tokenization: convert each character to a token id
        token_ids = [ord(c) % self.vocab_size for c in prompt]
        return torch.tensor(token_ids, dtype=torch.long)
    
    def to_str_tokens(self, prompt):
        # Return string tokens (characters)
        return list(prompt)
    
    def to_string(self, token_ids):
        # Convert token ids back to string
        if isinstance(token_ids, list):
            return ''.join([chr(tid % 256) for tid in token_ids])
        return chr(token_ids.item() % 256)

model = SimpleModel(vocab_size=100, hidden_dim=4)
model.eval()

tokenizer = SimpleTokenizer()

prompt = "hello world"

ARGS = {
    'prompt': prompt,
    'model': model,
    'tokenizer': tokenizer,
    'top_k': 5,
    'verbose': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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, 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
safe_to_str_tokens Ran
ran; our contract draft was wrong, not the code
halfmorepiece/PhantomCircuit/co_xsub_identifier.py
code served (permissive licence) · get_code("ce9db70729fd9a34")
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 torch.nn as nn

torch.manual_seed(0)

class MockTokenizer:
    def __init__(self):
        self.eos_token = '<|endoftext|>'

class MockModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.tokenizer = MockTokenizer()
    
    def to_str_tokens(self, prompt):
        # Simple mock: split prompt into tokens and add eos token
        tokens = prompt.split()
        tokens.append(self.tokenizer.eos_token)
        return tokens

# Create model instance
model = MockModel()

# Create prompt string
prompt = "hello world test"

# Define arguments dict
ARGS = {
    "model": model,
    "prompt": prompt
}
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 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
safe_to_tokens Ran
ran, honoured the contract we drafted
halfmorepiece/PhantomCircuit/co_xsub_identifier.py
code served (permissive licence) · get_code("7967a02919473231")
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 int, shape (1, 11) 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

torch.manual_seed(0)

class MockTokenizer(nn.Module):
    def __init__(self):
        super().__init__()
        self.vocab_size = 256
    
    def to_tokens(self, prompt, prepend_bos=False):
        # Simple mock: convert string to token ids
        # Return a tensor of shape (1, seq_len) or similar
        if isinstance(prompt, str):
            tokens = [ord(c) % self.vocab_size for c in prompt]
        else:
            tokens = [1, 2, 3]
        
        token_tensor = torch.tensor([tokens], dtype=torch.long)
        return token_tensor

model = MockTokenizer()
prompt = "hello world"

ARGS = {
    "model": model,
    "prompt": prompt
}
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 int, shape (1, 11) — shape (1, 11) 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

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 7 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.

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), despite their remarkable capabilities, are hampered by hallucinations. A particularly challenging variant, knowledge overshadowing, occurs when one piece of activated knowledge inadvertently masks another relevant piece, leading to erroneous outputs even with high-quality training data. Current understanding of overshadowing is largely confined to inference-time observations, lacking deep insights into its origins and internal mechanisms during model training. Therefore, we introduce PHANTOMCIRCUIT, a novel framework designed to comprehensively analyze and detect knowledge overshadowing. By innovatively employing knowledge circuit analysis, PHANTOMCIRCUIT dissects the function of key components in the circuit and how the attention pattern dynamics contribute to the overshadowing phenomenon and its evolution throughout the training process. Extensive experiments demonstrate PHANTOMCIRCUIT 's effectiveness in identifying such instances, offering novel insights into this elusive hallucination and providing the research community with a new methodological lens for its potential mitigation. Our code can be found in https://github.com/halfmorepiece/PhantomCircuit.

For agents

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

get_harvested_code_for_paper("2505.14406")
get_code_for_paper("2505.14406")
have("2505.14406")

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

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

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

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

Connect an agent — have() is free.