{"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/beam-retrieval-general-end-to-end-retrieval","title":"End-to-End Beam Retrieval for Multi-Hop Question Answering","arxiv_id":"2308.08973","date":"2023-08-17","proceeding":null,"authors":["Jiahao Zhang","Haiyang Zhang","Dongmei Zhang","Yong liu","Shen Huang"],"abstract":"Multi-hop question answering (QA) involves finding multiple relevant passages and step-by-step reasoning to answer complex questions, indicating a retrieve-and-read paradigm. However, previous retrievers were customized for two-hop questions, and most of them were trained separately across different hops, resulting in a lack of supervision over the entire multi-hop retrieval process and leading to poor performance in complicated scenarios beyond two hops. In this work, we introduce Beam Retrieval, an end-to-end beam retrieval framework for multi-hop QA. This approach models the multi-hop retrieval process in an end-to-end manner by jointly optimizing an encoder and two classification heads across all hops. Moreover, Beam Retrieval maintains multiple partial hypotheses of relevant passages at each step, expanding the search space and reducing the risk of missing relevant passages. To establish a complete QA system, we incorporate a supervised reader or a large language model (LLM). Experimental results demonstrate that Beam Retrieval achieves a nearly 50% improvement compared with baselines on challenging MuSiQue-Ans, and it also surpasses all previous retrievers on HotpotQA and achieves 99.9% precision on 2WikiMultiHopQA. Providing high-quality context, Beam Retrieval helps our supervised reader achieve new state-of-the-art performance and substantially improves the few-shot QA performance of LLMs.","url_abs":"https://arxiv.org/abs/2308.08973v2","url_pdf":"https://arxiv.org/pdf/2308.08973v2.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":"beam-retrieval-general-end-to-end-retrieval","repo_url":"https://github.com/Alab-NII/2wikimultihop","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"beam-retrieval-general-end-to-end-retrieval","repo_url":"https://github.com/canghongjian/beam_retriever","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"beam-retrieval-general-end-to-end-retrieval","repo_url":"https://github.com/ShayekhBinIslam/openrag","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"large-language-model","task_name":"Large Language Model"},{"task_slug":"multi-hop-question-answering","task_name":"Multi-hop Question Answering"},{"task_slug":"question-answering","task_name":"Question Answering"},{"task_slug":"retrieval","task_name":"Retrieval"}],"methods":[{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-dropout","method_name":"Attention Dropout"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"cosine-annealing","method_name":"Cosine Annealing"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"gpt-3","method_name":"GPT-3"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"linear-warmup-with-cosine-annealing","method_name":"Linear Warmup With Cosine Annealing"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"weight-decay","method_name":"Weight Decay"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/multi-hop-question-answering-on-musique-ans","task":"Multi-hop Question Answering","dataset":"MuSiQue-Ans","model":"Beam Retrieval","rank_in_archive_order":1,"of":1,"metrics":{"An":"69.2","Sp":"91.4"},"uses_additional_data":false},{"leaderboard":"/sota/question-answering-on-hotpotqa","task":"Question Answering","dataset":"HotpotQA","model":"Beam Retrieval","rank_in_archive_order":1,"of":72,"metrics":{"ANS-EM":"0.727","ANS-F1":"0.850","JOINT-EM":"0.505","JOINT-F1":"0.775","SUP-EM":"0.663","SUP-F1":"0.901"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2308.08973","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2308.08973"}},"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/Alab-NII/2wikimultihop","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/canghongjian/beam_retriever","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ShayekhBinIslam/openrag","reach":null}],"summary":{"ran":9,"ran_draft_wrong":1,"unverified":3},"by_repo_kind":{"official":{"samples":13,"ran":10,"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":0,"samples":[{"code_sha256_prefix":"14b4dc86a2f9d5fe","entry":"calculate_em_f1","repo":"canghongjian/beam_retriever","repo_kind":"official","path":"train_beam_retriever.py","file_url":"https://github.com/canghongjian/beam_retriever/blob/HEAD/train_beam_retriever.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"14b4dc86a2f9d5fe"}},{"code_sha256_prefix":"623c2ebe4e288e5d","entry":"collate_fn","repo":"canghongjian/beam_retriever","repo_kind":"official","path":"retrieval/datasets.py","file_url":"https://github.com/canghongjian/beam_retriever/blob/HEAD/retrieval/datasets.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"623c2ebe4e288e5d"}},{"code_sha256_prefix":"385a19954a28f7ad","entry":"collate_fn_each_hop","repo":"canghongjian/beam_retriever","repo_kind":"official","path":"retrieval/datasets.py","file_url":"https://github.com/canghongjian/beam_retriever/blob/HEAD/retrieval/datasets.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"385a19954a28f7ad"}},{"code_sha256_prefix":"c1478415449411ed","entry":"compute_exact","repo":"canghongjian/beam_retriever","repo_kind":"official","path":"train_reader.py","file_url":"https://github.com/canghongjian/beam_retriever/blob/HEAD/train_reader.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c1478415449411ed"}},{"code_sha256_prefix":"13a7774be41bd187","entry":"get_next","repo":"canghongjian/beam_retriever","repo_kind":"official","path":"qa/datasets.py","file_url":"https://github.com/canghongjian/beam_retriever/blob/HEAD/qa/datasets.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"13a7774be41bd187"}},{"code_sha256_prefix":"8a4f13df2795176e","entry":"get_tokens","repo":"canghongjian/beam_retriever","repo_kind":"official","path":"gpt_turbo_exp.py","file_url":"https://github.com/canghongjian/beam_retriever/blob/HEAD/gpt_turbo_exp.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8a4f13df2795176e"}},{"code_sha256_prefix":"e142253af9285485","entry":"kmp","repo":"canghongjian/beam_retriever","repo_kind":"official","path":"qa/datasets.py","file_url":"https://github.com/canghongjian/beam_retriever/blob/HEAD/qa/datasets.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e142253af9285485"}},{"code_sha256_prefix":"69c2c7b48e030046","entry":"load_saved","repo":"canghongjian/beam_retriever","repo_kind":"official","path":"utils/utils.py","file_url":"https://github.com/canghongjian/beam_retriever/blob/HEAD/utils/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"69c2c7b48e030046"}},{"code_sha256_prefix":"a4978f078a7eb7ec","entry":"move_to_cuda","repo":"canghongjian/beam_retriever","repo_kind":"official","path":"utils/utils.py","file_url":"https://github.com/canghongjian/beam_retriever/blob/HEAD/utils/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a4978f078a7eb7ec"}},{"code_sha256_prefix":"dae7ab386661a4f4","entry":"normalize_answer","repo":"canghongjian/beam_retriever","repo_kind":"official","path":"gpt_turbo_exp.py","file_url":"https://github.com/canghongjian/beam_retriever/blob/HEAD/gpt_turbo_exp.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"dae7ab386661a4f4"}},{"code_sha256_prefix":"0a8f1af973c82ca0","entry":"get_response","repo":"canghongjian/beam_retriever","repo_kind":"official","path":"llm_exp_long.py","file_url":"https://github.com/canghongjian/beam_retriever/blob/HEAD/llm_exp_long.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0a8f1af973c82ca0"}},{"code_sha256_prefix":"8e84eac6133f306f","entry":"gpt_turbo_request","repo":"canghongjian/beam_retriever","repo_kind":"official","path":"gpt_turbo_exp.py","file_url":"https://github.com/canghongjian/beam_retriever/blob/HEAD/gpt_turbo_exp.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"8e84eac6133f306f"}},{"code_sha256_prefix":"0918ce50e5647e35","entry":"reader_mhop_collate","repo":"canghongjian/beam_retriever","repo_kind":"official","path":"qa/datasets.py","file_url":"https://github.com/canghongjian/beam_retriever/blob/HEAD/qa/datasets.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0918ce50e5647e35"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}