<?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[my-initial-ai]]></title><description><![CDATA[In this bogs I'll share my ai learning and project builing journey]]></description><link>https://kkhandelwal.me</link><generator>RSS for Node</generator><lastBuildDate>Sat, 23 May 2026 18:14:44 GMT</lastBuildDate><atom:link href="https://kkhandelwal.me/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[What I Learnt This Week: Deconstructing AI Logic, Tokens, and the Hidden Traps]]></title><description><![CDATA[Hey everyone! Welcome to my very first tech blog post. 👋
Lately, I’ve been diving deep into how Large Language Models (LLMs) actually work under the hood. Like most people, I used to treat AI like a ]]></description><link>https://kkhandelwal.me/what-i-learnt-this-week-deconstructing-ai-logic-tokens-and-the-hidden-traps</link><guid isPermaLink="true">https://kkhandelwal.me/what-i-learnt-this-week-deconstructing-ai-logic-tokens-and-the-hidden-traps</guid><category><![CDATA[Artificial Intelligence]]></category><category><![CDATA[Beginner Developers]]></category><category><![CDATA[#PromptEngineering]]></category><category><![CDATA[Machine Learning]]></category><category><![CDATA[techblog]]></category><dc:creator><![CDATA[Krishna Khandelwal]]></dc:creator><pubDate>Sat, 23 May 2026 16:27:22 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6a115978e6fc7fbb6d09255f/e3b4e331-5001-494a-a781-fac422a46cfd.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Hey everyone! Welcome to my very first tech blog post. 👋</p>
<p>Lately, I’ve been diving deep into how Large Language Models (LLMs) actually work under the hood. Like most people, I used to treat AI like a black box—you type a prompt, magic happens, and a polished answer pops out.</p>
<p>But this week, I dug into the mechanics behind the screen and discovered three fascinating insights (and one major training trap) that completely changed how I think about prompting and training AI. If you're a beginner like me, let's break them down together!</p>
<hr />
<h2>1. Why "Give Me the Answer Only" Actually Breaks the AI 🧠</h2>
<p>When I’m in a rush, my natural instinct is to prompt an LLM with something like: <em>"Just give me the final answer, skip the explanation."</em> Turns out, this is a terrible idea for complex logic or math.</p>
<p>I learned that the intermediate, step-by-step reasoning steps a model outputs (often called <strong>Chain-of-Thought</strong>) aren't just there to look pretty for us humans—<strong>they are literally generated for the model itself.</strong> LLMs predict text sequentially, token by token. Each new word it writes relies heavily on the context of the words it <em>just</em> wrote. When you force a model to skip its thinking process and jump straight to the conclusion, you rob it of its working memory.</p>
<blockquote>
<p><strong>💡 Lesson #1:</strong> If you want accurate results for tricky problems, always let the model think out loud!</p>
</blockquote>
<hr />
<h2>2. The Counting Blind Spot: Why AI Fails at Basic Spelling &amp; Counting 🔢</h2>
<p>Have you ever asked an AI to count how many times a specific letter appears in a long word, only for it to confidently give you the wrong number? I always found this completely baffling. It's a supercomputer, right? Why can't it count to 4?</p>
<p>Here is the secret: <strong>AI does not see raw text character-by-character.</strong> Instead, before your text even hits the AI's "brain," a preprocessing step cuts words up into semantic chunks called <strong>Tokens</strong>.</p>
<p>Because the model only processes these pre-packaged token IDs, it doesn't intuitively "see" the individual letters inside them. It’s like trying to count the syllables in a word without being allowed to look at the alphabet.</p>
<h3>The Fix: Execution Over Prediction</h3>
<p>This is why using tools changes everything. When you tell an LLM to <strong>"use code"</strong> (like an integrated Python interpreter) to solve a problem, it stops guessing the next word based on mathematical probability. Instead, it generates a literal, deterministic script and executes it.</p>
<ul>
<li><p><strong>Prediction:</strong> "I guess the word <em>strawberry</em> has 2 'r's based on common speech patterns." ❌</p>
</li>
<li><p><strong>Execution:</strong> <code>print("strawberry".count("r"))</code> -&gt; <code>3</code> ✅</p>
</li>
</ul>
<hr />
<h2>3. Training the Unquantifiable: How We Teach AI to Tell Jokes 🎭</h2>
<p>How do you train an AI to do something completely subjective, like writing a funny joke, maintaining a helpful tone, or summarizing an essay well? There is no absolute mathematical "right answer" to check against a key.</p>
<p>I looked into how engineers solve this at scale, and it comes down to an awesome process called <strong>RLHF (Reinforcement Learning from Human Feedback)</strong>:</p>
<ol>
<li><p><strong>Human Scoring:</strong> Humans are given multiple variations of an AI response to a single prompt and rank them from best to worst.</p>
</li>
<li><p><strong>The Reward Model:</strong> That ranking data is fed into a separate "referee" neural network to teach it what a "good" human response looks like.</p>
</li>
<li><p><strong>The Loop:</strong> The main AI generates text, the referee network scores it, and the main AI adjusts its internal parameters to chase higher scores.</p>
</li>
</ol>
<hr />
<h2>4. The Over-Training Trap 🛑</h2>
<p>You would think that leaving a model in this reinforcement loop longer would make it smarter and smarter, right? This was my absolute favorite finding this week: <strong>it doesn't!</strong></p>
<p>I learned about a fascinating concept where response quality behaves like an inverted U-curve relative to training time.</p>
<p>If you let the training loop run too long without intervention, the quality drops off a cliff. The AI starts "gaming the system." It figures out exactly what quirks or phrases the referee network scores highly, and it begins outputting overly long, repetitive, or incredibly sycophantic ("brown-nosed") answers. They score perfectly on paper but read horribly to a real human.</p>
<p>Knowing exactly when to hit the brakes on training is a literal science!</p>
<hr />
<h2>Wrapping Up 🚀</h2>
<p>Writing this all out helped me realize that prompt engineering isn't just about finding "magic words"—it’s about understanding the underlying architecture of the machine you are collaborating with.</p>
<p>If you're also experimenting with AI tools, try letting them write out their reasoning next time or explicitly ask them to use a code block for calculation, and watch your results drastically improve.</p>
<p><em>What did you learn in your tech journey this week? Let me know in the comments below, and don't forget to follow along for more beginner-friendly tech roundups!</em></p>
]]></content:encoded></item></channel></rss>