SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2502.14910 · 2025

EvoP: Robust LLM Inference via Evolutionary Pruning

Shangyu Wu, Ying Xiong, Tei-Wei Kuo, Nan Guan, Chun Xue, Shuai Chen, Hongchao Du

arXiv · PDF · Open in the Atlas

Code that ran

7 of 12 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; 0 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 3 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/2502.14910.json · badge: /api/ran/2502.14910.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
luffy06/EvoP canonical (classifier label)
classifier basis not recorded on the link
7 ran · 5 no recorded run
FunctionStatusWhere it lives
block_remove Ran
ran; our contract draft was wrong, not the code
luffy06/EvoP/src/utils/block_remove.py
code served (permissive licence) · get_code("b8240cc6abfde326")
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 OptWrapper. 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 minimal OPT-style model
class OptAttention(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def forward(self, x):
        return self.linear(x)

class OptDecoderLayer(nn.Module):
    def __init__(self):
        super().__init__()
        self.self_attn = OptAttention()
        self.fc1 = nn.Linear(4, 4)
    
    def forward(self, x):
        return self.fc1(x)

class OptDecoder(nn.Module):
    def __init__(self):
        super().__init__()
        self.layers = nn.ModuleList([OptDecoderLayer() for _ in range(5)])
    
    def forward(self, x):
        return x

class OptModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.decoder = OptDecoder()
    
    def forward(self, x):
        return x

class OptWrapper(nn.Module):
    def __init__(self):
        super().__init__()
        self.model = OptModel()
        self.name = "opt-125m"
    
    def forward(self, x):
        return self.model(x)

# Build a minimal LLaMA-style model
class LlamaAttention(nn.Module):
    def __init__(self, layer_idx):
        super().__init__()
        self.linear = nn.Linear(4, 4)
        self.layer_idx = layer_idx
    
    def forward(self, x):
        return self.linear(x)

class LlamaDecoderLayer(nn.Module):
    def __init__(self, layer_idx):
        super().__init__()
        self.self_attn = LlamaAttention(layer_idx)
        self.mlp = nn.Linear(4, 4)
    
    def forward(self, x):
        return self.mlp(x)

class LlamaModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.layers = nn.ModuleList([LlamaDecoderLayer(i) for i in range(5)])
    
    def forward(self, x):
        return x

class LlamaWrapper(nn.Module):
    def __init__(self):
        super().__init__()
        self.model = LlamaModel()
        self.name = "llama-7b"
    
    def forward(self, x):
        return self.model(x)

# Create test instances
opt_model = OptWrapper()
llama_model = LlamaWrapper()

# Test kill_list with indices to remove (sorted order will be enforced by function)
kill_list_opt = [1, 3]
kill_list_llama = [2, 4]

ARGS = {
    "model": opt_model,
    "kill_list": kill_list_opt.copy()
}
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 OptWrapper — a OptWrapper output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OptWrapper 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
block_remove_llama Ran
ran; our contract draft was wrong, not the code
luffy06/EvoP/src/utils/block_remove.py
code served (permissive licence) · get_code("7a2e338ff7fb21b0")
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 LlamaForCausalLM. 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)

class SelfAttention(nn.Module):
    def __init__(self, layer_idx):
        super().__init__()
        self.layer_idx = layer_idx

class TransformerLayer(nn.Module):
    def __init__(self, layer_idx):
        super().__init__()
        self.self_attn = SelfAttention(layer_idx)

class LlamaModel(nn.Module):
    def __init__(self, num_layers):
        super().__init__()
        self.layers = nn.ModuleList([
            TransformerLayer(i) for i in range(num_layers)
        ])

class LlamaForCausalLM(nn.Module):
    def __init__(self, num_layers):
        super().__init__()
        self.model = LlamaModel(num_layers)

model = LlamaForCausalLM(num_layers=5)
kill_list = [1, 3]

ARGS = {
    "model": model,
    "kill_list": kill_list,
}
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 LlamaForCausalLM — a LlamaForCausalLM output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a LlamaForCausalLM 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
block_remove_opt Ran
ran; our contract draft was wrong, not the code
luffy06/EvoP/src/utils/block_remove.py
code served (permissive licence) · get_code("62cb0034e375daea")
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 ModelWrapper. 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 minimal model with the structure the function expects
class MinimalDecoder(nn.Module):
    def __init__(self, num_layers=5):
        super().__init__()
        self.layers = nn.ModuleList([
            nn.Linear(4, 4) for _ in range(num_layers)
        ])

