SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.12837 · ICML · 2024

LayerMerge: Neural Network Depth Compression through Layer Pruning and Merging

Hyun Song, Jinuk Kim, Marwa Halabi, Mingi Ji

arXiv · PDF · Open in the Atlas

Code that ran

17 of 23 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; 3 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 14 failures of our instrument; 6 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/2406.12837.json · badge: /api/ran/2406.12837.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
snu-mllab/LayerMerge canonical (classifier label)
classifier basis: census
11 ran · 6 no recorded run
snu-mllab/layermerge community
Papers with Code archive
6 ran · 0 no recorded run
FunctionStatusWhere it lives
accuracy Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
snu-mllab/LayerMerge/layer_merge/trainer.py
code served (permissive licence) · get_code("9230e14bc7473f01")
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)

# Small batch of logits/predictions: batch_size=2, num_classes=4
output = torch.randn(2, 4)

# Target class indices: batch_size=2
target = torch.tensor([1, 3])

# topk parameter for computing top-k accuracy
topk = (1, 2)

ARGS = {
    "output": output,
    "target": target,
    "topk": topk,
}
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
adjust_with_bn Ran
ran; our contract draft was wrong, not the code
snu-mllab/layermerge/layer_merge/models/merge_op.py
code served (permissive licence) · get_code("0aef496f982bd284")
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 small BatchNorm1d module
bn = nn.BatchNorm1d(num_features=4)

# Initialize its parameters to known values
bn.weight.data = torch.tensor([1.0, 1.5, 0.8, 1.2])
bn.bias.data = torch.tensor([0.1, 0.2, 0.3, 0.4])
bn.running_mean.data = torch.tensor([0.05, 0.1, 0.15, 0.2])
bn.running_var.data = torch.tensor([0.01, 0.02, 0.015, 0.025])

# Create conv_weight tensor with shape (4, 3) - 4 output channels, 3 input features
conv_weight = torch.randn(4, 3)

# Create bias tensor with shape (4,) - one bias per output channel
bias = torch.randn(4)

ARGS = {
    "conv_weight": conv_weight,
    "bias": bias,
    "bn": bn,
}
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
conv1x1 Ran
ran; our contract draft was wrong, not the code
snu-mllab/LayerMerge/HALP/models/resnet.py
code served (permissive licence) · get_code("d9def42110729a85")
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 Conv2d. 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)

# The function conv1x1 takes in_planes, out_planes, and stride as parameters
# It returns an nn.Conv2d layer configured for 1x1 convolution
# We need to provide valid integer arguments for these parameters

ARGS = {
    "in_planes": 3,
    "out_planes": 64,
    "stride": 1
}
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 Conv2d — a Conv2d output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Conv2d 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
conv3x3 Ran
ran; our contract draft was wrong, not the code
snu-mllab/LayerMerge/HALP/models/resnet.py
code served (permissive licence) · get_code("160bb14bd76201b4")
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 Conv2d. 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)

ARGS = {
    "in_planes": 3,
    "out_planes": 64,
    "stride": 1,
    "groups": 1,
    "dilation": 1,
}
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 Conv2d — a Conv2d output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Conv2d 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
conv_with_new Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
snu-mllab/layermerge/layer_merge/models/merge_op.py
code served (permissive licence) · get_code("7e877f94c66d280c")
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.functional as F
from einops import rearrange, repeat

torch.manual_seed(0)

# Create small tensors for the function parameters
# old_conv: tensor with shape (oup, inp, h, w)
old_conv = torch.randn(4, 3, 2, 2)  # 4 output channels, 3 input channels, 2x2 kernel

# old_bias: tensor with shape (oup,) for bias
old_bias = torch.randn(4)

# new_conv: tensor with shape (oup, inp, h, w) - used as weight in F.conv2d
new_conv = torch.randn(5, 4, 3, 3)  # 5 output channels, 4 input channels, 3x3 kernel

# stride: integer parameter
stride = 1

# padding: integer parameter
padding = 1

