{"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/knowledge-graph-enhanced-large-language","title":"Knowledge Graph-Enhanced Large Language Models via Path Selection","arxiv_id":"2406.13862","date":"2024-06-19","proceeding":null,"authors":["Haochen Liu","Song Wang","Yaochen Zhu","Yushun Dong","Jundong Li"],"abstract":"Large Language Models (LLMs) have shown unprecedented performance in various real-world applications. However, they are known to generate factually inaccurate outputs, a.k.a. the hallucination problem. In recent years, incorporating external knowledge extracted from Knowledge Graphs (KGs) has become a promising strategy to improve the factual accuracy of LLM-generated outputs. Nevertheless, most existing explorations rely on LLMs themselves to perform KG knowledge extraction, which is highly inflexible as LLMs can only provide binary judgment on whether a certain knowledge (e.g., a knowledge path in KG) should be used. In addition, LLMs tend to pick only knowledge with direct semantic relationship with the input text, while potentially useful knowledge with indirect semantics can be ignored. In this work, we propose a principled framework KELP with three stages to handle the above problems. Specifically, KELP is able to achieve finer granularity of flexible knowledge extraction by generating scores for knowledge paths with input texts via latent semantic matching. Meanwhile, knowledge paths with indirect semantic relationships with the input text can also be considered via trained encoding between the selected paths in KG and the input text. Experiments on real-world datasets validate the effectiveness of KELP.","url_abs":"https://arxiv.org/abs/2406.13862v1","url_pdf":"https://arxiv.org/pdf/2406.13862v1.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":"knowledge-graph-enhanced-large-language","repo_url":"https://github.com/haochenliu2000/kelp","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"hallucination","task_name":"Hallucination"},{"task_slug":"knowledge-graphs","task_name":"Knowledge Graphs"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2406.13862","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2406.13862"}},"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/haochenliu2000/kelp","reach":{"status":"ok"}}],"summary":{"ran":4,"unverified":2},"by_repo_kind":{"official":{"samples":6,"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":6,"samples":[{"code_sha256_prefix":"d5015ca62f525fed","entry":"build_subgraph","repo":"haochenliu2000/kelp","repo_kind":"official","path":"metaQA/test-1hop.py","file_url":"https://github.com/haochenliu2000/kelp/blob/HEAD/metaQA/test-1hop.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":"d5015ca62f525fed"}},{"code_sha256_prefix":"4dd29b64f443d338","entry":"build_subgraph","repo":"haochenliu2000/kelp","repo_kind":"official","path":"metaQA/test-2hop.py","file_url":"https://github.com/haochenliu2000/kelp/blob/HEAD/metaQA/test-2hop.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":"4dd29b64f443d338"}},{"code_sha256_prefix":"3c10b4517abec289","entry":"get_one_hop_neighbors_rels_ranking","repo":"haochenliu2000/kelp","repo_kind":"official","path":"metaQA/make_training_set.py","file_url":"https://github.com/haochenliu2000/kelp/blob/HEAD/metaQA/make_training_set.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":"3c10b4517abec289"}},{"code_sha256_prefix":"ac173d49e37e88b1","entry":"open_file","repo":"haochenliu2000/kelp","repo_kind":"official","path":"factkg/make_training_set.py","file_url":"https://github.com/haochenliu2000/kelp/blob/HEAD/factkg/make_training_set.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":"ac173d49e37e88b1"}},{"code_sha256_prefix":"cc7e3249dca667f4","entry":"build_subgraph_rels_ranking","repo":"haochenliu2000/kelp","repo_kind":"official","path":"factkg/make_training_set.py","file_url":"https://github.com/haochenliu2000/kelp/blob/HEAD/factkg/make_training_set.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":"cc7e3249dca667f4"}},{"code_sha256_prefix":"1495d07ab03e6a4a","entry":"llm","repo":"haochenliu2000/kelp","repo_kind":"official","path":"factkg/make_training_set.py","file_url":"https://github.com/haochenliu2000/kelp/blob/HEAD/factkg/make_training_set.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":"1495d07ab03e6a4a"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}