RecMem compresses long user histories for better recommendations

RecMem: Recurrent Memory Compression for Long-Sequence Generative Recommendation

Artificial IntelligenceInformation Retrieval

Summary

Recommender systems often look at many past actions to decide what to suggest next, but analyzing long histories can be very slow. The authors created RecMem, which summarizes these histories into a small, fixed memory so recommendations can be faster without losing much accuracy. They trained RecMem to remember important details for predictions while being consistent whether processing long sequences all at once or bit by bit. On tests, RecMem used much less memory and still recommended almost as well as methods that read the full history directly.

What this means in practice

  • For recommender system engineers: Build recommendation engines that handle long user histories efficiently by compressing past interactions while retaining predictive power.
  • For stream processing developers: Use memory compression techniques to maintain predictive accuracy in systems that need to process long sequences in real time with limited resources.

Authors

Haoyi Hu, Gaoyang Guo, Yunjia Xi, Wen Chen, Weiwen Liu, Jian Wu, Yuning Jiang, Weinan Zhang

Abstract

Generative recommendation benefits from long interaction histories, but the cost of processing them directly grows with history length. We propose RecMem, a recurrent memory compression framework guided by three desiderata: space invariance, semantic fidelity, and lifelong evolvability. RecMem compresses historical segments into a fixed set of memory slots using a bifurcated encoder-decoder with shared lower layers and slot-wise forget-gated updates. Recommendation supervision trains the memory to preserve predictive information, while stream-consistency training aligns predictions from sequential and packed processing. By construction, the memory state and decoder context are independent of history length; under contraction and approximate semigroup consistency, we further derive a horizon-independent bound on the state discrepancy between these two processing orders. On MerRec, RecMem uses 16 memory slots and a 216-token decoder context, compared with 1,200 tokens for HSTU-1200, while retaining 87.9% of HSTU-1200's Recall@10 and 97.0% of its Recall@200. It outperforms PHSTU and the evaluated recent-only and retrieval baselines, and analyses of distant history show that archived interactions contribute predictive signal.