class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.decoder = MinimalDecoder(num_layers=5)

class ModelWrapper(nn.Module):
    def __init__(self):
        super().__init__()
        self.model = MinimalModel()

# Create the model
model = ModelWrapper()

# Create a kill_list with indices to remove (sorted)
kill_list = [1, 3]

ARGS = {
    "model": model,
    "kill_list": kill_list,
}
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 ModelWrapper — a ModelWrapper output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ModelWrapper 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
chunk_by_sentence Ran
ran on a synthesized input
luffy06/EvoP/src/utils/data_utils.py
code served (permissive licence) · get_code("7a7cffdb95ebcb0d")
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 list, ndim 1, 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)

# Analyzing the function:
# - document: iterated over with enumerate, items checked with endswith() and compared to strings
#   This is a list/sequence of strings (words/characters)
# - nsentences: int, used in range() for merging
# - end_words: list of strings, used in any() with endswith() check

# Create a simple document as a list of words/tokens
document = [
    "Hello",
    "world",
    "This",
    "is",
    "a",
    "test.",
    " ",
    "Another",
    "sentence!",
    " ",
    "Final",
    "one."
]

nsentences = 1

end_words = ['.', '!']

ARGS = {
    'document': document,
    'nsentences': nsentences,
    'end_words': end_words
}
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 list, ndim 1, dtype family float — a list 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
compute_lm_loss Ran
ran on a synthesized input
luffy06/EvoP/src/skip/skip_ideal.py
code served (permissive licence) · get_code("bf9fab2fb238b6ab")
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 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

torch.manual_seed(0)

# Analyze the function:
# - lm_logits: accessed with [:, :-1, :] and .size(-1), so shape (batch, seq, vocab)
# - input_ids: accessed with [:, 1:], so shape (batch, seq)
# - max_model_seq_length: scalar, used in multiplication
# - batch_size: scalar, used in multiplication

batch_size = 2
seq_length = 5
vocab_size = 4

# lm_logits: (batch_size, seq_length, vocab_size)
lm_logits = torch.randn(batch_size, seq_length, vocab_size)

# input_ids: (batch_size, seq_length) with values in range [0, vocab_size)
input_ids = torch.randint(0, vocab_size, (batch_size, seq_length))

max_model_seq_length = 10

ARGS = {
    "lm_logits": lm_logits,
    "input_ids": input_ids,
    "max_model_seq_length": max_model_seq_length,
    "batch_size": batch_size,
}
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 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
compute_loss Ran
ran on a synthesized input
luffy06/EvoP/src/utils/eval_utils.py
code served (permissive licence) · get_code("fe39fa61a150100a")
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)

# Build a minimal model that satisfies the function's requirements
class MinimalModel(nn.Module):
    def __init__(self, vocab_size=50, hidden_size=4, seqlen=8):
        super().__init__()
        self.vocab_size = vocab_size
        self.hidden_size = hidden_size
        self.seqlen = seqlen
        self.device = torch.device('cpu')
        self.embedding = nn.Embedding(vocab_size, hidden_size)
        self.lm_head = nn.Linear(hidden_size, vocab_size)
        self._skip_layers = []
    
    def set_skip_layers(self, skip_layers):
        self._skip_layers = skip_layers
    
    def forward(self, input_ids):
        # input_ids shape: (batch_size, seq_len)
        batch_size, seq_len = input_ids.shape
        
        # Simple embedding + linear projection to logits
        embeddings = self.embedding(input_ids)  # (batch_size, seq_len, hidden_size)
        logits = self.lm_head(embeddings)  # (batch_size, seq_len, vocab_size)
        
        # Return object with logits attribute
        class ModelOutput:
            pass
        
        output = ModelOutput()
        output.logits = logits
        return output

# Create model instance
model = MinimalModel(vocab_size=50, hidden_size=4, seqlen=8)

# Create training data: list of input_ids tensors
# Each tensor will be reshaped to (1, -1) in the function
train_ids = [
    torch.randint(0, 50, (7,)),  # Sequence of 7 tokens
    torch.randint(0, 50, (6,)),  # Sequence of 6 tokens
]

