Robust Implementation of Retrieval-Augmented Generation on Edge-based Computing-in-Memory Architectures

📄 arXiv: 2405.04700v1 📥 PDF

作者: Ruiyang Qin, Zheyu Yan, Dewen Zeng, Zhenge Jia, Dancheng Liu, Jianbo Liu, Zhi Zheng, Ningyuan Cao, Kai Ni, Jinjun Xiong, Yiyu Shi

分类: cs.LG, cs.AI, cs.DC, cs.IR

发布日期: 2024-05-07


💡 一句话要点

提出RoCR框架,利用存内计算加速边缘设备上的检索增强生成。

🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture) 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 检索增强生成 存内计算 边缘计算 对比学习 噪声感知训练

📋 核心要点

  1. 边缘设备上部署LLM面临资源限制,RAG虽然能提升生成质量,但重复搜索用户数据导致延迟和可扩展性问题。
  2. RoCR框架利用存内计算(CiM)加速RAG,通过在存储器内部进行计算,避免数据传输瓶颈,提升搜索效率。
  3. RoCR采用对比学习和噪声感知训练,使RAG能够高效地利用CiM搜索profile数据,是首个利用CiM加速RAG的工作。

📝 摘要(中文)

大型语言模型(LLM)部署在边缘设备上通常通过微调和更新部分参数进行学习。尽管这些方法可以优化以减少资源利用,但总体资源需求对于边缘设备来说仍然是沉重的负担。检索增强生成(RAG)是一种资源高效的LLM学习方法,无需更新模型参数即可提高LLM生成内容的质量。然而,基于RAG的LLM可能在每次用户-LLM交互中重复搜索profile数据,导致显著的延迟和用户数据的积累。传统的降低延迟的努力限制了保存的用户数据的大小,从而降低了RAG的可扩展性。本文提出了一种新颖的框架,通过存内计算(CiM)架构加速RAG。它通过在存储器内部执行原位计算来加速矩阵乘法,同时避免了计算单元和存储器之间昂贵的数据传输。我们的框架,Robust CiM-backed RAG (RoCR),利用一种新颖的基于对比学习的训练方法和噪声感知训练,使RAG能够有效地使用CiM搜索profile数据。据我们所知,这是第一项利用CiM加速RAG的工作。

🔬 方法详解

问题定义:论文旨在解决边缘设备上RAG模型的延迟和可扩展性问题。现有方法在边缘设备上部署RAG时,需要频繁搜索用户数据,导致延迟较高。为了降低延迟,通常会限制用户数据的大小,从而降低了RAG的可扩展性。

核心思路:论文的核心思路是利用存内计算(CiM)架构加速RAG中的矩阵乘法运算,从而降低延迟并提高效率。CiM通过在存储器内部进行计算,避免了计算单元和存储器之间的数据传输瓶颈。

技术框架:RoCR框架包含以下主要模块:1) 嵌入生成:将用户数据和查询转换为嵌入向量。2) 相似度计算:使用CiM加速嵌入向量之间的相似度计算,找到最相关的profile数据。3) 内容生成:将检索到的profile数据输入LLM,生成最终内容。框架利用对比学习进行训练,并采用噪声感知训练方法,以提高CiM在实际应用中的鲁棒性。

关键创新:论文的关键创新在于将存内计算(CiM)应用于RAG加速,并提出了相应的训练方法。与传统方法相比,RoCR能够显著降低延迟,提高RAG的可扩展性。此外,噪声感知训练提高了CiM在实际应用中的鲁棒性。

关键设计:RoCR采用对比学习损失函数,鼓励相似的用户数据具有相似的嵌入向量,不相似的数据具有不同的嵌入向量。噪声感知训练通过在训练数据中引入噪声,模拟实际应用中CiM可能遇到的噪声干扰,从而提高模型的鲁棒性。具体的网络结构和参数设置在论文中有详细描述(未知)。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

由于论文中没有提供具体的实验数据,因此无法总结实验亮点。但根据论文描述,RoCR框架旨在通过存内计算加速RAG,从而降低延迟并提高可扩展性。未来的实验结果应该会展示RoCR在延迟、吞吐量和能效方面的提升,并与现有的RAG加速方法进行对比。

🎯 应用场景

该研究成果可应用于各种边缘计算场景,例如智能助手、个性化推荐系统、智能客服等。通过加速RAG,可以提升用户体验,并支持更大规模的用户数据。未来,该技术有望推动边缘设备上LLM的广泛应用,实现更智能、更高效的边缘计算服务。

📄 摘要(原文)

Large Language Models (LLMs) deployed on edge devices learn through fine-tuning and updating a certain portion of their parameters. Although such learning methods can be optimized to reduce resource utilization, the overall required resources remain a heavy burden on edge devices. Instead, Retrieval-Augmented Generation (RAG), a resource-efficient LLM learning method, can improve the quality of the LLM-generated content without updating model parameters. However, the RAG-based LLM may involve repetitive searches on the profile data in every user-LLM interaction. This search can lead to significant latency along with the accumulation of user data. Conventional efforts to decrease latency result in restricting the size of saved user data, thus reducing the scalability of RAG as user data continuously grows. It remains an open question: how to free RAG from the constraints of latency and scalability on edge devices? In this paper, we propose a novel framework to accelerate RAG via Computing-in-Memory (CiM) architectures. It accelerates matrix multiplications by performing in-situ computation inside the memory while avoiding the expensive data transfer between the computing unit and memory. Our framework, Robust CiM-backed RAG (RoCR), utilizing a novel contrastive learning-based training method and noise-aware training, can enable RAG to efficiently search profile data with CiM. To the best of our knowledge, this is the first work utilizing CiM to accelerate RAG.