<?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[LLM Journey]]></title><description><![CDATA[Documenting my journey in the ChaiCode GenAI cohort. Explore practical guides, deep dives into Transformer architectures, and the future of AI-augmented software development.]]></description><link>https://llmjourney.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6a4365fddc7a8c8a84d6a86b/0b1e5a64-64d6-453c-b2d8-bed7435a5b32.png</url><title>LLM Journey</title><link>https://llmjourney.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Wed, 09 Sep 2026 08:48:15 GMT</lastBuildDate><atom:link href="https://llmjourney.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How Do LLMs Know Things Beyond Their Training? An Introduction to RAG]]></title><description><![CDATA[We use Large Language Models (LLMs) every single day. But have you ever wondered how they seem to know everything?
In my previous blog, we discussed how LLMs are trained on massive datasets. However, ]]></description><link>https://llmjourney.hashnode.dev/how-do-llms-know-things-beyond-their-training-an-introduction-to-rag</link><guid isPermaLink="true">https://llmjourney.hashnode.dev/how-do-llms-know-things-beyond-their-training-an-introduction-to-rag</guid><category><![CDATA[RAG ]]></category><category><![CDATA[llm]]></category><category><![CDATA[genai]]></category><category><![CDATA[GenAI Cohort]]></category><dc:creator><![CDATA[Omkar Tripathi]]></dc:creator><pubDate>Sat, 11 Jul 2026 06:38:33 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6a4365fddc7a8c8a84d6a86b/c9907c15-a56e-4756-83ea-4e5e7b59f505.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>We use Large Language Models (LLMs) every single day. But have you ever wondered how they seem to know everything?</p>
<p>In my previous blog, we discussed how LLMs are trained on massive datasets. However, that training data is static—it represents a snapshot of the past. If an LLM's training cut-off was months ago, how does it know who won yesterday's crucial FIFA or cricket match?</p>
<p>If you think companies like Anthropic or OpenAI completely retrain their flagship models every single day, you'd be mistaken. Re-training a massive model daily is incredibly expensive and computationally impractical due to massive GPU costs.</p>
<p>Instead, they use a clever technique called <strong>RAG (Retrieval-Augmented Generation)</strong>. In this blog, we will break down what RAG means, explore its architectural pipeline, look at its real-world use cases, and examine exactly where it can fail.</p>
<hr />
<h2>What is RAG?</h2>
<p><strong>Retrieval-Augmented Generation (RAG)</strong> is a framework where we dynamically provide an LLM with external, up-to-date information relative to a user's prompt.</p>
<p>Think of it this way: If a user asks an LLM about last night's sports scores, the base LLM natively won't have it. In a RAG setup, the system's backend automatically searches a live sports database for the results, attaches those details directly to your prompt, and hands it to the LLM. The LLM then reads the fresh context and accurately answers, "Argentina won."</p>
<h3>A Real-Life Analogy</h3>
<p>Imagine you have a stack of five massive books and you need to study a specific topic in JavaScript. You have two options:</p>
<ol>
<li><p><strong>Option A:</strong> Read all five books cover-to-cover all at once, try to memorize every word, and then take a quiz. Your brain will likely hit cognitive overload, you'll forget key details, and you might start mixing up facts (<strong>hallucinating</strong>). This is what happens when you try to cram massive documents straight into an LLM's limited context window.</p>
</li>
<li><p><strong>Option B:</strong> Instead of reading everything, you look at the titles, eliminate the irrelevant books, check the index pages of the relevant ones, and flip directly to the few specific paragraphs you need.</p>
</li>
</ol>
<p>RAG acts as that <strong>index page</strong>. When you ask a question, the system looks at the index, pulls only the highly relevant paragraphs, and hands just that specific snippet to the LLM alongside your prompt.</p>
<hr />
<h2>The Two-Step RAG Pipeline</h2>
<p>To make this magic happen, a RAG system relies on two primary workflows: <strong>Indexing</strong> and <strong>Querying</strong>.</p>
<h3>1. The Indexing Pipeline (Preparing the Data)</h3>
<p>Before we can search our data, we have to organize it so a computer can quickly understand it. This happens in five steps:</p>
<ul>
<li><p><strong>Data Ingestion:</strong> We gather raw data from various formats (PDFs, Excel sheets, Markdown files, Word documents, PowerPoint presentations, or even video transcripts and images).</p>
</li>
<li><p><strong>Text Extraction:</strong> We convert all that raw data into clean, machine-readable text.</p>
</li>
<li><p><strong>Chunking:</strong> We break the massive text files down into smaller, bite-sized pieces—such as single paragraphs or specific page fractions.</p>
<pre><code class="language-javascript">import {PDFLoader} from "@langchain/community/document_loaders/fs/pdf";

