{"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-26315","title":"Curriculum Learning for Safety Alignment","arxiv_id":"2605.26315","date":"2026-05-25","proceeding":null,"authors":["Sandeep Kumar","Virginia Smith","Chhavi Yadav"],"abstract":"Direct Preference Optimisation (DPO) is widely used for safety alignment in large language models. However, prior work shows it is brittle and exhibits poor out-of-distribution (OOD) generalisation. In this paper, we investigate whether Curriculum Learning can improve the robustness of DPO-based safety alignment. We propose Staged-Competence, a curriculum-based framework that organises preference data by difficulty, employs competence-based sampling, and progressively updates the reference model during training. Averaged across three model families, Staged-Competence reduces OOD harmful response rates by 16% and jailbreak attack success rates by 20%, while preserving general capabilities with near-zero over-refusal. We further show that Staged-Competence (1) matches baseline safety with only 75% of the training data and (2) yields better separation between safe and unsafe responses. Staged-Competence is agnostic to the policy optimisation loss and can extend to other DPO variants and alignment domains. Our code and data are available at https://github.com/Sandeep5500/curriculum-learning-for-safety.","url_abs":"https://arxiv.org/abs/2605.26315","url_pdf":"https://arxiv.org/pdf/2605.26315","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.26315","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2605.26315"}},"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/Sandeep5500/curriculum-learning-for-safety","reach":null}],"summary":{"ran":10,"unverified":9},"by_repo_kind":{"found_in_text":{"samples":19,"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":19,"samples":[{"code_sha256_prefix":"45789c901dd4ce02","entry":"build_prefill_prompts","repo":"Sandeep5500/curriculum-learning-for-safety","repo_kind":"found_in_text","path":"src/eval/evaluate_prefill.py","file_url":"https://github.com/Sandeep5500/curriculum-learning-for-safety/blob/HEAD/src/eval/evaluate_prefill.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":"45789c901dd4ce02"}},{"code_sha256_prefix":"2c4656fcd9b823f3","entry":"extract_loss_curve_stitched","repo":"Sandeep5500/curriculum-learning-for-safety","repo_kind":"found_in_text","path":"src/eval/plot_training_loss.py","file_url":"https://github.com/Sandeep5500/curriculum-learning-for-safety/blob/HEAD/src/eval/plot_training_loss.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":"2c4656fcd9b823f3"}},{"code_sha256_prefix":"d6ec0bfb9cfb1384","entry":"format_alpaca_prompt","repo":"Sandeep5500/curriculum-learning-for-safety","repo_kind":"found_in_text","path":"src/eval/evaluate_harmless.py","file_url":"https://github.com/Sandeep5500/curriculum-learning-for-safety/blob/HEAD/src/eval/evaluate_harmless.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":"d6ec0bfb9cfb1384"}},{"code_sha256_prefix":"7f6753c7709c7444","entry":"get_benchmark_loader","repo":"Sandeep5500/curriculum-learning-for-safety","repo_kind":"found_in_text","path":"src/eval/evaluate_safety.py","file_url":"https://github.com/Sandeep5500/curriculum-learning-for-safety/blob/HEAD/src/eval/evaluate_safety.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":"7f6753c7709c7444"}},{"code_sha256_prefix":"271d630e735cf259","entry":"load_alpaca","repo":"Sandeep5500/curriculum-learning-for-safety","repo_kind":"found_in_text","path":"src/eval/evaluate_harmless.py","file_url":"https://github.com/Sandeep5500/curriculum-learning-for-safety/blob/HEAD/src/eval/evaluate_harmless.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":"271d630e735cf259"}},{"code_sha256_prefix":"4cd6b92eb2e89956","entry":"load_curri_dpo_trainer_states","repo":"Sandeep5500/curriculum-learning-for-safety","repo_kind":"found_in_text","path":"src/eval/plot_training_loss.py","file_url":"https://github.com/Sandeep5500/curriculum-learning-for-safety/blob/HEAD/src/eval/plot_training_loss.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":"4cd6b92eb2e89956"}},{"code_sha256_prefix":"12db38ad37394041","entry":"load_jsonl","repo":"Sandeep5500/curriculum-learning-for-safety","repo_kind":"found_in_text","path":"src/phase1/create_curriculum.py","file_url":"https://github.com/Sandeep5500/curriculum-learning-for-safety/blob/HEAD/src/phase1/create_curriculum.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":"12db38ad37394041"}},{"code_sha256_prefix":"720e3446a250db15","entry":"load_pairs","repo":"Sandeep5500/curriculum-learning-for-safety","repo_kind":"found_in_text","path":"src/interpretability/probe_safety.py","file_url":"https://github.com/Sandeep5500/curriculum-learning-for-safety/blob/HEAD/src/interpretability/probe_safety.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":"720e3446a250db15"}},{"code_sha256_prefix":"73ed615e55c37367","entry":"make_gpt_classifier","repo":"Sandeep5500/curriculum-learning-for-safety","repo_kind":"found_in_text","path":"src/eval/judge_safety_gpt.py","file_url":"https://github.com/Sandeep5500/curriculum-learning-for-safety/blob/HEAD/src/eval/judge_safety_gpt.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":"73ed615e55c37367"}},{"code_sha256_prefix":"9cdf8248df8a1707","entry":"score_file","repo":"Sandeep5500/curriculum-learning-for-safety","repo_kind":"found_in_text","path":"src/eval/judge_safety_gpt.py","file_url":"https://github.com/Sandeep5500/curriculum-learning-for-safety/blob/HEAD/src/eval/judge_safety_gpt.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":"9cdf8248df8a1707"}},{"code_sha256_prefix":"093465f26ea25603","entry":"extract_activations","repo":"Sandeep5500/curriculum-learning-for-safety","repo_kind":"found_in_text","path":"src/interpretability/probe_safety.py","file_url":"https://github.com/Sandeep5500/curriculum-learning-for-safety/blob/HEAD/src/interpretability/probe_safety.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":"093465f26ea25603"}},{"code_sha256_prefix":"208879c2c344db03","entry":"generate_continuations","repo":"Sandeep5500/curriculum-learning-for-safety","repo_kind":"found_in_text","path":"src/eval/evaluate_prefill.py","file_url":"https://github.com/Sandeep5500/curriculum-learning-for-safety/blob/HEAD/src/eval/evaluate_prefill.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":"208879c2c344db03"}},{"code_sha256_prefix":"06c4469609d4a987","entry":"generate_responses","repo":"Sandeep5500/curriculum-learning-for-safety","repo_kind":"found_in_text","path":"src/eval/evaluate_safety.py","file_url":"https://github.com/Sandeep5500/curriculum-learning-for-safety/blob/HEAD/src/eval/evaluate_safety.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":"06c4469609d4a987"}},{"code_sha256_prefix":"88b85dc93019c4bb","entry":"generate_responses","repo":"Sandeep5500/curriculum-learning-for-safety","repo_kind":"found_in_text","path":"src/eval/evaluate_harmless.py","file_url":"https://github.com/Sandeep5500/curriculum-learning-for-safety/blob/HEAD/src/eval/evaluate_harmless.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":"88b85dc93019c4bb"}},{"code_sha256_prefix":"fb47c61237e83037","entry":"generate_responses","repo":"Sandeep5500/curriculum-learning-for-safety","repo_kind":"found_in_text","path":"src/eval/evaluate_jailbreak.py","file_url":"https://github.com/Sandeep5500/curriculum-learning-for-safety/blob/HEAD/src/eval/evaluate_jailbreak.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":"fb47c61237e83037"}},{"code_sha256_prefix":"8a705943c32837e2","entry":"load_hellaswag","repo":"Sandeep5500/curriculum-learning-for-safety","repo_kind":"found_in_text","path":"src/eval/evaluate_quality.py","file_url":"https://github.com/Sandeep5500/curriculum-learning-for-safety/blob/HEAD/src/eval/evaluate_quality.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":"8a705943c32837e2"}},{"code_sha256_prefix":"6e6dbec92e02f2b3","entry":"load_mmlu","repo":"Sandeep5500/curriculum-learning-for-safety","repo_kind":"found_in_text","path":"src/eval/evaluate_quality.py","file_url":"https://github.com/Sandeep5500/curriculum-learning-for-safety/blob/HEAD/src/eval/evaluate_quality.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":"6e6dbec92e02f2b3"}},{"code_sha256_prefix":"28a23205d560ec6c","entry":"load_model","repo":"Sandeep5500/curriculum-learning-for-safety","repo_kind":"found_in_text","path":"src/interpretability/probe_safety.py","file_url":"https://github.com/Sandeep5500/curriculum-learning-for-safety/blob/HEAD/src/interpretability/probe_safety.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":"28a23205d560ec6c"}},{"code_sha256_prefix":"d2bebfaca70f72f4","entry":"load_trainer_state","repo":"Sandeep5500/curriculum-learning-for-safety","repo_kind":"found_in_text","path":"src/eval/plot_training_loss.py","file_url":"https://github.com/Sandeep5500/curriculum-learning-for-safety/blob/HEAD/src/eval/plot_training_loss.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":"d2bebfaca70f72f4"}}]},"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}