SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2605.15491 · 2026

Ghosted Layers: Unconstrained Activation Alignment for Recovering Layer-Pruned LLMs

Sai Karimireddy, Sunwoo Lee, Vincent-Daniel Yun, Jo Junhyuk

arXiv · PDF

Code that ran

17 of 22 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; 5 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 12 failures of our instrument; 5 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.15491.json · badge: /api/ran/2605.15491.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
chenxinrui-tsinghua/LinearPatch canonical (classifier label)
classifier basis: census
11 ran · 4 no recorded run
Nota-NetsPresso/shortened-llm canonical (classifier label)
classifier basis: census
3 ran · 1 no recorded run
sramshetty/ShortGPT canonical (classifier label)
classifier basis: census
2 ran · 0 no recorded run
ruckbreasoning/llm-streamline community
Papers with Code archive
1 ran · 0 no recorded run
FunctionStatusWhere it lives
add_wrapper_after_function_call_in_method Ran
ran; our contract draft was wrong, not the code
chenxinrui-tsinghua/LinearPatch/rotate_utils/monkeypatch.py
code served (permissive licence) · get_code("e649cf99e1985c23")
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 torch
import torch.nn as nn
import copy
import functools
import types


def copy_func_with_new_globals(f, globals=None):
    """Based on https://stackoverflow.com/a/13503277/2988730 (@unutbu)"""
    if globals is None:
        globals = f.__globals__
    g = types.FunctionType(f.__code__, globals, name=f.__name__, argdefs=f.__defaults__, closure=f.__closure__)
    g = functools.update_wrapper(g, f)
    g.__module__ = f.__module__
    g.__kwdefaults__ = copy.copy(f.__kwdefaults__)
    return g


def add_wrapper_after_function_call_in_method(module, method_name, function_name, wrapper_fn):
    """
    This function adds a wrapper after the output of a function call in the method named `method_name`. 
    Only calls directly in the method are affected. Calls by other functions called in the method are not affected.
    """
    original_method = getattr(module, method_name).__func__
    method_globals = dict(original_method.__globals__)
    wrapper = wrapper_fn(method_globals[function_name])
    method_globals[function_name] = wrapper
    new_method = copy_func_with_new_globals(original_method, globals=method_globals)
    setattr(module, method_name, new_method.__get__(module))
    return wrapper


# Create a simple test module with a method that calls a function
class TestModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        # This method directly calls helper_func
        result = helper_func(x)
        return result


def helper_func(x):
    """A simple function that will be wrapped"""
    return x * 2


# Create wrapper function factory
def create_wrapper(original_fn):
    """Creates a wrapper around the original function"""
    @functools.wraps(original_fn)
    def wrapper(*args, **kwargs):
        result = original_fn(*args, **kwargs)
        return result + 1
    return wrapper


# Create module instance
test_module = TestModule()

# Define ARGS
ARGS = {
    "module": test_module,
    "method_name": "forward",
    "function_name": "helper_func",
    "wrapper_fn": create_wrapper,
}
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 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
b2mb Ran
ran, honoured the contract we drafted
Nota-NetsPresso/shortened-llm/src/gen_batch_eval_vram.py
pointer only (licence: NONE) · get_code("32380a050ca033d4")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, Nota-NetsPresso/shortened-llm 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.

block_influence Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
sramshetty/ShortGPT/short_gpt/metrics.py
code served (permissive licence) · get_code("a88f5625827ddf9d")
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 1, dtype family float, shape (6,) 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 small tensors with shapes B=2, S=3, D=4
# B: batch size, S: sequence length, D: hidden dimension
batch_size = 2
seq_length = 3
hidden_dim = 4

input_hidden_state = torch.randn(batch_size, seq_length, hidden_dim)
output_hidden_state = torch.randn(batch_size, seq_length, hidden_dim)

ARGS = {
    "input_hidden_state": input_hidden_state,
    "output_hidden_state": output_hidden_state,
    "angular": False
}
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 1, dtype family float, shape (6,) — shape (6,) 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
copy_func_with_new_globals Ran
ran; our contract draft was wrong, not the code
chenxinrui-tsinghua/LinearPatch/rotate_utils/monkeypatch.py
code served (permissive licence) · get_code("76b345bcf88c8668")
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 copy
import functools
import types


