Posts

Showing posts from 2025

Improving Information Retrieval with fine-tuned Reranker

Colab Notebook on Github Retrieval Augmented Generation (RAG) is often overhyped, leading to unmet expectations after implementation. While it may seem straightforward—combining a vector database with an LLM—achieving optimal performance is complex. RAG is easy to use but difficult to master, requiring deeper understanding and fine-tuning beyond basic setups. More on RAG Agentic RAG with Redis, AWS Bedrock, and LlamaIndex Advance RAG with fine-tuning Fine-tuning Embedding Model With Synthetic Data for Improving RAG Evaluating information retrieval with Normalized Discounted Cumulative Gain (NDCG@K) and Redis Vector Database Improving Information Retrieval with fine-tuned Reranker In the previous two blogs, we have covered how to fine-tune the initial retrieval part with BGE embedding model and Redis Vector Database . Rerankers are specialized components in information retrieval systems that refine search results in a second evaluation stage. After an initial retrieval of relevant ...

Evaluating information retrieval with Normalized Discounted Cumulative Gain (NDCG@K) and Redis Vector Database

Image
Full Colab NoteBook on Github. Evaluating information retrieval (IR) systems is essential for informed design decisions and understanding system performance. Successful companies like Amazon and Google rely heavily on IR systems, with Amazon attributing over 35% of sales and Google 70% of YouTube views to their recommender systems. Effective evaluation measures are key to building and refining these systems.   In this blog, we will use Normalized Discounted Cumulative Gain ( NDCG@K) to evaluate the performance of both the base model and the fine-tuned model, assessing whether the fine-tuned model outperforms the base model. We will use Redis as a vector database as a persistent store for embedding and RedisVL as a python client library. Normalized Discounted Cumulative Gain (NDCG@K) NDCG evaluates retrieval quality by assigning ground truth ranks to database elements based on relevance. For example, highly relevant results might rank 5, partially relevant ones 2–4, and irrele...

Fine-tuning Embedding Model With Synthetic Data for Improving RAG

Image
Full Notebook on GitHub . Modified Notebook on GitHub . To build an effective question-answering system like RAG for the finance domain, you need a model that can handle specialized financial vocabulary and nuanced terminology. Generic embedding models often lack the domain-specific knowledge necessary for accurate information retrieval. To address this, you could fine-tune domain-specific embeddings using finance datasets, incorporate pre-trained models designed for finance text. This ensures the system can retrieve relevant and precise financial articles based on user queries. This blog post explores fine-tuning an embedding model for specialized domains like medicine, law, or finance. It covers generating a domain-specific dataset and training the model to grasp nuanced language patterns and concepts. The result is a more effective model optimized for accurate retrieval and improved NLP performance in your field. Embeddings are numerical representations of text, images, or audio...