<?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[SUMANTA KABIRAJ's blog]]></title><description><![CDATA[SUMANTA KABIRAJ's blog]]></description><link>https://blog.sumantakabiraj.com</link><generator>RSS for Node</generator><lastBuildDate>Fri, 03 Jul 2026 11:34:49 GMT</lastBuildDate><atom:link href="https://blog.sumantakabiraj.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How Does ChatGPT Actually Understand Your Questions?]]></title><description><![CDATA[You type a question, hit enter, and a few seconds later you get an answer that actually makes sense. It feels a little like magic. It isn't — it's math, a lot of it, running very fast. Here's what's r]]></description><link>https://blog.sumantakabiraj.com/how-does-chatgpt-actually-understand-your-questions</link><guid isPermaLink="true">https://blog.sumantakabiraj.com/how-does-chatgpt-actually-understand-your-questions</guid><category><![CDATA[ChaiCode]]></category><category><![CDATA[chai-code ]]></category><category><![CDATA[chai aur code]]></category><dc:creator><![CDATA[SUMANTA KABIRAJ]]></dc:creator><pubDate>Wed, 01 Jul 2026 06:53:18 GMT</pubDate><content:encoded><![CDATA[<p>You type a question, hit enter, and a few seconds later you get an answer that actually makes sense. It feels a little like magic. It isn't — it's math, a lot of it, running very fast. Here's what's really going on under the hood.</p>
<h2>1. What Is an LLM, Anyway?</h2>
<p>LLM stands for <strong>Large Language Model</strong>. Strip away the buzzwords and it's a program trained on enormous amounts of text — books, articles, code, conversations — to learn the patterns of how language works. Not facts memorized like a database, but <em>patterns</em>: which words tend to follow which, how ideas connect, how a question relates to an answer.</p>
<p>LLMs exist to solve a stubbornly hard problem: getting a computer to work with human language, which is messy, ambiguous, and full of context. "Can you get that thing from the store?" makes perfect sense to a person and means almost nothing to a traditional program.</p>
<p>You've probably already met a few LLMs by name: GPT-4/GPT-5 (OpenAI), Claude (Anthropic), Gemini (Google), Llama (Meta). And you're using them more than you might realize — in chatbots, in your email's "smart reply" suggestions, in search engines that now summarize instead of just linking, in coding assistants, in customer support widgets.</p>
<h2>2. What Actually Happens When You Send a Message</h2>
<p>The journey from "you typing" to "ChatGPT replying" has three simple stages:</p>
<ol>
<li><p><strong>You type a prompt.</strong> Could be a question, an instruction, a half-formed thought — doesn't matter.</p>
</li>
<li><p><strong>The message gets processed.</strong> The model breaks your text down, feeds it through its network, and works out what's likely to come next, word by word (more precisely, piece by piece — more on that below).</p>
</li>
<li><p><strong>A response gets generated.</strong> Not copy-pasted, not looked up — <em>built</em>, one piece at a time, based on probabilities the model learned during training.</p>
</li>
</ol>
<p>That last point matters: ChatGPT isn't Googling your question and pasting the top result. It's generating a fresh sequence of text based on patterns, which is why it can write a poem about your cat's opinion on Mondays — that sentence never existed anywhere on the internet before you asked for it.</p>
<img src="https://cdn.hashnode.com/uploads/covers/62449e8d114d74ee1e63230c/73d2fb50-022a-4760-91bd-5915117e6a33.png" alt="" style="display:block;margin:0 auto" />

<h2>3. Why Computers Don't "Understand" Language the Way We Do</h2>
<p>Here's the inconvenient truth: computers don't understand words. At all. They understand numbers — specifically, arrays of numbers being multiplied and added together very quickly.</p>
<p>So before a model can do anything with "What's the capital of France?", that sentence has to become numbers. Every letter, every word, every model on Earth — text always gets converted into numeric form first. The unit that conversion happens in is called a <strong>token</strong>.</p>
<h2>4. Tokenization: Chopping Language Into Bite-Sized Pieces</h2>
<p><strong>Tokenization</strong> is the process of breaking text into smaller chunks — tokens — that the model can turn into numbers and actually process.</p>
<p>Why not just use whole words? Two reasons: there are too many possible words (including typos, made-up words, and words in every language), and some words are really made of meaningful smaller parts. So models split text into a mix of whole words, word-fragments, and even single characters, depending on what's efficient.</p>
<p>A rough example — the sentence:</p>
<blockquote>
<p>"Tokenization is tricky!"</p>
</blockquote>
<p>might get split into something like:</p>
<pre><code class="language-plaintext">["Token", "ization", " is", " tricky", "!"]
</code></pre>
<p>Five tokens, four words. That's a normal ratio — as a rule of thumb, 100 tokens is roughly 75 words in English. Every one of those tokens gets mapped to a number, and <em>that</em> number is what the model actually operates on.</p>
<img src="https://cdn.hashnode.com/uploads/covers/62449e8d114d74ee1e63230c/eaaf599c-2dd4-4b76-a65e-306272e258bf.png" alt="" style="display:block;margin:0 auto" />

