{"id":50510405,"url":"https://github.com/songmzhang/AlignDistil","last_synced_at":"2026-06-19T14:00:34.653Z","repository":{"id":301333779,"uuid":"1004979536","full_name":"songmzhang/AlignDistil","owner":"songmzhang","description":"Code for ACL 2025 Paper \"AlignDistil: Token-Level Language Model Alignment as Adaptive Policy Distillation\"","archived":false,"fork":false,"pushed_at":"2025-08-26T13:47:53.000Z","size":2010,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-18T10:18:38.954Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/songmzhang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-19T13:24:45.000Z","updated_at":"2025-12-24T07:39:19.000Z","dependencies_parsed_at":"2025-06-26T10:40:19.327Z","dependency_job_id":"c582b0ad-2b56-4771-9a61-474374573f0e","html_url":"https://github.com/songmzhang/AlignDistil","commit_stats":null,"previous_names":["songmzhang/aligndistil"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/songmzhang/AlignDistil","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/songmzhang%2FAlignDistil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/songmzhang%2FAlignDistil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/songmzhang%2FAlignDistil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/songmzhang%2FAlignDistil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/songmzhang","download_url":"https://codeload.github.com/songmzhang/AlignDistil/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/songmzhang%2FAlignDistil/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34534278,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-02T20:00:26.252Z","updated_at":"2026-06-19T14:00:34.648Z","avatar_url":"https://github.com/songmzhang.png","language":"Python","funding_links":[],"categories":["🤝 OPD-RL Hybrids — Inside-RL OPD"],"sub_categories":["🔁 Iterative Self-Bootstrapping"],"readme":"# AlignDistil: Token-Level Language Model Alignment as Adaptive Policy Distillation (ACL2025)\n\u003csmall\u003e[Songming Zhang](https://songmzhang.github.io/), Xue Zhang, Tong Zhang, Bojie Hu, Yufeng Chen*, Jinan Xu\u003c/small\u003e\n\nOur code is based on [OpenRLHF](https://github.com/OpenRLHF/OpenRLHF) v0.5.2.post2 (We are also updating our codebase to the latest OpenRLHF).\n\n## Why use AlignDistil?\n- **Token**-level reward optimization\n- Solid performance\n- Stable optimization and Faster convergence\n- Support both on-policy (like RL) and off-policy training (like DPO)\n\n## Method Framework\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"images/framework.png\" alt=\"alignDistil framework\" width=\"60%\"\u003e\n\u003c/div\u003e\n\u003c!-- ![figure](images/method.png) --\u003e\n\nOur AlignDistil is easy to use, which contains three steps:\n- Train a DPO model on your preferece data\n- Train a reverse DPO model on your reversed preference data (swapping `chosen` and `rejected`)\n- AlignDistil: Composing a synthetic distribution from these two models and distill it to the current policy model.\nIt could be on your preference data (off-policy) or model-sampled data (on-policy).\n\n## Prepare\nPlease run the following commands to install the specific OpenRLHF in our repo:\n```shell\ngit clone https://github.com/songmzhang/AlignDistil\ncd AlignDistil/OpenRLHF\npip install -e ./\n```\nYou also need to install vllm to run on-policy AlignDistil.\n\n## Start\nDPO training example:\n```shell\nbash ./train_scripts/ultrafeedback/qwen2.5-1.5b/dpo_01.sh\n```\n\nReverse DPO training example:\n```shell\nbash ./train_scripts/ultrafeedback/qwen2.5-1.5b/reverse_dpo_01.sh\n```\n\nOff-policy AlignDistil training example:\n```shell\nbash ./train_scripts/ultrafeedback/qwen2.5-1.5b/aligndistil_off_policy.sh\n```\n\nOn-policy AlignDistil training example:\n```shell\nbash ./train_scripts/ultrafeedback/qwen2.5-1.5b/aligndistil_on_policy.sh\n```\n\n## Citation\nIf you find this repo helpful, please cite our paper:\n```text\n@article{zhang2025aligndistil,\n  title={Aligndistil: Token-level language model alignment as adaptive policy distillation},\n  author={Zhang, Songming and Zhang, Xue and Zhang, Tong and Hu, Bojie and Chen, Yufeng and Xu, Jinan},\n  journal={arXiv preprint arXiv:2503.02832},\n  year={2025}\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsongmzhang%2FAlignDistil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsongmzhang%2FAlignDistil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsongmzhang%2FAlignDistil/lists"}