def sample_function(x, y=10):
    """A simple test function with defaults and closure."""
    z = x + y
    return z


def another_function(a, b, c=5):
    """Another test function."""
    return a * b + c


ARGS = {
    "f": sample_function,
    "globals": None,
}
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 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
create_logger Ran
ran; our contract draft was wrong, not the code
chenxinrui-tsinghua/LinearPatch/utils.py
code served (permissive licence) · get_code("253d01253fa57089")
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 Logger. 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 tempfile
import os

# Create a temporary directory for output
output_dir = tempfile.mkdtemp()

ARGS = {
    'output_dir': output_dir,
    'dist_rank': 0,
    'name': 'test_logger'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
termcolor — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Logger — a Logger output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Logger 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
format_example Ran
ran; our contract draft was wrong, not the code
chenxinrui-tsinghua/LinearPatch/eval/mmlu_eval.py
code served (permissive licence) · get_code("cd763eaf1ac287e7")
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 str. 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 pandas as pd

# Create a small DataFrame with the structure expected by format_example
# The function expects:
# - Column 0: prompt text
# - Columns 1 to k: answer choices (k columns)
# - Column k+1: the correct answer
# With choices = ['A', 'B', 'C', 'D'], we have k=4 choices

data = {
    0: ["What is 2+2?"],
    1: ["3"],
    2: ["4"],
    3: ["5"],
    4: ["6"],
    5: ["B"]  # The answer is 'B' (which corresponds to choice index 1, value "4")
}

df = pd.DataFrame(data)

ARGS = {
    'df': df,
    'idx': 0,
    'include_answer': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
format_subject Ran
ran; our contract draft was wrong, not the code
chenxinrui-tsinghua/LinearPatch/eval/mmlu_eval.py
code served (permissive licence) · get_code("6ab745408cb8648b")
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 str. 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

def format_subject(subject):
    l = subject.split('_')
    s = ''
    for entry in l:
        s += ' ' + entry
    return s

ARGS = {
    'subject': 'machine_learning_model'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
gen_prompt Ran
ran; our contract draft was wrong, not the code
chenxinrui-tsinghua/LinearPatch/eval/mmlu_eval.py
code served (permissive licence) · get_code("3383488ea82b6c15")
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 str. 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 pandas as pd
import numpy as np

# Create a small DataFrame that mimics the structure expected by gen_prompt
# The function expects: question in column 0, answer choices in columns 1 to k, answer in column k+1
data = {
    0: ['What is 2+2?', 'What is the capital of France?'],
    1: ['3', 'London'],
    2: ['4', 'Paris'],
    3: ['5', 'Berlin'],
    4: ['6', 'Madrid'],
    5: ['A', 'B']  # answers column
}

train_df = pd.DataFrame(data)

subject = 'basic_math'

ARGS = {
    'train_df': train_df,
    'subject': subject,
    'k': -1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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_pruned_layer_with_cosine Ran
ran, honoured the contract we drafted
chenxinrui-tsinghua/LinearPatch/layer_select.py
code served (permissive licence) · get_code("6a159410399bfba3")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
from torch.utils.data import DataLoader, TensorDataset

torch.manual_seed(0)

# Build a minimal model that matches the function's expectations
class MinimalLayer(nn.Module):
    def __init__(self, in_dim, out_dim):
        super().__init__()
        self.linear = nn.Linear(in_dim, out_dim)
    
    def forward(self, x):
        return self.linear(x)

class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.layers = nn.ModuleList([
            MinimalLayer(4, 3),
            MinimalLayer(3, 3),
            MinimalLayer(3, 3),
            MinimalLayer(3, 3),
            MinimalLayer(3, 2),
        ])
    
    def forward(self, x):
        for layer in self.layers:
            x = layer(x)
        return x

class ModelWrapper(nn.Module):
    def __init__(self):
        super().__init__()
        self.model = MinimalModel()
    
    def forward(self, x):
        return self.model(x)

# Create small dataset
x_data = torch.randn(2, 4)
y_data = torch.randn(2, 2)
dataset = TensorDataset(x_data, y_data)
trainloader = DataLoader(dataset, batch_size=2)

# Build arguments
model = ModelWrapper()
num_to_prune = 2
device = 'cpu'

ARGS = {
    'model': model,
    'trainloader': trainloader,
    'num_to_prune': num_to_prune,
    'device': device,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
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
get_rope_function_name Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
chenxinrui-tsinghua/LinearPatch/rotate_utils/model_utils.py
code served (permissive licence) · get_code("8005fc23ccbe61fb")
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 str. 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 transformers
from transformers.models.llama.modeling_llama import LlamaForCausalLM
from transformers import LlamaConfig

torch.manual_seed(0)

# Create a minimal LlamaForCausalLM model
config = LlamaConfig(
    vocab_size=256,
    hidden_size=64,
    num_hidden_layers=2,
    num_attention_heads=2,
    num_key_value_heads=2,
    intermediate_size=128,
    max_position_embeddings=512,
)

model = LlamaForCausalLM(config)

ARGS = {
    'model': model,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
llama_down_proj_groupsize Ran
ran, honoured the contract we drafted
chenxinrui-tsinghua/LinearPatch/rotate_utils/utils.py
code served (permissive licence) · get_code("fe39dd44b7d2698b")
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
import torch.nn as nn
import logging

# Configure logging
logging.basicConfig(level=logging.INFO)

# Create a minimal config class that the function expects
class LlamaConfig:
    def __init__(self, hidden_size, intermediate_size):
        self.hidden_size = hidden_size
        self.intermediate_size = intermediate_size

# Create a minimal model class
class LlamaModel(nn.Module):
    def __init__(self, config):
        super().__init__()
        self.config = config
    
    def forward(self, x):
        return x

# Set up the model with specific dimensions
# hidden_size = 256, intermediate_size = 768
# This allows for groupsize calculations:
# - intermediate_size (768) should be divisible by group_num
# - hidden_size (256) should be divisible by groupsize
config = LlamaConfig(hidden_size=256, intermediate_size=768)
model = LlamaModel(config)

# groupsize = 64 means:
# group_num = 256 / 64 = 4
# down_proj_groupsize = 768 / 4 = 192
# This satisfies: 64 * 4 == 256 and 192 * 4 == 768
groupsize = 64

ARGS = {
    "model": model,
    "groupsize": groupsize
}
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
llama_eval Ran
ran; our contract draft was wrong, not the code
Nota-NetsPresso/shortened-llm/src/eval_ppl.py
pointer only (licence: NONE) · get_code("9012ddbbaf4ee64f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, Nota-NetsPresso/shortened-llm 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.

online_rotate Ran
ran; our contract draft was wrong, not the code
chenxinrui-tsinghua/LinearPatch/rotate_utils/rotation_utils.py
code served (permissive licence) · get_code("f27e39c71c8ebfb4")
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
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal module that has a Q attribute (weight matrix)
class MinimalModule(nn.Module):
    def __init__(self):
        super().__init__()
        # Q should be a weight matrix for linear transformation
        # Shape: (output_dim, input_dim) = (3, 4) for distinct dimensions
        self.Q = nn.Parameter(torch.randn(3, 4))

module = MinimalModule()

# Create input tensor
# inp should be a tuple where inp[0] is the input to the linear operation
# Shape: (batch_size, input_dim) = (2, 4)
inp = (torch.randn(2, 4), "extra_arg")

ARGS = {
    "module": module,
    "inp": inp
}
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
process_data Ran
ran, honoured the contract we drafted
Nota-NetsPresso/shortened-llm/src/dataset.py
pointer only (licence: NONE) · get_code("8a69aa6e08dc65a9")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, Nota-NetsPresso/shortened-llm 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.

random_orthogonal_matrix Ran
ran, honoured the contract we drafted
chenxinrui-tsinghua/LinearPatch/rotate_utils/rotation_utils.py
code served (permissive licence) · get_code("522f6e6438fa5941")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (5, 5) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 takes two parameters: size (int) and device (str)
# size: the dimension of the square orthogonal matrix to generate
# device: the torch device to place the matrix on

ARGS = {
    "size": 5,
    "device": "cpu"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (5, 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
replace_lightweight_network Ran
ran; our contract draft was wrong, not the code
ruckbreasoning/llm-streamline/LLM_Streamline/train_mseloss.py
pointer only (licence: NONE) · get_code("084cfa0149d7a511")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ruckbreasoning/llm-streamline 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.

sample_top_p Ran
ran; our contract draft was wrong, not the code
sramshetty/ShortGPT/short_gpt/short_llama.py
code served (permissive licence) · get_code("ab63b7d19f77cc5c")
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 (2, 1) 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 probability distribution tensor
# Shape: (batch_size=2, vocab_size=4)
# Each row should sum to 1.0 for a valid probability distribution
probs = torch.tensor([
    [0.1, 0.2, 0.3, 0.4],
    [0.25, 0.25, 0.25, 0.25]
], dtype=torch.float32)

# Normalize to ensure valid probabilities
probs = probs / probs.sum(dim=-1, keepdim=True)

# Top-p threshold
p = 0.9

ARGS = {
    "probs": probs,
    "p": p,
}
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 (2, 1) — shape (2, 1) 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
cleanup_memory Not yet run
unverified (harvested, no recorded run)
chenxinrui-tsinghua/LinearPatch/rotate_utils/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from intelligent-computing-lab-yale/gptaq, is pointer only (licence: NONE) · get_code("88c8d591b4688832")
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 intelligent-computing-lab-yale/gptaq, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

config_logging Not yet run
unverified (harvested, no recorded run)
chenxinrui-tsinghua/LinearPatch/rotate_utils/utils.py
code served (permissive licence) · get_code("cf7f28fedcdd19c5")
How it ran

no invocation recorded.

get_gpu_metrics Not yet run
unverified (harvested, no recorded run)
Nota-NetsPresso/shortened-llm/src/gen_batch_eval_time_gpuutil.py
pointer only (licence: NONE) · get_code("f8178f1b0c33cf48")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, Nota-NetsPresso/shortened-llm when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

get_layers Not yet run
unverified (harvested, no recorded run)
chenxinrui-tsinghua/LinearPatch/rotate_utils/model_utils.py
code served (permissive licence) · get_code("eb59d0a73734e449")
How it ran

no invocation recorded.

model_type_extractor Not yet run
unverified (harvested, no recorded run)
chenxinrui-tsinghua/LinearPatch/rotate_utils/model_utils.py
code served (permissive licence) · get_code("cdd805f7fc7a0842")
How it ran

no invocation recorded.

Also present in other papers' code

Of 22 samples lifted from this paper's linked repositories, 22 carry a function identity and 0 do not. Of the 22 distinct functions with an identity, 17 are also present in other papers whose code we hold (17 with at least one paper dated earlier, 0 the same month, 0 later) and 5 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
format_subject 21 other papers
21 dated earlier
2009.03300 (2020-09)
Measuring Massive Multitask Language Understanding
2304.12986 (2023-04)
Measuring Massive Multitask Chinese Understanding
2305.17306 (2023-05)
Chain-of-Thought Hub: A Continuous Effort to Measure Large Language Models' Reasoning Performance
and 18 more not named here
format_example 16 other papers
16 dated earlier
2009.03300 (2020-09)
Measuring Massive Multitask Language Understanding
2305.17306 (2023-05)
Chain-of-Thought Hub: A Continuous Effort to Measure Large Language Models' Reasoning Performance
2310.05736 (2023-10)
LLMLingua: Compressing Prompts for Accelerated Inference of Large Language Models
and 13 more not named here
b2mb 11 other papers
11 dated earlier
2303.18223 (2023-03)
A Survey of Large Language Models
2401.16405 (2024-01)
Scaling Sparse Fine-Tuning to Large Language Models
2402.02834 (2024-02)
Shortened LLaMA: Depth Pruning for Large Language Models with Comparison of Retraining Methods
and 8 more not named here
gen_prompt 10 other papers
10 dated earlier
2009.03300 (2020-09)
Measuring Massive Multitask Language Understanding
2305.17306 (2023-05)
Chain-of-Thought Hub: A Continuous Effort to Measure Large Language Models' Reasoning Performance
2310.05736 (2023-10)
LLMLingua: Compressing Prompts for Accelerated Inference of Large Language Models
and 7 more not named here
get_rope_function_name 4 other papers
4 dated earlier
2404.00456 (2024-04)
QuaRot: Outlier-Free 4-Bit Inference in Rotated LLMs
2511.04063 (2025-11)
DartQuant: Efficient Rotational Distribution Calibration for LLM Quantization
2602.02546 (2026-02)
D 2 Quant: Accurate Low-bit Post-Training Weight Quantization for LLMs
and 1 more not named here
cleanup_memory 3 other papers
3 dated earlier
2504.02692 (2025-04)
GPTAQ: Efficient Finetuning-Free Quantization for Asymmetric Calibration
2505.13866 (2025-05)
Reasoning Path Compression: Compressing Generation Trajectories for Efficient LLM Reasoning
2604.07955 (2026-04)
Rethinking Residual Errors in Compensation-based LLM Quantization
get_layers 3 other papers
3 dated earlier
2404.00456 (2024-04)
QuaRot: Outlier-Free 4-Bit Inference in Rotated LLMs
2511.04063 (2025-11)
DartQuant: Efficient Rotational Distribution Calibration for LLM Quantization
2604.07955 (2026-04)
Rethinking Residual Errors in Compensation-based LLM Quantization
model_type_extractor 3 other papers
3 dated earlier
2404.00456 (2024-04)
QuaRot: Outlier-Free 4-Bit Inference in Rotated LLMs
2511.04063 (2025-11)
DartQuant: Efficient Rotational Distribution Calibration for LLM Quantization
2604.07955 (2026-04)
Rethinking Residual Errors in Compensation-based LLM Quantization
random_orthogonal_matrix 2 other papers
2 dated earlier
2405.16406 (2024-05)
SpinQuant: LLM quantization with learned rotations
2604.07955 (2026-04)
Rethinking Residual Errors in Compensation-based LLM Quantization
add_wrapper_after_function_call_in_method 1 other paper
1 dated earlier
2511.04063 (2025-11)
DartQuant: Efficient Rotational Distribution Calibration for LLM Quantization
block_influence 1 other paper
1 dated earlier
2024.findings-emnlp.579 (2024 (year only))
Change Is the Only Constant: Dynamic LLM Slicing based on Layer Redundancy
config_logging 1 other paper
1 dated earlier
2604.07955 (2026-04)
Rethinking Residual Errors in Compensation-based LLM Quantization
copy_func_with_new_globals 1 other paper
1 dated earlier
2511.04063 (2025-11)
DartQuant: Efficient Rotational Distribution Calibration for LLM Quantization
get_gpu_metrics 1 other paper
1 dated earlier
2402.02834 (2024-02)
Shortened LLaMA: Depth Pruning for Large Language Models with Comparison of Retraining Methods
llama_down_proj_groupsize 1 other paper
1 dated earlier
2604.07955 (2026-04)
Rethinking Residual Errors in Compensation-based LLM Quantization
llama_eval 1 other paper
1 dated earlier
2402.02834 (2024-02)
Shortened LLaMA: Depth Pruning for Large Language Models with Comparison of Retraining Methods
process_data 1 other paper
1 dated earlier
2402.02834 (2024-02)
Shortened LLaMA: Depth Pruning for Large Language Models with Comparison of Retraining Methods

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

Layer pruning removes entire Transformer decoder blocks from large language models, but introduces a mismatch between the hidden state received by the next surviving layer and the distribution it was trained to process, leading to significant performance degradation. We propose Ghosted Layers, a training-free recovery module that addresses this issue by solving a boundary activation alignment problem. Our method derives a closed-form optimal linear operator from a small calibration set to reconstruct the activation discrepancy introduced by the pruned layers. We show that this solution corresponds to the unconstrained optimum of the alignment objective, whereas existing methods are restricted to constrained solutions over limited operator subspaces. Experiments across multiple LLM backbones and pruning strategies demonstrate that our method consistently improves accuracy and perplexity over prior training-free baselines, while preserving the efficiency gains of layer pruning. Official code repository: https://github.com/daniel-eai/ghosted_layers_ official_repository/.

For agents

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

get_harvested_code_for_paper("2605.15491")
get_code_for_paper("2605.15491")
have("2605.15491")

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

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

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

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

Connect an agent — have() is free.