<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Vishant's GenerativeAI Blogs]]></title><description><![CDATA[Vishant's GenerativeAI Blogs]]></description><link>https://vishant-generativeai.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6a44c6c882ac73541b4f461a/c7dec760-212c-41af-ba49-d4e2c748f05c.png</url><title>Vishant&apos;s GenerativeAI Blogs</title><link>https://vishant-generativeai.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Wed, 09 Sep 2026 03:45:57 GMT</lastBuildDate><atom:link href="https://vishant-generativeai.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Let's Understand the Limitation of RAG(Retrieval Augmentation Generation)]]></title><description><![CDATA[If you are an AI developer or planning to build AI powered applications, understanding RAG (Retrieval Augmentation Generation) skill is one of the most valuable skill for you.
Large Language Models ar]]></description><link>https://vishant-generativeai.hashnode.dev/let-s-understand-the-limitation-of-rag-retrieval-augmentation-generation</link><guid isPermaLink="true">https://vishant-generativeai.hashnode.dev/let-s-understand-the-limitation-of-rag-retrieval-augmentation-generation</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[RAG ]]></category><category><![CDATA[genai]]></category><dc:creator><![CDATA[Vishant Pal]]></dc:creator><pubDate>Tue, 14 Jul 2026 06:31:22 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6a44c6c882ac73541b4f461a/7f0cacb3-1db5-4f99-9fa1-0d3cc4fcc333.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>If you are an AI developer or planning to build AI powered applications, understanding <strong>RAG</strong> (<strong>Retrieval Augmentation Generation</strong>) skill is one of the most valuable skill for you.</p>
<p>Large Language Models are powerful but they do not have access to latest information or any company specific data. That's where RAG come in picture. It allows AI systems to retrieve relevent information from external source of data before generating a response, making answer accurate, and up to date. It also helpful to reduce the token usage and make overall less bill of LLM's.</p>
<p>In this article, we'll explore <strong>Retrieval-Augmented Generation (RAG)</strong> from the ground up. You'll learn what RAG is, why it's needed, how it works behind the scenes, and how modern AI applications use it in real-world scenarios. By the end, you'll have a clear understanding of both the basic concepts and advanced RAG techniques used in today's AI systems.</p>
<h3>What is RAG?</h3>
<img src="https://cdn.hashnode.com/uploads/covers/6a44c6c882ac73541b4f461a/4e60adcc-aec5-446e-8f37-a37946b90871.png" alt="" style="display:block;margin:0 auto" />

<p>RAG stand for <strong>Retrieval Augmented Generation</strong>. when we talk about LLM's they are good tools for generating text because they already trained on a massive amount of internet static data. In early days days of AI wave we were working directly with LLMs but that time we noticed two big problems of LLMs.</p>
<ol>
<li><p><strong>Hallucination:</strong> Give inaccurate answer with 100% confidence.</p>
</li>
<li><p><strong>Outdated and Private Information:</strong> LLMs are not upto date, they only able to give the answers based on the trained date.</p>
</li>
</ol>
<p>For solving these two big problems of Large Language Model researchers introduced something crazy that was <strong>RAG</strong>.</p>
<h3>How RAG work to solve these problems ?</h3>
<img src="https://cdn.hashnode.com/uploads/covers/6a44c6c882ac73541b4f461a/a36531de-cfe2-46e8-a68b-456b2875f3e3.png" alt="" style="display:block;margin:0 auto" />

