Generative recommendation (GR) aligns with advances in generative AI by casting next-item prediction as token-level generation rather than score-based ranking. Most GR methods adopt a two-stage pipeline: (i) \textit{item tokenization}, which maps each item to a sequence of discrete, hierarchically organized tokens; and (ii) \textit{autoregressive generation}, which predicts the next item's tokens conditioned on the tokens of user's interaction history. Although hierarchical tokenization induces a prefix tree (trie) over items, standard autoregressive modeling with conventional Transformers often flattens item tokens into a linear stream and overlooks the underlying topology. To address this, we propose TrieRec, a trie-aware generative recommendation method that augments Transformers with structural inductive biases via two positional encodings. First, a \textit{trie-aware absolute positional encoding} aggregates a token's (node's) local structural context (\eg depth, ancestors, and descendants) into the token representation. Second, a \textit{topology-aware relative positional encoding} injects pairwise structural relations into self-attention to capture topology-induced semantic relatedness. TrieRec is also model-agnostic, efficient, and hyperparameter-free. In our experiments, we implement TrieRec within three representative GR backbones, achieving notably improvements of 8.83\% on average across four real-world datasets.
翻译:生成式推荐(GR)顺应生成式人工智能的发展趋势,将下一物品预测任务重新定义为基于令牌的生成问题,而非传统的基于评分的排序问题。大多数GR方法采用两阶段流程:(i)物品令牌化:将每个物品映射为由离散、分层组织的令牌构成的序列;(ii)自回归生成:根据用户交互历史的令牌序列,预测下一物品的令牌序列。尽管分层令牌化在物品间形成了前缀树(trie)结构,但传统Transformer的标准自回归建模通常将物品令牌展平为线性序列,忽略了底层的拓扑结构。为解决这一问题,我们提出TrieRec——一种基于前缀树的生成式推荐方法,该方法通过两种位置编码机制为Transformer注入结构归纳偏置。首先,前缀树感知的绝对位置编码将令牌(节点)的局部结构上下文(如深度、祖先节点与后代节点)聚合到令牌表示中。其次,拓扑感知的相对位置编码将成对结构关系注入自注意力机制,以捕捉拓扑结构诱导的语义关联性。TrieRec同时具备模型无关性、高效性和超参数无关性。在实验中,我们在三种代表性GR骨干模型中实现了TrieRec,在四个真实世界数据集上平均取得了8.83%的显著性能提升。