[论文解读] Clustering-driven Memory Compression for On-device Large Language Models
该论文提出了一种基于聚类的内置设备端 LLM 的记忆压缩方法,它在簇内对记忆进行分组与合并,以在保持个性化质量的同时减少上下文使用,优于均值和拼接基线。
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.
研究动机与目标
- 在受限上下文窗口的设备端 LLM 上推动个性化。
- 通过高效压缩记忆来应对来自用户历史的记忆增长。
- 提出基于聚类的记忆压缩方法,以在上下文效率与个性化质量之间取得平衡。
- 在多个模型/数据集上展示相对于简单均值和拼接基线的实证提升。
提出的方法
- 使用 BM25 检索前 N 相关记忆。
- 使用带有 LoRA 微调的冻结 LLM 将每条记忆编码为固定数量的记忆标记。
- 按相似性将记忆聚类为 K 个簇(K-Means)。
- 通过对每个簇内的记忆取平均来计算簇级表示。
- 将簇表示拼接并在进行 LLM 推理之前将其附加到输入提示中。
实验结果
研究问题
- RQ1基于聚类的记忆合并在不牺牲在设备端 LLM 的个性化性能的情况下,是否能够减少记忆标记的使用?
- RQ2在固定上下文预算下,簇的数量和每条记忆的记忆标记数量如何影响性能?
- RQ3跨不同模型,基于聚类的表示是否优于基于均值或简单拼接的方法?
- RQ4在压缩个性化记忆时,上下文效率与生成质量之间的权衡在哪里?
主要发现
- 基于聚类的记忆压缩在减少记忆标记数量的同时,保持或提升 ROUGE-L 性能,相较于拼接。
- 在固定上下文预算下,聚类产生的记忆表示比简单平均更紧凑且生成质量更好。
- 在模型(Qwen2.5 1.5B、Gemma3 1B、StableLM2 1.6B)上,聚类在 ROUGE-L 指标上优于均值和拼接基线。
- 性能提升是在显著少于拼接的记忆标记数量下实现的(例如,聚类使用更少的记忆标记)。
- 增加簇的数量通常会提升性能,但当簇数量超过某个点后收益递减。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。