PCA-RAG: Principal Component Analysis for Efficient Retrieval-Augmented Generation
Arman Khaledian, Amirreza Ghadiridehkordi, Nariman Khaledian · 2025
Read PCA-RAG: Principal Component Analysis for Efficient Retrieval-Augmented Generation by Arman Khaledian, Amirreza Ghadiridehkordi, Nariman Khaledian (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2504-08386.txt.
Introduction
Khaledian, Ghadiridehkordi, and Khaledian test in twenty twenty-five whether shrinking number vectors keeps search quality while slashing cost. Systems that ground chatbots in outside texts store long vectors for each passage, which strains memory and speed on huge finance corpora. They compressed vectors with a classic method that keeps the main axes of variation, then compared search metrics.
Cutting vectors from thousands of numbers to about a hundred sped retrieval up to dozens of times. The index also shrank by a similar large factor. Agreement with human similarity scores dipped only modestly. The authors say the trade suits real-time finance platforms where speed, memory, and accuracy must hold together.
Catalog record
| CREATOR | Arman Khaledian, Amirreza Ghadiridehkordi, Nariman Khaledian |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 37 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2504-08386
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
PCA-RAG: Principal Component Analysis for Efficient Retrieval-Augmented Generation Arman Khaledian, Amirreza Ghadiridehkordi, Nariman Khaledian Abstract 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 × 60\times ) speedup in retrieval operations and a ∼ 28.6 × \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 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. 1 Introduction Recent advances in large language models (LLMs) and retrieval-based systems have paved the way for new applications in finance and trading, where swift access to accurate, domain-specific information is critical [ 7 , 19 ] . At Zanista AI, we have developed Newswitch , a platform designed to serve real-time news retrieval and sentiment analysis in the financial sector. Newswitch leverages Retrieval-Augmented Generation (RAG) to ground AI Investment Agent responses on up-to-date market data, enabling more precise and context-aware answers to financial queries [ 21 , 15 ] . Yet, a well-known challenge in RAG pipelines is the high-dimensional nature of the embedding vectors used for retrieval. Models like BERT and other Transformer-based encoders often produce 768- to 3,000-dimensional vectors [ 11 , 27 ] , creating large storage requirements and incurring significant computational costs—both of which are amplified when dealing with massive financial text corpora such as news articles and regulatory filings [ 14 ] . To address this challenge, researchers have turned to dimensionality reduction techniques, with Principal Component Analysis (PCA) emerging as a simple yet powerful tool [ 25 , 35 ] . By projecting high-dimensional embeddings onto a lower-dimensional subspace, PCA significantly reduces index size and query latency, often with minimal impact on retrieval accuracy [ 23 ] . In finance-focused applications such as Newswitch , where speed and scale are paramount, PCA thus presents an attractive trade-off between retaining semantic fidelity in embeddings and managing practical constraints like memory and throughput. In this paper, we examine how PCA-based compression can improve the efficiency of RAG pipelines for retrieval and question answering. We draw on prior work indicating that most variance in dense embeddings can be preserved with a modest fraction of dimensions [ 25 ] . By assessing the trade-off between retrieval accuracy and computational performance—both in terms of latency and memory footprint—we show that PCA maintains robust alignment with human judgments of semantic similarity while dramatically cutting storage requirements. Taken together, these findings underscore how Zanista AI’s Newswitch platform is more effectively integrating RAG techniques at scale, ultimately enhancing Investment Agent’s responsiveness in real-time financial decision-making scenarios. 2 Relevant Work 2.1 Principal Component Analysis in Retrieval-Augmented Generation (RAG) Retrieval-Augmented Generation (RAG) combines information retrieval with text generation to ground large language models on external knowledge [ 21 , 12 ] . A key challenge in RAG is efficiency – both in retrieving relevant documents and in processing them during generation [ 36 ] . High-dimensional vector representations (e.g. 768-dimensional BERT embeddings) provide strong retrieval accuracy but incur large storage and latency costs [ 19 , 15 , 34 ] . Dimensionality reduction techniques like Principal Component Analysis (PCA) have thus emerged as important tools to compress embeddings, speeding up retrieval and reducing memory usage while preserving accuracy [ 25 , 35 ] . 2.2 PCA for Efficient Neural Retrieval in NLP In natural language processing, PCA and related methods are used to identify and remove redundancy in embedding vectors [ 10 , 4 ] . Recent studies show that dense retrievers’ embedding dimensions are often larger than necessary. For example, Ma et al. [ 25 ] found that a 768-dimensional DPR vector has substantial redundancy – about 99% of the variance and mutual information is captured in the first \sim 256 dimensions. They proposed an unsupervised compression pipeline using PCA (followed by product quantization) to shrink embedding size, achieving a 48 \times index compression with under 3% loss in top-100 retrieval accuracy, and even 96 \times compression with <4\% drop, all with minimal retrieval effectiveness degradation. Notably, their results showed that unsupervised PCA can match or outperform learned reduction methods at moderate dimensions (128–256). In a similar vein, Yang and Seo [ 35 ] demonstrated that using only the first 128 dimensions of 512-d BERT embeddings in an open-domain QA retriever yields a linear 4 \times index size reduction with negligible accuracy loss ( \sim 1–2%). Beyond PCA, learned compressive models have been explored. Autoencoder approaches can reduce dimensionality while learning to preserve more task-specific features [ 8 , 23 ] . Liu et al. [ 23 ] introduce a Conditional Autoencoder (ConAE) to compress dense retriever embeddings, achieving nearly the same ranking performance at 128 dimensions as the original 768-d model. For instance, on MS MARCO passage retrieval, compressing embeddings from 768 \rightarrow 128 dims via ConAE only marginally lowered MRR@10 (0.3302 to 0.3245), whereas a naive PCA compression to 128 dims had a larger drop (0.2348). This suggests that while plain PCA finds the directions of maximal variance, learned models can better preserve task-specific signal. Nevertheless, PCA remains a simple and strong baseline for dimensionality reduction in retrieval, often serving as the first step in efficient pipeline designs [ 29 ] . By stripping out low-variance components, PCA tends to remove noise or redundant features in embeddings, which can even improve retrieval robustness in some cases [ 25 , 35 ] . 2.3 Applications in Finance and Trading Systems The finance and trading domain presents massive data – from lengthy regulatory filings to real-time market feeds – where RAG can offer significant value [ 26 , 9 ] . Recent work applies RAG to financial document question answering and analytics, leveraging retrieval to inject up-to-date domain knowledge into LLMs (Daizy V2). For instance, Iaroshev et al. [ 14 ] evaluate RAG for answering questions from annual reports, using a pipeline that chunks documents and encodes them into embeddings stored in a vector database. Such systems typically rely on high-dimensional language model embeddings (e.g. 768-dim) to capture fine-grained financial jargon and context. Dimensionality reduction can be especially beneficial here: financial corpora are large, so compressing embeddings reduces index size and query latency, crucial for real-time trading applications. Although specific uses of PCA in finance-focused retrieval are not always singled out, the general principle carries over – fewer dimensions often means faster retrieval – enabling