async function makeIndexingOfDocument(filePath: string) {
    const loader = new PDFLoader(filePath);
    const documents = await loader.load();
    console.log(`Loaded ${documents.length} documents from ${filePath}`);
</code></pre>
</li>
<li><p><strong>Vector Embedding:</strong> We pass these text chunks through an embedding model, turning text into numerical vectors (mathematical representations of the semantic meaning of the words).</p>
</li>
<li><p><strong>Vector Storage:</strong> Finally, we save these mathematical vectors into a specialized <strong>Vector Database</strong> (like <em>pgvector, Qdrant, Pinecone, or Milvus</em>).</p>
<pre><code class="language-javascript">import {OpenAIEmbeddings} from "@langchain/openai";
import {QdrantVectorStore} from "@langchain/qdrant";

const embeddings = new OpenAIEmbeddings({
        model: "text-embedding-3-small",
        apiKey:"YOUR API KEY"
    });

    const qdrantVectorStore = await QdrantVectorStore.fromExistingCollection(embeddings, {
        collectionName: "RagTesting",
        url: "http://localhost:6333"
    });

    await qdrantVectorStore.addDocuments(documents)
    console.log("Documents added to the Qdrant collection successfully.");
</code></pre>
</li>
</ul>
<h3>2. The Query Pipeline (Retrieving and Generating)</h3>
<p>When a user actually asks a question, the backend springs into action:</p>
<ul>
<li><p><strong>User Input:</strong> The user asks a question, such as: <em>"Who won yesterday's FIFA match?"</em></p>
</li>
<li><p><strong>Query Embedding:</strong> The system converts the user's question into a numerical vector using the same embedding model.</p>
</li>
<li><p><strong>Vector Search:</strong> The system searches the vector database to find the top $k$ (usually top 3 to 5) data chunks whose mathematical vectors closely align with the meaning of the user's question.</p>
</li>
<li><p><strong>Prompt Augmentation:</strong> The system takes those top 5 text chunks and injects them into the prompt layout sent to the LLM.</p>
</li>
<li><p><strong>Generation:</strong> The LLM reads the context, extracts the factual answer, and responds smoothly to the user.</p>
</li>
<li><p>code:</p>
<pre><code class="language-javascript">import { OpenAIEmbeddings} from "@langchain/openai";
import {QdrantVectorStore} from "@langchain/qdrant";
import OpenAI from "openai";

async function userQueryresult(query: string){
    const embeddings = new OpenAIEmbeddings({
            model: "text-embedding-3-small",
            apiKey:"YOUR API KEY"
        });


    const qdrantVectorStore = await QdrantVectorStore.fromExistingCollection(embeddings, {
            collectionName: "RagTesting",
            url: "http://localhost:6333"
        });

    const retrival = await qdrantVectorStore.asRetriever({k:5});

    const response = await retrival.invoke(query);
    const system_pronpt = `you are a helpful assistant that helps the user to answer the query based on the documents provided. If you don't know the answer, just say "I don't know". Don't try to make up an answer.

    Provided documents:
        ${response.map((e)=&gt; JSON.stringify({PageContent:e.pageContent,PageNumber:e.metadata.loc.pageNumber})).join("\n\n")}

    rule:
        -Explain the answer in detail and provide the page number from where the answer is derived.
        -If the answer is not found in the documents, say "I don't know".

    `;


    const openai = new OpenAI({
        apiKey: "YOUR API KEY"
    });

    const result = await openai.chat.completions.create({
        model: "gpt-4o-mini",
        messages: [
            { role: "system", content: system_pronpt },
            { role: "user", content: query }
        ]
</code></pre>
<img src="https://cdn.hashnode.com/uploads/covers/6a4365fddc7a8c8a84d6a86b/beb74736-d747-4fe4-82a6-5c723fc11607.webp" alt="" style="display:block;margin:0 auto" /></li>
</ul>
<hr />
<h2>Where RAG Works Well</h2>
<p>RAG is incredibly powerful across various industries because it brings accuracy and real-time grounding to AI agents:</p>
<ul>
<li><p><strong>Healthcare:</strong> It assists medical professionals by instantly pulling up the latest clinical research papers, updated treatment guidelines, or specific patient history files.</p>
</li>
<li><p><strong>Financial Services:</strong> Analysts use RAG to scan massive batches of real-time SEC filings, recent earnings reports, and volatile market data to generate grounded financial insights.</p>
</li>
<li><p><strong>Software Engineering:</strong> Instead of making developers waste hours hunting through dense API documentations, RAG-powered developer tools index the docs to give instant syntax answers.</p>
</li>
<li><p><strong>Legal &amp; Compliance:</strong> Legal AI assistants scan thousands of active contracts, case laws, and evolving government regulations to surface precise clauses.</p>
</li>
<li><p><strong>Enterprise Knowledge Management:</strong> Tools like Notion AI or Slack AI use RAG to let employees use natural language to search internal wikis, avoiding hours spent digging through old threads.</p>
</li>
</ul>
<hr />
<h2>Where RAG Can Fail</h2>
<p>While RAG is a massive leap forward, it isn't perfect. Implementing it poorly creates unique failure points:</p>
<ul>
<li><p><strong>Missing Content:</strong> If the answer to a user's question isn't inside your document database, a good RAG system should say, <em>"I don't know."</em> However, if the query sounds similar to existing content, the system might fetch irrelevant context and trick the LLM into giving a confidently wrong answer.</p>
</li>
<li><p><strong>Poor Chunking:</strong> If your chunking strategy is sloppy, a crucial sentence might get split right down the middle across two different chunks. If the system only retrieves the first chunk, the LLM loses the vital second half of the context and generates an incomplete or poor response.</p>
</li>
<li><p><strong>Context Noise &amp; Overload (High K-Value):</strong> If you configure the system to pull too many chunks (setting the $k$ value too high), you flood the LLM's prompt with too much irrelevant information. This extra "noise" can cause the LLM to get confused, ignore instructions, or hallucinate.</p>
</li>
<li><p><strong>Formatting Disregard:</strong> Sometimes, a user will ask for information in a specific format (like a markdown table or a numbered list), but the presence of heavy technical context causes the LLM to lose track of the original formatting instructions.</p>
</li>
<li><p><strong>Extraction Failures:</strong> Even when the exact answer lives perfectly within the retrieved text, an LLM can sometimes fail to find it if the surrounding text is highly repetitive, contradictory, or complex.</p>
</li>
</ul>
<hr />
<h2>Conclusion</h2>
<p>RAG bridges the gap between static LLM intelligence and dynamic real-world knowledge. By turning documents into searchable vectors and serving them as context clues, RAG helps businesses deploy highly accurate AI applications without spending millions on daily retraining.</p>
<p>Have you built a RAG pipeline before? What chunking strategies worked best for you? Let me know in the comments below!</p>
]]></content:encoded></item><item><title><![CDATA[The Shift to AI-Augmented Software Development: Understanding LLMs from the Inside Out]]></title><description><![CDATA[1. Introduction
On November 30, 2022, the tech landscape shifted permanently with the introduction of ChatGPT, a model built on the GPT (Generative Pre-trained Transformer) architecture. This launch c]]></description><link>https://llmjourney.hashnode.dev/the-shift-to-ai-augmented-software-development-understanding-llms-from-the-inside-out</link><guid isPermaLink="true">https://llmjourney.hashnode.dev/the-shift-to-ai-augmented-software-development-understanding-llms-from-the-inside-out</guid><category><![CDATA[AI]]></category><category><![CDATA[software development]]></category><category><![CDATA[llm]]></category><dc:creator><![CDATA[Omkar Tripathi]]></dc:creator><pubDate>Wed, 01 Jul 2026 07:24:47 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6a4365fddc7a8c8a84d6a86b/4f2a1648-801d-4b12-bf1d-269b9d409986.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3>1. Introduction</h3>
<p>On <strong>November 30, 2022</strong>, the tech landscape shifted permanently with the introduction of ChatGPT, a model built on the GPT (Generative Pre-trained Transformer) architecture. This launch completely disrupted software engineering, impacting developers in two opposing ways. While some faced layoffs due to automation, others earned promotions.</p>
<p>Interestingly, the core software development knowledge between these two groups was identical. The differentiating factor was simple: the promoted developers understood how Large Language Models (LLMs) worked, embraced the AI environment, and leveraged these tools to maximize their productivity, while others remained defensive.</p>
<p>From 2022 to <strong>June 30, 2026</strong>, LLMs evolved from simple Q&amp;A chatbots into highly capable engines that generate images, produce videos, and write production-grade code. Advanced coding agents like Claude, Codex, and Gemini have sparked urgent industry questions: <em>"Is software engineering dead?"</em>, <em>"Will LLMs replace coders?"</em>, or <em>"Why do we need engineers if we have AI?"</em> This blog addresses those concerns and explains why software development is not dying—it is simply evolving into <strong>AI-augmented software development</strong>.</p>
<hr />
<h3>2. What is an LLM?</h3>
<p>An LLM (<strong>Large Language Model</strong>) is an advanced artificial intelligence system trained on massive datasets to process, understand, and generate human-like text. When you ask a modern AI application a question, the underlying engine driving that chat interface is an LLM.</p>
<h4>The Washing Machine Analogy</h4>
<p>To understand this relationship, imagine an LLM as a <strong>washing machine</strong> and the software developer as the operator. The machine automates the actual washing process, but it cannot function without an operator to supply the clothes, add the detergent, select the settings, and handle the water supply.</p>
<p>Similarly, an LLM knows the mechanics of writing code, but it relies entirely on the developer to define <em>what</em> to build, design the overall system architecture, and specify the user experience. When washing machines were first introduced, critics claimed professional launderers would disappear; instead, their jobs simply adapted to the new technology. The same principle applies to software engineers.</p>
<h4>What Problems Do LLMs Solve?</h4>
<p>LLMs solve the challenges of scaling and automating complex human language tasks. They serve as a <strong>general-purpose reasoning layer</strong> for text, replacing rigid, rule-based legacy code with adaptive intelligence. For developers, they streamline information gathering, summarize complex technical documentation, and accelerate code generation.</p>
<h4>The Modern LLM Ecosystem</h4>
<ul>
<li><p><strong>Gemini:</strong> Ideal for day-to-day queries, text and document summarization, multimodal generation (images/videos), and coding assistance.</p>
</li>
<li><p><strong>Claude (Opus):</strong> A highly sophisticated reasoning model that serves as a powerful partner for complex coding workflows.</p>
</li>
<li><p><strong>GPT:</strong> A versatile model used widely for text summarization, content generation, multimodal asset creation, and development assistance.</p>
</li>
<li><p><strong>Mythos:</strong> A cutting-edge, high-performance model specifically optimized for specialized coding tasks.</p>
</li>
</ul>
<hr />
<h3>3. The Brain Behind the Screen: What Happens When You Message ChatGPT?</h3>
<p>While millions use platforms like ChatGPT daily, few stop to consider the mechanics operating behind the user interface.</p>
<p>When you input a natural language prompt, the model processes the text as a sequence of <strong>tokens</strong> (words or character fragments). Instead of copying pre-existing text from the internet, the model analyzes the context of your input and uses probability distributions to predict the next logical token. While the resulting answer is informed by its massive training data, the output text is completely original and generated dynamically, one token at a time, based on mathematical likelihood.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a4365fddc7a8c8a84d6a86b/2fb71653-b6b0-407f-8330-28aeee4667cd.png" alt="" style="display:block;margin:0 auto" />

<div class="hn-embed-widget" id="embed https://whimsical.com"></div> 

<hr />
<h3>4. Deep Inside the LLM: The 4-Step Prompt Transformation Lifecycle</h3>
<p>Computers do not understand human language; they only process binary code (0s and 1s). While numbers map easily to binary, converting unstructured human language is highly complex. To bridge this gap, an LLM executes four mandatory processing steps on your prompt before generating a response:</p>
<pre><code class="language-text">[ Raw User Prompt ] ➔ [ Tokenization ] ➔ [ Word Embeddings ] ➔ [ Positional Encoding ] ➔ [ Self-Attention ] ➔ [ Token Prediction ]
</code></pre>
<h4>1) Tokenization</h4>
<p>Before any computations occur, raw text must be converted into numerical values that can eventually map to binary code. The system breaks sentences down into tokens using an internal dictionary called a vocabulary.</p>
<ul>
<li><p><strong>Text Example:</strong> <code>"[Develop][ment] [with] [LLM][s]"</code></p>
</li>
<li><p><strong>Mapped IDs:</strong> <code>"[14324][382] [432] [8921][43]"</code></p>
</li>
</ul>
<blockquote>
<p>💡 <strong>LLM Rule of Thumb:</strong> Models see numbers, not English characters. On average, one token equals roughly 4 characters or 0.75 English words. This is why a complex word like <em>"Development"</em> is split into distinct token fragments (<code>develop</code> + <code>ment</code>) before entering the core mathematical matrix equations.</p>
</blockquote>
<h4>2) Embeddings</h4>
<p>Words carry distinct real-world meanings and relationships (e.g., "Paris" and "India" are geographic locations; "Cricket" and "Football" are sports). After tokenization, these numbers are converted into dense mathematical vectors. These <strong>vector embeddings</strong> capture semantic meaning, ensuring that words with related concepts sit closer together in a high-dimensional mathematical space.</p>
<h4>3) Positional Embeddings</h4>
<p>Without word order data, an AI model would treat the sentences <em>"Man watching television"</em> and <em>"Television watching man"</em> identically. Positional encoding applies a unique mathematical signature to each token based on its specific position in the sentence, preserving critical syntax and word order.</p>
<h4>4) Self-Attention</h4>
<p>The self-attention mechanism allows tokens to interact dynamically with one another to resolve contextual ambiguity. For example, consider these two sentences:</p>
<ol>
<li><p><em>"I</em> <em><strong>watch</strong></em> <em>television every morning."</em></p>
</li>
<li><p><em>"I bought a hand</em> <em><strong>watch</strong></em>*."*</p>
</li>
</ol>
<p>Though the word <em>"watch"</em> is identical in both cases, its meaning changes completely based on context. Self-attention enables the model to look at surrounding words, calculating that "watch" in the first sentence relates to an action, while "watch" in the second sentence relates to a physical timepiece.</p>
<p>Once these four phases are complete, the system applies a final mathematical function (<strong>Softmax</strong>) to calculate the highest probability for the next token and outputs the response back to the user.</p>
<hr />
<h3>5. Transformers: The Architecture Engine</h3>
<p>The Transformer is the core deep learning architecture powering almost all modern LLMs. Introduced by Google researchers in their seminal 2017 paper, <em>"Attention Is All You Need,"</em> it revolutionized natural language processing.</p>
<p>Legacy AI systems processed text sequentially—one word at a time. If a sentence was too long, the system would experience "recency bias" and forget the context established at the beginning of the sentence by the time it reached the end.</p>
<p>Transformers solved this constraint by processing entire sentences simultaneously using the self-attention steps detailed above. It is a massive network of trainable mathematical weights calculating exactly how much context one word must derive from another.</p>
<img src="https://cdn.hashnode.com/uploads/covers/6a4365fddc7a8c8a84d6a86b/aa1d28bd-95f8-4b0f-a3e3-3df80ffa5c54.png" alt="" style="display:block;margin:0 auto" />

<div class="hn-embed-widget" id="embed https://whimsical.com"></div> 

<hr />
<h3>6. Drawing the Line: Application Development vs. ML Engineering</h3>
<p>Returning to our washing machine analogy helps clarify the emerging workforce divide in modern engineering:</p>
<ul>
<li><p><strong>The AI/ML Engineer:</strong> The specialist who researches, designs, builds, and calibrates the machine (the LLM model architecture) from scratch.</p>
</li>
<li><p><strong>The AI-Augmented Software Developer:</strong> The modern engineer (the operator) who leverages the power of that completed machine to streamline building applications, ship features faster, and solve complex business problems.</p>
</li>
</ul>
<hr />
<p><em>This blog post was written as part of my learning journey in the GenAI Cohort by ChaiCode. If you found this breakdown helpful, drop a like or leave your thoughts on the future of AI-augmented development in the comments below!</em></p>
]]></content:encoded></item></channel></rss>