# RoutingTrie: Metadata Routing for Constrained Generative Retrieval

arXiv: https://arxiv.org/abs/2611.11016 · HTML: https://mlsanity.com/paper/2611.11016/

## Key facts

- No citing papers in the map yet (data through 24 Nov 2026).
- Builds on 34 of its 42 references that are in the map.
- Submitted 7 Nov 2026.

## Builds on (most cited first, 30 of 34)

- [Dense Passage Retrieval for Open-Domain Question Answering](https://mlsanity.com/paper/2004.04906/) (2020)
- [Self-Attentive Sequential Recommendation](https://mlsanity.com/paper/1808.09781/) (2018)
- [BERT4Rec: Sequential Recommendation with Bidirectional Encoder Representations from Transformer](https://mlsanity.com/paper/1904.06690/) (2019)
- [Approximate Nearest Neighbor Negative Contrastive Learning for Dense Text Retrieval](https://mlsanity.com/paper/2007.00808/) (2020)
- [Session-based Recommendations with Recurrent Neural Networks](https://mlsanity.com/paper/1511.06939/) (2015)
- [Recommendation as Language Processing (RLP): A Unified Pretrain, Personalized Prompt & Predict Paradigm (P5)](https://mlsanity.com/paper/2203.13366/) (2022)
- [Autoregressive Entity Retrieval](https://mlsanity.com/paper/2010.00904/) (2020)
- [Recommender Systems with Generative Retrieval](https://mlsanity.com/paper/2305.05065/) (2023)
- [Actions Speak Louder than Words: Trillion-Parameter Sequential Transducers for Generative Recommendations](https://mlsanity.com/paper/2402.17152/) (2024)
- [Adapting Large Language Models by Integrating Collaborative Semantics for Recommendation](https://mlsanity.com/paper/2311.09049/) (2023)
- [OneRec: Unifying Retrieve and Rank with Generative Recommender and Iterative Preference Alignment](https://mlsanity.com/paper/2502.18965/) (2025)
- [OneRec-Think: In-Text Reasoning for Generative Recommendation](https://mlsanity.com/paper/2510.11639/) (2025)
- [Better Generalization with Semantic IDs: A Case Study in Ranking for Recommendations](https://mlsanity.com/paper/2306.08121/) (2023)
- [ACORN: Performant and Predicate-Agnostic Search Over Vector Embeddings and Structured Data](https://mlsanity.com/paper/2403.04871/) (2024)
- [OneRec-V2 Technical Report](https://mlsanity.com/paper/2508.20900/) (2025)
- [OneRec Technical Report](https://mlsanity.com/paper/2506.13695/) (2025)
- [Unifying Generative and Dense Retrieval for Sequential Recommendation](https://mlsanity.com/paper/2411.18814/) (2024)
- [Approximate Nearest Neighbor Search with Window Filters](https://mlsanity.com/paper/2402.00943/) (2024)
- [Vectorizing the Trie: Efficient Constrained Decoding for LLM-based Generative Retrieval on Accelerators](https://mlsanity.com/paper/2602.22647/) (2026)
- [UNIFY: Unified Index for Range Filtered Approximate Nearest Neighbors Search](https://mlsanity.com/paper/2412.02448/) (2024)
- [CAPS: A Practical Partition Index for Filtered Similarity Search](https://mlsanity.com/paper/2308.15014/) (2023)
- [OneReason Technical Report](https://mlsanity.com/paper/2606.06260/) (2026)
- [HQANN: Efficient and Robust Similarity Search for Hybrid Queries with Structured and Unstructured Constraints](https://mlsanity.com/paper/2207.07940/) (2022)
- [SIEVE: Effective Filtered Vector Search with Collection of Indexes](https://mlsanity.com/paper/2507.11907/) (2025)
- [Constrained Auto-Regressive Decoding Constrains Generative Retrieval](https://mlsanity.com/paper/2504.09935/) (2025)
- [Efficient and Asymptotically Unbiased Constrained Decoding for Large Language Models](https://mlsanity.com/paper/2504.09135/) (2025)
- [Curator: Efficient Vector Search with Low-Selectivity Filters](https://mlsanity.com/paper/2601.01291/) (2026)
- [T-RoPE: Time-Aware Rotary Position Embedding for Sequential Recommendation](https://mlsanity.com/paper/2609.30576/) (2026)
- [Consistently faster and smaller compressed bitmaps with Roaring](https://mlsanity.com/paper/1603.06549/) (2016)
- [VecFlow: A High-Performance Vector Data Management System for Filtered-Search on GPUs](https://mlsanity.com/paper/2506.00812/) (2025)

## Abstract (arXiv)

Advances in large language models and semantic IDs (SIDs) have brought generative retrieval (GR) into industrial applications. These systems must return items that satisfy request metadata constraints as well as relevance requirements. A catalog trie ensures SID validity, but filtering metadata only after generation wastes computation on rejected candidates and may leave too few eligible results. We propose RoutingTrie to incorporate metadata constraints before beam selection. RoutingTrie maintains one shared SID trie and builds a compact index for each metadata field using Dense Bitset or Sparse List. We derive a storage cost formula to guide the choice between these index representations for different field distributions. During decoding, field probes determine whether requested values occur below candidate edges and produce a combined mask that guides beam selection. Experiments on ShopTrie, our configurable synthetic benchmark, demonstrate compact storage and efficient CPU and GPU probing across diverse metadata distributions. In a production replay, RoutingTrie raises Hit@100 from 67.5% to 96.1%, a gain of 28.6 percentage points, with only 1.1 ms latency increase. We will release the ShopTrie generator, benchmark scripts, and RoutingTrie CPU and Triton GPU implementations to support reproducibility.
