{"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/multi-hop-knowledge-graph-reasoning-with","title":"Multi-Hop Knowledge Graph Reasoning with Reward Shaping","arxiv_id":"1808.10568","date":"2018-08-31","proceeding":"EMNLP 2018 10","authors":["Xi Victoria Lin","Richard Socher","Caiming Xiong"],"abstract":"Multi-hop reasoning is an effective approach for query answering (QA) over\nincomplete knowledge graphs (KGs). The problem can be formulated in a\nreinforcement learning (RL) setup, where a policy-based agent sequentially\nextends its inference path until it reaches a target. However, in an incomplete\nKG environment, the agent receives low-quality rewards corrupted by false\nnegatives in the training data, which harms generalization at test time.\nFurthermore, since no golden action sequence is used for training, the agent\ncan be misled by spurious search trajectories that incidentally lead to the\ncorrect answer. We propose two modeling advances to address both issues: (1) we\nreduce the impact of false negative supervision by adopting a pretrained\none-hop embedding model to estimate the reward of unobserved facts; (2) we\ncounter the sensitivity to spurious paths of on-policy RL by forcing the agent\nto explore a diverse set of paths using randomly generated edge masks. Our\napproach significantly improves over existing path-based KGQA models on several\nbenchmark datasets and is comparable or better than embedding-based models.","url_abs":"http://arxiv.org/abs/1808.10568v2","url_pdf":"http://arxiv.org/pdf/1808.10568v2.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":"multi-hop-knowledge-graph-reasoning-with","repo_url":"https://github.com/salesforce/MultiHopKG","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"BSD-3-Clause"}},{"paper_slug":"multi-hop-knowledge-graph-reasoning-with","repo_url":"https://github.com/kingsaint/InductiveExplainableLinkPrediction","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"BSD-3-Clause"}},{"paper_slug":"multi-hop-knowledge-graph-reasoning-with","repo_url":"https://github.com/kracr/document-level-relation-extraction","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"knowledge-graph-embeddings","task_name":"Knowledge Graph Embeddings"},{"task_slug":"knowledge-graphs","task_name":"Knowledge Graphs"},{"task_slug":"reinforcement-learning","task_name":"Reinforcement Learning"},{"task_slug":"reinforcement-learning-1","task_name":"Reinforcement Learning (RL)"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1808.10568","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1808.10568"}},"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/salesforce/MultiHopKG","reach":{"status":"ok","spdx":"BSD-3-Clause"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/kingsaint/InductiveExplainableLinkPrediction","reach":{"status":"ok","spdx":"BSD-3-Clause"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/kracr/document-level-relation-extraction","reach":null}],"summary":{"unverified":12},"by_repo_kind":{"official":{"samples":11,"ran":0,"repositories":1},"listed":{"samples":1,"ran":0,"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":1,"samples":[{"code_sha256_prefix":"bf5d078656e9a5cb","entry":"batch_lookup","repo":"salesforce/MultiHopKG","repo_kind":"official","path":"src/utils/ops.py","file_url":"https://github.com/salesforce/MultiHopKG/blob/HEAD/src/utils/ops.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"bf5d078656e9a5cb"}},{"code_sha256_prefix":"cfe498d227766f79","entry":"change_to_test_model_path","repo":"salesforce/MultiHopKG","repo_kind":"official","path":"src/data_utils.py","file_url":"https://github.com/salesforce/MultiHopKG/blob/HEAD/src/data_utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"cfe498d227766f79"}},{"code_sha256_prefix":"10c22da7cb9db158","entry":"check_answer_ratio","repo":"salesforce/MultiHopKG","repo_kind":"official","path":"src/data_utils.py","file_url":"https://github.com/salesforce/MultiHopKG/blob/HEAD/src/data_utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"10c22da7cb9db158"}},{"code_sha256_prefix":"a7e3705996bcffee","entry":"check_relation_answer_ratio","repo":"salesforce/MultiHopKG","repo_kind":"official","path":"src/data_utils.py","file_url":"https://github.com/salesforce/MultiHopKG/blob/HEAD/src/data_utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"a7e3705996bcffee"}},{"code_sha256_prefix":"567cf7c18073ed45","entry":"check_relation_answer_ratio","repo":"kingsaint/InductiveExplainableLinkPrediction","repo_kind":"listed","path":"src/data_utils.py","file_url":"https://github.com/kingsaint/InductiveExplainableLinkPrediction/blob/HEAD/src/data_utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":false,"mcp_get_code":{"code_sha256":"567cf7c18073ed45"}},{"code_sha256_prefix":"84a0e853fae6b04f","entry":"compute_venn_areas","repo":"salesforce/MultiHopKG","repo_kind":"official","path":"src/error_analysis/analysis_modules.py","file_url":"https://github.com/salesforce/MultiHopKG/blob/HEAD/src/error_analysis/analysis_modules.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"84a0e853fae6b04f"}},{"code_sha256_prefix":"788b295e650aa151","entry":"convert_to_dist","repo":"salesforce/MultiHopKG","repo_kind":"official","path":"src/utils/ops.py","file_url":"https://github.com/salesforce/MultiHopKG/blob/HEAD/src/utils/ops.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"788b295e650aa151"}},{"code_sha256_prefix":"84a908f10b383452","entry":"entropy","repo":"salesforce/MultiHopKG","repo_kind":"official","path":"src/utils/ops.py","file_url":"https://github.com/salesforce/MultiHopKG/blob/HEAD/src/utils/ops.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"84a908f10b383452"}},{"code_sha256_prefix":"f19a8b7eac90f996","entry":"get_complex_kg_state_dict","repo":"salesforce/MultiHopKG","repo_kind":"official","path":"src/emb/fact_network.py","file_url":"https://github.com/salesforce/MultiHopKG/blob/HEAD/src/emb/fact_network.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"f19a8b7eac90f996"}},{"code_sha256_prefix":"54cd6b30f57076ba","entry":"get_conve_kg_state_dict","repo":"salesforce/MultiHopKG","repo_kind":"official","path":"src/emb/fact_network.py","file_url":"https://github.com/salesforce/MultiHopKG/blob/HEAD/src/emb/fact_network.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"54cd6b30f57076ba"}},{"code_sha256_prefix":"2d2c990dd61cae71","entry":"get_conve_nn_state_dict","repo":"salesforce/MultiHopKG","repo_kind":"official","path":"src/emb/fact_network.py","file_url":"https://github.com/salesforce/MultiHopKG/blob/HEAD/src/emb/fact_network.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"2d2c990dd61cae71"}},{"code_sha256_prefix":"cde5ea85581be0d2","entry":"visualize_step","repo":"salesforce/MultiHopKG","repo_kind":"official","path":"src/utils/vis.py","file_url":"https://github.com/salesforce/MultiHopKG/blob/HEAD/src/utils/vis.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"BSD-3-Clause","inline_ok":true,"mcp_get_code":{"code_sha256":"cde5ea85581be0d2"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}