arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2606.00324cs.IRcs.AI
收藏

LLM 也需要语义 ID 的编码器

LLMs Need Encoders for Semantic IDs Too

Pinterest United States(Pinterest美国公司)

Xiangyi Chen, Zelun Wang, Xinyi Li, Yi-Ping Hsu, Jaewon Yang, Jiajing Xu

AI总结:

提出 PrefixMem,一种基于前缀 n-gram 记忆表的轻量级语义 ID 编码器,为 LLM 提供结构化、前缀条件的表示,显著提升生成推荐中的语义 ID 准确率和检索召回率。

摘要:

多模态 LLM 使用专用编码器来桥接非语言模态(图像用视觉编码器,音频编解码器令牌用深度模型),因为原始令牌嵌入无法捕获模态特定的结构。我们认为语义 ID(SID),即生成推荐中使用的层次化代码,构成了另一种这样的模态:SID 级别令牌的含义取决于其前缀上下文,但当前系统只是将 SID 令牌添加到词汇表中,并依赖训练从头学习这些上下文相关的含义。我们提出 PrefixMem,一种基于前缀 n-gram 记忆表的轻量级 SID 编码器,它在 SID 令牌位置为 LLM 提供结构化、前缀条件的表示。与多模态 LLM 中的视觉编码器类似,PrefixMem 可以独立预训练,然后附加到任何 LLM 上进行联合训练。我们在 Pinterest 的大规模数据上,跨多个 LLM 家族进行评估,结果表明,在相同的训练计算量下,PrefixMem 将最深层次 SID 准确率相对提升高达 46%,完整 SID 检索召回率相对提升高达 22%。编码器的优势集中在贪心解码失败的困难样本上,准确率相对提升高达 77%,这证实了 SID 令牌与其他非语言模态一样,受益于专用编码器。

英文摘要:

Multimodal LLMs use dedicated encoders to bridge non-language modalities (vision encoders for images, depth models for audio codec tokens) because raw token embeddings alone cannot capture modality-specific structure. We argue that Semantic IDs (SIDs), the hierarchical codes used in generative recommendation, constitute another such modality: a SID level token's meaning depends on its prefix context, yet current systems simply add SID tokens to the vocabulary and rely on training to learn these context-dependent meanings from scratch. We propose PrefixMem, a lightweight SID encoder based on prefix n-gram memory tables that provides the LLM with structured, prefix-conditioned representations at SID token positions. Like vision encoders in multimodal LLMs, PrefixMem can be pre-trained independently and then attached to any LLM for joint training. We evaluate on large-scale data from Pinterest across multiple LLM families and show that PrefixMem improves deepest-level SID accuracy by up to 46% relative and full-SID retrieval recall by up to 22% relative at matched training compute. The encoder's benefit concentrates on hard examples where greedy decoding fails, with up to 77% relative accuracy gains, confirming that SID tokens benefit from a dedicated encoder just as other non-language modalities do.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