Papers › LayerMerge: Neural Network Depth Compression through Layer Pruning and Merging

LayerMerge: Neural Network Depth Compression through Layer Pruning and Merging

18 Jun 2024arXiv:2406.12837archive 2025-07-28

Jinuk Kim, Marwa El Halabi, Mingi Ji, Hyun Oh Song

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 speed-up 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.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2406.12837")

Code

Syntology Ran 17 of 23 code samples harvested from 1 repository linked to this paper; 6 have no recorded run. Of those that ran: 2 ran · honoured contract; 7 ran · our draft was wrong; 1 ran · fixture could not drive it; 7 ran with no contract checked.

By repository: official repository: 23 samples from 1 repository, 17 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

snu-mllab/layermerge officialmentioned in papermentioned on GitHubpytorchMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

23 samples harvested; 17 ran; 2 honoured the contract we drafted; 6 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

2ran · honoured contract
7ran · our draft was wrong
1ran · fixture could not drive it
7ran
6unverified

Licence: 0 of the 23 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from snu-mllab/LayerMerge. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

accuracy snu-mllab/LayerMerge/layer_merge/trainer.py official repository ran MIT (permissive) · 9230e14bc7473f01 · report
adjust_with_bn snu-mllab/layermerge/layer_merge/models/merge_op.py official repository ran · our draft was wrong MIT (permissive) · 0aef496f982bd284 · report
conv1x1 snu-mllab/LayerMerge/HALP/models/resnet.py official repository ran · our draft was wrong MIT (permissive) · d9def42110729a85 · report
conv3x3 snu-mllab/LayerMerge/HALP/models/resnet.py official repository ran · our draft was wrong MIT (permissive) · 160bb14bd76201b4 · report
conv_with_new snu-mllab/layermerge/layer_merge/models/merge_op.py official repository ran · fixture could not drive it fingerprinted MIT (permissive) · 7e877f94c66d280c · report
dict2namespace snu-mllab/LayerMerge/Diff-Pruning/exp_code/finetune.py official repository ran · our draft was wrong MIT (permissive) · bd1f17e427bf51a5 · report
get_beta_schedule snu-mllab/LayerMerge/layer_merge/ddpm_trainer.py official repository ran · honoured contract MIT (permissive) · ca0cea1ca1eeec89 · report
merge_or_new snu-mllab/layermerge/layer_merge/models/merge_op.py official repository ran · our draft was wrong MIT (permissive) · b698fd9df5f648a6 · report
natural_key snu-mllab/LayerMerge/layer_merge/aggregate_imp.py official repository ran fingerprinted MIT (permissive) · c5f7f81b1ed8389e · report
noise_estimation_loss snu-mllab/LayerMerge/layer_merge/ddpm_trainer.py official repository ran MIT (permissive) · 36a45cceb1209d2f · report
unroll_bias_params snu-mllab/LayerMerge/Efficient-CNN-Depth-Compression/models/model_op.py official repository ran MIT (permissive) · da634e83bc73dbc2 · report
unroll_bn_params snu-mllab/layermerge/layer_merge/models/merge_op.py official repository ran · honoured contract MIT (permissive) · afce56cbc2fd5872 · report
unroll_conv_params snu-mllab/layermerge/layer_merge/models/merge_op.py official repository ran · our draft was wrong MIT (permissive) · 766adfb76c25bc6b · report
unroll_conv_params snu-mllab/LayerMerge/Efficient-CNN-Depth-Compression/models/model_op.py official repository ran MIT (permissive) · b05267fb07337f46 · report
unroll_merged snu-mllab/LayerMerge/layer_merge/measure.py official repository ran MIT (permissive) · 85ac542b88d8f697 · report
unroll_merged_vgg snu-mllab/LayerMerge/layer_merge/measure.py official repository ran MIT (permissive) · 1084591b0a6b8b62 · report
update_m_weights snu-mllab/layermerge/layer_merge/models/merge_op.py official repository ran · our draft was wrong MIT (permissive) · d55563e057db09b2 · report
ResNet18 snu-mllab/LayerMerge/HALP/models/resnet.py official repository unverified MIT (permissive) · 7ca664ad5eb99003 · report
calculate_activation_statistics snu-mllab/LayerMerge/Diff-Pruning/exp_code/fid_score.py official repository unverified MIT (permissive) · 2e647db33e6bd721 · report
calculate_frechet_distance snu-mllab/LayerMerge/Diff-Pruning/exp_code/fid_score.py official repository unverified MIT (permissive) · 0def50a351111624 · report
get_activations snu-mllab/LayerMerge/Diff-Pruning/exp_code/fid_score.py official repository unverified MIT (permissive) · 1af4059005f8a78d · report
get_time snu-mllab/LayerMerge/layer_merge/measure.py official repository unverified MIT (permissive) · 53138d8dfe29a2a5 · report
parse_args_and_config snu-mllab/LayerMerge/Diff-Pruning/exp_code/finetune.py official repository unverified MIT (permissive) · ed8e294ff23d95ea · report

Tasks

Image Classificationimage-classification

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

ConvolutionPruning

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections