Close

Presentation

Segmented Angular Pre-Processing for Accurate and Efficient In-Memory Vector Similarity Search
DescriptionVector similarity search (VSS) is a fundamental operation in modern AI applications, including few-shot learning (FSL) and approximate-nearest neighbor search (ANNS). However, VSS incurs substantial energy and computational overhead, primarily due to frequent vector transfers and the complexity of cosine similarity calculations in high-dimensional spaces. Prior research has explored the use of ternary content addressable memories (TCAMs) for parallel in-memory VSS to enhance energy efficiency. However, existing TCAM-based approaches, such as Exact-Match TCAM (EX-TCAM) with range encoding and Best-Match TCAM (Best-TCAM), are limited to distance-based metrics like the L∞ and L1 norms. These spatial-domain metrics suffer from a significant accuracy gap compared to angular-domain cosine similarity. Cosine similarity is widely regarded as the optimal metric for software-based VSS. To address this limitation, we introduce Seg-Cos, a TCAM-based angular VSS framework with its corresponding pre-processing technique and encoding scheme. The Seg-Cos divides vectors into segments and encodes them as circular ranges based on magnitudes to approximate cosine similarity directly within TCAM. It is the first angular VSS framework compatible with both EX-TCAM and Best-TCAM, enabling accurate and energy-efficient VSS in the angular domain. Our approach encompasses angular quantization, weighted range generation, and circular range encoding design. Simulation results show that Seg-Cos improves energy efficiency by 1.41X and achieves up to 2.2% higher accuracy over prior EX-TCAM-based methods in FSL. In ANNS, Seg-Cos enhances recall by 10% to 52% compared to previous Best-TCAM approaches.