{"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/contextualized-sparse-representation-with-1","title":"Contextualized Sparse Representations for Real-Time Open-Domain Question Answering","arxiv_id":"1911.02896","date":"2019-11-07","proceeding":"ACL 2020 6","authors":["Jinhyuk Lee","Minjoon Seo","Hannaneh Hajishirzi","Jaewoo Kang"],"abstract":"Open-domain question answering can be formulated as a phrase retrieval problem, in which we can expect huge scalability and speed benefit but often suffer from low accuracy due to the limitation of existing phrase representation models. In this paper, we aim to improve the quality of each phrase embedding by augmenting it with a contextualized sparse representation (Sparc). Unlike previous sparse vectors that are term-frequency-based (e.g., tf-idf) or directly learned (only few thousand dimensions), we leverage rectified self-attention to indirectly learn sparse vectors in n-gram vocabulary space. By augmenting the previous phrase retrieval model (Seo et al., 2019) with Sparc, we show 4%+ improvement in CuratedTREC and SQuAD-Open. Our CuratedTREC score is even better than the best known retrieve & read model with at least 45x faster inference speed.","url_abs":"https://arxiv.org/abs/1911.02896v2","url_pdf":"https://arxiv.org/pdf/1911.02896v2.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":"contextualized-sparse-representation-with-1","repo_url":"https://github.com/jhyuklee/sparc","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"contextualized-sparse-representation-with-1","repo_url":"https://github.com/dmis-lab/covidAsk","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"contextualized-sparse-representation-with-1","repo_url":"https://github.com/dmis-lab/covidsearch","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"information-retrieval","task_name":"Information Retrieval"},{"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"}],"methods":[{"method_slug":"speed","method_name":"SPEED"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1911.02896","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1911.02896"}},"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/jhyuklee/sparc","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/dmis-lab/covidsearch","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/dmis-lab/covidAsk","reach":{"status":"ok"}}],"summary":{"ran_violates":2,"ran_honours":5,"ran_draft_wrong":3,"unverified":8},"by_repo_kind":{"official":{"samples":18,"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":"f6c275d6a18330a9","entry":"exact_match_score","repo":"jhyuklee/sparc","repo_kind":"official","path":"evaluate-v1.1.py","file_url":"https://github.com/jhyuklee/sparc/blob/HEAD/evaluate-v1.1.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":"f6c275d6a18330a9"}},{"code_sha256_prefix":"9d0dc82a4491f803","entry":"exact_match_score","repo":"jhyuklee/sparc","repo_kind":"official","path":"eval_utils.py","file_url":"https://github.com/jhyuklee/sparc/blob/HEAD/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":"2112c433b9c6d343","entry":"f1_score","repo":"jhyuklee/sparc","repo_kind":"official","path":"evaluate-v1.1.py","file_url":"https://github.com/jhyuklee/sparc/blob/HEAD/evaluate-v1.1.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":"2112c433b9c6d343"}},{"code_sha256_prefix":"32a5f1733d9a8971","entry":"f1_score","repo":"jhyuklee/sparc","repo_kind":"official","path":"eval_utils.py","file_url":"https://github.com/jhyuklee/sparc/blob/HEAD/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":"40e9fee2e0b7e278","entry":"gelu","repo":"jhyuklee/sparc","repo_kind":"official","path":"modeling.py","file_url":"https://github.com/jhyuklee/sparc/blob/HEAD/modeling.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"40e9fee2e0b7e278"}},{"code_sha256_prefix":"dae7ab386661a4f4","entry":"normalize_answer","repo":"jhyuklee/sparc","repo_kind":"official","path":"eval_utils.py","file_url":"https://github.com/jhyuklee/sparc/blob/HEAD/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":"c6a80c065d2e4851","entry":"normalize_answer","repo":"jhyuklee/sparc","repo_kind":"official","path":"evaluate-v1.1.py","file_url":"https://github.com/jhyuklee/sparc/blob/HEAD/evaluate-v1.1.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":"c6a80c065d2e4851"}},{"code_sha256_prefix":"5eff22fa0a651276","entry":"url_to_filename","repo":"jhyuklee/sparc","repo_kind":"official","path":"file_utils.py","file_url":"https://github.com/jhyuklee/sparc/blob/HEAD/file_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":"5eff22fa0a651276"}},{"code_sha256_prefix":"e7d542062316094a","entry":"warmup_constant","repo":"jhyuklee/sparc","repo_kind":"official","path":"optimization.py","file_url":"https://github.com/jhyuklee/sparc/blob/HEAD/optimization.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e7d542062316094a"}},{"code_sha256_prefix":"c58d57224530d17e","entry":"warmup_linear","repo":"jhyuklee/sparc","repo_kind":"official","path":"optimization.py","file_url":"https://github.com/jhyuklee/sparc/blob/HEAD/optimization.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":"c58d57224530d17e"}},{"code_sha256_prefix":"df9f10631fa5d322","entry":"cached_path","repo":"jhyuklee/sparc","repo_kind":"official","path":"file_utils.py","file_url":"https://github.com/jhyuklee/sparc/blob/HEAD/file_utils.py","link_basis":"harvester_set","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":"df9f10631fa5d322"}},{"code_sha256_prefix":"01bcde4d16ae2a8e","entry":"compress_metadata","repo":"jhyuklee/sparc","repo_kind":"official","path":"post.py","file_url":"https://github.com/jhyuklee/sparc/blob/HEAD/post.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":"01bcde4d16ae2a8e"}},{"code_sha256_prefix":"4e83a47cdc3c30e8","entry":"fetch_text","repo":"jhyuklee/sparc","repo_kind":"official","path":"build_tfidf.py","file_url":"https://github.com/jhyuklee/sparc/blob/HEAD/build_tfidf.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":"4e83a47cdc3c30e8"}},{"code_sha256_prefix":"6db16fe8f67e56b6","entry":"filename_to_url","repo":"jhyuklee/sparc","repo_kind":"official","path":"file_utils.py","file_url":"https://github.com/jhyuklee/sparc/blob/HEAD/file_utils.py","link_basis":"harvester_set","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":"6db16fe8f67e56b6"}},{"code_sha256_prefix":"dd2626636273d5ba","entry":"filter_metadata","repo":"jhyuklee/sparc","repo_kind":"official","path":"post.py","file_url":"https://github.com/jhyuklee/sparc/blob/HEAD/post.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":"dd2626636273d5ba"}},{"code_sha256_prefix":"22461a1b6fbcaa9c","entry":"run_dump_phrase","repo":"jhyuklee/sparc","repo_kind":"official","path":"local_dump.py","file_url":"https://github.com/jhyuklee/sparc/blob/HEAD/local_dump.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":"22461a1b6fbcaa9c"}},{"code_sha256_prefix":"77535ec3fc559506","entry":"tokenize","repo":"jhyuklee/sparc","repo_kind":"official","path":"build_tfidf.py","file_url":"https://github.com/jhyuklee/sparc/blob/HEAD/build_tfidf.py","link_basis":"harvester_set","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":"77535ec3fc559506"}},{"code_sha256_prefix":"35f7cddf90dd05d4","entry":"warmup_cosine","repo":"jhyuklee/sparc","repo_kind":"official","path":"optimization.py","file_url":"https://github.com/jhyuklee/sparc/blob/HEAD/optimization.py","link_basis":"harvester_set","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":"35f7cddf90dd05d4"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}