ARGS = {
    'old_conv': old_conv,
    'old_bias': old_bias,
    'new_conv': new_conv,
    'stride': stride,
    'padding': padding
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, 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
dict2namespace Ran
ran; our contract draft was wrong, not the code
snu-mllab/LayerMerge/Diff-Pruning/exp_code/finetune.py
pointer only (licence: MIT); the stored copy get_code serves, from leaveslei/obd, is pointer only (licence: NONE) · get_code("bd1f17e427bf51a5")
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 leaveslei/obd, 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.

get_beta_schedule Ran
ran, honoured the contract we drafted
snu-mllab/LayerMerge/layer_merge/ddpm_trainer.py
pointer only (licence: MIT); the stored copy get_code serves, from weizhigao/modiff, is pointer only (licence: NONE) · get_code("ca0cea1ca1eeec89")
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 weizhigao/modiff, 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.

merge_or_new Ran
ran; our contract draft was wrong, not the code
snu-mllab/layermerge/layer_merge/models/merge_op.py
code served (permissive licence) · get_code("b698fd9df5f648a6")
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
import torch.nn.functional as F
from einops import rearrange, repeat

torch.manual_seed(0)

# Create a small Conv2d layer
conv = nn.Conv2d(in_channels=3, out_channels=4, kernel_size=3, stride=1, padding=1, bias=True)

# Create a BatchNorm2d layer
bn = nn.BatchNorm2d(4)

# Create a small Conv2d layer for the merged case
conv2 = nn.Conv2d(in_channels=4, out_channels=5, kernel_size=3, stride=1, padding=1, bias=True)
bn2 = nn.BatchNorm2d(5)

# Create m_layers list (list of (conv, bn) tuples)
m_layers = [(conv, bn), (conv2, bn2)]

# Create weights tuple: (isize, m_cw, m_p, m_b)
# isize: input size
# m_cw: merged conv weight
# m_p: merged padding
# m_b: merged bias
isize = 32
m_cw = torch.randn(4, 3, 3, 3)  # output_channels=4, input_channels=3, kernel=3x3
m_p = 1
m_b = torch.zeros(4)
weights = (isize, m_cw, m_p, m_b)

# Create cparam tuple: (ctype, cstr)
ctype = 'cw'  # convolution type
cstr = 1      # stride
cparam = (ctype, cstr)

# Create lyrs tuple: (conv, bn)
lyrs = (conv2, bn2)

# pos and merged parameters
pos = 0
merged = True

ARGS = {
    'm_layers': m_layers,
    'pos': pos,
    'weights': weights,
    'lyrs': lyrs,
    'merged': merged,
    'cparam': cparam,
    'pop_k': 2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, 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
natural_key Ran
ran; our contract draft was wrong, not the code
snu-mllab/LayerMerge/layer_merge/aggregate_imp.py
code served (permissive licence) · get_code("c5f7f81b1ed8389e")
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 re

def natural_key(string_):
    return [int(s) if s.isdigit() else s for s in re.split('(\\d+)', string_)]

ARGS = {
    'string_': 'file_123_name_456.txt'
}
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 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
noise_estimation_loss Ran
ran; our contract draft was wrong, not the code
snu-mllab/LayerMerge/layer_merge/ddpm_trainer.py
code served (permissive licence) · get_code("36a45cceb1209d2f")
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
import torch.nn as nn

torch.manual_seed(0)

# Define a simple model that takes (x, t) and outputs noise prediction
class NoisePredictor(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def forward(self, x, t):
        # x shape: (batch, channels, height, width) = (2, 1, 1, 4)
        # t shape: (batch,) converted to float
        # output should match x shape
        batch_size = x.shape[0]
        x_flat = x.view(batch_size, -1)
        # t is (batch,), expand it to match
        t_expanded = t.unsqueeze(1)  # (batch, 1)
        combined = x_flat + t_expanded  # simple combination
        output = self.linear(combined)
        return output.view(batch_size, 1, 1, 4)

model = NoisePredictor()

# x0: original clean image, shape (batch=2, channels=1, height=1, width=4)
x0 = torch.randn(2, 1, 1, 4)

# t: timesteps, shape (batch=2,)
t = torch.LongTensor([0, 5])

# e: noise, same shape as x0
e = torch.randn(2, 1, 1, 4)

# b: betas (noise schedule), shape (num_timesteps,) - needs at least 6 elements for index 5
b = torch.linspace(0.0001, 0.02, 10)

ARGS = {
    "model": model,
    "x0": x0,
    "t": t,
    "e": e,
    "b": b,
    "keepdim": 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 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
unroll_bias_params Ran
ran, honoured the contract we drafted
snu-mllab/LayerMerge/Efficient-CNN-Depth-Compression/models/model_op.py
code served (permissive licence) · get_code("da634e83bc73dbc2")
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 (4, 3) 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)

class BiasModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.weight = nn.Parameter(torch.randn(4, 3))

bias = BiasModule()

ARGS = {
    "bias": bias
}
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 (4, 3) — shape (4, 3) 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
unroll_bn_params Ran
ran, honoured the contract we drafted
snu-mllab/layermerge/layer_merge/models/merge_op.py
code served (permissive licence) · get_code("afce56cbc2fd5872")
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, ndim 2, 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
import torch.nn as nn

torch.manual_seed(0)

# Create a BatchNorm1d module with 4 features
bn = nn.BatchNorm1d(num_features=4)

# Initialize the parameters with some values
bn.weight.data = torch.tensor([1.0, 1.5, 2.0, 0.5])
bn.bias.data = torch.tensor([0.1, 0.2, 0.3, 0.4])
bn.running_mean.data = torch.tensor([0.05, 0.1, 0.15, 0.2])
bn.running_var.data = torch.tensor([0.25, 0.3, 0.35, 0.4])

ARGS = {
    "bn": bn
}
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, ndim 2, 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
unroll_conv_params Ran
ran; our contract draft was wrong, not the code
snu-mllab/layermerge/layer_merge/models/merge_op.py
code served (permissive licence) · get_code("766adfb76c25bc6b")
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
from einops import rearrange, repeat

torch.manual_seed(0)

# Create a minimal Conv2d module
conv = nn.Conv2d(in_channels=3, out_channels=4, kernel_size=2)

# Test case 1: dw=False (default)
ARGS = {
    "conv": conv,
    "dw": False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, 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
unroll_conv_params Ran
ran; our contract draft was wrong, not the code
snu-mllab/LayerMerge/Efficient-CNN-Depth-Compression/models/model_op.py
code served (permissive licence) · get_code("b05267fb07337f46")
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
from einops import rearrange, repeat

torch.manual_seed(0)

# Create a simple Conv2d module
conv = nn.Conv2d(in_channels=3, out_channels=4, kernel_size=3, padding=1, bias=True)

# Test case 1: dw=False (standard convolution)
ARGS = {
    "conv": conv,
    "dw": False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, 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
unroll_merged Ran
ran; our contract draft was wrong, not the code
snu-mllab/LayerMerge/layer_merge/measure.py
code served (permissive licence) · get_code("85ac542b88d8f697")
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 Sequential. 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)

# The function iterates over module.m_features and module.classifier
# So we need a module with these two attributes
class MockModule(nn.Module):
    def __init__(self):
        super().__init__()
        # m_features should be iterable of nn.Module blocks
        self.m_features = nn.ModuleList([
            nn.Conv2d(3, 16, kernel_size=3),
            nn.ReLU(),
            nn.Conv2d(16, 32, kernel_size=3)
        ])
        # classifier should be iterable of nn.Module blocks
        self.classifier = nn.ModuleList([
            nn.Linear(32, 64),
            nn.ReLU(),
            nn.Linear(64, 10)
        ])

module = MockModule()

ARGS = {
    'module': module
}
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 Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 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
unroll_merged_vgg Ran
ran; our contract draft was wrong, not the code
snu-mllab/LayerMerge/layer_merge/measure.py
code served (permissive licence) · get_code("1084591b0a6b8b62")
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 Sequential. 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 MockVGG(nn.Module):
    def __init__(self):
        super().__init__()
        self.m_features = nn.Sequential(
            nn.Conv2d(3, 8, kernel_size=3, padding=1),
            nn.ReLU(inplace=True),
            nn.Conv2d(8, 16, kernel_size=3, padding=1),
            nn.ReLU(inplace=True)
        )
        self.classifier = nn.Sequential(
            nn.Linear(16 * 7 * 7, 64),
            nn.ReLU(inplace=True),
            nn.Linear(64, 10)
        )

module = MockVGG()

ARGS = {
    'module': module
}
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 Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 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
update_m_weights Ran
ran; our contract draft was wrong, not the code
snu-mllab/layermerge/layer_merge/models/merge_op.py
code served (permissive licence) · get_code("d55563e057db09b2")
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 small Conv2d layer
conv = nn.Conv2d(in_channels=3, out_channels=4, kernel_size=3, padding=1, stride=1, bias=True)

# Create a small BatchNorm2d layer
bn = nn.BatchNorm2d(num_features=4)

# Initialize bn with some reasonable values
bn.weight.data = torch.ones(4)
bn.bias.data = torch.zeros(4)
bn.running_mean.data = torch.zeros(4)
bn.running_var.data = torch.ones(4)

# Parameters for update_m_weights
isize = 8  # input spatial size
m_cw = torch.randn(4, 3, 3, 3)  # merged conv weight (out_channels, in_channels, h, w)
m_p = 0  # merged padding
m_b = torch.zeros(4)  # merged bias
merged = False  # whether weights are already merged

ARGS = {
    'isize': isize,
    'm_cw': m_cw,
    'm_p': m_p,
    'm_b': m_b,
    'conv': conv,
    'bn': bn,
    'merged': merged
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, 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
ResNet18 Not yet run
unverified (harvested, no recorded run)
snu-mllab/LayerMerge/HALP/models/resnet.py
code served (permissive licence) · get_code("7ca664ad5eb99003")
How it ran

no invocation recorded.

calculate_activation_statistics Not yet run
unverified (harvested, no recorded run)
snu-mllab/LayerMerge/Diff-Pruning/exp_code/fid_score.py
code served (permissive licence) · get_code("2e647db33e6bd721")
How it ran

no invocation recorded.

calculate_frechet_distance Not yet run
unverified (harvested, no recorded run)
snu-mllab/LayerMerge/Diff-Pruning/exp_code/fid_score.py
code served (permissive licence) · get_code("0def50a351111624")
How it ran

no invocation recorded. this sample carries JSON test cases instead of a setup block; get_reference_implementation serves them with the level they back.

get_activations Not yet run
unverified (harvested, no recorded run)
snu-mllab/LayerMerge/Diff-Pruning/exp_code/fid_score.py
code served (permissive licence) · get_code("1af4059005f8a78d")
How it ran

no invocation recorded.

get_time Not yet run
unverified (harvested, no recorded run)
snu-mllab/LayerMerge/layer_merge/measure.py
code served (permissive licence) · get_code("53138d8dfe29a2a5")
How it ran

no invocation recorded.

parse_args_and_config Not yet run
unverified (harvested, no recorded run)
snu-mllab/LayerMerge/Diff-Pruning/exp_code/finetune.py
code served (permissive licence) · get_code("ed8e294ff23d95ea")
How it ran

no invocation recorded.

Also present in other papers' code

Of 23 samples lifted from this paper's linked repositories, 23 carry a function identity and 0 do not. Of the 22 distinct functions with an identity, 7 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 5 the same month, 6 later) and 15 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
conv1x1 431 other papers
364 dated earlier, 4 the same month, 52 later, 10 same year, order not determinable, 1 undated · 38 only as an assembly brick
1409.1556 (2014-09)
Very Deep Convolutional Networks for Large-Scale Image Recognition
1506.01186 (2015-06)
Cyclical Learning Rates for Training Neural Networks
1507.05717 (2015-07)
An End-to-End Trainable Neural Network for Image-based Sequence Recognition and Its Application to Scene Text Recognition
and 428 more not named here
conv3x3 312 other papers
257 dated earlier, 3 the same month, 41 later, 10 same year, order not determinable, 1 undated · 31 only as an assembly brick
1409.1556 (2014-09)
Very Deep Convolutional Networks for Large-Scale Image Recognition
1507.05717 (2015-07)
An End-to-End Trainable Neural Network for Image-based Sequence Recognition and Its Application to Scene Text Recognition
1512.03385 (2015-12)
Deep Residual Learning for Image Recognition
and 309 more not named here
calculate_frechet_distance 74 other papers
61 dated earlier, 3 the same month, 9 later, 1 same year, order not determinable
1610.09585 (2016-10)
Conditional Image Synthesis With Auxiliary Classifier GANs
1706.08500 (2017-06)
GANs Trained by a Two Time-Scale Update Rule Converge to a Local Nash Equilibrium
1807.11458 (2018-07)
To learn image super-resolution, use a GAN to learn how to do image degradation first
and 71 more not named here
dict2namespace 28 other papers
15 dated earlier, 2 the same month, 10 later, 1 same year, order not determinable
1907.04809 (2019-07)
Variational Autoencoders and Nonlinear ICA: A Unifying Framework
1912.00589 (2019-12)
Flow Contrastive Estimation of Energy-Based Models
2002.11537 (2020-02)
ICE-BeeM: Identifiable Conditional Energy-Based Deep Models Based on Nonlinear ICA
and 25 more not named here
get_beta_schedule 25 other papers
14 dated earlier, 2 the same month, 9 later · 1 only as an assembly brick
2201.11760 (2022-01)
Unsupervised Denoising of Retinal OCT with Diffusion Probabilistic Model
2203.02923 (2022-03)
GeoDiff: a Geometric Diffusion Model for Molecular Conformation Generation
2206.02262 (2022-06)
Diffusion-GAN: Training GANs with Diffusion
and 22 more not named here
noise_estimation_loss 14 other papers
11 dated earlier, 2 later, 1 same year, order not determinable
2106.06819 (2021-06)
D2C: Diffusion-Denoising Models for Few-shot Conditional Generation
2206.02262 (2022-06)
Diffusion-GAN: Training GANs with Diffusion
2211.14680 (2022-11)
A Physics-informed Diffusion Model for High-fidelity Flow Field Reconstruction
and 11 more not named here
natural_key 2 other papers
2 dated earlier
2203.10977 (2022-03)
Improving anatomical plausibility in medical image segmentation via hybrid graph neural networks: applications to chest x-ray analysis
2303.08231 (2023-03)
Rotation-Invariant Transformer for Point Cloud Matching

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

Recent works show that reducing the number of layers in a convolutional neural network can enhance efficiency while maintaining the performance of the network. Existing depth compression methods remove redundant non-linear activation functions and merge the consecutive convolution layers into a single layer. However, these methods suffer from a critical drawback; the kernel size of the merged layers becomes larger, significantly undermining the latency reduction gained from reducing the depth of the network. We show that this problem can be addressed by jointly pruning convolution layers and activation functions. To this end, we propose LayerMerge, a novel depth compression method that selects which activation layers and convolution layers to remove, to achieve a desired inference speedup while minimizing performance loss. Since the corresponding selection problem involves an exponential search space, we formulate a novel surrogate optimization problem and efficiently solve it via dynamic programming. Empirical results demonstrate that our method consistently outperforms existing depth compression and layer pruning methods on various network architectures, both on image classification and generation tasks. We release the code at https:// github.com/snu-mllab/LayerMerge.

For agents

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

get_harvested_code_for_paper("2406.12837")
get_code_for_paper("2406.12837")
have("2406.12837")

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

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

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

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

Connect an agent — have() is free.