用主成分分析压缩嵌入向量,提升金融文本RAG的检索速度与效率
PCA-RAG: Principal Component Analysis for Efficient Retrieval-Augmented Generation
- 采用PCA将3072维嵌入降至110维,降低计算开销
- 检索速度提升60倍,索引大小减少28.6倍,精度损失可控
- 适合对实时性、内存效率要求高的金融AI系统
检索增强生成(RAG)通过引入外部知识源提升了大模型响应的准确性。然而,高维语言模型嵌入(数百至数千维)在存储和延迟方面带来可扩展性挑战,尤其在处理大规模金融文本语料时更为显著。本文研究使用主成分分析(PCA)降低嵌入维度,以缓解计算瓶颈,同时保持较高精度。我们在真实数据集上实验,对比全维与PCA压缩嵌入下的多种相似性与距离度量。结果表明,将向量从3072维降至110维后,检索操作速度提升最高达60倍,索引大小减少约28.6倍,与人工标注相似度评分相比相关性下降幅度适中。这些发现证明,基于PCA的压缩在检索保真度与资源效率之间提供了可行平衡,对Zanista AI的Newswitch平台等实时系统具有重要意义。研究表明,经典降维技术可有效支撑金融与交易场景中知识密集型应用的RAG架构规模化。
原文摘要 · Abstract (English)
Retrieval-Augmented Generation (RAG) has emerged as a powerful paradigm for grounding large language models in external knowledge sources, improving the precision of agents responses. However, high-dimensional language model embeddings, often in the range of hundreds to thousands of dimensions, can present scalability challenges in terms of storage and latency, especially when processing massive financial text corpora. This paper investigates the use of Principal Component Analysis (PCA) to reduce embedding dimensionality, thereby mitigating computational bottlenecks without incurring large accuracy losses. We experiment with a real-world dataset and compare different similarity and distance metrics under both full-dimensional and PCA-compressed embeddings. Our results show that reducing vectors from 3,072 to 110 dimensions provides a sizeable (up to $60\times$) speedup in retrieval operations and a $\sim 28.6\times$ reduction in index size, with only moderate declines in correlation metrics relative to human-annotated similarity scores. These findings demonstrate that PCA-based compression offers a viable balance between retrieval fidelity and resource efficiency, essential for real-time systems such as Zanista AI's \textit{Newswitch} platform. Ultimately, our study underscores the practicality of leveraging classical dimensionality reduction techniques to scale RAG architectures for knowledge-intensive applications in finance and trading, where speed, memory efficiency, and accuracy must jointly be optimized.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。