<p>This is also why LLMs have a <strong>context window</strong> — a maximum number of tokens they can "see" at once, like a limited-size whiteboard. Old messages fall off the edge once you fill it up.</p>
<img src="https://cdn.hashnode.com/uploads/covers/62449e8d114d74ee1e63230c/97763524-65a9-4bed-82b6-aa2656b948ac.png" alt="" style="display:block;margin:0 auto" />

<h2>5. Transformers: The Architecture That Changed Everything</h2>
<p>Tokens alone don't get you understanding — you need something to actually process the relationships between them. That something, for basically every serious LLM today, is called a <strong>Transformer</strong>.</p>
<p>Introduced in a 2017 paper with the almost cocky title "Attention Is All You Need," the Transformer solved a problem older models struggled with: figuring out which words in a sentence <em>matter to each other</em>, even when they're far apart.</p>
<p>Take: "The trophy didn't fit in the suitcase because <strong>it</strong> was too big." Is "it" the trophy or the suitcase? A human resolves this instantly using context. Transformers do it using a mechanism called <strong>self-attention</strong> — for every word, the model calculates how much "attention" to pay to every other word in the sentence when figuring out its meaning. Do this across many layers, at massive scale, and you get a system that can track meaning across entire paragraphs, not just neighboring words.</p>
<p>That's the "T" in GPT — <strong>Generative Pre-trained Transformer</strong>. It's why this architecture took over: it's parallelizable (fast to train on modern hardware), scales well with more data, and is genuinely good at capturing long-range context — the exact thing older approaches were bad at.</p>
<h2>Putting It All Together</h2>
<p>The full pipeline, start to finish:</p>
<img src="https://cdn.hashnode.com/uploads/covers/62449e8d114d74ee1e63230c/7af43fcc-91c6-47b7-b7ea-79062ca08eb6.png" alt="" style="display:block;margin:0 auto" />

<p>One more knob worth knowing about: <strong>temperature</strong>. It controls how "safe" vs. "creative" the model's word choices are.</p>
<ul>
<li><p><strong>Low temperature</strong> → the model almost always picks the most probable next word. Output is focused, consistent, a bit predictable. Good for factual answers, code, summaries.</p>
</li>
<li><p><strong>High temperature</strong> → the model is more willing to pick less-likely words. Output is more varied, surprising, and creative — but also more prone to going off the rails. Good for brainstorming, poetry, casual chat.</p>
</li>
</ul>
<img src="https://cdn.hashnode.com/uploads/covers/62449e8d114d74ee1e63230c/2ac0070d-6e41-4659-820f-80093ec51792.png" alt="" style="display:block;margin:0 auto" />

