{"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-15491","title":"Ghosted Layers: Unconstrained Activation Alignment for Recovering Layer-Pruned LLMs","arxiv_id":"2605.15491","date":"2026-05-15","proceeding":null,"authors":["Vincent-Daniel Yun","Junhyuk Jo","Sai Praneeth Karimireddy","Sunwoo Lee"],"abstract":"Layer pruning removes entire Transformer decoder blocks from large language models, but introduces a mismatch between the hidden state received by the next surviving layer and the distribution it was trained to process, leading to significant performance degradation. We propose Ghosted Layers, a training-free recovery module that addresses this issue by solving a boundary activation alignment problem. Our method derives a closed-form optimal linear operator from a small calibration set to reconstruct the activation discrepancy introduced by the pruned layers. We show that this solution corresponds to the unconstrained optimum of the alignment objective, whereas existing methods are restricted to constrained solutions over limited operator subspaces. Experiments across multiple LLM backbones and pruning strategies demonstrate that our method consistently improves accuracy and perplexity over prior training-free baselines, while preserving the efficiency gains of layer pruning. Official code repository: https://github.com/daniel-eai/ghosted_layers_official_repository/.","url_abs":"https://arxiv.org/abs/2605.15491","url_pdf":"https://arxiv.org/pdf/2605.15491","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":{"atlas_url":null,"mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2605.15491"}},"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/mts-ai/ReplaceMe","reach":{"status":"ok"}},{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/chenxinrui-tsinghua/LinearPatch","reach":null},{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/EleutherAI/lm-evaluation-harness","reach":null},{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/ruckbreasoning/llm-streamline","reach":null},{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/daniel-eai/ghosted_layers_","reach":{"status":"gone","observed_at":"2026-09-16","how":"tree_404+repo_404"}},{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/sramshetty/ShortGPT","reach":null},{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/Nota-NetsPresso/shortened-llm","reach":{"status":"ok"}}],"summary":{"ran":13,"ran_honours":1,"ran_draft_wrong":3,"unverified":5},"by_repo_kind":{"found_in_text":{"samples":22,"ran":17,"repositories":4}},"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":5,"samples":[{"code_sha256_prefix":"e649cf99e1985c23","entry":"add_wrapper_after_function_call_in_method","repo":"chenxinrui-tsinghua/LinearPatch","repo_kind":"found_in_text","path":"rotate_utils/monkeypatch.py","file_url":"https://github.com/chenxinrui-tsinghua/LinearPatch/blob/HEAD/rotate_utils/monkeypatch.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e649cf99e1985c23"}},{"code_sha256_prefix":"32380a050ca033d4","entry":"b2mb","repo":"Nota-NetsPresso/shortened-llm","repo_kind":"found_in_text","path":"src/gen_batch_eval_vram.py","file_url":"https://github.com/Nota-NetsPresso/shortened-llm/blob/HEAD/src/gen_batch_eval_vram.py","link_basis":"plan_row","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"32380a050ca033d4"}},{"code_sha256_prefix":"a88f5625827ddf9d","entry":"block_influence","repo":"sramshetty/ShortGPT","repo_kind":"found_in_text","path":"short_gpt/metrics.py","file_url":"https://github.com/sramshetty/ShortGPT/blob/HEAD/short_gpt/metrics.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a88f5625827ddf9d"}},{"code_sha256_prefix":"76b345bcf88c8668","entry":"copy_func_with_new_globals","repo":"chenxinrui-tsinghua/LinearPatch","repo_kind":"found_in_text","path":"rotate_utils/monkeypatch.py","file_url":"https://github.com/chenxinrui-tsinghua/LinearPatch/blob/HEAD/rotate_utils/monkeypatch.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"76b345bcf88c8668"}},{"code_sha256_prefix":"253d01253fa57089","entry":"create_logger","repo":"chenxinrui-tsinghua/LinearPatch","repo_kind":"found_in_text","path":"utils.py","file_url":"https://github.com/chenxinrui-tsinghua/LinearPatch/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"253d01253fa57089"}},{"code_sha256_prefix":"cd763eaf1ac287e7","entry":"format_example","repo":"chenxinrui-tsinghua/LinearPatch","repo_kind":"found_in_text","path":"eval/mmlu_eval.py","file_url":"https://github.com/chenxinrui-tsinghua/LinearPatch/blob/HEAD/eval/mmlu_eval.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"cd763eaf1ac287e7"}},{"code_sha256_prefix":"6ab745408cb8648b","entry":"format_subject","repo":"chenxinrui-tsinghua/LinearPatch","repo_kind":"found_in_text","path":"eval/mmlu_eval.py","file_url":"https://github.com/chenxinrui-tsinghua/LinearPatch/blob/HEAD/eval/mmlu_eval.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6ab745408cb8648b"}},{"code_sha256_prefix":"3383488ea82b6c15","entry":"gen_prompt","repo":"chenxinrui-tsinghua/LinearPatch","repo_kind":"found_in_text","path":"eval/mmlu_eval.py","file_url":"https://github.com/chenxinrui-tsinghua/LinearPatch/blob/HEAD/eval/mmlu_eval.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3383488ea82b6c15"}},{"code_sha256_prefix":"6a159410399bfba3","entry":"get_pruned_layer_with_cosine","repo":"chenxinrui-tsinghua/LinearPatch","repo_kind":"found_in_text","path":"layer_select.py","file_url":"https://github.com/chenxinrui-tsinghua/LinearPatch/blob/HEAD/layer_select.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6a159410399bfba3"}},{"code_sha256_prefix":"8005fc23ccbe61fb","entry":"get_rope_function_name","repo":"chenxinrui-tsinghua/LinearPatch","repo_kind":"found_in_text","path":"rotate_utils/model_utils.py","file_url":"https://github.com/chenxinrui-tsinghua/LinearPatch/blob/HEAD/rotate_utils/model_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8005fc23ccbe61fb"}},{"code_sha256_prefix":"fe39dd44b7d2698b","entry":"llama_down_proj_groupsize","repo":"chenxinrui-tsinghua/LinearPatch","repo_kind":"found_in_text","path":"rotate_utils/utils.py","file_url":"https://github.com/chenxinrui-tsinghua/LinearPatch/blob/HEAD/rotate_utils/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"fe39dd44b7d2698b"}},{"code_sha256_prefix":"9012ddbbaf4ee64f","entry":"llama_eval","repo":"Nota-NetsPresso/shortened-llm","repo_kind":"found_in_text","path":"src/eval_ppl.py","file_url":"https://github.com/Nota-NetsPresso/shortened-llm/blob/HEAD/src/eval_ppl.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9012ddbbaf4ee64f"}},{"code_sha256_prefix":"f27e39c71c8ebfb4","entry":"online_rotate","repo":"chenxinrui-tsinghua/LinearPatch","repo_kind":"found_in_text","path":"rotate_utils/rotation_utils.py","file_url":"https://github.com/chenxinrui-tsinghua/LinearPatch/blob/HEAD/rotate_utils/rotation_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f27e39c71c8ebfb4"}},{"code_sha256_prefix":"8a69aa6e08dc65a9","entry":"process_data","repo":"Nota-NetsPresso/shortened-llm","repo_kind":"found_in_text","path":"src/dataset.py","file_url":"https://github.com/Nota-NetsPresso/shortened-llm/blob/HEAD/src/dataset.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8a69aa6e08dc65a9"}},{"code_sha256_prefix":"522f6e6438fa5941","entry":"random_orthogonal_matrix","repo":"chenxinrui-tsinghua/LinearPatch","repo_kind":"found_in_text","path":"rotate_utils/rotation_utils.py","file_url":"https://github.com/chenxinrui-tsinghua/LinearPatch/blob/HEAD/rotate_utils/rotation_utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"522f6e6438fa5941"}},{"code_sha256_prefix":"084cfa0149d7a511","entry":"replace_lightweight_network","repo":"ruckbreasoning/llm-streamline","repo_kind":"found_in_text","path":"LLM_Streamline/train_mseloss.py","file_url":"https://github.com/ruckbreasoning/llm-streamline/blob/HEAD/LLM_Streamline/train_mseloss.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"084cfa0149d7a511"}},{"code_sha256_prefix":"ab63b7d19f77cc5c","entry":"sample_top_p","repo":"sramshetty/ShortGPT","repo_kind":"found_in_text","path":"short_gpt/short_llama.py","file_url":"https://github.com/sramshetty/ShortGPT/blob/HEAD/short_gpt/short_llama.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ab63b7d19f77cc5c"}},{"code_sha256_prefix":"88c8d591b4688832","entry":"cleanup_memory","repo":"chenxinrui-tsinghua/LinearPatch","repo_kind":"found_in_text","path":"rotate_utils/utils.py","file_url":"https://github.com/chenxinrui-tsinghua/LinearPatch/blob/HEAD/rotate_utils/utils.py","link_basis":"plan_row","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"88c8d591b4688832"}},{"code_sha256_prefix":"cf7f28fedcdd19c5","entry":"config_logging","repo":"chenxinrui-tsinghua/LinearPatch","repo_kind":"found_in_text","path":"rotate_utils/utils.py","file_url":"https://github.com/chenxinrui-tsinghua/LinearPatch/blob/HEAD/rotate_utils/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"cf7f28fedcdd19c5"}},{"code_sha256_prefix":"f8178f1b0c33cf48","entry":"get_gpu_metrics","repo":"Nota-NetsPresso/shortened-llm","repo_kind":"found_in_text","path":"src/gen_batch_eval_time_gpuutil.py","file_url":"https://github.com/Nota-NetsPresso/shortened-llm/blob/HEAD/src/gen_batch_eval_time_gpuutil.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f8178f1b0c33cf48"}},{"code_sha256_prefix":"eb59d0a73734e449","entry":"get_layers","repo":"chenxinrui-tsinghua/LinearPatch","repo_kind":"found_in_text","path":"rotate_utils/model_utils.py","file_url":"https://github.com/chenxinrui-tsinghua/LinearPatch/blob/HEAD/rotate_utils/model_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"eb59d0a73734e449"}},{"code_sha256_prefix":"cdd805f7fc7a0842","entry":"model_type_extractor","repo":"chenxinrui-tsinghua/LinearPatch","repo_kind":"found_in_text","path":"rotate_utils/model_utils.py","file_url":"https://github.com/chenxinrui-tsinghua/LinearPatch/blob/HEAD/rotate_utils/model_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"cdd805f7fc7a0842"}}]},"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}