{"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/alignment-aware-model-extraction-attacks-on","title":"\"Yes, My LoRD.\" Guiding Language Model Extraction with Locality Reinforced Distillation","arxiv_id":"2409.02718","date":"2024-09-04","proceeding":null,"authors":["Zi Liang","Qingqing Ye","Yanyun Wang","Sen Zhang","Yaxin Xiao","RongHua Li","Jianliang Xu","Haibo Hu"],"abstract":"Model extraction attacks (MEAs) on large language models (LLMs) have received increasing attention in recent research. However, existing attack methods typically adapt the extraction strategies originally developed for deep neural networks (DNNs). They neglect the underlying inconsistency between the training tasks of MEA and LLM alignment, leading to suboptimal attack performance. To tackle this issue, we propose Locality Reinforced Distillation (LoRD), a novel model extraction algorithm specifically designed for LLMs. In particular, LoRD employs a newly defined policy-gradient-style training task that utilizes the responses of victim model as the signal to guide the crafting of preference for the local model. Theoretical analyses demonstrate that I) The convergence procedure of LoRD in model extraction is consistent with the alignment procedure of LLMs, and II) LoRD can reduce query complexity while mitigating watermark protection through our exploration-based stealing. Extensive experiments validate the superiority of our method in extracting various state-of-the-art commercial LLMs. Our code is available at: https://github.com/liangzid/LoRD-MEA .","url_abs":"https://arxiv.org/abs/2409.02718v3","url_pdf":"https://arxiv.org/pdf/2409.02718v3.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":"alignment-aware-model-extraction-attacks-on","repo_url":"https://github.com/liangzid/alignmentextraction","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"alignment-aware-model-extraction-attacks-on","repo_url":"https://github.com/liangzid/lord-mea","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"model-extraction","task_name":"Model extraction"}],"methods":[{"method_slug":"attention","method_name":"Attention"},{"method_slug":"softmax","method_name":"Softmax"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2409.02718","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2409.02718"}},"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/liangzid/lord-mea","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/liangzid/alignmentextraction","reach":{"status":"ok"}}],"summary":{"ran":6,"unverified":1},"by_repo_kind":{"official":{"samples":7,"ran":6,"repositories":2}},"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":7,"samples":[{"code_sha256_prefix":"622878101d35577d","entry":"bleu_count","repo":"liangzid/alignmentextraction","repo_kind":"official","path":"bleu4.py","file_url":"https://github.com/liangzid/alignmentextraction/blob/HEAD/bleu4.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":"622878101d35577d"}},{"code_sha256_prefix":"11aff40704a6d93e","entry":"corpus_bleu","repo":"liangzid/alignmentextraction","repo_kind":"official","path":"bleu4.py","file_url":"https://github.com/liangzid/alignmentextraction/blob/HEAD/bleu4.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":"11aff40704a6d93e"}},{"code_sha256_prefix":"d19477d96c073c77","entry":"eval_code","repo":"liangzid/alignmentextraction","repo_kind":"official","path":"code_process.py","file_url":"https://github.com/liangzid/alignmentextraction/blob/HEAD/code_process.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":"d19477d96c073c77"}},{"code_sha256_prefix":"9b68d7c8c2502e0c","entry":"eval_siQA","repo":"liangzid/alignmentextraction","repo_kind":"official","path":"common_task_process.py","file_url":"https://github.com/liangzid/alignmentextraction/blob/HEAD/common_task_process.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":"9b68d7c8c2502e0c"}},{"code_sha256_prefix":"ac86eca2846149a7","entry":"formatting_func","repo":"liangzid/alignmentextraction","repo_kind":"official","path":"supervised_finetuning.py","file_url":"https://github.com/liangzid/alignmentextraction/blob/HEAD/supervised_finetuning.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":"ac86eca2846149a7"}},{"code_sha256_prefix":"9d95cead689f7ef6","entry":"random_take","repo":"liangzid/lord-mea","repo_kind":"official","path":"train_pod4_lord_II.py","file_url":"https://github.com/liangzid/lord-mea/blob/HEAD/train_pod4_lord_II.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":"9d95cead689f7ef6"}},{"code_sha256_prefix":"3f1d6e8a3a90c43c","entry":"reinforce_train_one_period","repo":"liangzid/lord-mea","repo_kind":"official","path":"lord_reinforce_train.py","file_url":"https://github.com/liangzid/lord-mea/blob/HEAD/lord_reinforce_train.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":"3f1d6e8a3a90c43c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}