{"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/generative-dense-retrieval-memory-can-be-a","title":"Generative Dense Retrieval: Memory Can Be a Burden","arxiv_id":"2401.10487","date":"2024-01-19","proceeding":null,"authors":["Peiwen Yuan","Xinglin Wang","Shaoxiong Feng","Boyuan Pan","Yiwei Li","HeDa Wang","Xupeng Miao","Kan Li"],"abstract":"Generative Retrieval (GR), autoregressively decoding relevant document identifiers given a query, has been shown to perform well under the setting of small-scale corpora. By memorizing the document corpus with model parameters, GR implicitly achieves deep interaction between query and document. However, such a memorizing mechanism faces three drawbacks: (1) Poor memory accuracy for fine-grained features of documents; (2) Memory confusion gets worse as the corpus size increases; (3) Huge memory update costs for new documents. To alleviate these problems, we propose the Generative Dense Retrieval (GDR) paradigm. Specifically, GDR first uses the limited memory volume to achieve inter-cluster matching from query to relevant document clusters. Memorizing-free matching mechanism from Dense Retrieval (DR) is then introduced to conduct fine-grained intra-cluster matching from clusters to relevant documents. The coarse-to-fine process maximizes the advantages of GR's deep interaction and DR's scalability. Besides, we design a cluster identifier constructing strategy to facilitate corpus memory and a cluster-adaptive negative sampling strategy to enhance the intra-cluster mapping ability. Empirical results show that GDR obtains an average of 3.0 R@100 improvement on NQ dataset under multiple settings and has better scalability.","url_abs":"https://arxiv.org/abs/2401.10487v1","url_pdf":"https://arxiv.org/pdf/2401.10487v1.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":"generative-dense-retrieval-memory-can-be-a","repo_url":"https://github.com/ypw0102/gdr","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"jax","reach":{"status":"ok"}}],"tasks":[{"task_slug":"retrieval","task_name":"Retrieval"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2401.10487","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2401.10487"}},"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/ypw0102/gdr","reach":{"status":"ok"}}],"summary":{"ran_draft_wrong":2,"ran":13,"unverified":4},"by_repo_kind":{"official":{"samples":19,"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":19,"samples":[{"code_sha256_prefix":"0f786c407fb1ee4c","entry":"swish","repo":"ypw0102/gdr","repo_kind":"official","path":"GDR_model/transformers/activations.py","file_url":"https://github.com/ypw0102/gdr/blob/HEAD/GDR_model/transformers/activations.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":2,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0f786c407fb1ee4c"}},{"code_sha256_prefix":"f9be524a39f343b5","entry":"E_CL","repo":"ypw0102/gdr","repo_kind":"official","path":"GDR_model/main_helper_loss.py","file_url":"https://github.com/ypw0102/gdr/blob/HEAD/GDR_model/main_helper_loss.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":"f9be524a39f343b5"}},{"code_sha256_prefix":"f4d5ea96900f4114","entry":"E_Reg_loss","repo":"ypw0102/gdr","repo_kind":"official","path":"GDR_model/main_helper_loss.py","file_url":"https://github.com/ypw0102/gdr/blob/HEAD/GDR_model/main_helper_loss.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":"f4d5ea96900f4114"}},{"code_sha256_prefix":"c90481d879d6e74f","entry":"doc_reweight_loss","repo":"ypw0102/gdr","repo_kind":"official","path":"GDR_model/main_helper_loss.py","file_url":"https://github.com/ypw0102/gdr/blob/HEAD/GDR_model/main_helper_loss.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":"c90481d879d6e74f"}},{"code_sha256_prefix":"14a1c81ea568d152","entry":"gelu","repo":"ypw0102/gdr","repo_kind":"official","path":"GDR_model/transformers/activations_tf.py","file_url":"https://github.com/ypw0102/gdr/blob/HEAD/GDR_model/transformers/activations_tf.py","link_basis":"first_harvest_node","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":"14a1c81ea568d152"}},{"code_sha256_prefix":"a4475703ff58ecf9","entry":"gelu_fast","repo":"ypw0102/gdr","repo_kind":"official","path":"GDR_model/transformers/activations.py","file_url":"https://github.com/ypw0102/gdr/blob/HEAD/GDR_model/transformers/activations.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a4475703ff58ecf9"}},{"code_sha256_prefix":"aef07bb1e2787431","entry":"gelu_new","repo":"ypw0102/gdr","repo_kind":"official","path":"GDR_model/transformers/activations.py","file_url":"https://github.com/ypw0102/gdr/blob/HEAD/GDR_model/transformers/activations.py","link_basis":"first_harvest_node","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":"aef07bb1e2787431"}},{"code_sha256_prefix":"13718ddda6b66f8e","entry":"gelu_new","repo":"ypw0102/gdr","repo_kind":"official","path":"GDR_model/transformers/activations_tf.py","file_url":"https://github.com/ypw0102/gdr/blob/HEAD/GDR_model/transformers/activations_tf.py","link_basis":"first_harvest_node","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":"13718ddda6b66f8e"}},{"code_sha256_prefix":"923d19a187027958","entry":"get_ckpt","repo":"ypw0102/gdr","repo_kind":"official","path":"GDR_model/main_utils.py","file_url":"https://github.com/ypw0102/gdr/blob/HEAD/GDR_model/main_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":"923d19a187027958"}},{"code_sha256_prefix":"4ed3a54ebfd50cc5","entry":"grad_status","repo":"ypw0102/gdr","repo_kind":"official","path":"GDR_model/main_utils.py","file_url":"https://github.com/ypw0102/gdr/blob/HEAD/GDR_model/main_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":"4ed3a54ebfd50cc5"}},{"code_sha256_prefix":"64e8746cf3f62e8e","entry":"lmap","repo":"ypw0102/gdr","repo_kind":"official","path":"GDR_model/main_utils.py","file_url":"https://github.com/ypw0102/gdr/blob/HEAD/GDR_model/main_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":"64e8746cf3f62e8e"}},{"code_sha256_prefix":"a4d8ea61b62189e8","entry":"load_candidate_from_stream","repo":"ypw0102/gdr","repo_kind":"official","path":"GDR_model/main_metrics.py","file_url":"https://github.com/ypw0102/gdr/blob/HEAD/GDR_model/main_metrics.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":"a4d8ea61b62189e8"}},{"code_sha256_prefix":"b75e94e5d0c04ad5","entry":"load_reference","repo":"ypw0102/gdr","repo_kind":"official","path":"GDR_model/main_metrics.py","file_url":"https://github.com/ypw0102/gdr/blob/HEAD/GDR_model/main_metrics.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":"b75e94e5d0c04ad5"}},{"code_sha256_prefix":"e99a1fef3b9d445c","entry":"load_reference_from_stream","repo":"ypw0102/gdr","repo_kind":"official","path":"GDR_model/main_metrics.py","file_url":"https://github.com/ypw0102/gdr/blob/HEAD/GDR_model/main_metrics.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":"e99a1fef3b9d445c"}},{"code_sha256_prefix":"1713558286ecf0e4","entry":"simple_tok","repo":"ypw0102/gdr","repo_kind":"official","path":"GDR_model/bm25_preprocess.py","file_url":"https://github.com/ypw0102/gdr/blob/HEAD/GDR_model/bm25_preprocess.py","link_basis":"first_harvest_node","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":"1713558286ecf0e4"}},{"code_sha256_prefix":"e79bfbea5d698632","entry":"build_or_load_embedding_tree","repo":"ypw0102/gdr","repo_kind":"official","path":"GDR_model/main_models.py","file_url":"https://github.com/ypw0102/gdr/blob/HEAD/GDR_model/main_models.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":"e79bfbea5d698632"}},{"code_sha256_prefix":"da402819a398f4a7","entry":"load_embedding","repo":"ypw0102/gdr","repo_kind":"official","path":"GDR_model/main_models.py","file_url":"https://github.com/ypw0102/gdr/blob/HEAD/GDR_model/main_models.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":"da402819a398f4a7"}},{"code_sha256_prefix":"cc8c8c3ebf0c343f","entry":"mish","repo":"ypw0102/gdr","repo_kind":"official","path":"GDR_model/transformers/activations_tf.py","file_url":"https://github.com/ypw0102/gdr/blob/HEAD/GDR_model/transformers/activations_tf.py","link_basis":"harvester_set","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":"cc8c8c3ebf0c343f"}},{"code_sha256_prefix":"097315a106ec7d48","entry":"tree_embedding_calculate","repo":"ypw0102/gdr","repo_kind":"official","path":"GDR_model/main_models.py","file_url":"https://github.com/ypw0102/gdr/blob/HEAD/GDR_model/main_models.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":"097315a106ec7d48"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}