MALLOC: Benchmarking the Memory-aware Long Sequence Compression for Large Sequential Recommendation

Qihang Yu, Kairui Fu, Zhaocheng Du, Yuxuan Si, Kaiyuan Li, Weihao Zhao, Zhicheng Zhang, Jieming Zhu, Quanyu Dai, Zhenhua Dong, Shengyu Zhang, Kun Kuang, Fei WuarXiv 2026 · arXiv · OpenReview

TL;DR

This paper introduces MALLOC, the first comprehensive benchmark for evaluating memory-aware compression techniques in large-scale sequential recommendation systems. It addresses the critical "memory-latency dilemma" by systematically classifying and evaluating various compression strategies, providing crucial insights for practical industrial deployment.

What Problem Does This Paper Address?

Modern recommendation systems are increasingly leveraging the "scaling law," meaning larger models and datasets lead to better performance. This trend, especially in recommendation systems, has led to a focus on modeling long user interaction sequences to capture evolving user intent. However, the standard self-attention mechanism used in these models has a quadratic computational cost with respect to sequence length, leading to significant latency and memory demands. While pre-storing intermediate states can accelerate inference, it introduces a massive memory overhead, especially for systems with billions of users, each having thousands of interactions. Existing memory management strategies, often borrowed from LLMs, haven't been thoroughly evaluated in the recommendation context, leaving a gap in understanding their trade-offs between accuracy, efficiency, and memory usage.

Methods

The core contribution of this paper is the MALLOC benchmark, which provides a structured framework for evaluating memory-aware long-sequence compression techniques. MALLOC categorizes these techniques based on the granularity of memory allocation:

  • Sequence-Level Compression: Approximates or restructures attention along the sequence dimension (e.g., Linformer, Reformer).
  • Token-Level Compression: Merges, prunes, or selectively retains intermediate states at the token level (e.g., Longformer, H2O, SnapKV).
  • Head-Level Compression: Shares or compresses attention heads within a layer (e.g., MQA, GQA, MLA).
  • Precision-Level Compression: Lowers the numerical precision of cached states (e.g., KIVI, IntactKV).
  • Architecture-Level: Fundamentally alters the modeling paradigm to rely on compact recurrent states (e.g., RWKV).

MALLOC integrates these techniques into a unified backbone (HSTU) and evaluates them across multiple dimensions: recommendation accuracy (AUC, GAUC, Logloss), computational cost (MACs), and memory occupation.

Datasets

The paper uses three real-world datasets for evaluation:

  • Amazon-Electronic: A smaller, sparser dataset with shorter sequences (max length 128), used to understand baseline behavior in less demanding scenarios.
  • MicroVideo1.7M: A dataset with longer sequences (max length 1024) to explore long-sequence modeling.
  • KuaiVideo: An industrial dataset from Kuaishou, also with long sequences (max length 1024), to simulate real-world recommendation system conditions.

Key Insights and Ideas

  • No Silver Bullet: Memory-aware compression is not a one-size-fits-all solution. The effectiveness of a technique is highly dependent on the specific dataset characteristics and the desired trade-off between accuracy and resource consumption.
  • Granularity Matters: Categorizing compression by memory allocation granularity provides a more nuanced understanding of how different strategies impact performance and resource usage compared to broader architectural classifications.
  • Accuracy vs. Resources is a Trade-off: While some methods achieve high accuracy, they come with prohibitive computational or memory costs. Conversely, aggressive compression can significantly reduce resources but may lead to performance degradation.
  • Scalability is Not Guaranteed: Not all efficient compression techniques scale well with increasing model depth. Some methods, like Longformer and Beacon, can become unstable or fail to converge in deeper architectures, highlighting the importance of considering training stability.
  • Head-Level Compression Offers a Balanced Approach: Methods like MQA, GQA, and MLA demonstrate a promising balance, achieving accuracy comparable to native methods while significantly reducing computational and memory costs, making them strong candidates for practical deployment.

Key Results

  • Performance Variability: Different memory management strategies can lead to substantial discrepancies in recommendation performance.
  • Resource Reduction: Techniques like H2O and SnapKV can reduce memory usage to as low as ~2 MB. Head-level compression methods (MQA, GQA, MLA) reduce MACs from 4.36 G to ~276 M while maintaining competitive accuracy.
  • Accuracy Trade-offs:
    • Sequence-level methods like Reformer show strong performance but can be resource-intensive.
  • Token-level pruning methods offer significant resource savings but may sacrifice accuracy on long sequences.
  • Precision-level methods show marked performance degradation on long sequences due to compromised fidelity.
  • Scalability Findings: Reformer and grouped-attention methods (GQA, MQA, MLA) exhibit better scalability and robustness to increased model depth compared to others.

Limitations and Future Work

  • Implementation Complexity: The paper acknowledges that some methods, particularly architectural innovations like RWKV, require substantial redesign and re-engineering, posing challenges for industrial deployment.
  • Future Directions: The authors suggest future research should focus on hardware-algorithm co-design and adaptive compression strategies that dynamically balance context retention with system-level constraints. They also highlight the need for further investigation into how these methods interact with different backbone architectures and industrial deployment scenarios.

Summary updated

Abstract

The scaling law, which indicates that model performance improves with increasing dataset and model capacity, has fueled a growing trend in expanding recommendation models in both industry and academia. However, the advent of large-scale recommenders also brings significantly higher computational costs, particularly under the long-sequence dependencies inherent in the user intent of recommendation systems. Current approaches often rely on pre-storing the intermediate states of the past behavior for each user, thereby reducing the quadratic re-computation cost for the following requests. Despite their effectiveness, these methods often treat memory merely as a medium for acceleration, without adequately considering the space overhead it introduces. This presents a critical challenge in real-world recommendation systems with billions of users, each of whom might initiate thousands of interactions and require massive memory for state storage. Fortunately, there have been several memory management strategies examined for compression in LLM, while most have not been evaluated on the recommendation task. To mitigate this gap, we introduce MALLOC, a comprehensive benchmark for memory-aware long sequence compression. MALLOC presents a comprehensive investigation and systematic classification of memory management techniques applicable to large sequential recommendations. These techniques are integrated into state-of-the-art recommenders, enabling a reproducible and accessible evaluation platform. Through extensive experiments across accuracy, efficiency, and complexity, we demonstrate the holistic reliability of MALLOC in advancing large-scale recommendation. Code is available at https://anonymous.4open.science/r/MALLOC.
BibTeX
@misc{yu2026malloc,
  author = {Qihang Yu and Kairui Fu and Zhaocheng Du and Yuxuan Si and Kaiyuan Li and Weihao Zhao and Zhicheng Zhang and Jieming Zhu and Quanyu Dai and Zhenhua Dong and Shengyu Zhang and Kun Kuang and Fei Wu},
  title = {{MALLOC: Benchmarking the Memory-aware Long Sequence Compression for Large Sequential Recommendation}},
  year = {2026},
  eprint = {2601.20234},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2601.20234},
}
Figure