{"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-2602-04448","title":"RASA: Routing-Aware Safety Alignment for Mixture-of-Experts Models","arxiv_id":"2602.04448","date":"2026-02-04","proceeding":null,"authors":["Jiacheng Liang","Yuhui Wang","Tanqiu Jiang","Ting Wang"],"abstract":"Mixture-of-Experts (MoE) language models introduce unique challenges for safety alignment due to their sparse routing mechanisms, which can enable degenerate optimization behaviors under standard full-parameter fine-tuning. In our preliminary experiments, we observe that naively applying full-parameter safety fine-tuning to MoE models can reduce attack success rates through routing or expert dominance effects, rather than by directly repairing Safety-Critical Experts. To address this challenge, we propose RASA, a routing-aware expert-level alignment framework that explicitly repairs Safety-Critical Experts while preventing routing-based bypasses. RASA identifies experts disproportionately activated by successful jailbreaks, selectively fine-tunes only these experts under fixed routing, and subsequently enforces routing consistency with safety-aligned contexts. Across two representative MoE architectures and a diverse set of jailbreak attacks, RASA achieves near-perfect robustness, strong cross-attack generalization, and substantially reduced over-refusal, while preserving general capabilities on benchmarks such as MMLU, GSM8K, and TruthfulQA. Our results suggest that robust MoE safety alignment benefits from targeted expert repair rather than global parameter updates, offering a practical and architecture-preserving alternative to prior approaches.","url_abs":"https://arxiv.org/abs/2602.04448","url_pdf":"https://arxiv.org/pdf/2602.04448","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=2602.04448","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2602.04448"}},"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/JACKPURCELL/RASAMoE-public","reach":null}],"summary":{"ran":1,"ran_honours":5,"ran_draft_wrong":4,"unverified":3},"by_repo_kind":{"found_in_text":{"samples":13,"ran":10,"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":13,"samples":[{"code_sha256_prefix":"fafb6f25dd3c217f","entry":"DataCollatorWithLabelIds","repo":"JACKPURCELL/RASAMoE-public","repo_kind":"found_in_text","path":"train_alternating_optimization.py","file_url":"https://github.com/JACKPURCELL/RASAMoE-public/blob/HEAD/train_alternating_optimization.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":"fafb6f25dd3c217f"}},{"code_sha256_prefix":"c9e91a1a29aa1e65","entry":"compute_router_consistency_loss_two_forward","repo":"JACKPURCELL/RASAMoE-public","repo_kind":"found_in_text","path":"train_alternating_optimization.py","file_url":"https://github.com/JACKPURCELL/RASAMoE-public/blob/HEAD/train_alternating_optimization.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c9e91a1a29aa1e65"}},{"code_sha256_prefix":"28fbbc4569d0c366","entry":"create_batch_aware_dataset","repo":"JACKPURCELL/RASAMoE-public","repo_kind":"found_in_text","path":"train_alternating_optimization.py","file_url":"https://github.com/JACKPURCELL/RASAMoE-public/blob/HEAD/train_alternating_optimization.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":"28fbbc4569d0c366"}},{"code_sha256_prefix":"025f2afeefebd941","entry":"create_batch_structured_dataset","repo":"JACKPURCELL/RASAMoE-public","repo_kind":"found_in_text","path":"train_alternating_optimization.py","file_url":"https://github.com/JACKPURCELL/RASAMoE-public/blob/HEAD/train_alternating_optimization.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":"025f2afeefebd941"}},{"code_sha256_prefix":"638636bce061d5f8","entry":"extract_router_probs_from_storage","repo":"JACKPURCELL/RASAMoE-public","repo_kind":"found_in_text","path":"train_alternating_optimization.py","file_url":"https://github.com/JACKPURCELL/RASAMoE-public/blob/HEAD/train_alternating_optimization.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":"638636bce061d5f8"}},{"code_sha256_prefix":"6b27737008eb1ccd","entry":"freeze_all_except_routers","repo":"JACKPURCELL/RASAMoE-public","repo_kind":"found_in_text","path":"train_alternating_optimization.py","file_url":"https://github.com/JACKPURCELL/RASAMoE-public/blob/HEAD/train_alternating_optimization.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6b27737008eb1ccd"}},{"code_sha256_prefix":"d92fb60cf1f0da3d","entry":"freeze_all_except_unsafe_experts","repo":"JACKPURCELL/RASAMoE-public","repo_kind":"found_in_text","path":"train_alternating_optimization.py","file_url":"https://github.com/JACKPURCELL/RASAMoE-public/blob/HEAD/train_alternating_optimization.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d92fb60cf1f0da3d"}},{"code_sha256_prefix":"58938d626bcb3324","entry":"load_prepared_batch_data","repo":"JACKPURCELL/RASAMoE-public","repo_kind":"found_in_text","path":"train_alternating_optimization.py","file_url":"https://github.com/JACKPURCELL/RASAMoE-public/blob/HEAD/train_alternating_optimization.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":"58938d626bcb3324"}},{"code_sha256_prefix":"6e3a39bffa679634","entry":"register_router_hooks","repo":"JACKPURCELL/RASAMoE-public","repo_kind":"found_in_text","path":"train_alternating_optimization.py","file_url":"https://github.com/JACKPURCELL/RASAMoE-public/blob/HEAD/train_alternating_optimization.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6e3a39bffa679634"}},{"code_sha256_prefix":"9e46159754607684","entry":"unfreeze_all_parameters","repo":"JACKPURCELL/RASAMoE-public","repo_kind":"found_in_text","path":"train_alternating_optimization.py","file_url":"https://github.com/JACKPURCELL/RASAMoE-public/blob/HEAD/train_alternating_optimization.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9e46159754607684"}},{"code_sha256_prefix":"960624622c7ff999","entry":"train_alternating_optimization","repo":"JACKPURCELL/RASAMoE-public","repo_kind":"found_in_text","path":"train_alternating_optimization.py","file_url":"https://github.com/JACKPURCELL/RASAMoE-public/blob/HEAD/train_alternating_optimization.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":"960624622c7ff999"}},{"code_sha256_prefix":"62b43474b086760f","entry":"train_one_epoch_experts","repo":"JACKPURCELL/RASAMoE-public","repo_kind":"found_in_text","path":"train_alternating_optimization.py","file_url":"https://github.com/JACKPURCELL/RASAMoE-public/blob/HEAD/train_alternating_optimization.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":"62b43474b086760f"}},{"code_sha256_prefix":"87691ea86267c57e","entry":"train_one_epoch_router","repo":"JACKPURCELL/RASAMoE-public","repo_kind":"found_in_text","path":"train_alternating_optimization.py","file_url":"https://github.com/JACKPURCELL/RASAMoE-public/blob/HEAD/train_alternating_optimization.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":"87691ea86267c57e"}}]},"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}