Sparse Retrieval
Sparse retrieval is a search approach that uses sparse vector representations β high-dimensional vectors where most dimensions are zero β to find documents based on term matching and statistical relevance. The most common form of sparse retrieval is BM25, a probabilistic ranking function that scores documents based on the frequency of query terms in each document, adjusted for document length and term frequency across the corpus. Unlike dense retrieval that captures semantic meaning, sparse retrieval excels at exact term matching, making it ideal for queries that require precision on specific terms, identifiers, or phrases. Sparse retrieval methods represent documents as sparse vectors where each dimension corresponds to a unique term in the vocabulary, and the value represents the term's importance in the document. This representation is called a bag-of-words model because it ignores word order and grammar, treating each document as a collection of independent terms. The key advantage of sparse retrieval is its efficiency β it can be implemented using inverted indices that map terms to documents, enabling fast retrieval even on very large corpora. Sparse retrieval is also highly interpretable because the relevance score can be explained by the specific terms that matched. Modern sparse retrieval has evolved beyond traditional BM25 with learned sparse retrieval approaches like SPLADE and uniCOIL, which use neural networks to learn which terms are important for retrieval and can expand queries with related terms. These learned sparse methods combine the precision of term matching with some semantic understanding, achieving performance that approaches dense retrieval on many benchmarks while maintaining the interpretability and efficiency of sparse methods. In production systems, sparse retrieval is often combined with dense retrieval in a hybrid search approach that weights and merges results from both methods to achieve optimal performance across different query types.
In Financial Services
Real-World Example
A compliance team at a global bank uses sparse retrieval as part of their hybrid search system for monitoring employee communications. The system maintains a list of 50,000+ regulated terms, sanction lists, and compliance keywords. When a compliance officer searches for communications mentioning 'PEP' (politically exposed person) or 'OFAC' (Office of Foreign Assets Control), the sparse retrieval component ensures exact match detection, finding all documents containing these specific terms. The system also uses BM25 scoring to rank communications by relevance, with higher scores for documents that mention compliance terms multiple times. The sparse retrieval component processes 10 million communications per day with sub-second latency, providing the precision needed for regulatory compliance while the dense retrieval component of the hybrid system handles conceptual searches like 'find all communications about potential conflicts of interest.' The bank reports that the hybrid approach achieves 99% precision on exact-match compliance queries while maintaining 90% recall on semantic search queries.
Why It Matters for Finance
Sparse retrieval remains a critical component of financial search systems because precision on exact terms is non-negotiable in regulated financial environments. When a compliance officer needs to find all documents that mention a specific regulatory clause, or a trader needs to verify the exact terms of a financial instrument, semantic approximations are not acceptable. Sparse retrieval provides the precision, interpretability, and auditability that financial search applications require. However, the limitations of sparse retrieval in handling synonyms and conceptual relationships mean it must be combined with dense retrieval for comprehensive search coverage. The trend toward hybrid search in financial AI systems reflects the understanding that different query types require different retrieval approaches, and the best systems leverage both sparse and dense methods to provide complete search capabilities.
Related Terms
Explore in Finatune
Frequently Asked Questions
What is sparse retrieval in RAG?
Sparse retrieval is a search approach that uses sparse vector representations with mostly zero dimensions to find documents based on exact term matching. The most common form is BM25, which scores documents based on query term frequency and document length.
When is sparse retrieval better than dense retrieval for financial text?
Sparse retrieval is better when exact term matching is critical, such as searching for specific regulatory identifiers, CUSIP numbers, ISIN codes, SEC filing numbers, or compliance terms where precision is paramount and semantic approximations are not acceptable.
How does BM25 sparse retrieval work for financial documents?
BM25 scores financial documents by calculating the frequency of query terms in each document, adjusted for document length and how common the terms are across the corpus. Documents with higher frequency of rare query terms receive higher relevance scores.