Multi-Grained Patch Training for Efficient LLM-based Recommendation
Jiayi Liao, Ruobing Xie, Sihang Li, Xiang Wang, Xingwu Sun, Zhanhui Kang, Xiangnan He
TL;DR
PatchRec introduces a multi-grained patch training framework for LLM-based recommendations to model long-term user histories within limited context windows. It hierarchically compresses item histories into item patches and session patches, and employs a two-stage training process—Patch Pre-training and Patch Fine-tuning—to teach the model to interpret compressed representations and to assign time-aware significance to interactions. The approach yields substantial gains in recommendation accuracy (e.g., HR@20 improvements up to 32%) while dramatically reducing input-token usage (compression ratios up to multi-fold), outperforming TALLRec and other baselines on MovieLens and Goodreads datasets. These results demonstrate that PatchRec enables practical, long-horizon LLM-based sequential recommendations with improved efficiency and robustness for real-world applications.
Abstract
Large Language Models (LLMs) have emerged as a new paradigm for recommendation by converting interacted item history into language modeling. However, constrained by the limited context length of LLMs, existing approaches have to truncate item history in the prompt, focusing only on recent interactions and sacrificing the ability to model long-term history. To enable LLMs to model long histories, we pursue a concise embedding representation for items and sessions. In the LLM embedding space, we construct an item's embedding by aggregating its textual token embeddings; similarly, we construct a session's embedding by aggregating its item embeddings. While efficient, this way poses two challenges since it ignores the temporal significance of user interactions and LLMs do not natively interpret our custom embeddings. To overcome these, we propose PatchRec, a multi-grained patch training method consisting of two stages: (1) Patch Pre-training, which familiarizes LLMs with aggregated embeddings -- patches, and (2) Patch Fine-tuning, which enables LLMs to capture time-aware significance in interaction history. Extensive experiments show that PatchRec effectively models longer behavior histories with improved efficiency. This work facilitates the practical use of LLMs for modeling long behavior histories. Codes are available at https://github.com/ljy0ustc/PatchRec.
