{"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/gradient-knowledge-distillation-for-pre","title":"Gradient Knowledge Distillation for Pre-trained Language Models","arxiv_id":"2211.01071","date":"2022-11-02","proceeding":null,"authors":["Lean Wang","Lei LI","Xu sun"],"abstract":"Knowledge distillation (KD) is an effective framework to transfer knowledge from a large-scale teacher to a compact yet well-performing student. Previous KD practices for pre-trained language models mainly transfer knowledge by aligning instance-wise outputs between the teacher and student, while neglecting an important knowledge source, i.e., the gradient of the teacher. The gradient characterizes how the teacher responds to changes in inputs, which we assume is beneficial for the student to better approximate the underlying mapping function of the teacher. Therefore, we propose Gradient Knowledge Distillation (GKD) to incorporate the gradient alignment objective into the distillation process. Experimental results show that GKD outperforms previous KD methods regarding student performance. Further analysis shows that incorporating gradient knowledge makes the student behave more consistently with the teacher, improving the interpretability greatly.","url_abs":"https://arxiv.org/abs/2211.01071v1","url_pdf":"https://arxiv.org/pdf/2211.01071v1.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":"gradient-knowledge-distillation-for-pre","repo_url":"https://github.com/lancopku/gkd","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"knowledge-distillation","task_name":"Knowledge Distillation"}],"methods":[{"method_slug":"knowledge-distillation","method_name":"Knowledge Distillation"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2211.01071","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2211.01071"}},"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/lancopku/gkd","reach":null}],"summary":{"ran_draft_wrong":3,"ran":1,"unverified":3},"by_repo_kind":{"official":{"samples":7,"ran":4,"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":7,"samples":[{"code_sha256_prefix":"2a880bde2645a9be","entry":"diff_loss","repo":"lancopku/gkd","repo_kind":"official","path":"model_architectures/gkd.py","file_url":"https://github.com/lancopku/gkd/blob/HEAD/model_architectures/gkd.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"2a880bde2645a9be"}},{"code_sha256_prefix":"69a1c78a2a729ae8","entry":"distillation_loss","repo":"lancopku/gkd","repo_kind":"official","path":"model_architectures/gkd.py","file_url":"https://github.com/lancopku/gkd/blob/HEAD/model_architectures/gkd.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"69a1c78a2a729ae8"}},{"code_sha256_prefix":"6cce00bc960354dc","entry":"logits_to_signal","repo":"lancopku/gkd","repo_kind":"official","path":"model_architectures/gkd.py","file_url":"https://github.com/lancopku/gkd/blob/HEAD/model_architectures/gkd.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6cce00bc960354dc"}},{"code_sha256_prefix":"be9d1e919909c7b1","entry":"part_classifier","repo":"lancopku/gkd","repo_kind":"official","path":"model_architectures/gkd.py","file_url":"https://github.com/lancopku/gkd/blob/HEAD/model_architectures/gkd.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":"be9d1e919909c7b1"}},{"code_sha256_prefix":"779227172e31a8b9","entry":"KDBertForSequenceClassification","repo":"lancopku/gkd","repo_kind":"official","path":"model_architectures/gkd.py","file_url":"https://github.com/lancopku/gkd/blob/HEAD/model_architectures/gkd.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":"779227172e31a8b9"}},{"code_sha256_prefix":"71d5700780c1280f","entry":"part_embedding","repo":"lancopku/gkd","repo_kind":"official","path":"model_architectures/gkd.py","file_url":"https://github.com/lancopku/gkd/blob/HEAD/model_architectures/gkd.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":"71d5700780c1280f"}},{"code_sha256_prefix":"7efe7456809e4513","entry":"part_encoder","repo":"lancopku/gkd","repo_kind":"official","path":"model_architectures/gkd.py","file_url":"https://github.com/lancopku/gkd/blob/HEAD/model_architectures/gkd.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":"7efe7456809e4513"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}