Papers › No Free Swap: Protocol-Dependent Layer Redundancy in Transformers

No Free Swap: Protocol-Dependent Layer Redundancy in Transformers

15 May 2026arXiv:2605.16234added by Syntology

Gabriel Garcia

Title, abstract, authors and date from arXiv's metadata (CC0); this paper is not in the Papers with Code archive (frozen 2025-07-28).

When researchers ask whether two transformer layers are "equivalent" for compression, they often conflate distinct tests. Replacement asks whether one layer's map can substitute for another's in place; interchange asks whether two layers approximately commute when their positions are swapped. Both are output-grounded swap-KL probes, but they need not agree: on pretrained transformers the protocol gap can change which layers look safe to prune by several-fold under the same evaluator, especially when replacement distances are high. We measure both protocols across checkpoints and architectures. On a Pythia training trajectory (410M and 1.4B), the replacement-interchange gap grows from initialization to convergence. Under one matched WikiText-2 contract at 8B scale, Qwen3-8B enters a divergent regime: interchange-guided removal is several-fold safer than replacement-guided at the same layer budgets, while Llama-3.1-8B ties the two protocols for pruning cost even though interchange KL is lower, showing metric gaps need not map one-to-one to removal. Before layer removal or merging, score both swap-KLs on the target checkpoint; the diagnostic requires only unlabeled forward passes.

