{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/arxiv-2605-16234","title":"No Free Swap: Protocol-Dependent Layer Redundancy in Transformers","arxiv_id":"2605.16234","date":"2026-05-15","proceeding":null,"authors":["Gabriel Garcia"],"abstract":"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.","url_abs":"https://arxiv.org/abs/2605.16234","url_pdf":"https://arxiv.org/pdf/2605.16234","source":{"archive":null,"snapshot":"2025-07-28","note":"not in the Papers with Code archive (frozen at the snapshot)","row_kind":"graph","title_abstract_authors_date":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)"},"code_links":[],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2605.16234","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2605.16234"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/Gpgabriel25/ProtocolGapDiagnostic","reach":null}],"summary":{"ran":20,"unverified":5},"by_repo_kind":{"found_in_text":{"samples":25,"ran":20,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"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"},"n_pointer_only_for_licence":25,"samples":[{"code_sha256_prefix":"1481a586c1407812","entry":"compute_baseline_logits","repo":"Gpgabriel25/ProtocolGapDiagnostic","repo_kind":"found_in_text","path":"bisimulation_experiment.py","file_url":"https://github.com/Gpgabriel25/ProtocolGapDiagnostic/blob/HEAD/bisimulation_experiment.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"1481a586c1407812"}},{"code_sha256_prefix":"075ab64edd069f3a","entry":"compute_bootstrap_kl","repo":"Gpgabriel25/ProtocolGapDiagnostic","repo_kind":"found_in_text","path":"bi_score_comparison.py","file_url":"https://github.com/Gpgabriel25/ProtocolGapDiagnostic/blob/HEAD/bi_score_comparison.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"075ab64edd069f3a"}},{"code_sha256_prefix":"7f3fe518c40f3bd4","entry":"extract_scores","repo":"Gpgabriel25/ProtocolGapDiagnostic","repo_kind":"found_in_text","path":"downstream_benchmark.py","file_url":"https://github.com/Gpgabriel25/ProtocolGapDiagnostic/blob/HEAD/downstream_benchmark.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"7f3fe518c40f3bd4"}},{"code_sha256_prefix":"243851cc0eee1821","entry":"get_layer_removability","repo":"Gpgabriel25/ProtocolGapDiagnostic","repo_kind":"found_in_text","path":"compression_sweep.py","file_url":"https://github.com/Gpgabriel25/ProtocolGapDiagnostic/blob/HEAD/compression_sweep.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"243851cc0eee1821"}},{"code_sha256_prefix":"881baeeeb30fce3e","entry":"greedy_select","repo":"Gpgabriel25/ProtocolGapDiagnostic","repo_kind":"found_in_text","path":"bi_geometry_ablation.py","file_url":"https://github.com/Gpgabriel25/ProtocolGapDiagnostic/blob/HEAD/bi_geometry_ablation.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"881baeeeb30fce3e"}},{"code_sha256_prefix":"e22e7062f481d4bf","entry":"greedy_select","repo":"Gpgabriel25/ProtocolGapDiagnostic","repo_kind":"found_in_text","path":"compression_sweep.py","file_url":"https://github.com/Gpgabriel25/ProtocolGapDiagnostic/blob/HEAD/compression_sweep.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"e22e7062f481d4bf"}},{"code_sha256_prefix":"faf2e4d251cb99dc","entry":"greedy_select_bi","repo":"Gpgabriel25/ProtocolGapDiagnostic","repo_kind":"found_in_text","path":"bi_vs_bisim_headtohead.py","file_url":"https://github.com/Gpgabriel25/ProtocolGapDiagnostic/blob/HEAD/bi_vs_bisim_headtohead.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"faf2e4d251cb99dc"}},{"code_sha256_prefix":"1bf31e23ad48679a","entry":"greedy_select_bisim","repo":"Gpgabriel25/ProtocolGapDiagnostic","repo_kind":"found_in_text","path":"bi_vs_bisim_headtohead.py","file_url":"https://github.com/Gpgabriel25/ProtocolGapDiagnostic/blob/HEAD/bi_vs_bisim_headtohead.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"1bf31e23ad48679a"}},{"code_sha256_prefix":"67099f736d6c4a2d","entry":"kl_div_pair","repo":"Gpgabriel25/ProtocolGapDiagnostic","repo_kind":"found_in_text","path":"bisimulation_experiment.py","file_url":"https://github.com/Gpgabriel25/ProtocolGapDiagnostic/blob/HEAD/bisimulation_experiment.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"67099f736d6c4a2d"}},{"code_sha256_prefix":"778da11f4d63fe5e","entry":"kl_div_pair","repo":"Gpgabriel25/ProtocolGapDiagnostic","repo_kind":"found_in_text","path":"bloom_1b1_bisimulation.py","file_url":"https://github.com/Gpgabriel25/ProtocolGapDiagnostic/blob/HEAD/bloom_1b1_bisimulation.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"778da11f4d63fe5e"}},{"code_sha256_prefix":"9f98a4f0be012b90","entry":"mean_gap_from_pairs","repo":"Gpgabriel25/ProtocolGapDiagnostic","repo_kind":"found_in_text","path":"analyze_protocol_gap_trajectory.py","file_url":"https://github.com/Gpgabriel25/ProtocolGapDiagnostic/blob/HEAD/analyze_protocol_gap_trajectory.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"9f98a4f0be012b90"}},{"code_sha256_prefix":"da52b8ac64ad243e","entry":"optimal_select","repo":"Gpgabriel25/ProtocolGapDiagnostic","repo_kind":"found_in_text","path":"bi_geometry_ablation.py","file_url":"https://github.com/Gpgabriel25/ProtocolGapDiagnostic/blob/HEAD/bi_geometry_ablation.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"da52b8ac64ad243e"}},{"code_sha256_prefix":"89432512e6234a25","entry":"pair_gap_values","repo":"Gpgabriel25/ProtocolGapDiagnostic","repo_kind":"found_in_text","path":"analyze_protocol_gap_trajectory.py","file_url":"https://github.com/Gpgabriel25/ProtocolGapDiagnostic/blob/HEAD/analyze_protocol_gap_trajectory.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"89432512e6234a25"}},{"code_sha256_prefix":"2c3e2520dd55d4d8","entry":"precompute_rope","repo":"Gpgabriel25/ProtocolGapDiagnostic","repo_kind":"found_in_text","path":"clean_oracle_bootstrap_ci.py","file_url":"https://github.com/Gpgabriel25/ProtocolGapDiagnostic/blob/HEAD/clean_oracle_bootstrap_ci.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"2c3e2520dd55d4d8"}},{"code_sha256_prefix":"f494d32e3c07ef5d","entry":"random_distributed","repo":"Gpgabriel25/ProtocolGapDiagnostic","repo_kind":"found_in_text","path":"bi_geometry_ablation.py","file_url":"https://github.com/Gpgabriel25/ProtocolGapDiagnostic/blob/HEAD/bi_geometry_ablation.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"f494d32e3c07ef5d"}},{"code_sha256_prefix":"87427dce86265325","entry":"remove_layer","repo":"Gpgabriel25/ProtocolGapDiagnostic","repo_kind":"found_in_text","path":"downstream_benchmark.py","file_url":"https://github.com/Gpgabriel25/ProtocolGapDiagnostic/blob/HEAD/downstream_benchmark.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"87427dce86265325"}},{"code_sha256_prefix":"f36f08ba54f97863","entry":"remove_layers","repo":"Gpgabriel25/ProtocolGapDiagnostic","repo_kind":"found_in_text","path":"bi_vs_bisim_headtohead.py","file_url":"https://github.com/Gpgabriel25/ProtocolGapDiagnostic/blob/HEAD/bi_vs_bisim_headtohead.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"f36f08ba54f97863"}},{"code_sha256_prefix":"1b33cd34b422c42e","entry":"remove_layers","repo":"Gpgabriel25/ProtocolGapDiagnostic","repo_kind":"found_in_text","path":"compression_sweep.py","file_url":"https://github.com/Gpgabriel25/ProtocolGapDiagnostic/blob/HEAD/compression_sweep.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"1b33cd34b422c42e"}},{"code_sha256_prefix":"e87ac474b28d38ca","entry":"rms_norm","repo":"Gpgabriel25/ProtocolGapDiagnostic","repo_kind":"found_in_text","path":"clean_oracle_bootstrap_ci.py","file_url":"https://github.com/Gpgabriel25/ProtocolGapDiagnostic/blob/HEAD/clean_oracle_bootstrap_ci.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"e87ac474b28d38ca"}},{"code_sha256_prefix":"23bdae01f04f427b","entry":"step_int","repo":"Gpgabriel25/ProtocolGapDiagnostic","repo_kind":"found_in_text","path":"analyze_protocol_gap_trajectory.py","file_url":"https://github.com/Gpgabriel25/ProtocolGapDiagnostic/blob/HEAD/analyze_protocol_gap_trajectory.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"23bdae01f04f427b"}},{"code_sha256_prefix":"1d1f71ed01bdb63e","entry":"apply_rope","repo":"Gpgabriel25/ProtocolGapDiagnostic","repo_kind":"found_in_text","path":"clean_oracle_bootstrap_ci.py","file_url":"https://github.com/Gpgabriel25/ProtocolGapDiagnostic/blob/HEAD/clean_oracle_bootstrap_ci.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"1d1f71ed01bdb63e"}},{"code_sha256_prefix":"9150ef273a402f9b","entry":"build_diverse_prompts","repo":"Gpgabriel25/ProtocolGapDiagnostic","repo_kind":"found_in_text","path":"bisimulation_experiment.py","file_url":"https://github.com/Gpgabriel25/ProtocolGapDiagnostic/blob/HEAD/bisimulation_experiment.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"9150ef273a402f9b"}},{"code_sha256_prefix":"03536c31aa1dc33a","entry":"compute_bi_scores","repo":"Gpgabriel25/ProtocolGapDiagnostic","repo_kind":"found_in_text","path":"bi_score_comparison.py","file_url":"https://github.com/Gpgabriel25/ProtocolGapDiagnostic/blob/HEAD/bi_score_comparison.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"03536c31aa1dc33a"}},{"code_sha256_prefix":"50848c5d55e1afc9","entry":"generate_diverse_prompts","repo":"Gpgabriel25/ProtocolGapDiagnostic","repo_kind":"found_in_text","path":"bloom_bisimulation.py","file_url":"https://github.com/Gpgabriel25/ProtocolGapDiagnostic/blob/HEAD/bloom_bisimulation.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"50848c5d55e1afc9"}},{"code_sha256_prefix":"6edd1bd3fa3950dc","entry":"spearman","repo":"Gpgabriel25/ProtocolGapDiagnostic","repo_kind":"found_in_text","path":"d_repl_asymmetry.py","file_url":"https://github.com/Gpgabriel25/ProtocolGapDiagnostic/blob/HEAD/d_repl_asymmetry.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"6edd1bd3fa3950dc"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.LG","source":"arxiv_2026.jsonl"},"syntology_extracted_results":null}