{"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-prompting-for-multi-document","title":"Knowledge Graph Prompting for Multi-Document Question Answering","arxiv_id":"2308.11730","date":"2023-08-22","proceeding":null,"authors":["Yu Wang","Nedim Lipka","Ryan A. Rossi","Alexa Siu","Ruiyi Zhang","Tyler Derr"],"abstract":"The `pre-train, prompt, predict' paradigm of large language models (LLMs) has achieved remarkable success in open-domain question answering (OD-QA). However, few works explore this paradigm in the scenario of multi-document question answering (MD-QA), a task demanding a thorough understanding of the logical associations among the contents and structures of different documents. To fill this crucial gap, we propose a Knowledge Graph Prompting (KGP) method to formulate the right context in prompting LLMs for MD-QA, which consists of a graph construction module and a graph traversal module. For graph construction, we create a knowledge graph (KG) over multiple documents with nodes symbolizing passages or document structures (e.g., pages/tables), and edges denoting the semantic/lexical similarity between passages or intra-document structural relations. For graph traversal, we design an LLM-based graph traversal agent that navigates across nodes and gathers supporting passages assisting LLMs in MD-QA. The constructed graph serves as the global ruler that regulates the transitional space among passages and reduces retrieval latency. Concurrently, the graph traversal agent acts as a local navigator that gathers pertinent context to progressively approach the question and guarantee retrieval quality. Extensive experiments underscore the efficacy of KGP for MD-QA, signifying the potential of leveraging graphs in enhancing the prompt design for LLMs. Our code: https://github.com/YuWVandy/KG-LLM-MDQA.","url_abs":"https://arxiv.org/abs/2308.11730v3","url_pdf":"https://arxiv.org/pdf/2308.11730v3.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-prompting-for-multi-document","repo_url":"https://github.com/yuwvandy/kg-llm-mdqa","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"open-domain-question-answering","task_name":"Open-Domain Question Answering"},{"task_slug":"question-answering","task_name":"Question Answering"},{"task_slug":"retrieval","task_name":"Retrieval"},{"task_slug":"graph-construction","task_name":"graph construction"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2308.11730","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2308.11730"}},"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/yuwvandy/kg-llm-mdqa","reach":{"status":"ok"}}],"summary":{"ran":15,"unverified":2},"by_repo_kind":{"official":{"samples":17,"ran":15,"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":17,"samples":[{"code_sha256_prefix":"bcb6a2f9dffc4de8","entry":"Dataset_collate","repo":"yuwvandy/kg-llm-mdqa","repo_kind":"official","path":"DPR/loader.py","file_url":"https://github.com/yuwvandy/kg-llm-mdqa/blob/HEAD/DPR/loader.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":"bcb6a2f9dffc4de8"}},{"code_sha256_prefix":"25de4cd985d9cf87","entry":"check_answer","repo":"yuwvandy/kg-llm-mdqa","repo_kind":"official","path":"DPR/evaluation.py","file_url":"https://github.com/yuwvandy/kg-llm-mdqa/blob/HEAD/DPR/evaluation.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":"25de4cd985d9cf87"}},{"code_sha256_prefix":"1935b354c2dfc484","entry":"collate_tokens","repo":"yuwvandy/kg-llm-mdqa","repo_kind":"official","path":"DPR/loader.py","file_url":"https://github.com/yuwvandy/kg-llm-mdqa/blob/HEAD/DPR/loader.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":"1935b354c2dfc484"}},{"code_sha256_prefix":"181d05538fbeb8a1","entry":"diG_ratio_nei_overlap","repo":"yuwvandy/kg-llm-mdqa","repo_kind":"official","path":"Data-Collect/count_nei_overlap.py","file_url":"https://github.com/yuwvandy/kg-llm-mdqa/blob/HEAD/Data-Collect/count_nei_overlap.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":"181d05538fbeb8a1"}},{"code_sha256_prefix":"2075373a61e75fd7","entry":"has_answer","repo":"yuwvandy/kg-llm-mdqa","repo_kind":"official","path":"DPR/evaluation.py","file_url":"https://github.com/yuwvandy/kg-llm-mdqa/blob/HEAD/DPR/evaluation.py","link_basis":"harvester_set","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":"2075373a61e75fd7"}},{"code_sha256_prefix":"b5110e3368d3de74","entry":"load_dataset","repo":"yuwvandy/kg-llm-mdqa","repo_kind":"official","path":"DPR/dataset.py","file_url":"https://github.com/yuwvandy/kg-llm-mdqa/blob/HEAD/DPR/dataset.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":"b5110e3368d3de74"}},{"code_sha256_prefix":"eecdb8aefda2aec2","entry":"load_dataset_inf","repo":"yuwvandy/kg-llm-mdqa","repo_kind":"official","path":"DPR/dataset.py","file_url":"https://github.com/yuwvandy/kg-llm-mdqa/blob/HEAD/DPR/dataset.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":"eecdb8aefda2aec2"}},{"code_sha256_prefix":"69c2c7b48e030046","entry":"load_saved","repo":"yuwvandy/kg-llm-mdqa","repo_kind":"official","path":"DPR/utils.py","file_url":"https://github.com/yuwvandy/kg-llm-mdqa/blob/HEAD/DPR/utils.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":"69c2c7b48e030046"}},{"code_sha256_prefix":"0be1ea343ffa7c85","entry":"move_to_cuda","repo":"yuwvandy/kg-llm-mdqa","repo_kind":"official","path":"DPR/utils.py","file_url":"https://github.com/yuwvandy/kg-llm-mdqa/blob/HEAD/DPR/utils.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":"0be1ea343ffa7c85"}},{"code_sha256_prefix":"27c848a2b411a83e","entry":"mp_loss","repo":"yuwvandy/kg-llm-mdqa","repo_kind":"official","path":"DPR/learn.py","file_url":"https://github.com/yuwvandy/kg-llm-mdqa/blob/HEAD/DPR/learn.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":"27c848a2b411a83e"}},{"code_sha256_prefix":"976d0ff530b8e0c1","entry":"multiG_ratio_nei_overlap","repo":"yuwvandy/kg-llm-mdqa","repo_kind":"official","path":"Data-Collect/count_nei_overlap.py","file_url":"https://github.com/yuwvandy/kg-llm-mdqa/blob/HEAD/Data-Collect/count_nei_overlap.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":"976d0ff530b8e0c1"}},{"code_sha256_prefix":"4cca112e5e6da5dc","entry":"normalize_answer","repo":"yuwvandy/kg-llm-mdqa","repo_kind":"official","path":"DPR/evaluation.py","file_url":"https://github.com/yuwvandy/kg-llm-mdqa/blob/HEAD/DPR/evaluation.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"4cca112e5e6da5dc"}},{"code_sha256_prefix":"cd4656b6c628c145","entry":"run","repo":"yuwvandy/kg-llm-mdqa","repo_kind":"official","path":"DPR/main_eval.py","file_url":"https://github.com/yuwvandy/kg-llm-mdqa/blob/HEAD/DPR/main_eval.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":"cd4656b6c628c145"}},{"code_sha256_prefix":"29f0e538be5cfceb","entry":"run","repo":"yuwvandy/kg-llm-mdqa","repo_kind":"official","path":"Data-Collect/mdr_encode.py","file_url":"https://github.com/yuwvandy/kg-llm-mdqa/blob/HEAD/Data-Collect/mdr_encode.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":"29f0e538be5cfceb"}},{"code_sha256_prefix":"0e5b1c99eaeb69b8","entry":"wat_annotations","repo":"yuwvandy/kg-llm-mdqa","repo_kind":"official","path":"Data-Collect/graph_construct.py","file_url":"https://github.com/yuwvandy/kg-llm-mdqa/blob/HEAD/Data-Collect/graph_construct.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":"0e5b1c99eaeb69b8"}},{"code_sha256_prefix":"4dbe24f676f0e199","entry":"wat_entity_linking","repo":"yuwvandy/kg-llm-mdqa","repo_kind":"official","path":"Data-Collect/graph_construct.py","file_url":"https://github.com/yuwvandy/kg-llm-mdqa/blob/HEAD/Data-Collect/graph_construct.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":"4dbe24f676f0e199"}},{"code_sha256_prefix":"720ae0d197ca6652","entry":"wiki_kw_extract_chunk","repo":"yuwvandy/kg-llm-mdqa","repo_kind":"official","path":"Data-Collect/graph_construct.py","file_url":"https://github.com/yuwvandy/kg-llm-mdqa/blob/HEAD/Data-Collect/graph_construct.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":"720ae0d197ca6652"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}