{"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/contextualization-distillation-from-large","title":"Contextualization Distillation from Large Language Model for Knowledge Graph Completion","arxiv_id":"2402.01729","date":"2024-01-28","proceeding":null,"authors":["Dawei Li","Zhen Tan","Tianlong Chen","Huan Liu"],"abstract":"While textual information significantly enhances the performance of pre-trained language models (PLMs) in knowledge graph completion (KGC), the static and noisy nature of existing corpora collected from Wikipedia articles or synsets definitions often limits the potential of PLM-based KGC models. To surmount these challenges, we introduce the Contextualization Distillation strategy, a versatile plug-in-and-play approach compatible with both discriminative and generative KGC frameworks. Our method begins by instructing large language models (LLMs) to transform compact, structural triplets into context-rich segments. Subsequently, we introduce two tailored auxiliary tasks, reconstruction and contextualization, allowing smaller KGC models to assimilate insights from these enriched triplets. Comprehensive evaluations across diverse datasets and KGC techniques highlight the efficacy and adaptability of our approach, revealing consistent performance enhancements irrespective of underlying pipelines or architectures. Moreover, our analysis makes our method more explainable and provides insight into generating path selection, as well as the choosing of suitable distillation tasks. All the code and data in this work will be released at https://github.com/David-Li0406/Contextulization-Distillation","url_abs":"https://arxiv.org/abs/2402.01729v3","url_pdf":"https://arxiv.org/pdf/2402.01729v3.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":"contextualization-distillation-from-large","repo_url":"https://github.com/david-li0406/contextulization-distillation","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"articles","task_name":"Articles"},{"task_slug":"knowledge-graph-completion","task_name":"Knowledge Graph Completion"},{"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"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2402.01729","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2402.01729"}},"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/david-li0406/contextulization-distillation","reach":{"status":"ok"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/David-Li0406/Contextulization-Distillation","reach":{"status":"ok"}}],"summary":{"ran_draft_wrong":1,"ran_honours":1,"ran":6,"unverified":1},"by_repo_kind":{"official":{"samples":9,"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":9,"samples":[{"code_sha256_prefix":"0f786c407fb1ee4c","entry":"swish","repo":"David-Li0406/Contextulization-Distillation","repo_kind":"official","path":"kg-bert/model_distillation.py","file_url":"https://github.com/David-Li0406/Contextulization-Distillation/blob/HEAD/kg-bert/model_distillation.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":2,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0f786c407fb1ee4c"}},{"code_sha256_prefix":"fdc64f4c72036ae4","entry":"gelu","repo":"David-Li0406/Contextulization-Distillation","repo_kind":"official","path":"kg-bert/model_distillation.py","file_url":"https://github.com/David-Li0406/Contextulization-Distillation/blob/HEAD/kg-bert/model_distillation.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"fdc64f4c72036ae4"}},{"code_sha256_prefix":"e74966ca8692821c","entry":"get_num","repo":"David-Li0406/Contextulization-Distillation","repo_kind":"official","path":"CSProm-KG/helper.py","file_url":"https://github.com/David-Li0406/Contextulization-Distillation/blob/HEAD/CSProm-KG/helper.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":"e74966ca8692821c"}},{"code_sha256_prefix":"effa50b5db3f0b19","entry":"get_num","repo":"David-Li0406/Contextulization-Distillation","repo_kind":"official","path":"KG-S2S/helper.py","file_url":"https://github.com/David-Li0406/Contextulization-Distillation/blob/HEAD/KG-S2S/helper.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":"effa50b5db3f0b19"}},{"code_sha256_prefix":"d619daabb614dbe4","entry":"read","repo":"David-Li0406/Contextulization-Distillation","repo_kind":"official","path":"CSProm-KG/helper.py","file_url":"https://github.com/David-Li0406/Contextulization-Distillation/blob/HEAD/CSProm-KG/helper.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":"d619daabb614dbe4"}},{"code_sha256_prefix":"e1214bdb8f4557e4","entry":"read","repo":"David-Li0406/Contextulization-Distillation","repo_kind":"official","path":"KG-S2S/helper.py","file_url":"https://github.com/David-Li0406/Contextulization-Distillation/blob/HEAD/KG-S2S/helper.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":"e1214bdb8f4557e4"}},{"code_sha256_prefix":"f9537cf81348be25","entry":"read_file","repo":"David-Li0406/Contextulization-Distillation","repo_kind":"official","path":"CSProm-KG/helper.py","file_url":"https://github.com/David-Li0406/Contextulization-Distillation/blob/HEAD/CSProm-KG/helper.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":"f9537cf81348be25"}},{"code_sha256_prefix":"c005f30ead3132ac","entry":"read_file","repo":"David-Li0406/Contextulization-Distillation","repo_kind":"official","path":"KG-S2S/helper.py","file_url":"https://github.com/David-Li0406/Contextulization-Distillation/blob/HEAD/KG-S2S/helper.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":"c005f30ead3132ac"}},{"code_sha256_prefix":"b1a7180868dd8d6a","entry":"load_tf_weights_in_bert","repo":"David-Li0406/Contextulization-Distillation","repo_kind":"official","path":"kg-bert/model_distillation.py","file_url":"https://github.com/David-Li0406/Contextulization-Distillation/blob/HEAD/kg-bert/model_distillation.py","link_basis":"plan_row","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":"b1a7180868dd8d6a"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}