{"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":"/code/dpo-loss","entry":"dpo_loss","source":"Syntology graph, per-sample; not an archive number","read_at":"2026-09-24T18:15:14+00:00","claim":"Names are grouped by exact entry-name string. Same-named routines are NOT asserted to be equivalent; 'ran' means executed on a synthesized fixture, not correctness. n_samples_ran = sum of by_status over every status except 'unverified' (ran_draft_wrong and ran_fixture are failures of Syntology's instrument, not of the code); n_papers_ran = papers with at least one such sample.","status_vocabulary":{"ran_honours":"ran, honoured the contract we drafted","ran_violates":"ran, violated the contract we drafted","ran_draft_wrong":"ran; our contract draft was wrong, not the code","ran_fixture":"ran; our fixture could not drive it","ran":"ran on a synthesized input","unverified":"unverified (harvested, no recorded run)"},"n_papers":21,"n_papers_ran":10,"units":"n_samples, n_samples_ran, n_samples_fingerprinted and by_status count distinct code bodies (code_sha256); n_places and n_places_pointer_only count places, one per (paper, code body) pair, which is also the unit of the samples list","n_samples":17,"n_samples_ran":8,"n_samples_fingerprinted":0,"n_places":21,"n_places_pointer_only":8,"by_status":{"ran_honours":0,"ran_violates":0,"ran_draft_wrong":1,"ran_fixture":1,"ran":6,"unverified":9},"syntology":{"atlas_url":null,"mcp":null,"mcp_per_sample":{"tool":"get_code","arguments_in":"samples[].mcp_get_code"},"developers":"https://syntology.ai/developers"},"samples":[{"arxiv_id":"2604.18966","paper":"/paper/arxiv-2604-18966","title":"Self-Improving Tabular Language Models via Iterative Reward-Guided Post-Training","date":null,"month_inferred_from_arxiv_id":"2026-04","title_source":"syntology","repo":"Yunbo-max/Post-Training-Tabular-Language-Models","path":"loss.py","file_url":"https://github.com/Yunbo-max/Post-Training-Tabular-Language-Models/blob/HEAD/loss.py","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"code_sha256_prefix":"5aa6cff234d655cd","mcp_get_code":{"code_sha256":"5aa6cff234d655cd"}},{"arxiv_id":"2506.11712","paper":null,"title":"arXiv:2506.11712","date":null,"month_inferred_from_arxiv_id":"2025-06","title_source":null,"repo":"Liuwq-bit/SymMPO","path":"muffin/train/trainers.py","file_url":"https://github.com/Liuwq-bit/SymMPO/blob/HEAD/muffin/train/trainers.py","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"code_sha256_prefix":"a9ca56191b3904f6","mcp_get_code":{"code_sha256":"a9ca56191b3904f6"}},{"arxiv_id":"2412.12497","paper":"/paper/nlsr-neuron-level-safety-realignment-of-large","title":"NLSR: Neuron-Level Safety Realignment of Large Language Models Against Harmful Fine-Tuning","date":"2024-12-17","month_inferred_from_arxiv_id":null,"title_source":"archive","repo":"xinykou/nlsr","path":"src/prune_regions/modeling_llama.py","file_url":"https://github.com/xinykou/nlsr/blob/HEAD/src/prune_regions/modeling_llama.py","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"code_sha256_prefix":"b8d15a97350e90e6","mcp_get_code":{"code_sha256":"b8d15a97350e90e6"}},{"arxiv_id":"2411.06424","paper":"/paper/ablation-is-not-enough-to-emulate-dpo-how","title":"Beyond Toxic Neurons: A Mechanistic Analysis of DPO for Toxicity Reduction","date":"2024-11-10","month_inferred_from_arxiv_id":null,"title_source":"archive","repo":"yushi-y/dpo-toxic-neurons","path":"train_dpo/trainers.py","file_url":"https://github.com/yushi-y/dpo-toxic-neurons/blob/HEAD/train_dpo/trainers.py","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"code_sha256_prefix":"6e420696373414b1","mcp_get_code":{"code_sha256":"6e420696373414b1"}},{"arxiv_id":"2410.23223","paper":"/paper/comal-a-convergent-meta-algorithm-for","title":"COMAL: A Convergent Meta-Algorithm for Aligning LLMs with General Preferences","date":"2024-10-30","month_inferred_from_arxiv_id":null,"title_source":"archive","repo":"yale-nlp/comal","path":"losses.py","file_url":"https://github.com/yale-nlp/comal/blob/HEAD/losses.py","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"code_sha256_prefix":"a71ddf2f2e1209ca","mcp_get_code":{"code_sha256":"a71ddf2f2e1209ca"}},{"arxiv_id":"2410.21662","paper":"/paper/f-po-generalizing-preference-optimization","title":"$f$-PO: Generalizing Preference Optimization with $f$-divergence Minimization","date":"2024-10-29","month_inferred_from_arxiv_id":null,"title_source":"archive","repo":"minkaixu/fpo","path":"src/align_stage/loss.py","file_url":"https://github.com/minkaixu/fpo/blob/HEAD/src/align_stage/loss.py","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"code_sha256_prefix":"f87ec21e6cc554fb","mcp_get_code":{"code_sha256":"f87ec21e6cc554fb"}},{"arxiv_id":"2410.16208","paper":"/paper/compute-constrained-data-selection","title":"Compute-Constrained Data Selection","date":"2024-10-21","month_inferred_from_arxiv_id":null,"title_source":"archive","repo":"oseyosey/CCDS","path":"ccds/evaluation/open_instruct/dpo_utils.py","file_url":"https://github.com/oseyosey/CCDS/blob/HEAD/ccds/evaluation/open_instruct/dpo_utils.py","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"code_sha256_prefix":"48ff6fdc0e5dae2e","mcp_get_code":{"code_sha256":"48ff6fdc0e5dae2e"}},{"arxiv_id":"2408.04568","paper":"/paper/learning-fine-grained-grounded-citations-for","title":"Learning Fine-Grained Grounded Citations for Attributed Large Language Models","date":"2024-08-08","month_inferred_from_arxiv_id":null,"title_source":"archive","repo":"luckyyysta/fine-grained-attribution","path":"training/stage2_consistency_aware_alignment/dpo_utils.py","file_url":"https://github.com/luckyyysta/fine-grained-attribution/blob/HEAD/training/stage2_consistency_aware_alignment/dpo_utils.py","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"code_sha256_prefix":"b2b6de249cebe189","mcp_get_code":{"code_sha256":"b2b6de249cebe189"}},{"arxiv_id":"2407.13709","paper":"/paper/understanding-reference-policies-in-direct","title":"Understanding Reference Policies in Direct Preference Optimization","date":"2024-07-18","month_inferred_from_arxiv_id":null,"title_source":"archive","repo":"yale-nlp/refdpo","path":"dpo_utils.py","file_url":"https://github.com/yale-nlp/refdpo/blob/HEAD/dpo_utils.py","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"code_sha256_prefix":"8c5617ecaa98baa1","mcp_get_code":{"code_sha256":"8c5617ecaa98baa1"}},{"arxiv_id":"2406.16797","paper":"/paper/lottery-ticket-adaptation-mitigating","title":"Lottery Ticket Adaptation: Mitigating Destructive Interference in LLMs","date":"2024-06-24","month_inferred_from_arxiv_id":null,"title_source":"archive","repo":"kiddyboots216/lottery-ticket-adaptation","path":"rlaif/single_gpu_trainers.py","file_url":"https://github.com/kiddyboots216/lottery-ticket-adaptation/blob/HEAD/rlaif/single_gpu_trainers.py","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"code_sha256_prefix":"16a2450aff4a3577","mcp_get_code":{"code_sha256":"16a2450aff4a3577"}},{"arxiv_id":"2406.09279","paper":"/paper/unpacking-dpo-and-ppo-disentangling-best","title":"Unpacking DPO and PPO: Disentangling Best Practices for Learning from Preference Feedback","date":"2024-06-13","month_inferred_from_arxiv_id":null,"title_source":"archive","repo":"hamishivi/EasyLM","path":"EasyLM/models/llama/llama_train_dpo.py","file_url":"https://github.com/hamishivi/EasyLM/blob/HEAD/EasyLM/models/llama/llama_train_dpo.py","status":"unverified","verification_level":0,"contract_check":"VIOLATES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"code_sha256_prefix":"a6d706f6e0699b5c","mcp_get_code":{"code_sha256":"a6d706f6e0699b5c"}},{"arxiv_id":"2405.14734","paper":"/paper/simpo-simple-preference-optimization-with-a","title":"SimPO: Simple Preference Optimization with a Reference-Free Reward","date":"2024-05-23","month_inferred_from_arxiv_id":null,"title_source":"archive","repo":"openpsi-project/realhf","path":"realhf/impl/model/utils/dpo_functional.py","file_url":"https://github.com/openpsi-project/realhf/blob/HEAD/realhf/impl/model/utils/dpo_functional.py","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"code_sha256_prefix":"6b05e6f1ad3cb9b6","mcp_get_code":{"code_sha256":"6b05e6f1ad3cb9b6"}},{"arxiv_id":"2405.05008","paper":"/paper/adelie-aligning-large-language-models-on","title":"ADELIE: Aligning Large Language Models on Information Extraction","date":"2024-05-08","month_inferred_from_arxiv_id":null,"title_source":"archive","repo":"THU-KEG/ADELIE","path":"train4llama/open_instruct/dpo_utils.py","file_url":"https://github.com/THU-KEG/ADELIE/blob/HEAD/train4llama/open_instruct/dpo_utils.py","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"code_sha256_prefix":"b2b6de249cebe189","mcp_get_code":{"code_sha256":"b2b6de249cebe189"}},{"arxiv_id":"2402.12366","paper":"/paper/a-critical-evaluation-of-ai-feedback-for","title":"A Critical Evaluation of AI Feedback for Aligning Large Language Models","date":"2024-02-19","month_inferred_from_arxiv_id":null,"title_source":"archive","repo":"architsharma97/dpo-rlaif","path":"trainers.py","file_url":"https://github.com/architsharma97/dpo-rlaif/blob/HEAD/trainers.py","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"code_sha256_prefix":"16a2450aff4a3577","mcp_get_code":{"code_sha256":"16a2450aff4a3577"}},{"arxiv_id":"2402.00856","paper":"/paper/towards-efficient-and-exact-optimization-of","title":"Towards Efficient Exact Optimization of Language Model Alignment","date":"2024-02-01","month_inferred_from_arxiv_id":null,"title_source":"archive","repo":"haozheji/exact-optimization","path":"src/align_stage/loss.py","file_url":"https://github.com/haozheji/exact-optimization/blob/HEAD/src/align_stage/loss.py","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"code_sha256_prefix":"f87ec21e6cc554fb","mcp_get_code":{"code_sha256":"f87ec21e6cc554fb"}},{"arxiv_id":"2401.01967","paper":"/paper/a-mechanistic-understanding-of-alignment","title":"A Mechanistic Understanding of Alignment Algorithms: A Case Study on DPO and Toxicity","date":"2024-01-03","month_inferred_from_arxiv_id":null,"title_source":"archive","repo":"ajyl/dpo_toxic","path":"toxicity/train_dpo/trainers.py","file_url":"https://github.com/ajyl/dpo_toxic/blob/HEAD/toxicity/train_dpo/trainers.py","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"code_sha256_prefix":"6e420696373414b1","mcp_get_code":{"code_sha256":"6e420696373414b1"}},{"arxiv_id":"2312.00267","paper":"/paper/sample-efficient-reinforcement-learning-from","title":"Sample Efficient Preference Alignment in LLMs via Active Exploration","date":"2023-12-01","month_inferred_from_arxiv_id":null,"title_source":"archive","repo":"belakaria/active-llm-alignment","path":"trainers.py","file_url":"https://github.com/belakaria/active-llm-alignment/blob/HEAD/trainers.py","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"code_sha256_prefix":"cb2b1a4a7f1ecabf","mcp_get_code":{"code_sha256":"cb2b1a4a7f1ecabf"}},{"arxiv_id":"2311.16714","paper":"/paper/embodied-multi-modal-agent-trained-by-an-llm","title":"Embodied Multi-Modal Agent trained by an LLM from a Parallel TextWorld","date":"2023-11-28","month_inferred_from_arxiv_id":null,"title_source":"archive","repo":"stevenyangyj/emma-alfworld","path":"LAVIS/lavis/models/blip2_models/blip2_emma.py","file_url":"https://github.com/stevenyangyj/emma-alfworld/blob/HEAD/LAVIS/lavis/models/blip2_models/blip2_emma.py","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"code_sha256_prefix":"112c839f24908701","mcp_get_code":{"code_sha256":"112c839f24908701"}},{"arxiv_id":"2310.12304","paper":"/paper/preference-optimization-for-molecular","title":"Preference Optimization for Molecular Language Models","date":"2023-10-18","month_inferred_from_arxiv_id":null,"title_source":"archive","repo":"harmonic-discovery/pref-opt-for-mols","path":"pref_opt_for_mols/models/dpo.py","file_url":"https://github.com/harmonic-discovery/pref-opt-for-mols/blob/HEAD/pref_opt_for_mols/models/dpo.py","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"code_sha256_prefix":"3d3a8ce9515f501f","mcp_get_code":{"code_sha256":"3d3a8ce9515f501f"}},{"arxiv_id":"2309.16240","paper":"/paper/beyond-reverse-kl-generalizing-direct","title":"Beyond Reverse KL: Generalizing Direct Preference Optimization with Diverse Divergence Constraints","date":"2023-09-28","month_inferred_from_arxiv_id":null,"title_source":"archive","repo":"alecwangcq/f-divergence-dpo","path":"trainers.py","file_url":"https://github.com/alecwangcq/f-divergence-dpo/blob/HEAD/trainers.py","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"code_sha256_prefix":"fc5f3e7e6f97a222","mcp_get_code":{"code_sha256":"fc5f3e7e6f97a222"}},{"arxiv_id":"2305.14718","paper":"/paper/improving-language-models-with-advantage","title":"Leftover Lunch: Advantage-based Offline Reinforcement Learning for Language Models","date":"2023-05-24","month_inferred_from_arxiv_id":null,"title_source":"archive","repo":"abaheti95/LoL-RL","path":"dpo_qlora_llama_hh.py","file_url":"https://github.com/abaheti95/LoL-RL/blob/HEAD/dpo_qlora_llama_hh.py","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"code_sha256_prefix":"1ed7c9ceaa90eb2c","mcp_get_code":{"code_sha256":"1ed7c9ceaa90eb2c"}}]}