{"slug": "day-7-dense-embedding-rag", "title": "Day 7 - Dense Embedding - RAG", "summary": "Dense embeddings represent text as continuous numeric vectors (e.g., [0.3455566, 0.6777779]) plotted in a latent space, while sparse embeddings mostly contain zeros and focus on word frequency rather than semantic meaning. Models for generating dense embeddings include LLMs and transformer encoders like Minilm and Nomic, available on platforms such as Hugging Face and Ollama. To evaluate a RAG system's performance, one compares the documents it returns for a user query against an expected set, similar to writing unit test cases for software.", "body_md": "Dense embedding have continuous numeric values. i.e after decimal point values will be present. Chunk will be converted to embeddings, each embedding point will have number like [0.3455566 ,0.6777779, ...]. Generated vectors will be plotted in a space called latent space. Discrete values like 0 won't be present.\nSparse embedding will mostly have values like 0. Rather than semantic meaning, it considers frequency or importance of words in a text.\nEx: one hot encoding\nModels for Dense embedding\n1. LLM\n2. Transformers (encoder)\nEx: Minilm, nomic transformers\nThese models are available in hugging face, ollama.It also hosts other models as well.\nGenerated vectors will\nHow can we evaluate the performance of RAG system ?\nFor a given user query, RAG system will return some set of matching documents. If the returned documents matches with our expectations, we can say it is yielding good results. Say, if our expectation from RAG is to return a, b, c, d, e documents for a user query and in reality it returns a, b, d docs alone. Out of 5, 3 is returned. It is meeting expectation to half right ? Like how we write unit test cases for a software code, we need to write test cases for user query for evaluating the RAG systems.", "url": "https://wpnews.pro/news/day-7-dense-embedding-rag", "canonical_source": "https://dev.to/indumathi__r/day-7-dense-embedding-rag-ojh", "published_at": "2026-05-21 03:52:11+00:00", "updated_at": "2026-05-21 04:01:31.678721+00:00", "lang": "en", "topics": ["artificial-intelligence", "machine-learning", "large-language-models", "data"], "entities": ["Minilm", "nomic transformers", "hugging face", "ollama"], "alternates": {"html": "https://wpnews.pro/news/day-7-dense-embedding-rag", "markdown": "https://wpnews.pro/news/day-7-dense-embedding-rag.md", "text": "https://wpnews.pro/news/day-7-dense-embedding-rag.txt", "jsonld": "https://wpnews.pro/news/day-7-dense-embedding-rag.jsonld"}}