# Create skip_layers parameter
skip_layers = []

# Create nrm_blocks parameter (appears to be unused in the function)
nrm_blocks = None

ARGS = {
    'skip_layers': skip_layers,
    'model': model,
    'train_ids': train_ids,
    'nrm_blocks': nrm_blocks,
}
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
compute_similarity Ran
ran on a synthesized input
luffy06/EvoP/src/skip/skip_ideal.py
code served (permissive licence) · get_code("9e8641dfe947d7fd")
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 3, dtype family float, shape (2, 3, 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 small tensors with distinct dimensions
# a and b must have matching shape[-2] (sequence length dimension)
# Format: (batch, num_heads, seq_len, hidden_dim)
batch_size = 2
num_heads = 3
seq_len = 4
hidden_dim = 5

a = torch.randn(batch_size, num_heads, seq_len, hidden_dim)
b = torch.randn(batch_size, num_heads, seq_len, hidden_dim)

ARGS = {
    "a": a,
    "b": b,
    "cross_tokens": 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 3, dtype family float, shape (2, 3, 4) — shape (2, 3, 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
compute_sparsity Not yet run
unverified (harvested, no recorded run)
luffy06/EvoP/src/utils/eval_utils.py
code served (permissive licence) · get_code("348c5f8adfcbcdb9")
How it ran

no invocation recorded.

get_tokenizer Not yet run
unverified (harvested, no recorded run)
luffy06/EvoP/src/utils/data_utils.py
code served (permissive licence) · get_code("729f957048af4a3f")
How it ran

no invocation recorded.

get_wikitext2 Not yet run
unverified (harvested, no recorded run)
luffy06/EvoP/src/utils/data_utils.py
code served (permissive licence) · get_code("a9e74891f2269718")
How it ran

no invocation recorded.

get_wikitext_enc Not yet run
unverified (harvested, no recorded run)
luffy06/EvoP/src/skip/skip_ideal.py
code served (permissive licence) · get_code("125421f27d2202af")
How it ran

no invocation recorded.

run_in_beam_search Not yet run
unverified (harvested, no recorded run)
luffy06/EvoP/src/skip/algorithms.py
code served (permissive licence) · get_code("f7ecb79a32d40d08")
How it ran

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, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 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
get_tokenizer 6 other papers
4 dated earlier, 1 later, 1 same year, order not determinable
2310.00034 (2023-10)
PB-LLM: Partially Binarized Large Language Models
2402.04291 (2024-02)
BiLLM: Pushing the Limit of Post-Training Quantization for LLMs
2402.17946 (2024-02)
SparseLLM: Towards Global Pruning of Pre-trained Language Models
and 3 more not named here
block_remove 1 other paper
1 dated earlier
2402.09025 (2024-02)
SLEB: Streamlining LLMs through Redundancy Verification and Elimination of Transformer Blocks
block_remove_llama 1 other paper
1 dated earlier
2402.09025 (2024-02)
SLEB: Streamlining LLMs through Redundancy Verification and Elimination of Transformer Blocks
block_remove_opt 1 other paper
1 dated earlier
2402.09025 (2024-02)
SLEB: Streamlining LLMs through Redundancy Verification and Elimination of Transformer Blocks

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

Large Language Models (LLMs) have achieved remarkable success in natural language processing tasks, but their massive size and computational demands hinder their deployment in resource-constrained environments. Existing model pruning methods address this issue by removing redundant structures (e.g., elements, channels, layers) from the model. However, these methods employ a heuristic pruning strategy, which leads to suboptimal performance. Besides, they also ignore the data characteristics when pruning the model. To overcome these limitations, we propose EvoP, an evolutionary pruning framework for robust LLM inference. EvoP first presents a cluster-based calibration dataset sampling (CCDS) strategy for creating a more diverse calibration dataset. EvoP then introduces an evolutionary pruning pattern searching (EPPS) method to find the optimal pruning pattern. Compared to existing model pruning techniques, EvoP achieves the best performance while maintaining the best efficiency. Experiments across different LLMs and different downstream tasks validate the effectiveness of the proposed EvoP, making it a practical and scalable solution for deploying LLMs in real-world applications.

For agents

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

get_harvested_code_for_paper("2502.14910")
get_code_for_paper("2502.14910")
have("2502.14910")

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

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

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

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

Connect an agent — have() is free.