2 Revolutions in semantics, scale, and similarity
This chapter covers
- Word2Vec's breakthrough in semantic understanding
- FAISS's solution to billion-scale similarity search
- Sentence-BERT's practical transformer similarity
- How these technologies have converged for RAG
It's important to remember that RAG is not a particular technology but an architectural pattern. By 2020, three separate technological innovations converged to pave the way for what would become retrieval-augmented generation, RAG.
The first of them was Word2Vec, a model that proved that semantic relationships could be captured mathematically, in vector form. Traditional search systems struggled when keywords didn't match (vocabulary mismatch or lexical mismatch), but this could address it, and later Transformer models showed how to generalize this idea to larger contexts. FAISS (Facebook AI Similarity Search), an approach and a library that made billion-scale similarity search practical, made high-dimensional vector search viable for production infrastructure. Finally, Sentence-BERT, which adapted Transformers for real-time similarity applications, completed the pipeline from user queries to relevant document retrieval.