PaperPDFCode Syntology ran

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

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

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 25 code samples harvested from 1 repository linked to this paper: 20 ran (of which 0 constructed an object rather than computing a result; 11 with no instrument failure: 6 honoured, 0 violated, 5 with no contract checked; 9 where Syntology's instrument failed) · 5 unverified. Where Syntology's instrument failed: 8 where our contract draft was wrong; 1 where the contract check could not run; failures of Syntology's instrument, not of the code.

By repository: found in paper text by Syntology: 25 samples from 1 repository, 20 ran (11 with no instrument failure; 9 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

Levels written on 2026-09-24 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed.

Gpgabriel25/ProtocolGapDiagnostic found in paper text by SyntologySyntology: 25 samples, 20 ran (9 instrument-failed) · 5 unverified report

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

25 samples harvested: 20 ran (of which 0 constructed an object rather than computing a result; 11 with no instrument failure: 6 honoured, 0 violated, 5 with no contract checked; 9 where Syntology's instrument failed) · 5 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page last changed ; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

6ran · honoured contract
8ran · our draft was wrong
1ran; the contract check could not run
5ran
5unverified

Licence: 25 of the 25 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 Gpgabriel25/ProtocolGapDiagnostic. “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. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (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 are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. 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 six 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; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. 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.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity. A census tag appears when Syntology's census ran implementations with that name on one shared input per bucket: it gives how many were compared, from how many papers, and how many distinct outputs they produced, and names this sample's bucket when this sample was one of them.

Gpgabriel25/ProtocolGapDiagnostic found in paper text by Syntology 25 samples, 20 ran (9 instrument-failed) · 5 unverified
compute_baseline_logits bisimulation_experiment.py ran · honoured contract licence not identified · pointer only · 1481a586c1407812 · report fixture: signature model:callable/0/?, tokenizer:callable/0/?, prompts:list/1/str · returned list · level recorded 2026-09-24
compute_bootstrap_kl bi_score_comparison.py ran licence not identified · pointer only · 075ab64edd069f3a · report fixture: signature checkpoint_path:str/0/str, n_bootstrap:int/0/int, seed:int/0/int · returned dict · level recorded 2026-09-24
extract_scores in 16 papers downstream_benchmark.py ran · our draft was wrong licence not identified · pointer only · 7f3fe518c40f3bd4 · report fixture: signature results:dict/0/? · returned dict · level recorded 2026-09-24
get_layer_removability compression_sweep.py ran · our draft was wrong licence not identified · pointer only · 243851cc0eee1821 · report fixture: signature kl_data:dict/0/? · returned dict · level recorded 2026-09-24
greedy_select bi_geometry_ablation.py ran licence not identified · pointer only · 881baeeeb30fce3e · report fixture: signature scores:ndarray/1/float, n:int/0/int, num_layers:int/0/int, min_gap:int/0/int, layer_range:range/0/? · returned list · level recorded 2026-09-24
greedy_select compression_sweep.py ran · honoured contract licence not identified · pointer only · e22e7062f481d4bf · report fixture: signature scores:dict/0/?, n:int/0/int, forbidden:set/0/? · returned list · level recorded 2026-09-24
greedy_select_bi bi_vs_bisim_headtohead.py ran · our draft was wrong licence not identified · pointer only · faf2e4d251cb99dc · report fixture: signature bi_scores:list/1/float, n:int/0/int, num_layers:int/0/int · returned list · level recorded 2026-09-24
greedy_select_bisim bi_vs_bisim_headtohead.py ran · our draft was wrong licence not identified · pointer only · 1bf31e23ad48679a · report fixture: signature removability:list/1/float, n:int/0/int, num_layers:int/0/int · returned list · level recorded 2026-09-24
kl_div_pair bisimulation_experiment.py ran · our draft was wrong fingerprinted licence not identified · pointer only · 67099f736d6c4a2d · report fixture: signature p_logits:Tensor/2/float, q_logits:Tensor/2/float · returned float · level recorded 2026-09-24
kl_div_pair bloom_1b1_bisimulation.py ran · our draft was wrong fingerprinted licence not identified · pointer only · 778da11f4d63fe5e · report fixture: signature p_logits:Tensor/2/float, q_logits:Tensor/2/float · returned float · level recorded 2026-09-24
mean_gap_from_pairs analyze_protocol_gap_trajectory.py ran · honoured contract licence not identified · pointer only · 9f98a4f0be012b90 · report fixture: signature r:dict/0/? · returned float · level recorded 2026-09-24
optimal_select bi_geometry_ablation.py ran licence not identified · pointer only · da52b8ac64ad243e · report fixture: signature scores:dict/0/?, n:int/0/int, num_layers:int/0/int, min_gap:int/0/int, layer_range:NoneType/0/? · returned list · level recorded 2026-09-24
pair_gap_values analyze_protocol_gap_trajectory.py ran · honoured contract licence not identified · pointer only · 89432512e6234a25 · report fixture: signature r:dict/0/? · returned list · level recorded 2026-09-24
precompute_rope clean_oracle_bootstrap_ci.py ran licence not identified · pointer only · 2c3e2520dd55d4d8 · report fixture: signature seq_len:int/0/int, head_dim:int/0/int, theta:float/0/float, dtype:callable/0/? · returned tuple · level recorded 2026-09-24
random_distributed bi_geometry_ablation.py ran licence not identified · pointer only · f494d32e3c07ef5d · report fixture: signature n:int/0/int, num_layers:int/0/int, min_gap:int/0/int, seed:int/0/int · returned list · level recorded 2026-09-24
remove_layer downstream_benchmark.py ran; the contract check could not run (RAISES) licence not identified · pointer only · 87427dce86265325 · report fixture: signature model:callable/0/?, layer_idx:int/0/int · returned GPT2LMHeadModel · level recorded 2026-09-24
remove_layers bi_vs_bisim_headtohead.py ran · our draft was wrong licence not identified · pointer only · f36f08ba54f97863 · report fixture: signature model:callable/0/?, remove_indices:list/1/int · returned MinimalModel · level recorded 2026-09-24
remove_layers compression_sweep.py ran · our draft was wrong licence not identified · pointer only · 1b33cd34b422c42e · report fixture: signature model:callable/0/?, layer_indices:list/1/int · returned MinimalGPT2 · level recorded 2026-09-24
rms_norm in 10 papers clean_oracle_bootstrap_ci.py ran · honoured contract licence not identified · pointer only · e87ac474b28d38ca · report fixture: signature x:ArrayImpl/2/float, w:ArrayImpl/1/float, eps:float/0/float · returned ArrayImpl · level recorded 2026-09-24
step_int analyze_protocol_gap_trajectory.py ran · honoured contract licence not identified · pointer only · 23bdae01f04f427b · report fixture: signature checkpoint:str/0/str · returned int · level recorded 2026-09-24
build_diverse_prompts bisimulation_experiment.py unverified licence not identified · pointer only · 9150ef273a402f9b · report
compute_bi_scores bi_score_comparison.py unverified licence not identified · pointer only · 03536c31aa1dc33a · report
generate_diverse_prompts bloom_bisimulation.py unverified licence not identified · pointer only · 50848c5d55e1afc9 · report
spearman in 12 papers d_repl_asymmetry.py unverified licence not identified · pointer only · 6edd1bd3fa3950dc · report

Results from the paper

The Papers with Code archive ends with its 2025-07-28 snapshot. This paper's arXiv identifier, 2605.16234, was issued in May 2026, after that date, so the archive has no leaderboard rows for it.

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