<h2>So, Is It "Understanding"?</h2>
<p>Not in the human sense — there's no consciousness, no beliefs, no lived experience behind the response. But functionally, by learning statistical patterns over trillions of tokens and using attention to track context, the model produces responses that <em>behave</em> like understanding: relevant, coherent, and tailored to what you actually asked.</p>
<p>It's not magic. It's tokens, numbers, and attention — just at a scale big enough to feel like magic.</p>
]]></content:encoded></item><item><title><![CDATA[Decoding AI 🤖 Jargons with Chai ☕]]></title><description><![CDATA[Brewing Machine Learning Concepts One Cup at a Time

"AI is like chai. You need the right ingredients, in the right order, with just the right amount of attention." – Hitesh Choudhary


Every evening at 5 PM, a ritual unfolds across the streets of In...]]></description><link>https://blog.sumantakabiraj.com/decoding-ai-jargons-with-chai</link><guid isPermaLink="true">https://blog.sumantakabiraj.com/decoding-ai-jargons-with-chai</guid><category><![CDATA[ChaiCohort]]></category><category><![CDATA[Chaiaurcode]]></category><category><![CDATA[chai-code ]]></category><category><![CDATA[ChaiCode]]></category><dc:creator><![CDATA[SUMANTA KABIRAJ]]></dc:creator><pubDate>Tue, 08 Apr 2025 11:56:49 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1744114189407/24958e73-9147-467e-b2e5-0c299b9dbe94.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-brewing-machine-learning-concepts-one-cup-at-a-time">Brewing Machine Learning Concepts One Cup at a Time</h3>
<blockquote>
<p>"AI is like chai. You need the right ingredients, in the right order, with just the right amount of attention." – Hitesh Choudhary</p>
</blockquote>
<hr />
<p>Every evening at 5 PM, a ritual unfolds across the streets of India—cups clink, kettles hiss, and the air fills with the spicy scent of chai. It's not just a drink. It’s an experience.</p>
<p>Now imagine decoding <strong>artificial intelligence</strong> concepts the same way—one flavorful sip at a time.</p>
<p>This blog is for you if AI jargon like "self-attention" or "tokenization" makes your head spin faster than a boiling kettle. Let's walk through these terms using the humble, glorious cup of <strong>chai</strong>. And we’ll have company—two of the best teachers in tech: <strong>Hitesh Choudhary</strong> (founder of <em>Chai Code</em>) and <strong>Piyush Garg</strong>, both known for making complex concepts digestible.</p>
<hr />
<h2 id="heading-1-tokenization-chopping-the-words">🥄 1. <strong>Tokenization</strong> – Chopping the Words</h2>
<p>Before brewing, you prep ingredients—chop ginger, measure sugar. <strong>Tokenization</strong> is the AI’s version of chopping language into pieces it can understand.</p>
<p>Example:</p>
<blockquote>
<p>Sentence: “Chai is life.”<br />Tokens: [“Ch”, “ai”, “is”, “life”, “.”]</p>
</blockquote>
<p>Transformers prefer subwords so they can handle unseen words gracefully.</p>
<hr />
<h2 id="heading-2-vocab-size-size-of-the-spice-rack">📦 2. <strong>Vocab Size</strong> – Size of the Spice Rack</h2>
<p>The bigger your spice rack, the more variations of chai you can make. <strong>Vocab size</strong> in AI determines how many unique tokens a model can understand.</p>
<blockquote>
<p>GPT-3 has ~50,000 tokens.<br />Too small: Can’t understand rare words.<br />Too big: Model gets bloated.</p>
</blockquote>
<hr />
<h2 id="heading-3-transformers-the-master-chaiwala-of-ai">🏗️ 3. <strong>Transformers</strong> – The Master Chaiwala of AI</h2>
<p>If AI were a tea stall, the <strong>transformer</strong> would be the all-knowing chaiwala. Just like a skilled chaiwala mixes ingredients to craft that perfect flavor, a transformer learns which words to focus on, which to ignore, and how they all mix together.</p>
<blockquote>
<p>Imagine you're making masala chai for four friends—each with a unique preference. One wants more ginger, another less sugar. You adapt the recipe. Transformers do the same with language.</p>
</blockquote>
<h3 id="heading-chai-code-tip-by-hitesh">🍵 Chai Code Tip by Hitesh:</h3>
<blockquote>
<p>“Transformers changed the AI game. Before them, models forgot long-term context like bad waiters forgetting orders. Now they remember, relate, and generate.”</p>
</blockquote>
<hr />
<h2 id="heading-4-encoder-crushing-the-spices">↪️ 4. <strong>Encoder</strong> – Crushing the Spices</h2>
<p>Before making chai, we start by crushing cardamom, clove, and ginger. That's the <strong>encoder</strong>—it takes raw ingredients (words), processes them, and preps them into a meaningful mixture.</p>
<p>It doesn’t make chai—it just prepares the flavor base.</p>
<blockquote>
<p>For example: “I love chai” gets turned into a context-rich internal representation of what each word means and how they connect.</p>
</blockquote>
<hr />
<h2 id="heading-5-decoder-pouring-the-final-cup">↩️ 5. <strong>Decoder</strong> – Pouring the Final Cup</h2>
<p>Now that we’ve brewed the base, we strain and pour the chai into cups—<strong>the decoder's</strong> job. It takes all that encoded meaning and produces the final output: a translated sentence, a reply, or a line of poetry.</p>
<p>Without the decoder, all you’ve got is a spicy mess in the pot. No drink.</p>
<hr />
<h2 id="heading-6-vectors-ingredient-flavor-profiles">🧮 6. <strong>Vectors</strong> – Ingredient Flavor Profiles</h2>
<p>Ever wondered how ginger is <em>warming</em>, and cardamom is <em>floral</em>? In AI, words are converted into <strong>vectors</strong>—sets of numbers that represent their “flavor.”</p>
<p>Like:</p>
<pre><code class="lang-js"><span class="hljs-string">"chai"</span> =&gt; [<span class="hljs-number">0.4</span>, <span class="hljs-number">0.8</span>, <span class="hljs-number">-0.3</span>]
<span class="hljs-string">"tea"</span> =&gt; [<span class="hljs-number">0.41</span>, <span class="hljs-number">0.79</span>, <span class="hljs-number">-0.28</span>]
</code></pre>
<p>Words with similar meanings have similar vectors.</p>
<hr />
<h2 id="heading-7-embeddings-soaking-the-spices">🌊 7. <strong>Embeddings</strong> – Soaking the Spices</h2>
<p>When you let chai simmer, the spices soak into the liquid. In AI, <strong>embeddings</strong> are like that—the deeper flavor of a word in context.</p>
<blockquote>
<p>Example from Piyush Garg: "The word 'bank' means something different in 'river bank' vs 'bank account.' Context changes flavor. Embeddings capture that nuance."</p>
</blockquote>
<hr />
<h2 id="heading-8-positional-encoding-the-recipe-order">🔢 8. <strong>Positional Encoding</strong> – The Recipe Order</h2>
<p>Chai tastes awful if you boil milk before water or add sugar too early. <strong>Order matters.</strong></p>
<p>But transformers don’t naturally understand sequence. That’s where <strong>positional encoding</strong> comes in—like writing step numbers on your recipe.</p>
<blockquote>
<p>“I love chai” ≠ “Chai love I”<br />Positional encodings let the model know who came first.</p>
</blockquote>
<hr />
<h2 id="heading-9-semantic-meaning-the-taste-of-a-word">🧠 9. <strong>Semantic Meaning</strong> – The Taste of a Word</h2>
<p>Just like "masala chai" and "spiced tea" taste similar, <strong>semantic meaning</strong> is about understanding similarity even when words differ.</p>
<blockquote>
<p>Example:<br />“Large” ≈ “Big”<br />“Hot” = (temperature or trend)</p>
</blockquote>
<p>Semantic understanding helps models answer:</p>
<ul>
<li><p>“What’s the opposite of cold?”</p>
</li>
<li><p>“What does ‘burning out’ mean in work context?”</p>
</li>
</ul>
<hr />
<h2 id="heading-10-self-attention-the-tasting-spoon">👁️ 10. <strong>Self-Attention</strong> – The Tasting Spoon</h2>
<p>While brewing, the chaiwala constantly tastes and adjusts. Ginger too strong? More milk. That’s <strong>self-attention</strong>—a mechanism where each word checks in on others in the sentence.</p>
<blockquote>
<p>Example:<br />“The tea that Hitesh made was perfect.”<br />→ “tea” should relate more to “perfect” than “Hitesh.”</p>
</blockquote>
<hr />
<h2 id="heading-11-softmax-deciding-on-the-flavor">☕ 11. <strong>Softmax</strong> – Deciding on the Flavor</h2>
<p>Now all ingredients are in. But what dominates? Is the cardamom strongest? That’s <strong>softmax</strong>—it takes all possible outputs and decides the <em>most probable</em> one.</p>
<blockquote>
<p>Output:</p>
<ul>
<li><p>“chai” – 70%</p>
</li>
<li><p>“coffee” – 20%</p>
</li>
<li><p>“milk” – 10%</p>
</li>
</ul>
</blockquote>
<p>Chai wins.</p>
<hr />
<h2 id="heading-12-multi-head-attention-the-multi-sensory-taste-test">🧠🧠 12. <strong>Multi-Head Attention</strong> – The Multi-Sensory Taste Test</h2>
<p>You know those chaiwalas who taste, sniff, and swirl the pot? They use <strong>multi-head attention</strong>—looking at multiple aspects of flavor at once.</p>
<p>AI does the same. Each “head” looks at different relationships—like grammar, emotion, or topic—simultaneously.</p>
<hr />
<h2 id="heading-13-temperature-temp-spontaneity-level">🔥 13. <strong>Temperature (temp)</strong> – Spontaneity Level</h2>
<p>In AI, <strong>temperature</strong> controls creativity.</p>
<ul>
<li><p>Low temperature (0.2): Safe, predictable text → “Chai is a beverage.”</p>
</li>
<li><p>High temperature (0.9): Creative, poetic → “Chai is liquid nostalgia in a clay cup.”</p>
</li>
</ul>
<p>Hitesh once demoed this in a video where the AI generated a Bollywood chai poem at temp = 1.0!</p>
<hr />
<h2 id="heading-14-knowledge-cutoff-the-last-chai-update">📆 14. <strong>Knowledge Cutoff</strong> – The Last Chai Update</h2>
<p>If your chaiwala moved out of town in 2021, he won’t know what “rose chai” is. That’s <strong>knowledge cutoff</strong>.</p>
<blockquote>
<p>GPT-3's cutoff: 2021<br />GPT-4: 2023<br />Anything newer is unknown to the model unless updated.</p>
</blockquote>
<hr />
<h2 id="heading-final-sips-brewing-language-with-love">🫶 Final Sips: Brewing Language with Love</h2>
<p>Just like every cup of chai is a delicate balance of spices, temperature, and timing, so is every sentence generated by an AI. The terms may sound technical, but underneath it all, they’re about relationships, understanding, and context—just like great conversation over tea.</p>
<h2 id="heading-bonus-chai-code-example-with-hitesh-and-piyush">🍵 Bonus Chai Code Example – With Hitesh and Piyush</h2>
<pre><code class="lang-js"><span class="hljs-keyword">const</span> chaiAI = <span class="hljs-function">(<span class="hljs-params">prompt, temp = <span class="hljs-number">0.7</span></span>) =&gt;</span> {
  <span class="hljs-keyword">const</span> transformer = <span class="hljs-keyword">new</span> HiteshChoudhary(); <span class="hljs-comment">// Master chaiwala</span>
  <span class="hljs-keyword">const</span> encoder = <span class="hljs-keyword">new</span> PiyushGarg(); <span class="hljs-comment">// Spice grinder</span>
  <span class="hljs-keyword">const</span> context = encoder.encode(prompt);
  <span class="hljs-keyword">const</span> output = transformer.brew(context, temp);
  <span class="hljs-keyword">return</span> output; <span class="hljs-comment">// Perfectly brewed sentence</span>
};

