Manuscript Offprint
arXiv:2610.17467Computed, not Memorized: Bit-Factorized Identifiers for Efficient Generative Retrieval
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
I-Fan Lin
Leiden University
Leiden, The Netherlands
Zhen Zhang
Shandong University
Qingdao, China
Faegheh Hasibi
Radboud University
Nijmegen, The Netherlands
Suzan Verberne
Leiden University
Leiden, The Netherlands
s.verberne@liacs.leidenuniv.nl
Abstract
Generative retrieval is known for its efficient end-to-end indexing and retrieval. In particular, numeric Document Identifiers (DocIDs) are generally more efficient because they are shorter and generally fixed-length sequences over a small vocabulary, requiring fewer decoding steps during beam search. However, they tend to generalize poorly to unseen documents and must be learned during indexing-stage training. In this paper, we propose a numeric DocID design for generative retrieval that enables better adaptation to unseen documents without retraining. Our DocID design inherits the language model's knowledge: each DocID is a sequence of tokens factorized into bits, and each token is scored as the sum of its bits. Unlike existing numeric DocIDs, whose tokens carry meaning only through embeddings memorized during indexing training, each bit here derives its meaning from the model's representation. Therefore, the DocIDs of unseen documents remain scorable without retraining.
Experiments on three benchmarks show that our DocID design substantially improves unseen-document retrieval while maintaining comparable performance on seen documents. It achieves over 20 percentage points higher Hit@10 on unseen documents and up to 7× lower inference latency than existing numeric DocID designs on NQ320K and TriviaQA, while performing only 3 percentage points below weight-update methods on MS MARCO without additional training. These results show that an appropriate DocID design can heavily reduce retraining costs when adapting generative retrievers to new documents.
1 Introduction
Generative Retrieval is a retrieval paradigm in which an input query text is directly matched to a document identifier (DocID) using a language model, typically a sequence-to-sequence model. Unlike conventional dense retrieval meth-

Figure 1: Our DocID design achieves comparable retrieval to the strongest baseline on seen documents, a clear margin on unseen documents, and the lowest latency of any method.
ods, which require a vector database or Approximate Nearest Neighbour (ANN) index to store document embeddings and perform nearest-neighbor search at inference time, generative retrieval retrieves documents by generating their DocID directly (Li et al., 2025). This design can offer inference and memory efficiency advantages (Kim et al., 2024).
Two different DocID designs exist for generative retrieval systems: numeric DocIDs and textual DocIDs. Both have their own strengths: Numeric DocIDs offer computational advantages, as they reduce the complexity of beam-search decoding (Wang et al., 2022; Sun et al., 2023; Zhao et al., 2025). In contrast, textual DocIDs can exploit the semantic priors encoded in pretrained language models and are able to give more interpretable document identifiers (Bevilacqua et al., 2022; Zhou et al., 2022; Askari et al., 2026).
One of the major challenges in current generative retrieval research is adapting to the retrieval of previously unseen documents. Generative retrieval models typically require an indexing stage during training, where the model learns to associate documents with their corresponding DocIDs. As a result, the model tends to be biased toward DocIDs seen during training. This lack of generalization is especially pronounced for numeric DocIDs (Zhang et al., 2025), but also textual DocIDs lead to substantially lower effectiveness on unseen than on seen documents (Zhang et al., 2025).
While incremental training methods adapt numeric DocIDs to new documents (Mehta et al., 2023; Kishore et al., 2023), updating model parameters remains computationally expensive. Recent model-editing approaches update only a small subset of parameters while achieving performance comparable to full retraining (Zhang et al., 2026b). However, editing the model for newly added documents still requires computation with each update, making frequent updates costly.
To address the poor adaptation of numeric DocIDs and the cost of updating model weights, we propose Computed Bit-Factorized Identifiers for Generative Retrieval (CoBIGR). CoBIGR represents each document with a sign-projection binary code of its document vector and factorizes the retrieval score over its identifier bits, which inherit the model's knowledge of the document rather than a memorized embedding learned from indexing training. Additionally, the proposed bit-factorized IDs are flat and their score is permutation-invariant. This property enables multi-tree beam search during inference, which substantially improves effectiveness on unseen documents, while scoring with one forward pass keeps decoding efficient (see Figure 1).
Our contributions are: (1) We propose a bit-factorized numeric DocID: its bits derive meaning from the language model, so unseen DocIDs can still be retrievable. (2) We study direct DocID adaptation to dynamic corpora without weight updates, addressing an underexplored gap in costly generative retrieval training. (3) Our experiments show that our approach achieves comparable performance on seen documents to prior DocID designs while substantially improving performance on unseen documents, with 40–60 percentage points higher Hit@1 and Hit@100 than other numeric DocIDs. It also remains within 3 percentage points of methods that update model weights. Our source code is available at https://anonymous.4open.science/r/bit_factorized_token-2C13/
Hashing in Retrieval Hashing has been widely used for efficient retrieval by providing compact representations and approximate similarity measures based on Hamming distance (Yamada et al., 2021; He et al., 2025). Recently, FLASH (Zhang et al., 2026a) uses hash codes as the first step of retrieval: the generated code seeds a Hamming-radius search and is reconstructed into a continuous embedding for reranking. Our method follows generative retrieval paradigm: it directly generates valid DocIDs, decoded token by token under a prefix-tree constraint and ranked by log-probability.
Dynamic Corpus Adaptation for Numeric Identifiers Existing work primarily focuses on retraining the retrieval model when new documents are arrived: DSI++ (Mehta et al., 2023) reduces catastrophic forgetting by optimizing for flatter loss landscapes and incorporating pseudo-queries in continual training. IncDSI (Kishore et al., 2023) perform a constraint optimization to adapt to dynamic corpus, this avoids the full re-training of the decoder. However, the method is restricted to atomic document identifiers. DOME (Zhang et al., 2026b) further generalizes document insertion by optimizing edit vectors with soft-label guidance, enabling effective adaptation under structured document identifier schemes. Unlike prior retraining-based approaches, we study the zero-shot adaptation of newly arrived documents into structured numeric identifier spaces, which, to the best of our knowledge, has remained underexplored.
3 Method
3.1 Problem Formulation
Generative retrieval Let be a document corpus. Each document is associated with a DocID , a length-T sequence of tokens from a predefined vocabulary. Given a query , a generative retrieval model returns a ranked list of DocIDs by directly generating them. Typically, is a sequence-to-sequence model that factorizes the DocID probability autoregressively,
The most relevant DocIDs are obtained by constrained beam search over the prefix tree of valid identifiers, so that only DocIDs of documents in D can be produced. Training combines two objectives: an indexing step that learns to bind each document d to its DocID , and a retrieval step that learns to map a query to the DocIDs of its relevant documents.
Dynamic Corpus In practice, the document collection changes over time. We therefore consider newly arrived documents after the model is trained. The model is trained on an initial seen document set , using queries whose relevant documents all belong to . After training, a set of new documents arrives, with , resulting in the expanded corpus . We evaluate retrieval on the expanded corpus using two types of test queries: seen-document queries, whose relevant documents belong to , and unseen-document queries, whose relevant documents belong to .
3.2 Proposed Approach
Our proposed pipeline is summarized in Figure 2.
3.2.1 DocID derivation
To ensure DocIDs inherit the knowledge of a pre-trained language model (PLM) encoder, we derive them directly from the PLM output. Given the encoder embedding e of a text, we compute
where is a projection layer that decouples the DocID length from the encoder’s hidden size . LN is layer normalization used to stabilize the scale (Ba et al., 2016). Following Yamada et al. (2021), the tanh bounds each dimension so that its sign can serve as a bit: a document’s DocID bit vector is . The entire model is trained with InfoNCE contrastive loss (Oord et al., 2018; Karpukhin et al., 2020) between query and document representations at the tanh output:
where is the set of documents in the batch, is a temperature, and is the relevant document(s) paired with . For each query, the other documents in serve as in-batch negatives. We denote the resulting encoder as , which is used for DocID derivation for documents in both and .
3.2.2 Query-to-DocID optimization
Seen documents This stage is where our method departs most from prior work. Generative retrieval models (using either textual or numeric identifiers) typically perform two types of training: Indexing and retrieving. In prior work, the use of numeric identifiers requires the indexing training because the embeddings of the identifier tokens are learned from scratch. Our DocID bit vectors are instead computed by the encoder from the document itself, so no indexing training is required. A query q is encoded into its tanh output by an encoder whose weights are initialized from (see above). We define the weighted query representation as
where is the encoder output for the query (using the same architecture as in equation 2), is the element-wise product, is a learnable vector with one entry per bit, shared across all queries, that weighs each bit's contribution to the ranking score. We denote this encoder together with as the retriever encoder . The relevance scores of a document for a given query is
Stacking the bit vectors of all documents in as the rows of gives every score in a single matrix product. The retriever encoder is optimized with InfoNCE over documents :

