SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · aaai_28960 · AAAI · 2024

Fluctuation-Based Adaptive Structured Pruning for Large Language Models

Tao Yu, Ming Tang, Jinqiao Wang, Yongqi An, Xu Zhao

Open in the Atlas

Code that ran

4 of 8 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; 3 failures of our instrument; 4 no recorded run), measured 2026-11-22; 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/aaai_28960.json · badge: /api/ran/aaai_28960.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
CASIA-IVA-Lab/FLAP canonical (classifier label)
classifier basis: census
4 ran · 4 no recorded run
FunctionStatusWhere it lives
apply_rotary_pos_emb Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
CASIA-IVA-Lab/FLAP/models/hf_llama/modeling_llama.py
code served (permissive licence) · get_code("9b4dff79d5e6102c")
How it ran

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

import torch

torch.manual_seed(0)

# Analyze the function to understand tensor shapes:
# q, k: used in element-wise operations with cos, sin
# cos, sin: gathered using position_ids, shape [batch, heads, seq_len, dim]
# position_ids: shape [batch, seq_len], used to gather from cos/sin at dim 2

batch_size = 2
num_heads = 3
seq_len = 4
head_dim = 4

# q and k: [batch, heads, seq_len, head_dim]
q = torch.randn(batch_size, num_heads, seq_len, head_dim)
k = torch.randn(batch_size, num_heads, seq_len, head_dim)

# cos and sin: [1, heads, seq_len, head_dim] (will be repeated to batch_size)
cos = torch.randn(1, num_heads, seq_len, head_dim)
sin = torch.randn(1, num_heads, seq_len, head_dim)

# position_ids: [batch, seq_len] with values in range [0, seq_len)
position_ids = torch.tensor([
    [0, 1, 2, 3],
    [0, 1, 2, 3]
], dtype=torch.long)

ARGS = {
    "q": q,
    "k": k,
    "cos": cos,
    "sin": sin,
    "position_ids": position_ids,
}
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 tuple, ndim 5, 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
check_sparsity Ran
ran, honoured the contract we drafted
CASIA-IVA-Lab/FLAP/lib/prune.py
code served (permissive licence) · get_code("d7befe8027d275aa")
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 config class with required attributes
class MinimalConfig:
    def __init__(self):
        self.use_cache = False
        self.intermediate_size = 8
        self.hidden_size = 4

# Create minimal layer structure
class MinimalAttention(nn.Module):
    def __init__(self, hidden_size):
        super().__init__()
        self.self_attn = nn.Linear(hidden_size, hidden_size)
    
    def forward(self, x):
        return self.self_attn(x)

class MinimalLayer(nn.Module):
    def __init__(self, hidden_size, intermediate_size):
        super().__init__()
        self.self_attn_layer = MinimalAttention(hidden_size)
        self.mlp_dense = nn.Linear(hidden_size, intermediate_size)
    
    def forward(self, x):
        return self.mlp_dense(self.self_attn_layer(x))

class MinimalModel(nn.Module):
    def __init__(self, num_layers=2, hidden_size=4, intermediate_size=8):
        super().__init__()
        self.config = MinimalConfig()
        self.config.hidden_size = hidden_size
        self.config.intermediate_size = intermediate_size
        
        # Create model.layers attribute as expected
        self.model = nn.Module()
        layers_list = nn.ModuleList([
            MinimalLayer(hidden_size, intermediate_size)
            for _ in range(num_layers)
        ])
        self.model.layers = layers_list
    
    def forward(self, x):
        for layer in self.model.layers:
            x = layer(x)
        return x

# Instantiate the model
model = MinimalModel(num_layers=2, hidden_size=4, intermediate_size=8)

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
CASIA-IVA-Lab/FLAP/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.

rotate_half Ran
ran; our contract draft was wrong, not the code
CASIA-IVA-Lab/FLAP/models/hf_llama/modeling_llama.py
code served (permissive licence) · get_code("b99eea6376d1e212")
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 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)

# The function rotate_half takes a single parameter 'x' which is a tensor
# It accesses x.shape[-1] to get the last dimension
# It uses indexing with [..., :] slicing notation
# It calls torch.cat() to concatenate tensors

# Create a small tensor with shape (2, 4) - batch size 2, hidden dim 4
x = torch.randn(2, 4)

ARGS = {
    "x": x
}
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 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
get_c4 Not yet run
unverified (harvested, no recorded run)
CASIA-IVA-Lab/FLAP/lib/data.py
code served (permissive licence) · get_code("6ccf0fe3fd4574d5")
How it ran

