SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2204.00408 · ACL · 2022

Structured Pruning Learns Compact and Accurate Models

Danqi Chen, Zexuan Zhong, Mengzhou Xia

arXiv · PDF · Open in the Atlas

Code that ran

9 of 12 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (7 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 2 failures of our instrument; 3 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/2204.00408.json · badge: /api/ran/2204.00408.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
huawei-noah/Pretrained-Language-Model community
Papers with Code archive
8 ran · 2 no recorded run
princeton-nlp/cofipruning marked official in Papers with Code
Papers with Code archive
1 ran · 0 no recorded run
jongwooko/nash-pruning-official community
Papers with Code archive
0 ran · 1 no recorded run
FunctionStatusWhere it lives
L0Module Ran
ran on a synthesized input · constructed an object; no result was computed
princeton-nlp/cofipruning/models/l0_module.py
code served (permissive licence) · get_code("ef9ec1a11223fbd0")
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 an instance of its own class, L0Module: the run constructed the object and did not call it, so no result was computed. 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
from torch.nn.parameter import Parameter
import math

torch.manual_seed(0)

class MockConfig:
    def __init__(self):
        self.hidden_size = 16
        self.intermediate_size = 32
        self.num_attention_heads = 4
        self.num_hidden_layers = 2
        self.vocab_size = 256

config = MockConfig()

ARGS = {
    'config': config,
    'droprate_init': 0.5,
    'temperature': 2.0 / 3.0,
    'lagrangian_warmup': 0,
    'start_sparsity': 0.0,
    'target_sparsity': 0.0,
    'pruning_type': 'structured_heads+structured_mlp+hidden+layer',
    'magical_number': 0.8,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type L0Module — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a L0Module 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
SuperBertIntermediate Ran
ran on a synthesized input · constructed an object; no result was computed
huawei-noah/Pretrained-Language-Model/AutoTinyBERT/transformer/modeling_extractor.py
pointer only (licence: NONE) · get_code("f868beb1186a0be6")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, huawei-noah/Pretrained-Language-Model 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.

SuperBertLayerNorm Ran
ran on a synthesized input · constructed an object; no result was computed
huawei-noah/Pretrained-Language-Model/AutoTinyBERT/transformer/modeling_extractor.py
pointer only (licence: NONE) · get_code("a788435baa6f3652")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, huawei-noah/Pretrained-Language-Model 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.

SuperBertOutput Ran
ran on a synthesized input · constructed an object; no result was computed
huawei-noah/Pretrained-Language-Model/AutoTinyBERT/transformer/modeling_extractor.py
pointer only (licence: NONE) · get_code("42db1dab8b861073")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, huawei-noah/Pretrained-Language-Model 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.

SuperBertSelfAttention Ran
ran on a synthesized input · constructed an object; no result was computed
huawei-noah/Pretrained-Language-Model/AutoTinyBERT/transformer/modeling_extractor.py
pointer only (licence: NONE) · get_code("85b2789fba54e4c8")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, huawei-noah/Pretrained-Language-Model 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.

SuperBertSelfOutput Ran
ran on a synthesized input · constructed an object; no result was computed
huawei-noah/Pretrained-Language-Model/AutoTinyBERT/transformer/modeling_extractor.py
pointer only (licence: NONE) · get_code("47debaa2ae1929ad")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, huawei-noah/Pretrained-Language-Model 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.

SuperLinear Ran
ran on a synthesized input · constructed an object; no result was computed
huawei-noah/Pretrained-Language-Model/AutoTinyBERT/transformer/modeling_extractor.py
pointer only (licence: NONE) · get_code("f2877934d142e015")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, huawei-noah/Pretrained-Language-Model 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_bias Ran
ran; our contract draft was wrong, not the code
huawei-noah/Pretrained-Language-Model/AutoTinyBERT/transformer/modeling_extractor.py
pointer only (licence: NONE) · get_code("8f3031bdf0cdcbce")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, huawei-noah/Pretrained-Language-Model 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_weight Ran
ran; our contract draft was wrong, not the code
huawei-noah/Pretrained-Language-Model/AutoTinyBERT/transformer/modeling_extractor.py
pointer only (licence: NONE) · get_code("7ae41cd971c17070")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, huawei-noah/Pretrained-Language-Model 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.

L0Module Not yet run
unverified (harvested, no recorded run)
jongwooko/nash-pruning-official/models/l0_module.py
code served (permissive licence) · get_code("4609348007b5c7f7")
How it ran

no invocation recorded.

SuperBertAttention Not yet run
unverified (harvested, no recorded run)
huawei-noah/Pretrained-Language-Model/AutoTinyBERT/transformer/modeling_extractor.py
pointer only (licence: NONE) · get_code("0c8206b768637d45")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, huawei-noah/Pretrained-Language-Model 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.

SuperBertLayer Not yet run
unverified (harvested, no recorded run)
huawei-noah/Pretrained-Language-Model/AutoTinyBERT/transformer/modeling_extractor.py
pointer only (licence: NONE) · get_code("48eeeaddaa79fd07")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, huawei-noah/Pretrained-Language-Model 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.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 0 later) and 10 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
sample_bias
brick of this paper's assembly: helper
1 other paper
1 dated earlier · 1 only as an assembly brick
2101.08106 (2021-01)
Learning to Augment for Data-Scarce Domain BERT Knowledge Distillation
sample_weight
brick of this paper's assembly: helper
1 other paper
1 dated earlier · 1 only as an assembly brick
2101.08106 (2021-01)
Learning to Augment for Data-Scarce Domain BERT Knowledge Distillation

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

The growing size of neural language models has led to increased attention in model compression. The two predominant approaches are pruning, which gradually removes weights from a pre-trained model, and distillation, which trains a smaller compact model to match a larger one. Pruning methods can significantly reduce the model size but hardly achieve large speedups as distillation. However, distillation methods require large amounts of unlabeled data and are expensive to train. In this work, we propose a task-specific structured pruning method CoFi 1 (Coarse-and Fine-grained Pruning), which delivers highly parallelizable subnetworks and matches the distillation methods in both accuracy and latency, without resorting to any unlabeled data. Our key insight is to jointly prune coarse-grained (e.g., layers) and fine-grained (e.g., heads and hidden units) modules, which controls the pruning decision of each parameter with masks of different granularity. We also devise a layerwise distillation strategy to transfer knowledge from unpruned to pruned models during optimization. Our experiments on GLUE and SQuAD datasets show that CoFi yields models with over 10× speedups with a small accuracy drop, showing its effectiveness and efficiency compared to previous pruning and distillation approaches. 2

For agents

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

get_harvested_code_for_paper("2204.00408")
get_code_for_paper("2204.00408")
have("2204.00408")

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

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

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

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

Connect an agent — have() is free.