{"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/how-to-leverage-demonstration-data-in","title":"How to Leverage Demonstration Data in Alignment for Large Language Model? A Self-Imitation Learning Perspective","arxiv_id":"2410.10093","date":"2024-10-14","proceeding":null,"authors":["Teng Xiao","Mingxiao Li","Yige Yuan","Huaisheng Zhu","Chao Cui","Vasant G Honavar"],"abstract":"This paper introduces a novel generalized self-imitation learning ($\\textbf{GSIL}$) framework, which effectively and efficiently aligns large language models with offline demonstration data. We develop $\\textbf{GSIL}$ by deriving a surrogate objective of imitation learning with density ratio estimates, facilitating the use of self-generated data and optimizing the imitation learning objective with simple classification losses. $\\textbf{GSIL}$ eliminates the need for complex adversarial training in standard imitation learning, achieving lightweight and efficient fine-tuning for large language models. In addition, $\\textbf{GSIL}$ encompasses a family of offline losses parameterized by a general class of convex functions for density ratio estimation and enables a unified view for alignment with demonstration data. Extensive experiments show that $\\textbf{GSIL}$ consistently and significantly outperforms baselines in many challenging benchmarks, such as coding (HuamnEval), mathematical reasoning (GSM8K) and instruction-following benchmark (MT-Bench).","url_abs":"https://arxiv.org/abs/2410.10093v1","url_pdf":"https://arxiv.org/pdf/2410.10093v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"how-to-leverage-demonstration-data-in","repo_url":"https://github.com/tengxiao1/gsil","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"density-ratio-estimation","task_name":"Density Ratio Estimation"},{"task_slug":"gsm8k","task_name":"GSM8K"},{"task_slug":"imitation-learning","task_name":"Imitation Learning"},{"task_slug":"instruction-following","task_name":"Instruction Following"},{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"large-language-model","task_name":"Large Language Model"},{"task_slug":"mathematical-reasoning","task_name":"Mathematical Reasoning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2410.10093","atlas_url":"https://app.syntology.ai/?focus=2410.10093","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.10093"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/tengxiao1/gsil","reach":{"status":"ok"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/tengxiao1/GSIL","reach":{"status":"ok"}}],"summary":{"ran":8,"unverified":2},"by_repo_kind":{"official":{"samples":10,"ran":8,"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":10,"samples":[{"code_sha256_prefix":"23781da963dd98a5","entry":"apply_chat_template","repo":"tengxiao1/GSIL","repo_kind":"official","path":"gsil/alignment/data.py","file_url":"https://github.com/tengxiao1/GSIL/blob/HEAD/gsil/alignment/data.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":"23781da963dd98a5"}},{"code_sha256_prefix":"1b4af0629010ced4","entry":"apply_chat_template_dpo","repo":"tengxiao1/GSIL","repo_kind":"official","path":"gsil/run_gsil.py","file_url":"https://github.com/tengxiao1/GSIL/blob/HEAD/gsil/run_gsil.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":"1b4af0629010ced4"}},{"code_sha256_prefix":"4f500029c1332cc3","entry":"apply_chat_template_spin","repo":"tengxiao1/GSIL","repo_kind":"official","path":"gsil/run_gsil.py","file_url":"https://github.com/tengxiao1/GSIL/blob/HEAD/gsil/run_gsil.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":"4f500029c1332cc3"}},{"code_sha256_prefix":"d644aa0a41ffedf1","entry":"load_and_process_data_ultrachat","repo":"tengxiao1/GSIL","repo_kind":"official","path":"gsil/combine.py","file_url":"https://github.com/tengxiao1/GSIL/blob/HEAD/gsil/combine.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":"d644aa0a41ffedf1"}},{"code_sha256_prefix":"a934ef1868f33dea","entry":"mix_datasets","repo":"tengxiao1/GSIL","repo_kind":"official","path":"gsil/alignment/data.py","file_url":"https://github.com/tengxiao1/GSIL/blob/HEAD/gsil/alignment/data.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":"a934ef1868f33dea"}},{"code_sha256_prefix":"65ab2e38274df088","entry":"prepare_prompts","repo":"tengxiao1/GSIL","repo_kind":"official","path":"gsil/generate.py","file_url":"https://github.com/tengxiao1/GSIL/blob/HEAD/gsil/generate.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":"65ab2e38274df088"}},{"code_sha256_prefix":"d15e65c12916d1f1","entry":"read_json","repo":"tengxiao1/GSIL","repo_kind":"official","path":"gsil/combine.py","file_url":"https://github.com/tengxiao1/GSIL/blob/HEAD/gsil/combine.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":"d15e65c12916d1f1"}},{"code_sha256_prefix":"ed3cbe8d977dbf1d","entry":"read_jsonl","repo":"tengxiao1/GSIL","repo_kind":"official","path":"gsil/combine.py","file_url":"https://github.com/tengxiao1/GSIL/blob/HEAD/gsil/combine.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":"ed3cbe8d977dbf1d"}},{"code_sha256_prefix":"26a8955ec17591c5","entry":"get_datasets","repo":"tengxiao1/GSIL","repo_kind":"official","path":"gsil/alignment/data.py","file_url":"https://github.com/tengxiao1/GSIL/blob/HEAD/gsil/alignment/data.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":"26a8955ec17591c5"}},{"code_sha256_prefix":"c9ed692d311c459a","entry":"get_quantization_config","repo":"tengxiao1/GSIL","repo_kind":"official","path":"gsil/alignment/model_utils.py","file_url":"https://github.com/tengxiao1/GSIL/blob/HEAD/gsil/alignment/model_utils.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":"c9ed692d311c459a"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}