[Paper Review] Clustering-driven Memory Compression for On-device Large Language Models
The paper proposes a clustering-based memory compression method for on-device LLMs that groups and merges memories within clusters to reduce context usage while preserving personalization quality, outperforming mean and concatenation baselines.
Large language models (LLMs) often rely on user-specific memories distilled from past interactions to enable personalized generation. A common practice is to concatenate these memories with the input prompt, but this approach quickly exhausts the limited context available in on-device LLMs. Compressing memories by averaging can mitigate context growth, yet it frequently harms performance due to semantic conflicts across heterogeneous memories. In this work, we introduce a clustering-based memory compression strategy that balances context efficiency and personalization quality. Our method groups memories by similarity and merges them within clusters prior to concatenation, thereby preserving coherence while reducing redundancy. Experiments demonstrate that our approach substantially lowers the number of memory tokens while outperforming baseline strategies such as naive averaging or direct concatenation. Furthermore, for a fixed context budget, clustering-driven merging yields more compact memory representations and consistently enhances generation quality.
Motivation & Objective
- Motivate personalization for on-device LLMs with limited context windows.
- Address memory growth from user histories by compressing memories efficiently.
- Propose a clustering-based memory compression to balance context efficiency and personalization quality.
- Demonstrate empirical gains over naive mean and concatenation baselines across multiple models/datasets.
Proposed method
- Retrieve top-N relevant memories using BM25.
- Encode each memory into a fixed set of memory tokens using a frozen LLM with LoRA fine-tuning.
- Cluster memories into K clusters by similarity (K-Means).
- Compute cluster-level representations by averaging memories within each cluster.
- Concatenate cluster representations and append to the input prompt before LLM inference.
Experimental results
Research questions
- RQ1Can clustering-based memory merging reduce token usage without sacrificing personalization performance on on-device LLMs?
- RQ2How does the number of clusters and memory tokens per memory affect performance under a fixed context budget?
- RQ3Do clustering-based representations outperform mean-based or naive concatenation approaches across different models?
- RQ4What is the trade-off between context efficiency and generation quality when compressing personalized memories?
Key findings
- Clustering-based memory compression reduces memory tokens compared to concatenation while maintaining or improving ROUGE-L performance.
- For a fixed context budget, clustering yields more compact memory representations with better generation quality than naive averaging.
- Across models (Qwen2.5 1.5B, Gemma3 1B, StableLM2 1.6B), clustering outperforms mean and concatenation baselines on ROUGE-L.
- Performance gains are achieved with significantly fewer memory tokens than concatenation (e.g., clustering with fewer tokens).
- Increasing the number of clusters generally improves performance, with diminishing gains as the cluster count rises beyond a point.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.