{"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-20296","title":"Spectral Unforgetting: Post-Hoc Recovery of Damaged Capabilities Without Retraining","arxiv_id":"2605.20296","date":"2026-05-19","proceeding":null,"authors":["Aarash Abro","Muhammad Tahir"],"abstract":"Fine-tuning a language model for a target task routinely degrades capabilities the training data never explicitly threatened. We study this phenomenon, known as catastrophic forgetting, and propose a post-hoc repair solution that uses only the pretrained checkpoint $W_{\\mathrm{base}}$ and its fine-tuned descendant $W_{\\mathrm{ft}}$. The goal is not merely to revert the model toward the base checkpoint, but to recover capabilities damaged by fine-tuning while preserving both the target-task gains and any beneficial held-out improvements. We introduce DG-Hard, a checkpoint-only spectral repair method for the fine-tuning update $Δ= W_{\\mathrm{ft}} - W_{\\mathrm{base}}$. DG-Hard treats $Δ$ as a low-rank task-aligned signal embedded in an IID-like noise residual that gradient descent has no incentive to remove, and applies the Donoho-Gavish hard singular-value threshold to each weight-delta matrix, keeping the structured high-energy part of the update and removing the spectral bulk. This reduces repair to a closed-form SVD filtering step requiring no data-dependent tuning. A central difficulty is evaluation: average accuracy hides per-benchmark failures, while naive recovery scores reward models that simply revert toward the base. We therefore introduce a partition-conditional metric that separately tracks healing, preservation, non-damage, and target-task retention. Across $14$ (model, task) settings and nine cross-domain held-out benchmarks, DG-Hard achieves the strongest balanced repair among post-hoc baselines. DG-Hard also restores safety alignment degraded by benign fine-tuning on three independent safety axes, despite using no alignment data. These results suggest that part of fine-tuning-induced capability loss is not an unavoidable consequence of specialization, but a removable spectral residue in the weight update itself.","url_abs":"https://arxiv.org/abs/2605.20296","url_pdf":"https://arxiv.org/pdf/2605.20296","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":"https://app.syntology.ai/?focus=2605.20296","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2605.20296"}},"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/BrickleRex/dghard","reach":null}],"summary":{"ran_draft_wrong":2,"ran_fixture":4,"ran_honours":3,"unverified":1},"by_repo_kind":{"found_in_text":{"samples":10,"ran":9,"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":0,"samples":[{"code_sha256_prefix":"0dc3919b12724614","entry":"_compute_deltas","repo":"BrickleRex/dghard","repo_kind":"found_in_text","path":"dghard/repair/dg_hard.py","file_url":"https://github.com/BrickleRex/dghard/blob/HEAD/dghard/repair/dg_hard.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0dc3919b12724614"}},{"code_sha256_prefix":"e3e0a7657eb33954","entry":"_dg_hard_shrink_batch","repo":"BrickleRex/dghard","repo_kind":"found_in_text","path":"dghard/repair/dg_hard.py","file_url":"https://github.com/BrickleRex/dghard/blob/HEAD/dghard/repair/dg_hard.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e3e0a7657eb33954"}},{"code_sha256_prefix":"be03b9b860271a8c","entry":"_sigma_hat_dg_batch","repo":"BrickleRex/dghard","repo_kind":"found_in_text","path":"dghard/repair/dg_hard.py","file_url":"https://github.com/BrickleRex/dghard/blob/HEAD/dghard/repair/dg_hard.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"be03b9b860271a8c"}},{"code_sha256_prefix":"a28002a12a235b53","entry":"_sigma_hat_ours_batch","repo":"BrickleRex/dghard","repo_kind":"found_in_text","path":"dghard/repair/dg_hard.py","file_url":"https://github.com/BrickleRex/dghard/blob/HEAD/dghard/repair/dg_hard.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a28002a12a235b53"}},{"code_sha256_prefix":"9ced83614bd103c8","entry":"dg_hard_shrink","repo":"BrickleRex/dghard","repo_kind":"found_in_text","path":"dghard/repair/dg_hard.py","file_url":"https://github.com/BrickleRex/dghard/blob/HEAD/dghard/repair/dg_hard.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9ced83614bd103c8"}},{"code_sha256_prefix":"31512bd50deec21d","entry":"dg_omega","repo":"BrickleRex/dghard","repo_kind":"found_in_text","path":"dghard/repair/dg_hard.py","file_url":"https://github.com/BrickleRex/dghard/blob/HEAD/dghard/repair/dg_hard.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"31512bd50deec21d"}},{"code_sha256_prefix":"d59c7ded5c646650","entry":"mp_singular_median","repo":"BrickleRex/dghard","repo_kind":"found_in_text","path":"dghard/repair/dg_hard.py","file_url":"https://github.com/BrickleRex/dghard/blob/HEAD/dghard/repair/dg_hard.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d59c7ded5c646650"}},{"code_sha256_prefix":"22373b7862723a7f","entry":"sigma_hat_dg","repo":"BrickleRex/dghard","repo_kind":"found_in_text","path":"dghard/repair/dg_hard.py","file_url":"https://github.com/BrickleRex/dghard/blob/HEAD/dghard/repair/dg_hard.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"22373b7862723a7f"}},{"code_sha256_prefix":"ba7eeb93bfb0e628","entry":"sigma_hat_ours","repo":"BrickleRex/dghard","repo_kind":"found_in_text","path":"dghard/repair/dg_hard.py","file_url":"https://github.com/BrickleRex/dghard/blob/HEAD/dghard/repair/dg_hard.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"ba7eeb93bfb0e628"}},{"code_sha256_prefix":"b2ed3fabfcfc87cf","entry":"DgHardRepair","repo":"BrickleRex/dghard","repo_kind":"found_in_text","path":"dghard/repair/dg_hard.py","file_url":"https://github.com/BrickleRex/dghard/blob/HEAD/dghard/repair/dg_hard.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"b2ed3fabfcfc87cf"}}]},"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}