{"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/phrase-retrieval-learns-passage-retrieval-too","title":"Phrase Retrieval Learns Passage Retrieval, Too","arxiv_id":"2109.08133","date":"2021-09-16","proceeding":"EMNLP 2021 11","authors":["Jinhyuk Lee","Alexander Wettig","Danqi Chen"],"abstract":"Dense retrieval methods have shown great promise over sparse retrieval methods in a range of NLP problems. Among them, dense phrase retrieval-the most fine-grained retrieval unit-is appealing because phrases can be directly used as the output for question answering and slot filling tasks. In this work, we follow the intuition that retrieving phrases naturally entails retrieving larger text blocks and study whether phrase retrieval can serve as the basis for coarse-level retrieval including passages and documents. We first observe that a dense phrase-retrieval system, without any retraining, already achieves better passage retrieval accuracy (+3-5% in top-5 accuracy) compared to passage retrievers, which also helps achieve superior end-to-end QA performance with fewer passages. Then, we provide an interpretation for why phrase-level supervision helps learn better fine-grained entailment compared to passage-level supervision, and also show that phrase retrieval can be improved to achieve competitive performance in document-retrieval tasks such as entity linking and knowledge-grounded dialogue. Finally, we demonstrate how phrase filtering and vector quantization can reduce the size of our index by 4-10x, making dense phrase retrieval a practical and versatile solution in multi-granularity retrieval.","url_abs":"https://arxiv.org/abs/2109.08133v1","url_pdf":"https://arxiv.org/pdf/2109.08133v1.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":"phrase-retrieval-learns-passage-retrieval-too","repo_url":"https://github.com/princeton-nlp/DensePhrases","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"entity-linking","task_name":"Entity Linking"},{"task_slug":"open-domain-question-answering","task_name":"Open-Domain Question Answering"},{"task_slug":"passage-retrieval","task_name":"Passage Retrieval"},{"task_slug":"quantization","task_name":"Quantization"},{"task_slug":"question-answering","task_name":"Question Answering"},{"task_slug":"retrieval","task_name":"Retrieval"},{"task_slug":"slot-filling","task_name":"Slot Filling"},{"task_slug":"slot-filling-1","task_name":"slot-filling"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2109.08133","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2109.08133"}},"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/princeton-nlp/DensePhrases","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran_draft_wrong":5,"ran_honours":2,"ran_violates":1,"ran":3,"unverified":8},"by_repo_kind":{"official":{"samples":19,"ran":11,"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":"9df40357afea56cc","entry":"to_list","repo":"princeton-nlp/DensePhrases","repo_kind":"official","path":"densephrases/utils/single_utils.py","file_url":"https://github.com/princeton-nlp/DensePhrases/blob/HEAD/densephrases/utils/single_utils.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":2,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9df40357afea56cc"}},{"code_sha256_prefix":"cf9ffa02a42184af","entry":"whitespace_tokenize","repo":"princeton-nlp/DensePhrases","repo_kind":"official","path":"densephrases/utils/data_utils.py","file_url":"https://github.com/princeton-nlp/DensePhrases/blob/HEAD/densephrases/utils/data_utils.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":2,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"cf9ffa02a42184af"}},{"code_sha256_prefix":"9026d9da5d085bd4","entry":"compute_exact","repo":"princeton-nlp/DensePhrases","repo_kind":"official","path":"densephrases/utils/squad_metrics.py","file_url":"https://github.com/princeton-nlp/DensePhrases/blob/HEAD/densephrases/utils/squad_metrics.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9026d9da5d085bd4"}},{"code_sha256_prefix":"9d0dc82a4491f803","entry":"exact_match_score","repo":"princeton-nlp/DensePhrases","repo_kind":"official","path":"densephrases/utils/eval_utils.py","file_url":"https://github.com/princeton-nlp/DensePhrases/blob/HEAD/densephrases/utils/eval_utils.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9d0dc82a4491f803"}},{"code_sha256_prefix":"32a5f1733d9a8971","entry":"f1_score","repo":"princeton-nlp/DensePhrases","repo_kind":"official","path":"densephrases/utils/eval_utils.py","file_url":"https://github.com/princeton-nlp/DensePhrases/blob/HEAD/densephrases/utils/eval_utils.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"32a5f1733d9a8971"}},{"code_sha256_prefix":"aa6bc32d9c17a2f1","entry":"get_tokens","repo":"princeton-nlp/DensePhrases","repo_kind":"official","path":"densephrases/utils/squad_metrics.py","file_url":"https://github.com/princeton-nlp/DensePhrases/blob/HEAD/densephrases/utils/squad_metrics.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":"aa6bc32d9c17a2f1"}},{"code_sha256_prefix":"070b5bdeecd71825","entry":"hf_bucket_url","repo":"princeton-nlp/DensePhrases","repo_kind":"official","path":"densephrases/utils/file_utils.py","file_url":"https://github.com/princeton-nlp/DensePhrases/blob/HEAD/densephrases/utils/file_utils.py","link_basis":"plan_row","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":"070b5bdeecd71825"}},{"code_sha256_prefix":"899d1e2736236351","entry":"is_remote_url","repo":"princeton-nlp/DensePhrases","repo_kind":"official","path":"densephrases/utils/file_utils.py","file_url":"https://github.com/princeton-nlp/DensePhrases/blob/HEAD/densephrases/utils/file_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":"899d1e2736236351"}},{"code_sha256_prefix":"dae7ab386661a4f4","entry":"normalize_answer","repo":"princeton-nlp/DensePhrases","repo_kind":"official","path":"densephrases/utils/eval_utils.py","file_url":"https://github.com/princeton-nlp/DensePhrases/blob/HEAD/densephrases/utils/eval_utils.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":"6a96435eba311b08","entry":"normalize_answer","repo":"princeton-nlp/DensePhrases","repo_kind":"official","path":"densephrases/utils/squad_metrics.py","file_url":"https://github.com/princeton-nlp/DensePhrases/blob/HEAD/densephrases/utils/squad_metrics.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":"6a96435eba311b08"}},{"code_sha256_prefix":"e827d94caab33f59","entry":"url_to_filename","repo":"princeton-nlp/DensePhrases","repo_kind":"official","path":"densephrases/utils/file_utils.py","file_url":"https://github.com/princeton-nlp/DensePhrases/blob/HEAD/densephrases/utils/file_utils.py","link_basis":"harvester_set","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":"e827d94caab33f59"}},{"code_sha256_prefix":"4c8de8b151ba3a85","entry":"backward_compat","repo":"princeton-nlp/DensePhrases","repo_kind":"official","path":"densephrases/utils/single_utils.py","file_url":"https://github.com/princeton-nlp/DensePhrases/blob/HEAD/densephrases/utils/single_utils.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":"4c8de8b151ba3a85"}},{"code_sha256_prefix":"3baccefd6793b306","entry":"filter_metadata","repo":"princeton-nlp/DensePhrases","repo_kind":"official","path":"densephrases/utils/embed_utils.py","file_url":"https://github.com/princeton-nlp/DensePhrases/blob/HEAD/densephrases/utils/embed_utils.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":"3baccefd6793b306"}},{"code_sha256_prefix":"bb7cb2f116b46a6b","entry":"float_to_int8","repo":"princeton-nlp/DensePhrases","repo_kind":"official","path":"densephrases/utils/embed_utils.py","file_url":"https://github.com/princeton-nlp/DensePhrases/blob/HEAD/densephrases/utils/embed_utils.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":"bb7cb2f116b46a6b"}},{"code_sha256_prefix":"3149bf27eadf82a3","entry":"get_metadata","repo":"princeton-nlp/DensePhrases","repo_kind":"official","path":"densephrases/utils/embed_utils.py","file_url":"https://github.com/princeton-nlp/DensePhrases/blob/HEAD/densephrases/utils/embed_utils.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":"3149bf27eadf82a3"}},{"code_sha256_prefix":"3a741d4be5d5e611","entry":"load_cross_encoder","repo":"princeton-nlp/DensePhrases","repo_kind":"official","path":"densephrases/utils/open_utils.py","file_url":"https://github.com/princeton-nlp/DensePhrases/blob/HEAD/densephrases/utils/open_utils.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":"3a741d4be5d5e611"}},{"code_sha256_prefix":"ca7e876a279ff16f","entry":"squad_convert_example_to_features","repo":"princeton-nlp/DensePhrases","repo_kind":"official","path":"densephrases/utils/squad_utils.py","file_url":"https://github.com/princeton-nlp/DensePhrases/blob/HEAD/densephrases/utils/squad_utils.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":"ca7e876a279ff16f"}},{"code_sha256_prefix":"a47a1d74b5244c37","entry":"squad_convert_examples_to_features","repo":"princeton-nlp/DensePhrases","repo_kind":"official","path":"densephrases/utils/squad_utils.py","file_url":"https://github.com/princeton-nlp/DensePhrases/blob/HEAD/densephrases/utils/squad_utils.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":"a47a1d74b5244c37"}},{"code_sha256_prefix":"9d4a497954fa5100","entry":"to_numpy","repo":"princeton-nlp/DensePhrases","repo_kind":"official","path":"densephrases/utils/single_utils.py","file_url":"https://github.com/princeton-nlp/DensePhrases/blob/HEAD/densephrases/utils/single_utils.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":"9d4a497954fa5100"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}