{"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/lion-adversarial-distillation-of-closed","title":"Lion: Adversarial Distillation of Proprietary Large Language Models","arxiv_id":"2305.12870","date":"2023-05-22","proceeding":null,"authors":["Yuxin Jiang","Chunkit Chan","Mingyang Chen","Wei Wang"],"abstract":"The practice of transferring knowledge from a sophisticated, proprietary large language model (LLM) to a compact, open-source LLM has garnered considerable attention. Previous works have focused on a unidirectional knowledge distillation way by aligning the responses of the student model with those of the teacher model to a set of instructions. Nevertheless, they overlooked the possibility of incorporating any reciprocal \"feedback\"--identifying challenging instructions where the student model's performance falls short--to boost the student model's proficiency iteratively. To this end, we propose a novel adversarial distillation framework for a more efficient knowledge transfer. Leveraging the versatile role adaptability of LLMs, we prompt the teacher model to identify \"hard\" instructions and generate new \"hard\" instructions for the student model, creating a three-stage adversarial loop of imitation, discrimination, and generation. By applying this adversarial framework, we successfully transfer knowledge from ChatGPT to a student model (named Lion), using a mere 70k training data. Our results show that Lion-13B not only achieves comparable open-ended generation capabilities to ChatGPT but surpasses conventional state-of-the-art (SOTA) instruction-tuned models like Vicuna-13B by 55.4% in challenging zero-shot reasoning benchmarks such as BIG-Bench Hard (BBH) and 16.7% on AGIEval. Code and model can be found at https://github.com/YJiangcm/Lion.","url_abs":"https://arxiv.org/abs/2305.12870v2","url_pdf":"https://arxiv.org/pdf/2305.12870v2.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":"lion-adversarial-distillation-of-closed","repo_url":"https://github.com/yjiangcm/lion","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"instruction-following","task_name":"Instruction Following"},{"task_slug":"knowledge-distillation","task_name":"Knowledge Distillation"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"large-language-model","task_name":"Large Language Model"},{"task_slug":"transfer-learning","task_name":"Transfer Learning"}],"methods":[{"method_slug":"knowledge-distillation","method_name":"Knowledge Distillation"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2305.12870","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2305.12870"}},"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":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/yjiangcm/lion","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_draft_wrong":1,"ran":1,"unverified":9},"by_repo_kind":{"official":{"samples":11,"ran":2,"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":0,"samples":[{"code_sha256_prefix":"d07d04439cd1d44f","entry":"jload","repo":"yjiangcm/lion","repo_kind":"official","path":"src/utils.py","file_url":"https://github.com/yjiangcm/lion/blob/HEAD/src/utils.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d07d04439cd1d44f"}},{"code_sha256_prefix":"817d5f759487007d","entry":"preprocess","repo":"yjiangcm/lion","repo_kind":"official","path":"src/train_deepspeed.py","file_url":"https://github.com/yjiangcm/lion/blob/HEAD/src/train_deepspeed.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"817d5f759487007d"}},{"code_sha256_prefix":"e19e3003e9840448","entry":"encode_prompt","repo":"yjiangcm/lion","repo_kind":"official","path":"src/generate_easy_instruction.py","file_url":"https://github.com/yjiangcm/lion/blob/HEAD/src/generate_easy_instruction.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e19e3003e9840448"}},{"code_sha256_prefix":"2d9884b05d0bfa25","entry":"gen_prompt","repo":"yjiangcm/lion","repo_kind":"official","path":"src/chatgpt_referee.py","file_url":"https://github.com/yjiangcm/lion/blob/HEAD/src/chatgpt_referee.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2d9884b05d0bfa25"}},{"code_sha256_prefix":"36dc95d12630a6f0","entry":"generate_prompt","repo":"yjiangcm/lion","repo_kind":"official","path":"src/lion_inference.py","file_url":"https://github.com/yjiangcm/lion/blob/HEAD/src/lion_inference.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"36dc95d12630a6f0"}},{"code_sha256_prefix":"8cd557465a1f5553","entry":"get_eval","repo":"yjiangcm/lion","repo_kind":"official","path":"src/chatgpt_inference.py","file_url":"https://github.com/yjiangcm/lion/blob/HEAD/src/chatgpt_inference.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8cd557465a1f5553"}},{"code_sha256_prefix":"5823dba3817cc067","entry":"get_eval","repo":"yjiangcm/lion","repo_kind":"official","path":"src/chatgpt_referee.py","file_url":"https://github.com/yjiangcm/lion/blob/HEAD/src/chatgpt_referee.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5823dba3817cc067"}},{"code_sha256_prefix":"e74ea48e46988286","entry":"get_json_list","repo":"yjiangcm/lion","repo_kind":"official","path":"src/utils.py","file_url":"https://github.com/yjiangcm/lion/blob/HEAD/src/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e74ea48e46988286"}},{"code_sha256_prefix":"f529caa047a46653","entry":"get_model_answers","repo":"yjiangcm/lion","repo_kind":"official","path":"src/lion_inference.py","file_url":"https://github.com/yjiangcm/lion/blob/HEAD/src/lion_inference.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f529caa047a46653"}},{"code_sha256_prefix":"eb6629df9a940cb4","entry":"parse_score","repo":"yjiangcm/lion","repo_kind":"official","path":"src/chatgpt_referee.py","file_url":"https://github.com/yjiangcm/lion/blob/HEAD/src/chatgpt_referee.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"eb6629df9a940cb4"}},{"code_sha256_prefix":"a2aee0157546c3ef","entry":"post_process_gpt3_response","repo":"yjiangcm/lion","repo_kind":"official","path":"src/generate_easy_instruction.py","file_url":"https://github.com/yjiangcm/lion/blob/HEAD/src/generate_easy_instruction.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a2aee0157546c3ef"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}