SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.02924 · 2024

Pruner-Zero: Evolving Symbolic Pruning Metric from scratch for Large Language Models

arXiv · PDF · Open in the Atlas

Code that ran

8 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; 4 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 4 failures of our instrument; 9 no recorded run), measured 2026-11-24; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; 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/2406.02924.json · badge: /api/ran/2406.02924.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
pprp/pruner-zero canonical (classifier label)
classifier basis: census
8 ran · 9 no recorded run
FunctionStatusWhere it lives
add Ran
ran, honoured the contract we drafted
pprp/pruner-zero/lib/gptree.py
code served (permissive licence) · get_code("28f088bf9d4cf797")
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

torch.manual_seed(0)

# Test case 1: Two tensors
x_tensor = torch.randn(2, 4)
y_tensor = torch.randn(2, 4)

# Test case 2: Two integers
x_int = 5
y_int = 3

# We'll use the tensor case as primary
ARGS = {
    "x": x_tensor,
    "y": y_tensor,
}
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 (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
check_sparsity Ran
ran, honoured the contract we drafted
pprp/pruner-zero/lib/prune.py
code served (permissive licence) · get_code("ac28c555c0ec0815")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal model that satisfies the function's requirements
class MinimalConfig:
    def __init__(self):
        self.use_cache = False

class MinimalLayer(nn.Module):
    def __init__(self, input_dim=4, output_dim=3):
        super().__init__()
        self.linear1 = nn.Linear(input_dim, output_dim)
        self.linear2 = nn.Linear(output_dim, output_dim)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

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

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

# Create model instance
model = MinimalModel()

# Introduce some sparsity by zeroing out some weights
with torch.no_grad():
    for layer in model.model.layers:
        layer.linear1.weight.data[0, 0] = 0
        layer.linear1.weight.data[1, 1] = 0
        layer.linear2.weight.data[0, 0] = 0

ARGS = {
    '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 float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
find_layers Ran
ran; our contract draft was wrong, not the code
pprp/pruner-zero/lib/prune.py
pointer only (licence: MIT); the stored copy get_code serves, from zyxxmu/dsnot, is pointer only (licence: NONE) · get_code("2ed16fcdc14ad951")
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 zyxxmu/dsnot, 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.

find_layers Ran
ran; our contract draft was wrong, not the code
pprp/pruner-zero/lora_ft/evaluate_ppl.py
pointer only (licence: MIT); the stored copy get_code serves, from squeezeailab/kvquant, is pointer only (licence: NONE) · get_code("a9e7f2cdf016b88b")
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 squeezeailab/kvquant, 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.

find_layers Ran
ran; our contract draft was wrong, not the code
pprp/pruner-zero/lib/gradient_computation.py
code served (permissive licence) · get_code("14fab8e91e876c60")
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 torch.nn as nn

torch.manual_seed(0)

# Build a simple nested module with Linear layers
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
        self.nested = nn.Sequential(
            nn.Linear(2, 5),
            nn.ReLU(),
            nn.Linear(5, 1)
        )
    
    def forward(self, x):
        return x

module = SimpleModel()

ARGS = {
    'module': module,
    'layers': [nn.Linear],
    'name': ''
}
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 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_llm Ran
ran; our contract draft was wrong, not the code
pprp/pruner-zero/main_opt.py
code served (permissive licence) · get_code("612df986c51330d9")
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 Mock. 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
from unittest.mock import Mock, MagicMock

torch.manual_seed(0)

# Create a mock model config
mock_config = Mock()
mock_config.max_position_embeddings = 2048

# Create a mock model that behaves like AutoModelForCausalLM
mock_model = Mock()
mock_model.config = mock_config
mock_model.seqlen = None  # Will be set by the function

# Mock AutoModelForCausalLM.from_pretrained to return our mock model
import transformers
original_from_pretrained = transformers.AutoModelForCausalLM.from_pretrained

def mock_from_pretrained(model_name, torch_dtype=None, cache_dir=None, low_cpu_mem_usage=None, device_map=None):
    return mock_model

transformers.AutoModelForCausalLM.from_pretrained = mock_from_pretrained

ARGS = {
    'model_name': 'gpt2',
    'cache_dir': 'llm_weights'
}
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 Mock — a Mock 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
mul Ran
ran, honoured the contract we drafted
pprp/pruner-zero/lib/gptree.py
code served (permissive licence) · get_code("dff0648acd37c706")
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

torch.manual_seed(0)

# Test case 1: Two tensors (will be broadcast and multiplied element-wise)
x_tensor = torch.randn(2, 4)
y_tensor = torch.randn(2, 4)

# Test case 2: Scalar and tensor (will use standard multiplication)
x_scalar = 5
y_scalar = 3

# We'll use the tensor case for ARGS
ARGS = {
    "x": x_tensor,
    "y": y_tensor,
}
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 (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
sub Ran
ran, honoured the contract we drafted
pprp/pruner-zero/lib/gptree.py
code served (permissive licence) · get_code("fa506a51274c7eac")
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

torch.manual_seed(0)

# Create two small tensors for testing
x = torch.randn(2, 4)
y = torch.randn(2, 4)

ARGS = {
    "x": x,
    "y": y,
}
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 (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
check_sparsity Not yet run
unverified (harvested, no recorded run)
pprp/pruner-zero/lib/prune_opt.py
code served (permissive licence) · get_code("4cf1dd5e7d4e2ca9")
How it ran

no invocation recorded.

evaluate_ppl Not yet run
unverified (harvested, no recorded run)
pprp/pruner-zero/lora_ft/evaluate_ppl.py
code served (permissive licence) · get_code("1fa25202a1526a5f")
How it ran

no invocation recorded.

get_c4 Not yet run
unverified (harvested, no recorded run)
pprp/pruner-zero/lib/data.py
code served (permissive licence) · get_code("a271ec700d8df453")
How it ran

no invocation recorded.

get_loaders Not yet run
unverified (harvested, no recorded run)
pprp/pruner-zero/lib/data.py
code served (permissive licence) · get_code("b6ec51bc8a06ee71")
How it ran

no invocation recorded.

get_loaders Not yet run
unverified (harvested, no recorded run)
pprp/pruner-zero/lib/gradient_computation.py
code served (permissive licence) · get_code("35a6bbc8f64f77b7")
How it ran

no invocation recorded.

get_wikitext2 Not yet run
unverified (harvested, no recorded run)
pprp/pruner-zero/lib/data.py
code served (permissive licence) · get_code("07cb1fc598db64e8")
How it ran

no invocation recorded.

get_wikitext2 Not yet run
unverified (harvested, no recorded run)
pprp/pruner-zero/lib/gradient_computation.py
code served (permissive licence) · get_code("3a97b0120e186c09")
How it ran

no invocation recorded.

prepare_calibration_input Not yet run
unverified (harvested, no recorded run)
pprp/pruner-zero/lib/prune.py
code served (permissive licence) · get_code("298323fc64be86fa")
How it ran

no invocation recorded.

prepare_calibration_input Not yet run
unverified (harvested, no recorded run)
pprp/pruner-zero/lib/prune_opt.py
code served (permissive licence) · get_code("6530251d1f1a7f4e")
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 16 distinct functions with an identity, 7 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 2 the same month, 5 later) and 9 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
find_layers 27 other papers
15 dated earlier, 2 the same month, 8 later, 1 same year, order not determinable, 1 undated
2203.13474 (2022-03)
CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis
2023.emnlp-main.892 (2023 (year only))
Z-FOLD: A Frustratingly Easy Post-Training Quantization Scheme for LLMs
2307.09288 (2023-07)
Llama 2: Open Foundation and Fine-Tuned Chat Models
and 24 more not named here
find_layers 21 other papers
7 dated earlier, 1 the same month, 12 later, 1 same year, order not determinable · 5 only as an assembly brick
2306.11695 (2023-06)
A Simple and Effective Pruning Approach for Large Language Models
2310.05175 (2023-10)
Outlier Weighed Layerwise Sparsity (OWL ): A Missing Secret Sauce for Pruning LLMs to High Sparsity
2310.08915 (2023-10)
Dynamic Sparse No Training: Training-Free Fine-tuning for Sparse LLMs
and 18 more not named here
get_loaders 9 other papers
6 dated earlier, 2 later, 1 same year, order not determinable
2306.11695 (2023-06)
A Simple and Effective Pruning Approach for Large Language Models
2310.01382 (2023-10)
Compressing LLMs: The Truth is Rarely Pure and Never Simple
2310.05175 (2023-10)
Outlier Weighed Layerwise Sparsity (OWL ): A Missing Secret Sauce for Pruning LLMs to High Sparsity
and 6 more not named here
prepare_calibration_input 4 other papers
3 dated earlier, 1 later · 1 only as an assembly brick
2306.11695 (2023-06)
A Simple and Effective Pruning Approach for Large Language Models
2310.05175 (2023-10)
Outlier Weighed Layerwise Sparsity (OWL ): A Missing Secret Sauce for Pruning LLMs to High Sparsity
2401.02938 (2024-01)
Fast and Effective Weight Update for Pruned Large Language Models
and 1 more not named here
check_sparsity 1 other paper
1 dated earlier
2401.02938 (2024-01)
Fast and Effective Weight Update for Pruned Large Language Models
get_loaders 1 other paper
1 later
2410.09344 (2024-10)
DARE the Extreme: Revisiting Delta-Parameter Pruning For Fine-Tuned Models
prepare_calibration_input 1 other paper
1 dated earlier
2401.02938 (2024-01)
Fast and Effective Weight Update for Pruned Large Language Models

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

Despite the remarkable capabilities, Large Language Models (LLMs) face deployment challenges due to their extensive size. Pruning methods drop a subset of weights to accelerate, but many of them require retraining, which is prohibitively expensive and computationally demanding. Recently, post-training pruning approaches introduced novel metrics, enabling the pruning of LLMs without retraining. However, these metrics require the involvement of human experts and tedious trial and error. To efficiently identify superior pruning metrics, we develop an automatic framework for searching symbolic pruning metrics using genetic programming. In particular, we devise an elaborate search space encompassing the existing pruning metrics to discover the potential symbolic pruning metric. We propose an opposing operation simplification strategy to increase the diversity of the population. In this way, Pruner-Zero allows auto-generation of symbolic pruning metrics. Based on the searched results, we explore the correlation between pruning metrics and performance after pruning and summarize some principles. Extensive experiments on LLaMA and LLaMA-2 on language modeling and zero-shot tasks demonstrate that our Pruner-Zero obtains superior performance than SOTA post-training pruning methods. Code at: \url{https://github.com/pprp/Pruner-Zero}.

For agents

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

get_harvested_code_for_paper("2406.02924")
get_code_for_paper("2406.02924")
have("2406.02924")

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

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

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

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

Connect an agent — have() is free.