<span class="hljs-built_in">console</span>.log(chaiAI(<span class="hljs-string">"Tell me a poetic line about chai"</span>, <span class="hljs-number">0.9</span>));
<span class="hljs-comment">// Output: “Chai whispers secrets of sun-drenched afternoons into clay cups of joy.”</span>
</code></pre>
<hr />
<h2 id="heading-final-thoughts-learn-with-chai-amp-code">🙌 Final Thoughts: Learn with Chai &amp; Code</h2>
<p>Whether you're watching <strong>Hitesh Choudhary</strong> break down transformers or <strong>Piyush Garg</strong> explain embeddings with whiteboard magic, just know—you’re learning from the best.</p>
<p>And just like chai, it’s not about rushing. Let the concepts steep, savor the flavor, and share a cup of code with your fellow learners.</p>
<blockquote>
<p>“AI isn’t magic—it’s just math with the right masala.”<br />— Piyush Garg</p>
</blockquote>
<h2 id="heading-wrapping-up-with-chai">Wrapping Up With Chai 🍵</h2>
<p>All this AI stuff sounds complex, but when you hear <strong>Hitesh</strong> explain it in Hindi, with chai in one hand and a whiteboard in the other, it just <em>clicks</em>. And when <strong>Piyush Garg</strong> shows you how to use it in real projects with React or Node.js, you start building cool stuff immediately.</p>
<p>So next time someone says:</p>
<blockquote>
<p>“Self-attention with multi-head transformers uses vector embeddings and softmax over tokenized vocab to preserve semantic meaning...”</p>
</blockquote>
<p>You just sip your chai and say:</p>
<blockquote>
<p>“Bhai, Hitesh ne padhaya hai. Sab samajh gaya.” 😎</p>
</blockquote>
]]></content:encoded></item></channel></rss>