Generative recommendation has recently emerged as a promising paradigm in sequential recommendation. It formulates the task as an autoregressive generation process, predicting discrete tokens of the next item conditioned on user interaction histories. Existing generative recommendation models are typically trained with token-level likelihood objectives, such as cross-entropy loss, while employing multi-step beam search during inference to generate ranked item candidates. However, this leads to a fundamental training-inference inconsistency: standard training assumes ground-truth history is always available, ignoring the fact that beam search prunes low-probability branches during inference. Consequently, the correct item may be prematurely discarded simply because its initial tokens (prefixes) have low scores. To address this issue, we propose the Adaptive Prefix-Aware Optimization (APAO) framework, which introduces prefix-level optimization losses to better align the training objective with the inference setting. Furthermore, we design an adaptive worst-prefix optimization strategy that dynamically focuses on the most vulnerable prefixes during training, thereby enhancing the model's ability to retain correct candidates under beam search constraints. We provide theoretical analyses to demonstrate the effectiveness and efficiency of our framework. Extensive experiments on multiple datasets further show that APAO consistently alleviates the training-inference inconsistency and improves performance across various generative recommendation backbones. Our codes are publicly available at https://github.com/yuyq18/APAO.
翻译:生成式推荐作为一种新兴的序列推荐范式,展现出广阔的应用前景。该范式将推荐任务构建为自回归生成过程,根据用户交互历史预测下一物品的离散标记序列。现有生成式推荐模型通常采用标记级似然目标(如交叉熵损失)进行训练,而在推理阶段则使用多步束搜索生成排序后的候选物品列表。然而,这导致了训练与推理之间的根本性不一致:标准训练假设真实历史始终可得,却忽略了束搜索在推理过程中会剪枝低概率分支的事实。因此,正确物品可能仅因其初始标记(前缀)得分较低而被过早丢弃。为解决这一问题,我们提出自适应前缀感知优化(APAO)框架,通过引入前缀级优化损失使训练目标与推理设置更好对齐。此外,我们设计了自适应最差前缀优化策略,在训练过程中动态聚焦于最脆弱的前缀,从而增强模型在束搜索约束下保留正确候选的能力。我们通过理论分析证明了框架的有效性与效率。在多个数据集上的大量实验进一步表明,APAO能持续缓解训练-推理不一致问题,并在多种生成式推荐骨干模型上提升性能。代码已开源:https://github.com/yuyq18/APAO。