{"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-2603-06923","title":"Reforming the Mechanism: Editing Reasoning Patterns in LLMs with Circuit Reshaping","arxiv_id":"2603.06923","date":"2026-03-06","proceeding":null,"authors":["Zhenyu Lei","Qiong Wu","Jianxiong Dong","Yinhan He","Emily Dodwell","Yushun Dong","Jundong Li"],"abstract":"Large language models (LLMs) often exhibit flawed reasoning ability that undermines reliability. Existing approaches to improving reasoning typically treat it as a general and monolithic skill, applying broad training which is inefficient and unable to target specific reasoning errors. We introduce Reasoning Editing, a paradigm for selectively modifying specific reasoning patterns in LLMs while preserving other reasoning pathways. This task presents a fundamental trade-off between Generality, the ability of an edit to generalize across different tasks sharing the same reasoning pattern, and Locality, the ability to preserve other reasoning capabilities. Through systematic investigation, we uncover the Circuit-Interference Law: Edit interference between reasoning patterns is proportional to the overlap of their neural circuits. Guided by this principle, we propose REdit, the first framework to actively reshape neural circuits before editing, thereby modulating interference between reasoning patterns and mitigating the trade-off. REdit integrates three components: (i) Contrastive Circuit Reshaping, which directly addresses the generality-locality trade-off by disentangling overlapping circuits; (ii) Meta-Contrastive Learning, which extends transferability to novel reasoning patterns; and (iii) Dual-Level Protection, which preserves preexisting abilities by constraining reshaping update directions and regularizing task-level predictions. Extensive experiments with Qwen-2.5-3B on propositional logic reasoning tasks across three difficulty levels demonstrate that REdit consistently achieves superior generality and locality compared to baselines, with additional validation in mathematics showing broader potential. Our code is available at https://github.com/LzyFischer/REdit.","url_abs":"https://arxiv.org/abs/2603.06923","url_pdf":"https://arxiv.org/pdf/2603.06923","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=2603.06923","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2603.06923"}},"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/LzyFischer/REdit","reach":null}],"summary":{"unverified":19},"by_repo_kind":{"found_in_text":{"samples":19,"ran":0,"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":19,"samples":[{"code_sha256_prefix":"ffe1f2a1da5c47fe","entry":"build_protected_loader","repo":"LzyFischer/REdit","repo_kind":"found_in_text","path":"src/get_dataset.py","file_url":"https://github.com/LzyFischer/REdit/blob/HEAD/src/get_dataset.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":"ffe1f2a1da5c47fe"}},{"code_sha256_prefix":"b7914b2a0e431ad4","entry":"chunk_indices","repo":"LzyFischer/REdit","repo_kind":"found_in_text","path":"src/get_dataset.py","file_url":"https://github.com/LzyFischer/REdit/blob/HEAD/src/get_dataset.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":"b7914b2a0e431ad4"}},{"code_sha256_prefix":"2f1d1428483920e6","entry":"chunk_indices","repo":"LzyFischer/REdit","repo_kind":"found_in_text","path":"src/get_dataset_math.py","file_url":"https://github.com/LzyFischer/REdit/blob/HEAD/src/get_dataset_math.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":"2f1d1428483920e6"}},{"code_sha256_prefix":"30bcd3b2a291a41d","entry":"collate_fn","repo":"LzyFischer/REdit","repo_kind":"found_in_text","path":"src/get_dataset_math.py","file_url":"https://github.com/LzyFischer/REdit/blob/HEAD/src/get_dataset_math.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":"30bcd3b2a291a41d"}},{"code_sha256_prefix":"76d6a43b19068395","entry":"encode_example","repo":"LzyFischer/REdit","repo_kind":"found_in_text","path":"src/lora_edit.py","file_url":"https://github.com/LzyFischer/REdit/blob/HEAD/src/lora_edit.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":"76d6a43b19068395"}},{"code_sha256_prefix":"169f6fa899af8940","entry":"encode_supervised","repo":"LzyFischer/REdit","repo_kind":"found_in_text","path":"src/alpha_edit.py","file_url":"https://github.com/LzyFischer/REdit/blob/HEAD/src/alpha_edit.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":"169f6fa899af8940"}},{"code_sha256_prefix":"25efada3496b2e7c","entry":"flatten_effect_dict","repo":"LzyFischer/REdit","repo_kind":"found_in_text","path":"src/contrastive.py","file_url":"https://github.com/LzyFischer/REdit/blob/HEAD/src/contrastive.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":"25efada3496b2e7c"}},{"code_sha256_prefix":"09e55b9fd42a20a2","entry":"flatten_effect_dict","repo":"LzyFischer/REdit","repo_kind":"found_in_text","path":"src/ns_dist.py","file_url":"https://github.com/LzyFischer/REdit/blob/HEAD/src/ns_dist.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":"09e55b9fd42a20a2"}},{"code_sha256_prefix":"5667bf6b1323fa2b","entry":"flatten_effects_to_embeddings","repo":"LzyFischer/REdit","repo_kind":"found_in_text","path":"src/contrastive.py","file_url":"https://github.com/LzyFischer/REdit/blob/HEAD/src/contrastive.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":"5667bf6b1323fa2b"}},{"code_sha256_prefix":"7525b5ff21414d89","entry":"flatten_effects_to_embeddings","repo":"LzyFischer/REdit","repo_kind":"found_in_text","path":"src/ns_dist.py","file_url":"https://github.com/LzyFischer/REdit/blob/HEAD/src/ns_dist.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":"7525b5ff21414d89"}},{"code_sha256_prefix":"df38d476b622a1c1","entry":"get_comp_nodes","repo":"LzyFischer/REdit","repo_kind":"found_in_text","path":"src/attribute_patch.py","file_url":"https://github.com/LzyFischer/REdit/blob/HEAD/src/attribute_patch.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":"df38d476b622a1c1"}},{"code_sha256_prefix":"81e240792e199f18","entry":"get_tokenizer","repo":"LzyFischer/REdit","repo_kind":"found_in_text","path":"src/alpha_edit.py","file_url":"https://github.com/LzyFischer/REdit/blob/HEAD/src/alpha_edit.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":"81e240792e199f18"}},{"code_sha256_prefix":"5688f7cfac10c27e","entry":"load_augmented_json_grouped","repo":"LzyFischer/REdit","repo_kind":"found_in_text","path":"src/get_dataset.py","file_url":"https://github.com/LzyFischer/REdit/blob/HEAD/src/get_dataset.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":"5688f7cfac10c27e"}},{"code_sha256_prefix":"6bfc912341693cef","entry":"load_augmented_json_grouped","repo":"LzyFischer/REdit","repo_kind":"found_in_text","path":"src/get_dataset_math.py","file_url":"https://github.com/LzyFischer/REdit/blob/HEAD/src/get_dataset_math.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":"6bfc912341693cef"}},{"code_sha256_prefix":"f9ef9642c51b72c3","entry":"load_state_dict_from_hf_dir","repo":"LzyFischer/REdit","repo_kind":"found_in_text","path":"src/lora_edit_bio.py","file_url":"https://github.com/LzyFischer/REdit/blob/HEAD/src/lora_edit_bio.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":"f9ef9642c51b72c3"}},{"code_sha256_prefix":"691ecf50c57dd9fa","entry":"numeric_equal","repo":"LzyFischer/REdit","repo_kind":"found_in_text","path":"src/alpha_edit_math.py","file_url":"https://github.com/LzyFischer/REdit/blob/HEAD/src/alpha_edit_math.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":"691ecf50c57dd9fa"}},{"code_sha256_prefix":"233ea82dc9aa6d11","entry":"report_effects","repo":"LzyFischer/REdit","repo_kind":"found_in_text","path":"src/attribute_patch.py","file_url":"https://github.com/LzyFischer/REdit/blob/HEAD/src/attribute_patch.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":"233ea82dc9aa6d11"}},{"code_sha256_prefix":"16f84f297e15bfda","entry":"report_param_grads","repo":"LzyFischer/REdit","repo_kind":"found_in_text","path":"src/attribute_patch.py","file_url":"https://github.com/LzyFischer/REdit/blob/HEAD/src/attribute_patch.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":"16f84f297e15bfda"}},{"code_sha256_prefix":"0850b62e25187e5b","entry":"str2bool","repo":"LzyFischer/REdit","repo_kind":"found_in_text","path":"src/alpha_edit.py","file_url":"https://github.com/LzyFischer/REdit/blob/HEAD/src/alpha_edit.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":"0850b62e25187e5b"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.CL","source":"arxiv_2026.jsonl"},"syntology_extracted_results":null}