SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.07461 · EMNLP · 2024

Is C4 Dataset Optimal for Pruning? An Investigation of Calibration Data for LLM Pruning

Tianlong Chen, Cheng-Yu Hsieh, Li Shen, Shiwei Liu, Lu Yin, Ajay Jaiswal, Ranjay Krishna, Abhinav Bandari

arXiv · PDF · Open in the Atlas

Code that ran

5 of 9 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, 0 violated it and 0 have no contract verdict; 4 failures of our instrument; 4 no recorded run), measured 2026-11-22; 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/2410.07461.json · badge: /api/ran/2410.07461.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
abx393/llm-pruning-calibration-data canonical (classifier label)
classifier basis: census
5 ran · 4 no recorded run
FunctionStatusWhere it lives
check_sparsity Ran
ran, honoured the contract we drafted
abx393/llm-pruning-calibration-data/lib/prune.py
code served (permissive licence) · get_code("91a952a7c3e11f8b")
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 mock config
class MockConfig:
    def __init__(self):
        self.use_cache = True

# Create a minimal mock model matching the structure expected by check_sparsity
class MockModel(nn.Module):
    def __init__(self, num_layers=2):
        super().__init__()
        self.config = MockConfig()
        self.model = nn.Module()
        
        # Create layers attribute with transformer blocks
        layers = []
        for i in range(num_layers):
            layer = nn.Sequential(
                nn.Linear(4, 3),
                nn.Linear(3, 4)
            )
            layers.append(layer)
        
        self.model.layers = nn.ModuleList(layers)

# Create mock args with verbose attribute
class MockArgs:
    def __init__(self, verbose=False):
        self.verbose = verbose

# Instantiate the model and args
model = MockModel(num_layers=2)

# Add some sparsity to weights (set some values to zero)
for layer in model.model.layers:
    for module in layer.modules():
        if isinstance(module, nn.Linear):
            with torch.no_grad():
                module.weight.data[0, 0] = 0
                module.weight.data[1, 1] = 0

args = MockArgs(verbose=False)

