[论文解读] CQ-CiM: Hardware-Aware Embedding Shaping for Robust CiM-Based Retrieval
CQ-CiM 通过联合学习嵌入适配、压缩和低比特量化以匹配 CiM 交叉开关,在硬件变化下提升设备端 RAG 检索性能。
Deploying Retrieval-Augmented Generation (RAG) on edge devices is in high demand, but is hindered by the latency of massive data movement and computation on traditional architectures. Compute-in-Memory (CiM) architectures address this bottleneck by performing vector search directly within their crossbar structure. However, CiM's adoption for RAG is limited by a fundamental ``representation gap,'' as high-precision, high-dimension embeddings are incompatible with CiM's low-precision, low-dimension array constraints. This gap is compounded by the diversity of CiM implementations (e.g., SRAM, ReRAM, FeFET), each with unique designs (e.g., 2-bit cells, 512x512 arrays). Consequently, RAG data must be naively reshaped to fit each target implementation. Current data shaping methods handle dimension and precision disjointly, which degrades data fidelity. This not only negates the advantages of CiM for RAG but also confuses hardware designers, making it unclear if a failure is due to the circuit design or the degraded input data. As a result, CiM adoption remains limited. In this paper, we introduce CQ-CiM, a unified, hardware-aware data shaping framework that jointly learns Compression and Quantization to produce CiM-compatible low-bit embeddings for diverse CiM designs. To the best of our knowledge, this is the first work to shape data for comprehensive CiM usage on RAG.
研究动机与目标
- 弥合高精度、高维嵌入与低比特、固定大小 CiM 交叉开关之间的表示差距。
- 开发一个统一的端到端管线,联合适配嵌入、压缩维度并量化数值以实现 CiM 兼容性。
- 在训练中纳入硬件非理想性和设备方差,以提升 CiM 基于检索的鲁棒性。
- 在没有标签数据的情况下实现自监督学习以对嵌入进行塑形。
- 在多种嵌入模型和 CiM 设备类型下展示方法的泛化性。
提出的方法
- 基于 LoRA 的适配器以实现参数高效的嵌入适配。
- 密集投影压缩头将维度降低至 CiM 兼容尺寸。
- 噪声注入模块在训练期间模拟设备级方差。
- Nonuniform-to-Uniform Quantization (N2UQ) 头将压缩后的嵌入映射到低比特 CiM 水平。
- 对比学习损失用于通过自监督塑形语义空间。
- 重建损失(MSE)在端到端训练中稳定压缩与量化。

实验结果
研究问题
- RQ1一个统一的、硬件感知的框架是否能够联合压缩和量化嵌入以适配多样的 CiM 交叉开关?
- RQ2结合硬件感知的噪声进行端到端训练是否能在设备方差下提升 CiM 基于检索的鲁棒性?
- RQ3在 CiM 兼容任务上,CQ-CiM 相较于最先进的降维和量化基线有何表现?
- RQ4该方法是否能够在不同的嵌入模型和 CiM 设备技术(SRAM、ReRAM、FeFET)之间泛化?
主要发现
- 在五个数据集上,CQ-CiM 在积极的 1 位和 2 位设置下始终达到最佳或具竞争力的检索性能。
- LoRA 适配、密集压缩与学习的 N2UQ 量化的组合在消融实验中带来最强的提升。
- N2UQ 在检索任务中相对于固定 STE 的绝对提升为 3–7%。
- 框架在四种嵌入模型上表现出泛化性,并在带设备噪声的端到端 RAG 中保持鲁棒性。
- 端到端 RAG 结果在现实设备方差模型下显示出稳定的性能。

阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。