<p>Before answering, RAG system retrieves specific, authoritative documents from your private or trusted data sources and instructs the LLM: <em>"Only use the provided information to answer the question." As well as RAG</em> bypasses the need to retrain or fine-tune the expensive base model. Instead, it dynamically pulls the most recent and relevant data from your live database (like a vector store) and injects it into the prompt in real-time.</p>
<h3><strong>Common scenarios where RAG works well</strong></h3>
<p>RAG technique is work very well on your private data and where LLMs needs access to update and domain-spicific information that's not capture in their training data.</p>
<p><strong>Main reason why RAG perform well in these scenarios:</strong></p>
<ul>
<li><p>Dynamic or updated information: RAG pulls fresh data to the LLM at the time of inference.</p>
</li>
<li><p>Private Data: It grounds responses in trusted internal sources (docs, policies, manuals).</p>
</li>
<li><p>Cost-efficiency — Avoids expensive fine-tuning while adapting to new content.</p>
</li>
</ul>
<p>Examples:</p>
<ol>
<li><p>Customer Support and Helpdesk Chatbots</p>
</li>
<li><p>Internal Enterprise Knowledge Management and Search</p>
</li>
<li><p>Legal, Compliance, and Contract Review</p>
</li>
<li><p>Healthcare and Clinical Support</p>
</li>
<li><p>E-commerce and Product Q&amp;A</p>
</li>
<li><p>Data and Engineering Teams</p>
</li>
</ol>
<h3><strong>Why RAG sometimes gives incorrect answers ?</strong></h3>
<p>RAG technique is help to reduce <strong>Hallucination</strong> but it can't eliminate it 100%. Sometime even with RAG it can give incorrect answers. Here are some basic reasons why RAG fail.</p>
<ol>
<li><p>Poor Retrieval (Most Common Reason)</p>
<p>If the retrieval system fetches the wrong documents, the LLM has incorrect information to work with.</p>
<p><strong>Example:</strong></p>
<ul>
<li><p><strong>Question:</strong> "What is the refund period for Product X?"</p>
</li>
<li><p><strong>Retrieved Document:</strong> Refund policy for Product Y.</p>
</li>
<li><p><strong>Answer:</strong> The model confidently gives Product Y's refund policy instead of Product X's.</p>
</li>
</ul>
<p><strong>Problem:</strong> Garbage in → garbage out.</p>
</li>
<li><p>2. Missing Information in the Knowledge Base</p>
<p>Sometimes the required information simply doesn't exist in the database.</p>
<p><strong>Example:</strong></p>
<ul>
<li><p>User asks about a feature released yesterday.</p>
</li>
<li><p>The vector database hasn't been updated yet.</p>
</li>
</ul>
<p>The model may:</p>
<ul>
<li><p>Say it doesn't know (best case)</p>
</li>
<li><p>Guess based on similar information (worst case)</p>
</li>
</ul>
</li>
<li><p>3. Irrelevant Chunks Retrieved</p>
<p>Large documents are split into smaller chunks before indexing. If chunking is poor, retrieval may return only part of the context.</p>
<p>Example:</p>
<ul>
<li><p>Chunk 1: "Premium users receive..."</p>
</li>
<li><p>Chunk 2: "...free cloud backup for 30 days."</p>
</li>
</ul>
<p>If only Chunk 1 is retrieved, the model lacks the complete information.</p>
</li>
<li><p>Hallucination by the LLM</p>
<p>Even when relevant documents are retrieved, the language model can still invent details that are not present in the retrieved context.</p>
<p>Example:<br />Retrieved context , The API rate limit is 100 requests per minute.</p>
<p>Model answers:</p>
<p>The rate limit is 120 requests per minute.</p>
<p>The model added information that wasn't in the source.</p>
</li>
<li><p>Outdated Knowledge Base</p>
<p>If documents are old, RAG retrieves outdated information.</p>
<p>Example:<br />Documentation says:</p>
<ul>
<li>Pricing: <strong>$20/month</strong></li>
</ul>
<p>Current website:</p>
<ul>
<li>Pricing: <strong>$25/month</strong></li>
</ul>
<p>The model answers using outdated data because that's what it retrieved.</p>
</li>
<li><p>Context window limitations: Every LLM have a limit of context some time we feed the data above the limit of context window by which our LLM lose the control on a dta that are not present on our context window.</p>
</li>
</ol>
<h3><strong>When RAG is not the right solution ?</strong></h3>
<p>RAG is an excellent solution for <strong>bringing external knowledge into an LLM</strong>, but it is <strong>not the right choice for every AI application</strong>. In many situations, adding RAG only increases complexity, latency, and cost without improving results.</p>
<p>Here are some common scnerios where you should avoid RAG:</p>
<ul>
<li><p><strong>The Model Already Knows the Information:</strong> If the answer comes from general knowledge that the LLM already understands, retrieving documents is unnecessary. <strong>Example:</strong></p>
<p>Who was the first Prime Minister of India?</p>
<p>What is the capital of Russia?</p>
</li>
<li><p><strong>The Data Fits in the Context Window</strong></p>
<p>Modern LLMs support very large context windows. If your entire document fits comfortably into the prompt, retrieval may not be needed.</p>
<p><strong>Example:</strong></p>
<ul>
<li><p>Summarizing a 20-page PDF</p>
</li>
<li><p>Answering questions about a short report</p>
</li>
<li><p>Analyzing a single research paper</p>
</li>
</ul>
</li>
<li><p><strong>Tasks That Don't Require External Knowledge</strong></p>
<p>Many AI applications focus on reasoning, creativity, or transformation rather than retrieving facts.</p>
<p><strong>Examples:</strong></p>
<ul>
<li><p>Writing blogs</p>
</li>
<li><p>Generating code</p>
</li>
<li><p>Translating text</p>
</li>
</ul>
</li>
<li><p><strong>When Accuracy Depends on Exact Data</strong></p>
<p>Vector search is based on semantic similarity, not exact matches. If users need precise values, structured lookups are more reliable.</p>
<p><strong>Examples:</strong></p>
<ul>
<li><p>Bank account balances</p>
</li>
<li><p>Medical records</p>
</li>
<li><p>Inventory counts</p>
</li>
<li><p>Flight availability</p>
</li>
</ul>
</li>
</ul>
<p>Conclusion: RAG is a powerful technique to increase the efficiency of LLM for getting the upto date information or making an AI application that is heaviely depends on a that is not feeded in the LLM during training that LLM model.</p>
<p>But every tool or technique have their own limitations, you need another techniques to handle these types of problems. Here you engineering are very helpful so add your engineering and solve the real world problems with the help of coding.</p>
]]></content:encoded></item><item><title><![CDATA[How ChatGPT Understands Your Questions: A Step-by-Step Guide]]></title><description><![CDATA[If you're using ChatGPT or any other large language model in your day-to-day life, have you ever wondered how it actually answers your questions? How does it understand the prompts you type? How can i]]></description><link>https://vishant-generativeai.hashnode.dev/how-chatgpt-understands-your-questions-a-step-by-step-guide</link><guid isPermaLink="true">https://vishant-generativeai.hashnode.dev/how-chatgpt-understands-your-questions-a-step-by-step-guide</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[generative ai]]></category><category><![CDATA[genai]]></category><dc:creator><![CDATA[Vishant Pal]]></dc:creator><pubDate>Wed, 01 Jul 2026 14:10:12 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6a44c6c882ac73541b4f461a/4d41b601-afbd-46c0-be87-4173ab982b64.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>If you're using ChatGPT or any other large language model in your day-to-day life, have you ever wondered how it actually answers your questions? How does it understand the prompts you type? How can it generate responses that often feel so natural and human-like?</p>
<p>If you already know the answer, that's great. But if you've ever been curious about what happens behind the scenes, this article is for you.</p>
<p>In this guide, we'll break down the entire process—from the moment you enter a prompt to the point where the AI generates a response. We'll explain concepts like tokenization, transformers, and large language models in simple terms, so you can understand how modern AI works without needing a background in machine learning.</p>
<h3>Response workflow of a language Model</h3>
<img src="https://cdn.hashnode.com/uploads/covers/6a44c6c882ac73541b4f461a/c99049a7-4c11-4255-99d8-832ecdeb4abf.png" alt="" style="display:block;margin:0 auto" />

<ol>
<li><p>User asked a question about anything.</p>
</li>
<li><p>User write prompt of his/her question and send to LLM where LLM process the user prompt and give the most related response as per user prompt.</p>
</li>
</ol>
<h3>What is LLM?</h3>
<p>LLM stand for <strong>Large Language Models.</strong></p>
<p>LLM is advance Artificial Intelligence (AI) which is trained on massive amount of text data to undersatnd, summerize, and human responses.</p>
<h3>what problems it solve in our day to day life?</h3>
<p>In today's world LLM are solving different problems in day today life such as:</p>
<ul>
<li><p>Answer very quickly as per user request.</p>
</li>
<li><p>Very helpful in writing different type of content.</p>
</li>
<li><p>Helping developers to write quality code quickly.</p>
</li>
<li><p>LLMs are very helpful to summarize something very quickly and many more.</p>
</li>
</ul>
<h3>Most common used LLMs</h3>
<ul>
<li><p>ChatGPT</p>
</li>
<li><p>Gemini</p>
</li>
<li><p>Claude code</p>
</li>
<li><p>Misteral</p>
</li>
<li><p>Deepseek</p>
</li>
</ul>
<h3><strong>What Happens When You Send a Message to ChatGPT?</strong></h3>
<img src="https://cdn.hashnode.com/uploads/covers/6a44c6c882ac73541b4f461a/837b5608-2966-49b4-b1b5-d3c3ad52fa89.png" alt="" style="display:block;margin:0 auto" />

<ul>
<li><p><strong>You Type a Prompt:</strong> Basically it is your question that you asked from LLM.</p>
</li>
<li><p><strong>Your Message Is Processed:</strong> In this step a LLm process your given prompt basically it convert the text into tokens and after this it do tokenionization means it convert tokens to numbers that a computer understand.</p>
</li>
<li><p><strong>The Model Generates a Response:</strong> Explain that ChatGPT predicts one token at a time, choosing the most likely next token based on everything that has come before. Repeat this process until the complete response is generated.</p>
</li>
<li><p><strong>Why responses are not copied from the internet:</strong> Basically LLM not search web for every question, instead it generate new text as per pattern learned during training.</p>
</li>
<li><p><strong>The Final Response Appears:</strong> Conclude by explaining that within a few seconds, millions or even billions of calculations have been performed to predict the best sequence of tokens, which are then converted back into readable text for the user.</p>
</li>
</ul>
<h3>Why Computers Don't Understand Human Language</h3>
<p>when you read some words like I'm eating the Apple, you can easily understand here apple is a fruit not a company. But a computer can't differentiate this because a computer can not understand basic language like a human can understand.</p>
<p>Simply when we give a text to a computer before doing anything with this text computer convert in in to a set of number (0, and 1) then it understand the given text and give answers.</p>
<p>Without converting text into numbers, an AI model like ChatGPT wouldn't be able to understand or process your message.</p>
<h3>What Are Tokens?</h3>
<p>When we split a sentence into words this process known as tokens.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a44c6c882ac73541b4f461a/4f412c79-1060-468b-849b-a595e44542df.png" alt="" style="display:block;margin:0 auto" />

<p>A token can be:</p>
<ul>
<li><p>A whole word</p>
</li>
<li><p>Part of a word</p>
</li>
<li><p>A punctuation mark</p>
</li>
<li><p>Sometimes even a single character</p>
</li>
</ul>
<p>For example, the sentence:</p>
<p>I love learning AI</p>
<p>might be split into tokens like:</p>
<ul>
<li><p><strong>I</strong></p>
</li>
<li><p><strong>love</strong></p>
</li>
<li><p><strong>learning</strong></p>
</li>
<li><p><strong>AI</strong></p>
</li>
<li><p><strong>.</strong></p>
</li>
</ul>
<p>Each of these tokens is then assigned a unique number. The AI model works with these numbers instead of the original text.</p>
<h3><strong>Tokenization</strong>:</h3>
<p>Tokenization is the process to convert token into numbers it is very important process in the LLM. Without the process of tokenization a LLM can not give the answer.</p>
<p><strong>why we need Tokenization?</strong></p>
<p>Tokenization is important because a computer or LLM can't understand text directly we disscussed above why a computer not understand text directly. so for computer or LLM understanding we do the process of Tokenization.</p>
<p>Tokenization is also helpful because it split long sentences into small that is known as proceesing of large sentence into small tokens/text parts.</p>
<h2>Words vs. Tokens</h2>
<p>Many beginners think <strong>words</strong> and <strong>tokens</strong> are the same, but they are not.</p>
<p>A <strong>word</strong> is something humans read and write. A <strong>token</strong> is a small piece of text that an AI model processes.</p>
<p>Sometimes one word is one token, but not always. A long or uncommon word may be split into multiple tokens.</p>
<h2>What Is a Transformer?</h2>
<p>A <strong>Transformer</strong> is the technology that powers modern AI models like ChatGPT, Claude, Gemini, and many others.</p>
<p>Think of it as the <strong>brain</strong> of a language model. It reads your message, understands the relationship between words, and generates a meaningful response.</p>
<p>Before Transformers were introduced, AI models struggled to understand long sentences and often forgot information from earlier in the text.</p>
<p>The Transformer solved this problem, making AI much better at understanding and generating human language.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a44c6c882ac73541b4f461a/c7b3c0b1-552a-45a7-89f1-8b79c10c75a7.png" alt="" style="display:block;margin:0 auto" />

<h2>Why Did Transformers Change AI?</h2>
<p>In 2017, researchers introduced the Transformer architecture in a paper called <strong>"Attention Is All You Need."</strong></p>
<p>This was a major breakthrough because Transformers could:</p>
<ul>
<li><p>Understand much longer pieces of text.</p>
</li>
<li><p>Learn relationships between words more accurately.</p>
</li>
<li><p>Process text much faster than older AI models.</p>
</li>
<li><p>Generate more natural and coherent responses.</p>
</li>
</ul>
<p>This breakthrough laid the foundation for today's powerful language models.</p>
<h2>How Does a Transformer Understand Language?</h2>
<p>Imagine you read this sentence:</p>
<p><strong>The trophy didn't fit into the suitcase because it was too big.</strong></p>
<p>What does <strong>"it"</strong> refer to?</p>
<p>As a human, you know it refers to <strong>the trophy</strong>, not the suitcase.</p>
<p>A Transformer can learn this too.</p>
<p>Instead of looking at words one by one, it looks at <strong>all the words in the sentence together</strong>. It pays attention to the words that are most important for understanding the meaning.</p>
<p>This helps it understand grammar, context, and the relationships between words.</p>
<h2>Why Do Almost All Modern LLMs Use Transformers?</h2>
<p>Almost every modern Large Language Model (LLM) is built on the Transformer architecture because it is very effective at understanding language.</p>
<p>Transformers can:</p>
<ul>
<li><p>Remember information from earlier in a conversation.</p>
</li>
<li><p>Understand the meaning of words based on context.</p>
</li>
<li><p>Generate fluent and natural-sounding text.</p>
</li>
<li><p>Scale to billions or even trillions of parameters.</p>
</li>
</ul>
<p>This is why models like <strong>ChatGPT</strong>, <strong>Gemini</strong>, <strong>Claude</strong>, <strong>Llama</strong>, <strong>DeepSeek</strong>, and many others all use Transformer-based architectures.</p>
]]></content:encoded></item></channel></rss>