Figure 2: Overview of CoBIGR: (1) DocID derivation: Trains documents to map to separable binary codes, so each document derives its DocID through direct computation instead of assignment. (2) Query-to-DocID optimization: Trains the retriever to score gold DocIDs highly. Since training is based on seen documents, we reduce the resulting bias through weight interpolation. (3) Inference: We use lookup table to do the scoring. Since our DocID tokens are flat, we decode with constrained beam search over multiple permuted prefix trees.
where , with a temperature. normalizes the dot product and converts it to the cosine similarity between and . This loss trains each query to score its relevant DocID above all others in .
Unseen documents The Query-to-DocID stage optimizes only on seen (training) documents , as the unseen documents are introduced only at test time. This training setup may bias toward the seen documents, potentially limiting generalization to unseen documents. To reduce the bias in the retrieval model, we adopt weight-space ensembling following WiSE-FT (Wortsman et al., 2022), which improves accuracy under distribution shift while preserving in-distribution accuracy. We interpolate the parameters of and to get our retriever : , where and are the parameters of and , respectively. Since has no per-bit scale, we set its scale to . The merged encoder is our retriever model and is discarded. We set , following WiSE-FT, without tuning it on our data.
3.2.3 Inference: multi-tree constrained beam search
Both training stages operate on bits, but we perform inference token by token: each token represents an m-bit segment of as an integer in . Thus, each DocID has T tokens and bits in total. This reduces the number of pruning decisions, as m bits (instead of one bit) are used for each decision. Since no token score depends on previously decoded tokens, no autoregressive decoder is needed.
Token scoring In generative retrieval, a DocID is decoded as a sequence of tokens, each step producing a softmax over the possible token values, with a prefix tree restricting the output to valid DocIDs. Our add-on is to bit-factorize each token value into an m-bit pattern.
Let the DocID of document be , with . We map each token to its -bit representation using a fixed table , whose row is the binary code of in form. The bit-factorized DocID is then .
Let contain the entries of (Equation 4) corresponding to token , so that . Recall that is a sum over the bits (see Eq. 5). Since each token represents bits, this sum can be split into T terms:
The score is a sum of per-token terms, each depending only on a token value and the query.
At decoding time the document is not known in advance, so at step we score every candidate value by , and apply a softmax over the values:
The second term is shared by all token values at level (denoted for brevity), so token values are ranked by alone. Summing along document 's path gives:
(9)
where is the same for every document, so the relative scores across documents are determined solely by . Normalization is optional because it does not affect the ranking. In our main experiments, we use T = 10 tokens of m = 12 bits each, giving k = 120 total bits.
Multi-trees beam search. Beam search scores DocIDs token by token on the partial sum and prunes prefixes as it goes. One potential problem is that pruning may discard a relevant DocID early, even if its remaining bits match the query well. Because our tokens are independently scored through bit factorization, any bit permutation, followed by regrouping into tokens, generates a valid prefix tree. We therefore build h trees using different bit permutations, run beam search on each tree, and rank the union of their candidates by log-probability. Since different bit orders prune based on different bits, using multiple trees can recover documents that a single tree would miss. We set h = 8 in our main experiments and analyze the effect of different values.
4 Experimental Settings
4.1 Datasets
We follow prior work (Tay et al., 2022; Wang et al., 2022; Zhang et al., 2025, 2026b) to use Natural Questions (NQ320K) (Kwiatkowski et al., 2019), MS MARCO (Nguyen et al., 2016), and TriviaQA (Joshi et al., 2017) in our experimentns. NQ320K and TriviaQA include approximately 109K and 73K documents, respectively. To simulate newly arrived documents, we split the documents into seen ( ) and unseen ( ) sets, with (60%, 40%) in our main experiments and (90%, 10%) in additional experiments. For MS MARCO, we use the 320K-document and the (90%, 10%) split from Zhang et al. (2026b).
We evaluate by testing on queries whose gold documents are exclusively in either or . Neither nor its associated queries are used during training or model selection. Further details on dataset sampling are provided in Appendix A.1.
4.2 Models
We use T5-base (110M parameters) (Raffel et al., 2020) and BERT-base-uncased (110M parameters) (Devlin et al., 2018) as the encoders in all experiments, which are half the size as the T5-base encoder-decoder (220M) used by common baselines (Tay et al., 2022; Wang et al., 2022; Sun et al., 2023).
4.3 Evaluation
We follow prior work (Tay et al., 2022; Wang et al., 2022; Sun et al., 2023) to report Hit@N, which is defined as the proportion of queries for which the relevant document appears in the top-N retrieved results. Because distinct documents can share one DocID, we solve such ties by expectation (McSherry and Najork, 2008): All documents sharing a retrieved identifier are returned, and each metric is its expected value over all orderings of the tied documents.
4.4 Baselines
All baselines are generative retrievers, the paradigm we follow. Our core research question is whether an alternative numeric DocID design improves generalization to newly added documents, so we focus on numeric DocID baselines.
Following recent studies of generative retrieval over dynamic corpora (Zhang et al., 2025, 2026b), we cover four numeric DocID designs: hierarchical k-means, used by DSI (Tay et al., 2022) and NCI (Wang et al., 2022); PQ, used by ULTRON-PQ (Zhou et al., 2022); RQ, used by MEVI (Zhang et al., 2023); RQ-VAE, used by TIGER (Rajput et al., 2023). For further comparison, we include textual DocID baselines, ULTRON-URL (Zhou et al., 2022) and SEAL (Bevilacqua et al., 2022), and weight-update methods DSI++ (Mehta et al., 2023) and DOME (Zhang et al., 2026b). This allows us to compare our zero-shot adaptation approach with methods that update the weights using . See Appendix A.2 for details. Non-generative approaches baselines such as BM25 (Robertson and Zaragoza, 2009) and GTR (Ni et al., 2022) are reported as references, since the different indexing and exhaustive search limit direct comparison.
We reproduce all baselines on NQ320K and TriviaQA, while using results reported in prior work (Zhang et al., 2026b) for MS MARCO.
4.5 Hyperparameters
In our setting, queries and documents are truncated to 128 tokens for DocID derivation, with an effective batch size of 512. We train using pseudo-queries with a budget of 96 A100 GPU-hours. Other hyperparameters are detailed in Appendix A.3. For other baselines, we follow their original settings and provide the same pseudo-queries and GPU budget.
During inference, following prior work (Wang et al., 2022), we use a beam size of 100 for reproduced baselines, except SEAL, which uses its default size of 15 (Bevilacqua et al., 2022) because each token can already map to many documents.
5 Results
Comparison across identifier types Table 1 reports the results for two query groups under the 60%/40% split on the NQ320K and TriviaQA datasets: queries whose gold documents are in (unseen document, upper part) and those in (seen document, lower part). We first focus on queries, which directly evaluate generalization to unseen documents. Our method achieves the highest performance among the compared DocID designs on both datasets by a large margin. Hierarchical k-means DocIDs generalize poorly because their final identifier digit acts as a document-specific counter, making new identifiers difficult to predict. Removing the counter digit improves both methods slightly (indicated with ‘shared IDs’ in parentheses), but their performance remains limited. Quantization-based DocIDs also show poor generalization to unseen documents. Our DocID design also substantially improves over the text-based DocID methods ULTRON-URL and SEAL for unseen documents.
For queries with gold documents in , our method achieves higher Hit@1 and MRR@100, indicating stronger top-ranking performance, while NCI achieves higher Hit@100, suggesting better high-rank retrieval coverage. The 90%/10% splits shows the similar patterns (Appendix A.4). We also report results on the full corpus in Appendix A.5. Overall, our method maintains comparable performance to baselines on seen documents while improving with a large margin on unseen documents.
Comparison with incremental training and model editing Table 2 shows that our method maintains similar performance on . More importantly, our zero-shot adaptation achieves results within approximately 3 percentage points of the incremental training and model editing methods on . This suggests that our method can reduce the need for additional training while maintaining competitive performance.
Efficiency Our method provides efficient retrieval: token scores for all positions come from one encoder forward pass, so decoding needs no autoregressive decoder calls. We measure single-query latency (batch size 1) on a single A100 GPU on the NQ320K dataset, and find that our method takes 24 ms per query and is at least faster than NCI, DSI, and MEVI, faster than ULTRON, and faster than SEAL. See Appendix A.6 for the overall efficiency analysis. On MS MARCO, whose corpus is about three times larger, latency increases by only 4 ms per query.
6 Ablation
Effect of weight interpolation Table 3 shows that the DocID encoder provides better generalization to unseen documents, while the retriever , which is optimized on seen documents, achieves better performance on seen documents, with Hit@1 increasing by more than 10 percentage points on both datasets. However, also shows a substantial drop in performance on unseen documents. Our final model provides a balance between the two. Additionally, using multiple trees substantially improves almost all metrics. This suggests permutation helps reduce premature pruning of relevant documents.
Effect of multiple trees Figures 3 shows Hit@10 under different beam size and permutation-tree counts. Increasing both the beam size and the
| Method | DocID type | NQ320K | TriviaQA | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Hit@1 | Hit@10 | Hit@100 | MRR@100 | Hit@1 | Hit@10 | Hit@100 | MRR@100 | ||
| Queries with unseen target documents () | |||||||||
| NCI | Hier. k-means | 0.07 | 0.61 | 1.97 | 0.24 | 0.13 | 0.71 | 2.48 | 0.36 |
| DSI | Hier. k-means | 0.07 | 0.61 | 3.51 | 0.28 | 0.09 | 0.73 | 2.80 | 0.33 |
| NCI (shared IDs) | Hier. k-means | 0.65 | 4.89 | 15.18 | 2.11 | 0.58 | 4.76 | 16.29 | 2.01 |
| DSI (shared IDs) | Hier. k-means | 0.58 | 4.20 | 11.24 | 1.80 | 0.43 | 3.69 | 12.21 | 1.55 |
| DSI | RQ-VAE | 0.08 | 0.54 | 3.75 | 0.29 | 0.02 | 0.34 | 2.38 | 0.14 |
| ULTRON-PQ | Product quant. | 0.04 | 0.45 | 13.98 | 0.37 | 0.00 | 0.03 | 8.64 | 0.12 |
| MEVI | RQ | 0.66 | 5.18 | 16.06 | 2.17 | 0.67 | 5.04 | 16.09 | 2.15 |
| ULTRON-URL | URL / title string | 13.12 | 27.41 | 43.36 | 18.18 | - | - | - | - |
| SEAL (BART) | Substrings | 10.76 | 50.32 | 78.93 | 23.72 | 26.77 | 59.03 | 79.75 | 37.67 |
| CoBIGR-Bert | Bit-factorized code | 41.45* | 77.74* | 85.48* | 54.79* | 53.13* | 77.15* | 85.22* | 61.88* |
| CoBIGR-T5 | Bit-factorized code | 42.90* | 74.92* | 81.80* | 54.54* | 49.72* | 74.74* | 82.93* | 58.66* |
| Reference (non-GenIR approach) | |||||||||
| BM25 | Term weights (sparse) | 36.20 | 69.73 | 87.68 | 47.55 | 47.75 | 77.48 | 89.86 | 58.53 |
| GTR | Dense vector | 54.39 | 83.84 | 93.65 | 64.86 | 56.77 | 80.12 | 91.02 | 65.32 |
| Queries with seen target documents () | |||||||||
| NCI | Hier. k-means | 68.83 | 87.39 | 93.75 | 75.69 | 68.82 | 89.51 | 95.27 | 76.69 |
| DSI | Hier. k-means | 63.81 | 79.15 | 85.65 | 69.62 | 58.90 | 78.37 | 86.63 | 66.20 |
| DSI | RQ-VAE | 63.26 | 80.71 | 86.97 | 69.92 | 60.53 | 79.73 | 87.76 | 67.54 |
| ULTRON-PQ | Product quant. | 64.92 | 81.74 | 87.84 | 71.38 | 68.71 | 84.35 | 89.86 | 74.73 |
| MEVI | RQ | 50.86 | 80.53 | 88.93 | 61.98 | 56.98 | 83.58 | 90.80 | 66.99 |
| ULTRON-URL | URL / title string | 66.11 | 81.04 | 88.01 | 71.81 | - | - | - | - |
| SEAL (BART) | Substrings | 67.73 | 84.28 | 92.61 | 74.01 | 73.18 | 85.84 | 91.90 | 77.93 |
| CoBIGR-Bert | Bit-factorized code | 71.06* | 87.59 | 91.87 | 77.18* | 70.73 | 86.76 | 91.18 | 76.75 |
| CoBIGR-T5 | Bit-factorized code | 69.68 | 85.80 | 89.77 | 75.68 | 70.05 | 85.73 | 90.10 | 76.04 |
| Reference (non-GenIR approach) | |||||||||
| BM25 | Term weights (sparse) | 36.49 | 69.13 | 87.62 | 47.68 | 49.18 | 79.15 | 90.97 | 60.00 |
| GTR | Dense vector | 54.26 | 83.84 | 93.79 | 64.92 | 57.84 | 81.61 | 91.73 | 66.60 |
Table 1: Retrieval results on NQ320K and TriviaQA with seen / unseen split. MEVI: we reproduce only the generative-stage results without DPR ranking. ULTRON-URL: TriviaQA lacks URLs. *: ours are significantly better than both NCI and SEAL (paired t-test, with Bonferroni correction). Reference retrievers search the full corpus with larger indexes: 3 KB/doc for GTR and 1.4 KB/doc for BM25, vs. 0.015 KB/doc for ours.
| Method | Hit@10 | MRR@10 |
|---|---|---|
| Queries with unseen target documents () | ||
| DSI++ | 75.9 | 51.7 |
| DOME | 76.4 | 52.4 |
| CoBIGR-Bert | 74.5 | 49.1 |
| From Scratch | 77.2 | 52.9 |
| Queries with seen target documents () | ||
| DSI++ | 77.5 | 53.2 |
| DOME | 77.5 | 53.2 |
| CoBIGR-Bert | 78.2 | 56.2 |
| From Scratch | 77.5 | 53.2 |
Table 2: Comparison with weight-update methods using on MS MARCO, with seen / unseen split. All baselines are cited from Zhang et al. (2026b). From Scratch is the paper's upper bound with full-parameter updates.
number of trees clearly improves the metric. In particular, increasing the number of trees brings larger improvements than increasing the beam size. Across both metrics and datasets, increasing the beam size from 10 to 200 (20×) with the tree size fixed at h = 1 leads to smaller improvements than increasing the tree size from h = 1 to 16 (16×) with the beam size fixed at 10. See Appendix A.7 for other metrics.