no invocation recorded.

get_ptb Not yet run
unverified (harvested, no recorded run)
CASIA-IVA-Lab/FLAP/lib/data.py
code served (permissive licence) · get_code("1d035152616b1d19")
How it ran

no invocation recorded.

get_wikitext2 Not yet run
unverified (harvested, no recorded run)
CASIA-IVA-Lab/FLAP/lib/data.py
code served (permissive licence) · get_code("2d79e7ef9f571f3d")
How it ran

no invocation recorded.

prepare_calibration_input Not yet run
unverified (harvested, no recorded run)
CASIA-IVA-Lab/FLAP/lib/prune.py
code served (permissive licence) · get_code("2519b3efd481ad47")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 8 are also present in other papers whose code we hold (8 with at least one paper dated earlier, 0 the same month, 7 later) and 0 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
rotate_half 360 other papers
58 dated earlier, 124 later, 175 same year, order not determinable, 3 undated · 30 only as an assembly brick
1901.02860 (2019-01)
Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context
2203.08913 (2022-03)
Memorizing Transformers
2302.13971 (2023-02)
LLaMA: Open and Efficient Foundation Language Models
and 357 more not named here
apply_rotary_pos_emb 47 other papers
25 dated earlier, 4 later, 18 same year, order not determinable
2305.14167 (2023-05)
DetGPT: Detect What You Need via Reasoning
2305.16103 (2023-05)
ChatBridge: Bridging Modalities with Large Language Model as a Language Catalyst
2305.16355 (2023-05)
PandaGPT: One Model To Instruction-Follow Them All
and 44 more not named here
find_layers 21 other papers
5 dated earlier, 7 later, 9 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_wikitext2 15 other papers
5 dated earlier, 2 later, 8 same year, order not determinable · 1 only as an assembly brick
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 12 more not named here
get_c4 10 other papers
4 dated earlier, 1 later, 5 same year, order not determinable · 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
2310.08915 (2023-10)
Dynamic Sparse No Training: Training-Free Fine-tuning for Sparse LLMs
and 7 more not named here
prepare_calibration_input 3 other papers
1 dated earlier, 2 later
2312.11983 (2023-12)
Fluctuation-based Adaptive Structured Pruning for Large Language Models
2506.09351 (2025-06)
DIVE into MoE: Diversity-Enhanced Reconstruction of Large Language Models from Dense into Mixture-of-Experts
2601.06787 (2026-01)
Garbage Attention in Large Language Models: <BOS> Sink Heads and Sink-aware Pruning
get_ptb 2 other papers
1 dated earlier, 1 later
2312.11983 (2023-12)
Fluctuation-based Adaptive Structured Pruning for Large Language Models
2601.06787 (2026-01)
Garbage Attention in Large Language Models: <BOS> Sink Heads and Sink-aware Pruning
check_sparsity 1 other paper
1 dated earlier
2312.11983 (2023-12)
Fluctuation-based Adaptive Structured Pruning for 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-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 is a promising way to address the huge computing resource demands of the deployment and inference of Large Language Models (LLMs). Retraining-free is important for LLMs' pruning methods. However, almost all of the existing retraining-free pruning approaches for LLMs focus on unstructured pruning, which requires specific hardware support for acceleration. In this paper, we propose a novel retraining-free structured pruning framework for LLMs, named FLAP (FLuctuation-based Adaptive Structured Pruning). It is hardware-friendly by effectively reducing storage and enhancing inference speed. For effective structured pruning of LLMs, we highlight three critical elements that demand the utmost attention: formulating structured importance metrics, adaptively searching the global compressed model, and implementing compensation mechanisms to mitigate performance loss. First, FLAP determines whether the output feature map is easily recoverable when a column of weight is removed, based on the fluctuation pruning metric. Then it standardizes the importance scores to adaptively determine the global compressed model structure. At last, FLAP adds additional bias terms to recover the output feature maps using the baseline values. We thoroughly evaluate our approach on a variety of language benchmarks. Without any retraining, our method significantly outperforms the state-of-the-art methods, including LLM-Pruner and the extension of Wanda in structured pruning. The code is released at https://github.com/CASIA-IVA-Lab/FLAP.

For agents

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

get_harvested_code_for_paper("aaai_28960")
get_code_for_paper("aaai_28960")
have("aaai_28960")

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

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

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

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

Connect an agent — have() is free.