Building RAG Systems with Transformers

This post is divided into five parts: • Understanding the RAG architecture • Building the Document Indexing System • Implementing the Retrieval System • Implementing the Generator • Building the Complete RAG System An RAG system consists of two main components: • Retriever: Responsible for finding relevant documents or passages from a knowledge base given …

Generating and Visualizing Context Vectors in Transformers

This post is divided into three parts; they are: • Understanding Context Vectors • Visualizing Context Vectors from Different Layers • Visualizing Attention Patterns Unlike traditional word embeddings (such as Word2Vec or GloVe), which assign a fixed vector to each word regardless of context, transformer models generate dynamic representations that depend on surrounding words.