Number of trees
h=1 h=2 h=4 h=8 h=16
Figure 3: Hit@10 by different size of trees and beams ( , ) with the BERT backbone.
Effect of token length In the main experiments, each token represents 12 bits, resulting in a total of 10 tokens ( ). Since the score is a sum over bits, the same identifiers can be read as T tokens of m bits for any m dividing 120, without retraining; we additionally evaluate . Figure 4 shows that different grouping sizes achieve
| Model | NQ320K | TriviaQA | ||||||
|---|---|---|---|---|---|---|---|---|
| Hit@1 | Hit@10 | Hit@100 | MRR@100 | Hit@1 | Hit@10 | Hit@100 | MRR@100 | |
| (DocID encoder) | 57.03 / 44.12 | 73.69 / 63.31 | 74.50 / 64.46 | 63.67 / 51.41 | 51.69 / 43.95 | 65.27 / 56.95 | 66.02 / 58.19 | 57.03 / 48.86 |
| (trained on ) | 68.58 / 20.71 | 76.60 / 44.81 | 76.89 / 45.49 | 71.75 / 30.42 | 64.54 / 36.51 | 71.74 / 49.62 | 72.15 / 50.61 | 67.49 / 41.62 |
| (weight interpolation) | 67.69 / 36.09 | 78.20 / 58.83 | 78.78 / 59.77 | 71.93 / 45.10 | 62.20 / 42.86 | 71.34 / 55.97 | 71.90 / 57.08 | 65.90 / 47.87 |
| + multi-tree (h=8) | 71.06 / 41.45 | 87.59 / 77.74 | 91.87 / 85.48 | 77.18 / 54.79 | 70.73 / 53.13 | 86.76 / 77.15 | 91.18 / 85.22 | 76.75 / 61.88 |
Table 3: Ablation on NQ320K and TriviaQA ( , ) with the BERT backbone. Identifiers are derived by in every row. All rows retrieve by constrained beam search (beam 100); the last row runs the same search over h=8 permuted trees.