ARGS = {
    'args': 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
abx393/llm-pruning-calibration-data/lib/prune.py
pointer only (licence: Apache-2.0); 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 (Apache-2.0), 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.

grouper Ran
ran; our contract draft was wrong, not the code
abx393/llm-pruning-calibration-data/lib/tasks/util.py
code served (permissive licence) · get_code("a7a81b4c3a6ce8aa")
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 zip_longest. 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.

from itertools import zip_longest

def grouper(n, iterable, fillvalue):
    """grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx"""
    args = [iter(iterable)] * n
    return zip_longest(*args, fillvalue=fillvalue)

ARGS = {
    "n": 3,
    "iterable": "ABCDEFG",
    "fillvalue": "x"
}
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 zip_longest — a zip_longest output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a zip_longest 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
prepare_calibration_input Ran
ran; our contract draft was wrong, not the code
abx393/llm-pruning-calibration-data/lib/prune.py
code served (permissive licence) · get_code("4dae8adb46b1e46e")
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 config object
class MinimalConfig:
    def __init__(self):
        self.use_cache = True
        self.hidden_size = 4
        self.vocab_size = 50
        self.num_hidden_layers = 2

# Create a minimal model
class MinimalLlamaModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.config = MinimalConfig()
        self.seqlen = 8
        
        # Create minimal layers structure
        self.model = nn.Module()
        self.model.layers = nn.ModuleList([
            nn.Linear(4, 4) for _ in range(2)
        ])
        
        # Embed tokens layer
        self.embed_tokens = nn.Embedding(50, 4)
        
        # Register parameters so dtype can be extracted
        self.register_parameter('_dummy', nn.Parameter(torch.randn(4, 4)))
    
    def forward(self, input_ids, attention_mask=None):
        # Simulate forward pass
        x = self.embed_tokens(input_ids)
        for layer in self.model.layers:
            x = layer(x)
        return x

# Create minimal args object
class Args:
    def __init__(self):
        self.nsamples = 2

# Create minimal dataloader (list of batches)
# Each batch is a tuple of (input_ids, labels)
dataloader = [
    (torch.randint(0, 50, (1, 8)),),
    (torch.randint(0, 50, (1, 8)),),
]

# Set up all arguments
model = MinimalLlamaModel()
args = Args()
device = 'cpu'
pad_token = 0

ARGS = {
    'args': args,
    'model': model,
    'dataloader': dataloader,
    'device': device,
    'pad_token': pad_token,
    'mode': 'llama',
    'prepend_calibration': None,
}
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
shrink_seq Ran
ran; our contract draft was wrong, not the code
abx393/llm-pruning-calibration-data/lib/tasks/util.py
code served (permissive licence) · get_code("cdb488c7e605e47b")
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 numpy as np

# Create a small examples dict with the required keys
# The function accesses: examples['obs'], examples['target'], examples['eval_mask']
# It uses shape[-1] to get sequence length, and performs operations like slicing

batch_size = 2
seq_length = 16
feature_dim = 4

# Create obs with shape (batch_size, feature_dim, seq_length)
obs = np.random.randn(batch_size, feature_dim, seq_length).astype(np.float32)

# Create target with same shape as obs
target = np.random.randn(batch_size, feature_dim, seq_length).astype(np.float32)

# Create eval_mask: binary mask with shape (batch_size, seq_length)
# The mask is used to find max_length via: np.max(examples['eval_mask'] * np.arange(0, length))
# We'll create a mask where some positions are 1 and others are 0
eval_mask = np.zeros((batch_size, seq_length), dtype=np.float32)
# Set first 10 positions to 1 for the first batch, first 8 for second batch
eval_mask[0, :10] = 1
eval_mask[1, :8] = 1

examples = {
    'obs': obs,
    'target': target,
    'eval_mask': eval_mask
}

ARGS = {
    'examples': examples,
    'min_seq': None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type 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_ellipses Not yet run
unverified (harvested, no recorded run)
abx393/llm-pruning-calibration-data/lib/data.py
code served (permissive licence) · get_code("558bf8c612039e2f")
How it ran

no invocation recorded.

get_random Not yet run
unverified (harvested, no recorded run)
abx393/llm-pruning-calibration-data/lib/data.py
code served (permissive licence) · get_code("de40864022e3d0d0")
How it ran

no invocation recorded.

get_wikitext2 Not yet run
unverified (harvested, no recorded run)
abx393/llm-pruning-calibration-data/lib/data.py
code served (permissive licence) · get_code("8be36298f96f0805")
How it ran

no invocation recorded.

process_request Not yet run
unverified (harvested, no recorded run)
abx393/llm-pruning-calibration-data/lib/tasks/eval_harness.py
code served (permissive licence) · get_code("5d1116e05e5772c7")
How it ran

no invocation recorded.

Also present in other papers' code

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

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

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Network pruning has emerged as a potential solution to make LLMs cheaper to deploy. However, existing LLM pruning approaches universally rely on the C4 dataset as the calibration data for calculating pruning scores, leaving its optimality unexplored. In this study, we evaluate the choice of calibration data on LLM pruning, across a wide range of datasets that are most commonly used in LLM training and evaluation, including four pretraining datasets as well as three categories of downstream tasks encompassing nine datasets. Each downstream dataset is prompted with In-Context Learning (ICL) and Chain-of-Thought (CoT), respectively. Besides the already intriguing observation that the choice of calibration data significantly impacts the performance of pruned LLMs, our results also uncover several subtle and often unexpected findings, summarized as follows: (1) C4 is not the optimal choice for LLM pruning, even among commonly used pre-training datasets; (2) arithmetic datasets-when used as calibration data-performs on par or even better than pre-training datasets; (3) pruning with downstream datasets does not necessarily help the corresponding downstream task, compared to pre-training data; (4) ICL is widely beneficial to all data categories, whereas CoT is only useful on certain tasks. Our findings shed light on the importance of carefully selecting calibration data for LLM pruning and pave the way for more efficient deployment of these powerful models in real-world applications. We release our code at: https://github.com/abx393/ llm-pruning-calibration-data.

For agents

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

get_harvested_code_for_paper("2410.07461")
get_code_for_paper("2410.07461")
have("2410.07461")

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

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

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

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

Connect an agent — have() is free.