Figure 4: Results with different bits per token, given 120 bits ( , ) with the BERT backbone.

Figure 5: Search latency by tokens given 120 bits (, ) with the BERT backbone. Query encoding time is excluded, as it is the same for all settings.
similar results. However, the number of bits per token has a clear effect on inference speed: Figure 5 shows using too few or too many bits per token can reduce decoding speed. Nevertheless, search remains fast overall.
Document collision Figure 6 shows the number of documents sharing the same DocID on NQ320K and TriviaQA. All baselines have collision rates below 10%, while our method achieves the lowest collision rate among the numeric ID baselines (32 documents for NQ and 1 documents for TriviaQA). SEAL has no duplicate identifiers because it assigns no code at all. A manual inspection shows that (1) no more than two documents share a Do- cID, and (2) Most collisions occur between near duplicate documents, indicating good separation of dissimilar documents.
Figure 6: Number of document collisions ( , ) with the BERT backbone.
7 Conclusions
We propose a computable DocID design whose bit-level factorization allows new DocIDs to be scored, while model fusion and multiple-tree search enable better zero-shot retrieval. We find that existing numeric DocID designs perform well on seen documents but degrade substantially on unseen documents, while our approach maintains comparable performance on seen documents and improves on unseen documents by a large margin over previous methods, and remains close to methods that update model weights. This suggests that our DocID design for incorporating new documents without retraining is promising, especially given the high computational cost of retraining generative retrievers. In future work, we plan to apply factorization to hierarchical DocIDs (RQ-VAE or H-KMEANS) to investigate whether it can further improve recall at high ranks.
Limitations
Flat identifiers make early pruning harder. In our token design, no prefix is more informative than another, so early decoding prunes on limited information. Multi-tree beam search reduces this effect, but Hit@100 on seen documents remains slightly below some baselines. In future work, we plan to combine bit factorization with residual quantization such as RQ-VAE, whose coarse-to-fine codes may make early levels more informative and reduce pruning errors.
Language. Like most of the prior work, we only focus on English datasets. This is common because most of benchmark datasets are in English. Our method is completely data-driven and not dependent on labeled data and it is therefore applicable to other languages than English.
References
Arian Askari, Chuan Meng, Mohammad Aliannejadi, Zhaochun Ren, Evangelos Kanoulas, and Suzan Verberne. 2026. Generative retrieval with few-shot indexing. In European Conference on Information Retrieval, pages 606–614. Springer.
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. 2016. Layer normalization. arXiv preprint arXiv:1607.06450.
Michele Bevilacqua, Giuseppe Ottaviano, Patrick Lewis, Scott Yih, Sebastian Riedel, and Fabio Petroni. 2022. Autoregressive search engines: Generating substrings as document identifiers. Advances in Neural Information Processing Systems, 35:31668–31683.
Nicola De Cao, Gautier Izacard, Sebastian Riedel, and Fabio Petroni. 2020. Autoregressive entity retrieval. ICLR 2021.
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2018. BERT: pre-training of deep bidirectional transformers for language understanding. CoRR, abs/1810.04805.
Liyang He, Zhenya Huang, Cheng Yang, Rui Li, Zheng Zhang, Kai Zhang, Zhi Li, Qi Liu, and Enhong Chen. 2025. A survey on deep text hashing: Efficient semantic text retrieval with binary representation. arXiv preprint arXiv:2510.27232.
Mandar Joshi, Eunsol Choi, Daniel S Weld, and Luke Zettlemoyer. 2017. Triviaqa: A large scale distantly supervised challenge dataset for reading comprehension. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1601–1611.
Vladimir Karpukhin, Barlas Oguz, Sewon Min, Patrick Lewis, Ledell Wu, Sergey Edunov, Danqi Chen, and Wen-tau Yih. 2020. Dense passage retrieval for open-domain question answering. In Proceedings of the 2020 conference on empirical methods in natural language processing (EMNLP), pages 6769–6781.
Chaeeun Kim, Soyoung Yoon, Hyunji Lee, Joel Jang, Sohee Yang, and Minjoon Seo. 2024. Exploring the practicality of generative retrieval on dynamic corpora. In Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing, pages 13616–13633.
Varsha Kishore, Chao Wan, Justin Lovelace, Yoav Artzi, and Kilian Q Weinberger. 2023. Incdsi: Incrementally updatable document retrieval. In International conference on machine learning, pages 17122–17134. PMLR.
Tom Kwiatkowski, Jennimaria Palomaki, Olivia Redfield, Michael Collins, Ankur Parikh, Chris Alberti, Danielle Epstein, Illia Polosukhin, Jacob Devlin, Kenton Lee, et al. 2019. Natural questions: a benchmark for question answering research. Transactions of the Association for Computational Linguistics, 7:453–466.
Xiaoxi Li, Jiajie Jin, Yujia Zhou, Yuyao Zhang, Peitian Zhang, Yutao Zhu, and Zhicheng Dou. 2025. From matching to generation: A survey on generative information retrieval. ACM Transactions on Information Systems, 43(3):1–62.
Frank McSherry and Marc Najork. 2008. Computing information retrieval performance measures efficiently in the presence of tied scores. In European conference on information retrieval, pages 414–421. Springer.
Sanket Vaibhav Mehta, Jai Gupta, Yi Tay, Mostafa Dehghani, Vinh Q Tran, Jinfeng Rao, Marc Najork, Emma Strubell, and Donald Metzler. 2023. Dsi++: Updating transformer memory with new documents. In Proceedings of the 2023 conference on empirical methods in natural language processing, pages 8198–8213.
Tri Nguyen, Mir Rosenberg, Xia Song, Jianfeng Gao, Saurabh Tiwary, Rangan Majumder, and Li Deng. 2016. Ms marco: A human-generated machine reading comprehension dataset.
Jianmo Ni, Chen Qu, Jing Lu, Zhuyun Dai, Gustavo Hernandez Abrego, Ji Ma, Vincent Zhao, Yi Luan, Keith Hall, Ming-Wei Chang, et al. 2022. Large dual encoders are generalizable retrievers. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 9844–9855.
Rodrigo Nogueira, Jimmy Lin, and AI Epistemic. From doc2query to doctttttquery.
Aaron van den Oord, Yazhe Li, and Oriol Vinyals. 2018. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748.
Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. 2020. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21(140):1–67.
Shashank Rajput, Nikhil Mehta, Anima Singh, Raghu-nandan Hulikal Keshavan, Trung Vu, Lukasz Heldt, Lichan Hong, Yi Tay, Vinh Tran, Jonah Samost, et al. 2023. Recommender systems with generative retrieval. Advances in Neural Information Processing Systems, 36:10299–10315.
Stephen Robertson and Hugo Zaragoza. 2009. The probabilistic relevance framework: Bm25 and beyond. Foundations and trends in information retrieval, 4(1-2):1–174.
Weiwei Sun, Lingyong Yan, Zheng Chen, Shuaiqiang Wang, Haichao Zhu, Pengjie Ren, Zhumin Chen, Dawei Yin, Maarten Rijke, and Zhaochun Ren. 2023. Learning to tokenize for generative retrieval. Advances in Neural Information Processing Systems, 36:46345–46361.
Yi Tay, Vinh Tran, Mostafa Dehghani, Jianmo Ni, Dara Bahri, Harsh Mehta, Zhen Qin, Kai Hui, Zhe Zhao, Jai Gupta, et al. 2022. Transformer memory as a differentiable search index. Advances in neural information processing systems, 35:21831–21843.
Yujing Wang, Yingyan Hou, Haonan Wang, Ziming Miao, Shibin Wu, Qi Chen, Yuqing Xia, Chengmin Chi, Guoshuai Zhao, Zheng Liu, et al. 2022. A neural corpus indexer for document retrieval. Advances in Neural Information Processing Systems, 35:25600–25614.
Zihan Wang, Yujia Zhou, Yiteng Tu, and Zhicheng Dou. 2023. Novo: Learnable and interpretable document identifiers for model-based ir. In Proceedings of the 32nd ACM International Conference on Information and Knowledge Management, pages 2656–2665.
Mitchell Wortsman, Gabriel Ilharco, Jong Wook Kim, Mike Li, Simon Kornblith, Rebecca Roelofs, Raphael Gontijo Lopes, Hannaneh Hajishirzi, Ali Farhadi, Hongseok Namkoong, et al. 2022. Robust fine-tuning of zero-shot models. In 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 7949–7961. IEEE.
Ikuya Yamada, Akari Asai, and Hannaneh Hajishirzi. 2021. Efficient passage retrieval with hashing for open-domain question answering. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 2: Short Papers), pages 979–986.
Hailin Zhang, Yujing Wang, Qi Chen, Ruiheng Chang, Ting Zhang, Ziming Miao, Yingyan Hou, Yang Ding, Xupeng Miao, Haonan Wang, et al. 2023. Model-enhanced vector index. Advances in Neural Information Processing Systems, 36:54903–54917.
Peitian Zhang, Zheng Liu, Yujia Zhou, Zhicheng Dou, Fangchao Liu, and Zhao Cao. 2024. Generative retrieval via term set generation. In Proceedings of the 47th international ACM SIGIR conference on research and development in information retrieval, pages 458–468.
Yifei Zhang, Hao Zhu, Haoran Shi, Yanyu Chen, Xiaolin Han, Yupei Zhang, Lingyun Song, Wenxuan Wang, Chao Zhou, Xuequn Shang, et al. 2026a. Flash: Fast generative retrieval via autoregressive semantic hashing with provably distance bounds. In Proceedings of the 32nd ACM SIGKDD Conference on Knowledge Discovery and Data Mining V. 2, pages 6594–6605.
Zhen Zhang, Xinyu Ma, Weiwei Sun, Pengjie Ren, Zhumin Chen, Shuaiqiang Wang, Dawei Yin, Maarten de Rijke, and Zhaochun Ren. 2025. Replication and exploration of generative retrieval over dynamic corpora. In Proceedings of the 48th international ACM SIGIR conference on research and development in information retrieval, pages 3325–3334.
Zhen Zhang, Zihan Wang, Xinyu Ma, Shuaiqiang Wang, Dawei Yin, Xin Xin, Pengjie Ren, Maarten de Rijke, and Zhaochun Ren. 2026b. Model editing for new document integration in generative information retrieval. In Proceedings of the ACM Web Conference 2026, pages 1993–2003.
Jujia Zhao, Wenjie Wang, Chen Xu, Xiuying Chen, Zhaochun Ren, and Suzan Verberne. 2025. Unifying search and recommendation with dual-view representation learning in a generative paradigm. ACM Transactions on Information Systems.
Yujia Zhou, Jing Yao, Zhicheng Dou, Ledell Wu, Peitian Zhang, and Ji-Rong Wen. 2022. Ultron: An ultimate retriever on corpus with a model-based indexer. arXiv preprint arXiv:2208.09257.
A Appendix
A.1 Dataset statistics
For NQ320K and TriviaQA, with each split, we distinguish seen document queries, whose gold documents are entirely in , from unseen document queries, whose gold documents are entirely in . Queries with gold documents in both sets are discarded. We randomly hold out 10,000 seen document queries for testing and 10 % of the remaining queries for validation, using the rest for training. We sample 10,000 unseen document queries for testing. For MS MARCO, we follow the splits in Zhang et al. (2026b). See Table 4 for details.
A.2 Baseline details
-
Hierarchical k-means Semantic IDs: DSI (Tay et al., 2022) and NCI (Wang et al., 2022). Both assign identifiers by recursive k-means over document embeddings. The remaining difference between the two methods is architectural.
-
Product Quantization Semantic IDs: ULTRON-PQ (Zhou et al., 2022), in which every identifier token is a quantized code of a document embedding.
-
RQ and RQ-VAE Semantic IDs: Residual quantization DocID is first used in MEVI (Zhang et al., 2023); RQ-VAE DocID is first used in generative recommendation by TIGER (Rajput et al., 2023). We adopt the identifier under the DSI architecture so that it differs from the hierarchical k-means baselines only in how identifiers are constructed.
-
Textual IDs: In addition, we include two non-numeric baselines to contrast numeric identifiers with text-derived ones: ULTRON-URL (Zhou et al., 2022), which assigns each document a title- and URL-derived string, and SEAL (Bevilacqua et al., 2022), which assigns no identifier at all and instead generates document substrings resolved through an FM-index.
A.3 Hyperparameters
Table 5 shows the hyperparameters we used. We did not tune any training hyperparameters: a single configuration is used for every dataset and split, and only the checkpoint is selected by early stopping on seen document queries from validation set.
Additionally, We train with additional pseudo-queries, following prior work. For NQ320K and TriviaQA, we use NCI's released pseudo-queries (Wang et al., 2022), generated by docTTTT-Tquery (Nogueira et al.), with 10 pseudo-queries per document in . The total training budget for our method is 96 A100 GPU-hours. Each reproduced baseline is trained with the same pseudo-queries and budget hours. For MS MARCO, we follow prior work (Zhang et al., 2026b), using up to 5 pseudo-queries per document in .
A.4 Retrieval result on seen / unseen split
Table 6 shows the result of seen / unseen split. The same findings from seen / can be seen.
A.5 Full corpus
Dataset For the full-corpus evaluation, we follow the prior work: NQ320K contains 109,739 documents with 307,373 training and 7,830 validation queries (the test set was not released); TriviaQA contains 73,970 documents with 61,891 training, 7,993 validation, and 7,701 test queries.
Baslines On the full corpus, where no documents are added after indexing, besides the baselines used for the dynamic-corpus setting, we additionally compare against recent generative retrieval systems that report on this benchmark, including Learnable numeric DocID GenRet (Sun et al., 2023), and Text DocID Novo (Wang et al., 2023), we also report the none-generative search results as reference.
Result Table 7 shows the static setting ( ), where all documents are seen during training and generative retrieval baselines can make the most effective use of indexing training compared to the dynamic setting. Our method remains competitive by performing only query-to-DocID optimization: it achieves 69.11% Hit@1 on NQ320K and 75.51% Hit@1, and maintains comparable results on other metrics. Using more tokens improves performance, while latency is relatively insensitive to identifier length (23.7–27.7 ms for 7–21 tokens).
A.6 Efficiency analysis
Figure 7 shows the latency against hit rate. On unseen documents, our method achieves the highest
TriviaQA has only 4,195 eligible unseen queries at , so we use all of them.
Table 4: Statistics of the dynamic-corpus splits. Train and valid have all gold documents only in . Test queries for are held out from training.
| Dataset | #Documents | #Queries | |||||
|---|---|---|---|---|---|---|---|
| Train | Valid | Test (for ) | Test (for ) | ||||
| NQ320K | 90/10 | 98,765 | 10,974 | 246,751 | 27,417 | 10,000 | 10,000 |
| 60/40 | 65,843 | 43,896 | 162,077 | 18,009 | 10,000 | 10,000 | |
| TriviaQA | 90/10 | 66,573 | 7,397 | 49,271 | 5,474 | 10,000 | 4,195 |
| 60/40 | 44,382 | 29,588 | 22,088 | 2,454 | 10,000 | 10,000 | |
| MS MARCO | 90/10 | 291,869 | 32,428 | 297,397 | 33,044 | 4,675 | 518 |
| BERT-base | T5-base | |||
|---|---|---|---|---|
| Backbone | BERT-base | from | T5-base encoder | from |
| Objective | InfoNCE | InfoNCE over DocID | InfoNCE | InfoNCE over DocID |
| Temperature | ||||
| Optimizer | AdamW | AdamW | Adafactor | Adafactor |
| Learning rate | ||||
| Effective batch | ||||
| Budget | ≤200 epochs | ≤100k steps | ≤200 epochs | ≤100k steps |
| Early stopping | patience 5 | patience 10 | patience 5 | patience 10 |
Table 5: Training hyperparameters. PDIM: MRR of the gold document under exhaustive ranking by bitwise agreement, without a prefix tree. 's validation set is the official dev set for NQ320K and TriviaQA and a held-out 10% slice of the training queries for MS MARCO.
Hit@1 and Hit@100 while also being the most efficient. SEAL generalizes relatively well to unseen documents, but retrieving the documents matching its candidate substrings through the FM-index introduces substantial query-time overhead. On seen documents, our method achieves the highest Hit@1, while NCI achieves the highest Hit@100; even so, our method remains substantially faster than all baselines because the score of our method decomposes over bits and does not condition on previously generated tokens, the constrained search that follows requires no more forward pass.
A.7 Effect of multiple trees- hit@1 and hit@100
Figures 8 and 9 show the simialr result as hit@10 in Figure 3.
| Method | DocID type | NQ320K | TriviaQA | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Hit@1 | Hit@10 | Hit@100 | MRR@100 | Hit@1 | Hit@10 | Hit@100 | MRR@100 | ||
| Queries with unseen target documents () | |||||||||
| NCI | Hier. k-means | 0.09 | 0.49 | 2.03 | 0.24 | 0.00 | 0.12 | 0.62 | 0.03 |
| DSI | Hier. k-means | 0.09 | 0.64 | 3.95 | 0.30 | 0.01 | 0.23 | 1.57 | 0.08 |
| NCI (shared IDs) | Hier. k-means | 0.90 | 6.68 | 18.04 | 2.83 | 0.34 | 4.84 | 15.80 | 1.76 |
| DSI (shared IDs) | Hier. k-means | 0.67 | 5.34 | 14.11 | 2.22 | 0.38 | 3.97 | 13.23 | 1.59 |
| DSI | RQ-VAE | 0.06 | 0.66 | 3.63 | 0.28 | 0.01 | 0.11 | 1.53 | 0.06 |
| ULTRON-PQ | Product quant. | 0.05 | 0.43 | 12.09 | 0.32 | 0.00 | 0.00 | 5.08 | 0.06 |
| ULTRON-URL | URL / title string | 14.80 | 31.25 | 46.53 | 20.60 | - | - | - | - |
| SEAL (BART) | Substrings | 15.05 | 58.88 | 83.13 | 29.47 | 27.60 | 58.62 | 78.71 | 38.11 |
| CoBIGR-Bert | Bit-factorized code | 45.02 | 79.10 | 85.83 | 57.73 | 45.70 | 73.73 | 82.29 | 55.95 |
| CoBIGR-T5 | Bit-factorized code | 42.90 | 77.48 | 85.10 | 55.60 | 44.22 | 70.35 | 80.00 | 53.60 |
| Queries with seen target documents () | |||||||||
| NCI | Hier. k-means | 66.15 | 85.85 | 92.71 | 73.46 | 71.77 | 91.47 | 96.45 | 79.31 |
| DSI | Hier. k-means | 61.44 | 77.49 | 85.07 | 67.60 | 63.17 | 83.10 | 89.99 | 70.62 |
| DSI | RQ-VAE | 58.15 | 78.52 | 85.90 | 65.87 | 63.36 | 84.26 | 90.79 | 71.24 |
| ULTRON-PQ | Product quant. | 60.58 | 79.18 | 86.46 | 67.60 | 66.88 | 84.87 | 91.62 | 73.71 |
| ULTRON-URL | URL / title string | 63.71 | 79.36 | 87.04 | 69.78 | - | - | - | - |
| SEAL (BART) | Substrings | 62.99 | 83.44 | 92.61 | 70.53 | 71.45 | 85.92 | 92.74 | 76.86 |
| CoBIGR-Bert | Bit-factorized code | 69.37 | 87.01 | 91.09 | 75.99 | 73.22 | 89.75 | 93.44 | 79.55 |
| CoBIGR-T5 | Bit-factorized code | 68.33 | 85.89 | 90.68 | 74.92 | 70.79 | 88.45 | 92.44 | 77.41 |
Table 6: Retrieval results on NQ320K and TriviaQA, seen / unseen split; all methods retrieve from the full index.
| Method | NQ320K (Validation set) | TriviaQA | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Hit@1 | Hit@10 | Hit@100 | MRR@100 | B/doc | Hit@1 | Hit@10 | Hit@100 | MRR@100 | B/doc | |
| DSI | 60.87 | 76.90 | 84.37 | 66.94 | 3.0 | 63.38 | 84.09 | 91.16 | 70.99 | 2.5 |
| SEAL | 61.38 | 82.96 | 93.05 | 69.39 | 3,134 | 70.71 | 86.85 | 93.30 | 76.76 | 1,901 |
| NCI | 65.90 | 85.06 | 92.80 | 73.04 | 3.0 | 72.78 | 92.61 | 97.29 | 80.35 | 2.5 |
| ULTRON-PQ | 58.90 | 78.44 | 86.19 | 66.34 | 24 | 66.63 | 86.11 | 92.70 | 74.08 | 24 |
| ULTRON-URL | 62.05 | 79.31 | 86.85 | 68.74 | 27 | - | - | - | - | - |
| GenRet (Sun et al., 2023) | 68.1 | 88.8 | 95.2 | 75.9 | - | - | - | - | - | - |
| MEVI (full ensemble) | 63.04 | 84.55 | 95.27 | 71.55 | 3,074.5 | 70.94 | 90.65 | 97.35 | 78.60 | 3,074.5 |
| NOVO (Wang et al., 2023) | 69.3 | 89.7 | 95.9 | 76.7 | - | - | - | - | - | - |
| CoBIGR-T5 | 67.71 | 86.00 | 90.55 | 74.70 | 15.0 | 71.24 | 89.72 | 93.64 | 78.32 | 15.0 |
| CoBIGR-Bert | 68.46 | 87.04 | 91.57 | 75.50 | 15.0 | 74.08 | 91.04 | 94.34 | 80.63 | 15.0 |
| full-corpus search | ||||||||||
| BERT-FT | 65.25 | 88.45 | 95.12 | 73.91 | 3,072 | 69.86 | 91.44 | 96.84 | 78.12 | 3,072 |
| GTR-T5-base | 54.94 | 83.70 | 93.60 | 65.30 | 3,072 | 60.16 | 83.76 | 93.46 | 68.70 | 3,072 |
| BM25 | 36.93 | 70.28 | 88.31 | 48.41 | 1,568 | 51.94 | 81.48 | 92.87 | 62.70 | 1,037 |
Table 7: Retrieval results on the official splits. All documents are seen documents ( ). “-” means the metric is not reported in the original paper. Our reproduction. BERT-FT refers to fine-tuned on the NQ and TriviaQA datasets. B/doc: The bytes the index must store per document.

- Ours (10 tokens) ■ NCI ▲ DSI ● MEVI ▼ Ultron PQ + Ultron URL ◆ SEAL
Figure 7: Latency against Hit on the NQ dataset, batch size of 1 and 1 GPU. ( , )

TriviaQA - unseen
TriviaQA - seen
Number of trees
h=1 h=2 h=4 h=8 h=16
Figure 8: Hit@1 by different size of trees and beams ( , )
NQ320K - unseen
NQ320K - seen

TriviaQA - unseen
TriviaQA - seen
Number of trees
h=1 h=2 h=4 h=8 h=16
Figure 9: Hit@100 by different size of trees and beams ( , )