<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sreehari R on Medium]]></title>
        <description><![CDATA[Stories by Sreehari R on Medium]]></description>
        <link>https://medium.com/@rshsreehari?source=rss-20b5ec570fd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*hlex8-IWU1ble2CqG8UevQ.png</url>
            <title>Stories by Sreehari R on Medium</title>
            <link>https://medium.com/@rshsreehari?source=rss-20b5ec570fd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 08:32:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rshsreehari/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[What Actually Happens inside a chatbot]]></title>
            <link>https://medium.com/@rshsreehari/what-actually-happens-inside-a-chatbot-dfa68d3a2619?source=rss-20b5ec570fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/dfa68d3a2619</guid>
            <category><![CDATA[rags]]></category>
            <category><![CDATA[mls]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[mcps]]></category>
            <dc:creator><![CDATA[Sreehari R]]></dc:creator>
            <pubDate>Thu, 06 Aug 2026 05:13:55 GMT</pubDate>
            <atom:updated>2026-08-06T05:13:55.006Z</atom:updated>
            <content:encoded><![CDATA[<p>You type a question into a chatbot. You hit enter.</p><p>A sec later, you have an answer that reads like something sat down and thought about it. Picked its words. Considered your question.</p><p>Nothing sat and thought. There’s no pause where understanding happens. There’s just a chain of very fast, very mechanical steps, one after another, each one a fix for a problem the previous step couldn’t solve on its own.</p><p>I wanted to simplify that chain to you, so I pulled it apart, layer by layer, until I hit the bottom.</p><p>Here’s the whole thing, start to finish.</p><h3>1. The large language model</h3><p>Strip away the branding and a <strong>large language model</strong> is a very large function that has learned the statistical shape of language from an enormous amount of text: given everything written so far, what word is likely to come next.</p><p>That’s the entire core skill. Chat, code completion, tool calling, all of it sits on top of that one repeated trick, one word at a time.</p><p>Scale matters more than it sounds like it should. Push the parameters and training data up far enough, and the model starts doing things nobody explicitly taught it: translating, summarizing, solving problems it was never directly trained on, purely as a side effect of getting very good at predicting text.</p><p>But prediction assumes the model can already read. A neural network doesn’t take English as input. It takes numbers.</p><p><strong>So the first real question isn’t how it thinks. It’s how it reads at all.</strong></p><h3>2. Tokenization</h3><p>Before any math happens, your sentence gets chopped into pieces called <strong>tokens</strong>, and they usually aren’t whole words. “Tokenization” itself might split into “token,” “iz,” “ation.”</p><p>This isn’t a random chop. Most models use <strong>byte pair encoding</strong>: start with individual characters, repeatedly merge whichever pair shows up together most often in the training data, and build a vocabulary out of the results. Common words become single tokens. Rare words break into smaller, reusable pieces, so the model is never truly stuck on something it’s never seen.</p><p>Each piece then becomes a number, an ID in a fixed vocabulary.</p><p>And that’s where the real problem shows up. An ID is arbitrary. Token 4021 and token 4022 could sit right next to each other and mean nothing alike.</p><p><strong>If all the model has is ID numbers, how does it know “king” and “queen” belong near each other while “king” and “spoon” don’t?</strong></p><h3>3. Vectorization</h3><p>The fix is to stop treating each token as an isolated ID and represent it instead as a <strong>vector</strong>, a long list of numbers placed in a high-dimensional space where distance and direction actually carry meaning.</p><p>This got its breakthrough with <strong>word2vec</strong>, which showed you could train these vectors just by predicting a word from its neighbors, no manual labeling required. Words that appear in similar contexts end up with similar vectors. The famous demonstration: take the vector for “king,” subtract “man,” add “woman,” and you land almost exactly on “queen.” That’s geometry falling directly out of raw co-occurrence statistics.</p><p>But this gives you one fixed vector per word. Language doesn’t work with fixed meanings.</p><p>Take “bank.” In “river bank” and “bank account,” it’s the same token, needing two completely different vectors depending on what’s around it. A static vector can’t do that.</p><p><strong>So how does a model let the words around a token reshape that token’s meaning on the fly?</strong></p><h3>4. Attention</h3><p>This is arguably the single idea that made the modern LLM possible.</p><p>For every token, the model computes how much it should “attend to” every other token, then uses that weighted mix to update its own representation. In “the bank of the river was steep,” the word “bank” pays heavy attention to “river,” which pulls its meaning toward geography instead of finance.</p><p>Mechanically, this runs through <strong>queries, keys, and values</strong>: each token asks a question (query), every other token offers something to match against (key), and the actual information gets pulled from value vectors, weighted by how well the query matched each key.</p><p>The paper that introduced this at scale is literally titled “Attention Is All You Need” (A must read paper). It replaced older models that read text step by step with something that looks at an entire sentence at once and decides what matters.</p><p>Here’s the catch. Teaching a model all of this, that “bank” near “river” means one thing, is expensive if you need humans labeling every example by hand.</p><p><strong>So how did anyone train something this complex on the entire internet without manually labeling any of it?</strong></p><h3>5. Self-supervised learning</h3><p>The trick: you don’t need labels if the text can label itself.</p><p>Hide a word in a sentence, ask the model to guess it from what’s around it. Or take a massive chunk of text and just ask the model to predict the next token, over and over, across trillions of tokens. The “correct answer” is whatever word actually came next in the real text. The internet becomes an infinite, free training set.</p><p>This is <strong>self-supervised learning</strong>: the supervision comes from the structure of the data itself, not a human tagging examples. BERT popularized the masked version of this, hiding random words and training the model to fill them in, learning deep two-directional context in the process.</p><p>This explains how you train on unlabeled text at scale. It doesn’t explain what shape of network can actually run attention efficiently across this much data without falling over.</p><p><strong>What’s the actual architecture doing the work?</strong></p><h3>6. Transformer</h3><p>The <strong>transformer</strong> packages attention into something you can stack, scale, and run in parallel across thousands of GPUs at once.</p><p>Before it, sequence models processed text one word at a time, which made training painfully slow: you couldn’t work on word ten until word nine was finished. Transformers process the whole sequence simultaneously, letting every token look at every other token through attention, then pass the result through simple feedforward layers, then repeat, stacked dozens of times deep.</p><p>That parallelism is the entire reason models could scale to billions of parameters and trillions of tokens in a reasonable amount of time. Every LLM you’ve used, GPT, Claude, Gemini, Llama, is some version of this same architecture underneath.</p><p>But a raw transformer trained this way is just a very good autocomplete. Ask it a question and it might continue your question with more questions, because that’s a statistically plausible continuation of text it saw during training. It has no built-in sense that it’s supposed to be helpful.</p><p><strong>So how do you turn a raw next-word predictor into something that actually acts like an assistant?</strong></p><h3>7. Fine-tuning</h3><p><strong>Fine-tuning</strong> takes the pretrained model and keeps training it, but now on a much smaller, deliberately chosen dataset meant to shape behavior rather than just knowledge.</p><p>This usually happens in stages: supervised fine-tuning on examples of good question-and-answer pairs, then a reward-based stage where the model’s outputs get ranked by human preference and it’s nudged toward whatever people actually prefer. This exact recipe is what turned raw GPT-3 into something that reliably follows instructions instead of just continuing text, laid out in OpenAI’s InstructGPT paper.</p><p>Fine-tuning bakes new behavior permanently into the weights. But retraining a multi-billion parameter model every time you want a slightly different task is slow and expensive.</p><p><strong>What if you needed the model to pick up a new pattern for a single conversation, without touching a single weight?</strong></p><h3>8. Few-shot prompting</h3><p>If the model is large enough, you don’t need to retrain it to teach it a new pattern. Show it a few examples directly inside the prompt, and it infers the pattern and applies it to your actual question, with zero weight updates.</p><p>Show three examples of turning a casual sentence into a formal one, give it a fourth, and it usually gets it right. This is <strong>few-shot prompting</strong>, and it was one of the most surprising findings in the GPT-3 paper: scale alone gave models an emergent ability to learn a task on the fly, purely from a handful of examples sitting in the context window.</p><p>This has a hard ceiling, though. No matter how clever the examples, the model’s actual knowledge is frozen at whatever it learned during training.</p><p><strong>How do you get a frozen model to accurately talk about things that happened, or exist, outside its training data?</strong></p><h3>9. Retrieval augmented generation</h3><p>The answer: stop asking the model to know everything. Hand it the specific information it needs, right there in the prompt, at the moment it’s answering.</p><p>That’s <strong>retrieval augmented generation</strong>, RAG. A question comes in, the system searches an external source for the most relevant documents, stuffs those documents into the model’s context, and only then asks it to answer. The model isn’t recalling facts from its weights anymore. It’s reading them off a page you just handed it, the same way you’d answer better with the manual open in front of you. The original RAG paper framed it exactly this way: combine a model’s reasoning with a source it can look things up in, instead of cramming the entire source into its parameters.</p><p>But “search for the most relevant documents” hides a lot. Search by keyword and you miss anything phrased differently but conceptually identical.</p><p><strong>Where do you actually store information so it can be searched by meaning instead of exact wording?</strong></p><h3>10. Vector database</h3><p>This is where those embedding vectors come back.</p><p>Instead of storing documents as raw text searched by keyword, you convert each one into a vector, same as a word, and store it in a database built specifically to find the nearest vectors to a query vector, fast, across millions or billions of entries. Comparing your query against every single stored vector doesn’t scale, so <strong>vector databases</strong> use approximate nearest neighbor algorithms, techniques popularized by libraries like FAISS, trading a sliver of accuracy for enormous speed. A billion vectors searched in milliseconds instead of hours.</p><p>Ask a question, embed it, find the nearest document vectors, hand those to the model. That’s the retrieval half of RAG, made concrete.</p><p>This solves the knowledge problem for answering questions. But a lot of what people actually want from AI now isn’t an answer, it’s an action: book this, call that, update this record. Knowing the right document doesn’t tell a model which tools exist or how to use them.</p><p><strong>So how does a model even find out what tools it’s allowed to touch?</strong></p><h3>11. Model Context Protocol</h3><p>In November 2024, Anthropic open-sourced the <strong>Model Context Protocol</strong>, MCP, a standard for connecting AI models to the systems where data and tools actually live, instead of every developer hand-building a custom integration for every API.</p><p>Before MCP, hooking a model up to a database, a ticketing system, and a set of internal APIs meant bespoke glue code for each one. MCP standardizes the connection: a server exposes what tools it has and what parameters they expect, in a predictable format, and any compliant model can discover and call them the same way. People describe it as a universal port for AI, the same way USB standardized how peripherals talk to a computer.</p><p>MCP tells a model which tools exist and what their schemas look like. Having the schema available doesn’t guarantee the model uses it correctly under pressure, in a long conversation, with that schema sitting three tool calls back, competing for attention with everything else going on.</p><p><strong>So what actually decides whether the model uses the right information at the right moment?</strong></p><h3>12. Context engineering</h3><p>For a while, the instinct was to fix this with better wording: rephrase the instruction, add a stern warning, hope for the best.</p><p>But the real issue usually isn’t the phrasing of one instruction. It’s everything else sitting in the context window at that moment: conversation history, tool schemas, prior results, all competing for a model’s limited attention. In mid-2025 this got a name, <strong>context engineering</strong>, after Shopify’s CEO described it as the art of giving a model all the context a task needs to be plausibly solvable, and Andrej Karpathy amplified it by comparing the context window to RAM. The job isn’t writing a clever prompt. It’s deciding exactly what goes into that limited working memory at each step, and what gets dropped before it pushes out something that actually mattered.</p><p>Fixing context makes a single model call behave better. But a lot of real tasks aren’t one call. They need the model to look at a result, decide what to do next, act again, and keep going until the job is actually done.</p><p><strong>What do you call a model that can loop, decide, and act on its own instead of stopping after one reply?</strong></p><h3>13. Agents</h3><p>An <strong>agent</strong> is a language model wired into a loop: observe the current state, reason about what to do next, take an action like calling a tool, look at the result, repeat until the task is done.</p><p>The pattern that made this concrete is called <strong>ReAct</strong>, short for reasoning and acting, where the model explicitly interleaves short bursts of reasoning with tool calls, using each result to inform the next step instead of trying to plan the whole task in one shot.</p><p>Here’s the uncomfortable part, though. An agent built purely on next-token prediction has no built-in sense of whether a decision five steps ago actually helped or hurt the outcome. It’s still just predicting plausible text, with no feedback loop connecting the final result back to the choices that led there.</p><p><strong>If you want a model to actually get better at succeeding, not just at sounding right, what training method rewards outcomes directly?</strong></p><h3>14. Reinforcement learning</h3><p><strong>Reinforcement learning</strong> flips the setup. Instead of training on a fixed correct answer for every input, the model takes an action, observes the result, and gets updated based on a reward signal, more reward for outcomes you want, less for ones you don’t.</p><p>Applied to language models, this is usually reinforcement learning from human feedback: humans rank a set of model outputs from best to worst, that ranking trains a separate reward model, and the language model gets optimized to produce outputs the reward model scores highly. This is the missing piece from fine-tuning earlier, the stage that moves a model from technically follows instructions to actually prefers what a person would prefer. It traces back to earlier work on learning from human preferences that predates language models entirely.</p><p>RLHF makes models more aligned and generally more pleasant to talk to. But there’s a real gap between a model giving a fluent, good-sounding answer instantly and one that actually works through a genuinely hard problem step by step before committing to an answer.</p><p><strong>How do you get a model to slow down instead of pattern-matching to the first plausible response?</strong></p><h3>15. Chain of thought</h3><p>The fix turned out to be almost embarrassingly simple. Ask.</p><p>Prompt a model to write out its reasoning step by step before giving a final answer, instead of jumping straight there, and accuracy on multi-step problems improves dramatically. This is <strong>chain of thought</strong> prompting, and the core finding was that this behavior mostly showed up once models got large enough. Smaller models barely benefited, which suggests the capacity to reason step by step was sitting latent in large models the whole time, and chain of thought was just a way of unlocking it.</p><p>That’s still fundamentally a prompting trick, though. Something you have to explicitly ask for.</p><p><strong>What if the model reasoned automatically, every time, without anyone prompting it to?</strong></p><h3>16. Reasoning models</h3><p>This is what changed with models like OpenAI’s o1 and DeepSeek’s R1.</p><p>Instead of prompting a regular model to show its work, these are trained specifically, using reinforcement learning, to generate long internal reasoning before producing a final answer, learning during training itself when to keep thinking and when a problem is solved. OpenAI described o1 as a model that thinks before it answers, with accuracy on competition-level math jumping dramatically compared to models without this training. DeepSeek-R1 pushed further, showing reasoning could emerge from large-scale reinforcement learning on a base model without a supervised fine-tuning step first, a genuinely surprising result about how much capability was already sitting latent in the base model.</p><p>Everything so far, tokens, attention, reasoning, has been entirely about text.</p><p><strong>What happens when the input isn’t a sentence at all, it’s an image, or a sound, or a screenshot?</strong></p><h3>17. Multi-modal models</h3><p>The core trick: map different types of input, text, images, audio, into the same shared vector space, so a picture of a dog and the word “dog” end up close together even though they started as completely different kinds of data.</p><p><strong>CLIP</strong> demonstrated this by training on image and caption pairs scraped from the internet, learning to pull matching pairs close together in embedding space and push mismatched pairs apart, with no manual labeling of what’s actually in each image. Once images and text live in a comparable representation, the same transformer and attention machinery from earlier can operate across both.</p><p>These large, multi-modal, reasoning-capable models are genuinely impressive. They’re also heavy: expensive to run, slow to respond, often massive overkill for a narrow, well-defined task.</p><p><strong>Do you really need hundreds of billions of parameters just to sort a support ticket into one of five categories?</strong></p><h3>18. Small language models</h3><p>Often, no.</p><p>A <strong>small language model</strong>, trained on a smaller, more carefully curated dataset and tuned for a narrower range of tasks, can match or beat a much larger general-purpose model on the specific job it was built for, while running faster, cheaper, sometimes directly on a phone instead of a data center. Microsoft’s Phi models made this case directly: data quality, not just parameter count, is a major lever. A model trained on carefully filtered, textbook-quality data rivaled models many times its size on reasoning benchmarks.</p><p>But you can’t always train a small model from scratch with the depth of knowledge a giant model has already absorbed from trillions of tokens.</p><p><strong>Is there a way to compress what a huge model learned into a much smaller one, without starting over?</strong></p><h3>19. Distillation</h3><p><strong>Distillation</strong> trains a smaller “student” model to mimic a larger “teacher,” not just by copying its final answers, but by matching its full probability distribution over possible next tokens, which carries far more information than a single right-or-wrong label.</p><p>If the teacher says a token is 70 percent likely to be “cat” and 25 percent likely to be “dog,” that ratio teaches the student something about how the teacher generalizes, information a plain label would throw away. This goes back to Geoffrey Hinton’s original work on distilling a neural network, and it’s exactly what DeepSeek used to build its smaller distilled models: compact versions trained on reasoning traces generated by the much larger R1, often beating attempts to train the same small model with reinforcement learning directly.</p><p>Distillation shrinks the model itself, fewer parameters, fewer layers. But even a small, distilled model still stores every weight as a 32-bit or 16-bit floating point number, and that adds up fast on a device with limited memory.</p><p><strong>Is there a way to shrink the numbers themselves, without touching the size of the model?</strong></p><h3>20. Quantization</h3><p><strong>Quantization</strong> reduces the precision of the numbers a model stores its weights in, going from 32-bit or 16-bit floating point down to 8-bit or even 4-bit integers, cutting memory usage dramatically with a surprisingly small hit to accuracy, if it’s done carefully.</p><p>The LLM.int8 approach showed most weights in a large model tolerate this precision drop just fine, as long as you identify and separately handle a small number of outlier values that matter disproportionately. GPTQ pushed further, quantizing weights layer by layer while correcting for the error introduced at each step, making it possible to run massive models on hardware that would never have fit the full-precision version.</p><p>This is the actual difference between a model that only runs in a data center and one that runs locally, on your own machine.</p><p>And that’s the whole one sec story. A sentence becomes tokens, tokens become vectors, attention decides what matters, a transformer runs it all in parallel, training teaches it without labels, fine-tuning and reinforcement learning teach it manners, retrieval and tools give it a memory and hands, reasoning teaches it patience, and distillation and quantization make the whole thing small enough to actually fit somewhere.</p><p>It’s twenty separate problems, solved one at a time, stacked on top of each other. Now you know exactly what you’re looking at instead of assuming it’s smarter, or stranger, than it actually is.</p><p><strong>References</strong></p><ol><li>Vaswani, A. et al. (2017). <em>Attention Is All You Need.</em></li><li>Sennrich, R., Haddow, B., Birch, A. (2016). <em>Neural Machine Translation of Rare Words with Subword Units.</em></li><li>Mikolov, T. et al. (2013). <em>Efficient Estimation of Word Representations in Vector Space.</em></li><li>Devlin, J. et al. (2018). <em>BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding.</em></li><li>Radford, A. et al. (2018). <em>Improving Language Understanding by Generative Pre-Training.</em></li><li>Brown, T. et al. (2020). <em>Language Models are Few-Shot Learners.</em></li><li>Ouyang, L. et al. (2022). <em>Training Language Models to Follow Instructions with Human Feedback.</em></li><li>Christiano, P. et al. (2017). <em>Deep Reinforcement Learning from Human Preferences.</em></li><li>Lewis, P. et al. (2020). <em>Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks.</em></li><li>Johnson, J., Douze, M., Jégou, H. (2017). <em>Billion-scale Similarity Search with GPUs</em> (FAISS).</li><li>Anthropic (2024). <em>Introducing the Model Context Protocol.</em></li><li>Lütke, T. and Karpathy, A. (2025). Public commentary popularizing the term “context engineering.”</li><li>Yao, S. et al. (2022). <em>ReAct: Synergizing Reasoning and Acting in Language Models.</em></li><li>Wei, J. et al. (2022). <em>Chain-of-Thought Prompting Elicits Reasoning in Large Language Models.</em></li><li>OpenAI (2024). <em>Learning to Reason with LLMs</em> (o1).</li><li>DeepSeek-AI (2025). <em>DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning.</em></li><li>Radford, A. et al. (2021). <em>Learning Transferable Visual Models From Natural Language Supervision</em> (CLIP).</li><li>Abdin, M. et al. (2024). <em>Phi-3 Technical Report</em> (Microsoft Research).</li><li>Hinton, G., Vinyals, O., Dean, J. (2015). <em>Distilling the Knowledge in a Neural Network.</em></li><li>Dettmers, T. et al. (2022). <em>LLM.int8(): 8-bit Matrix Multiplication for Transformers at Scale.</em></li><li>Frantar, E. et al. (2022). <em>GPTQ: Accurate Post-Training Quantization for Generative Pre-trained Transformers.</em></li><li>Inspired from Gaurav Sen</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dfa68d3a2619" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java Heap vs Stack Memory: The Complete Guide]]></title>
            <link>https://medium.com/@rshsreehari/java-heap-vs-stack-memory-the-complete-guide-46ea6f118f7c?source=rss-20b5ec570fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/46ea6f118f7c</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[java-memory-management]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[jvm]]></category>
            <dc:creator><![CDATA[Sreehari R]]></dc:creator>
            <pubDate>Thu, 23 Apr 2026 09:36:27 GMT</pubDate>
            <atom:updated>2026-04-23T09:36:27.987Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve been writing Java for a while and still feel a little fuzzy about what actually goes where in memory, you’re not alone. Heap and Stack are two of the most fundamental concepts in the JVM, yet they’re often explained in ways that leave you more confused than when you started. This is the blog I wish existed when I first ran into my first StackOverflowError and had absolutely no idea why my program was shouting at me.</p><p><em>Let’s fix that, once and for all</em>.</p><h3>First, Let’s Talk About the JVM’s Memory Model</h3><p>When you run a Java program, the JVM fires up and carves out memory into different regions. Think of it like a well-organized kitchen. Some things go on the counter because you’re actively using them right now (that’s your Stack). Other things go in the fridge because they need to stick around for longer or be shared across the meal (that’s your Heap). Different tools, different jobs, different rules.</p><p>The two regions we care about most are the <strong>Stack</strong> and the <strong>Heap</strong>.</p><h3>The Stack: Your Method’s Personal Workspace</h3><p>Every single thread in your Java program gets its own private Stack, created the moment the thread is born. The Stack is not shared. Not with other threads, not with anything else. It is completely yours.</p><p>So what does the Stack actually hold? It holds <strong>frames</strong>.</p><p>Every time you call a method, the JVM creates a new frame and pushes it onto the Stack. This frame contains:</p><ul><li><strong>Local variables</strong> — every variable you declare inside that method</li><li><strong>An operand stack</strong> — a temporary scratch pad the JVM uses to do computations</li><li><strong>A reference to the runtime constant pool</strong> — for looking up class and method info</li></ul><p>When the method finishes (either normally or by throwing an exception), the frame is popped off the Stack and discarded. Gone. That memory is immediately reclaimed.</p><h4>A Real Example</h4><p>Let’s say you have this code:</p><pre>public class Calculator {<br>    public int add(int a, int b) {<br>        int result = a + b;<br>        return result;<br>    }<br>    public void run() {<br>            int x = 5;<br>            int y = 10;<br>            int sum = add(x, y);<br>            System.out.println(sum);<br>    }<br>}</pre><p>When run() is called, a frame goes onto the Stack with x, y, and sum as local variables. Then add() is called, and a brand new frame is pushed on top of that. This frame holds a, b, and result. Once add() returns, its frame vanishes. Back in run(), life continues normally.</p><p>Picture it like a stack of plates. You keep adding plates on top, and you always take from the top. You can never grab a plate from the middle.</p><h4>What Lives on the Stack</h4><p>The Stack stores:</p><ul><li>Primitive values like int, double, boolean, char declared inside a method</li><li>References to objects (not the objects themselves — more on this soon)</li><li>Method call information and return addresses</li></ul><h4>Stack Memory is Fast But Finite</h4><p>The Stack is blazing fast because allocation and deallocation are just pointer adjustments. There’s no bookkeeping, no garbage collection, no negotiation. You push, you pop, done.</p><p>But it has a hard size limit. And when you exceed it, Java throws a StackOverflowError.</p><p>The most classic way to hit this is infinite recursion:</p><pre>public void infinite() {<br>    infinite(); // calls itself forever<br>}</pre><p>Each call pushes a new frame. The Stack fills up. Boom. StackOverflowError.</p><p>If the JVM can’t even create a new Stack for a new thread due to lack of memory, you get an OutOfMemoryError instead.</p><h3>The Heap: The Shared Storage for Everything Else</h3><p>The Heap is where all objects live. Every time you write new SomeClass(), the object is created in the Heap. The Heap is created when the JVM starts and is shared among all threads.</p><p>Unlike the Stack where things live and die with method calls, objects on the Heap can outlive the method that created them. They stick around as long as something is still holding a reference to them.</p><pre>public Person createPerson() {<br>    Person p = new Person(&quot;Alice&quot;);<br>    return p;<br>}</pre><p>Here, p is a local variable on the Stack — it&#39;s just a reference (like a pointer to where Alice lives). The actual Person object is on the Heap. When createPerson() returns, the frame is destroyed and p disappears from the Stack. But the Person object? It&#39;s still alive on the Heap, because the caller now has a reference to it.</p><p>This is a critical distinction. <strong>The reference lives on the Stack. The object it points to lives on the Heap.</strong></p><h4>Arrays Too</h4><p>Arrays also go on the Heap. Every time you do new int[100] or new String[5], that memory is allocated on the Heap.</p><h4>The Garbage Collector</h4><p>Nobody manually frees Heap memory in Java. That’s the whole point. The JVM has a Garbage Collector (GC) that periodically scans the Heap, finds objects that nothing is pointing to anymore, and reclaims that memory automatically.</p><p>If you come from C or C++, this is one of Java’s biggest gifts. No malloc, no free, no memory leaks from forgetting to clean up. The tradeoff is that GC pauses can sometimes affect performance, which is why GC tuning is its own rabbit hole , but that&#39;s a topic for another day.</p><p>If the Heap runs out of room and the GC can’t free up enough space, the JVM throws an OutOfMemoryError.</p><h3>Primitives vs Objects: Where Do They Really Go?</h3><p>This trips people up all the time.</p><p><strong>Inside a method:</strong> If you declare int x = 5;, that 5 lives directly on the Stack inside the method&#39;s frame.</p><p><strong>Inside an object:</strong> If you have a class with a field int age;, that integer lives inside the object on the Heap.</p><pre>public class Dog {<br>    int age = 3; // lives on the Heap, inside the Dog object<br>}<br>public void doSomething() {<br>    int localVar = 10;   // lives on the Stack<br>    Dog d = new Dog();   // &#39;d&#39; (the reference) is on the Stack,<br>                         // the Dog object itself is on the Heap<br>}</pre><p>Think of the reference like a house address written on a sticky note. The sticky note (reference) might be on your desk (Stack), but the actual house (object) is out there in the city (Heap).</p><h3>Thread Safety: Why the Stack Doesn’t Need Locks</h3><p>Because each thread has its own private Stack, local variables inside methods are inherently thread-safe. Thread A can’t reach into Thread B’s Stack and mess with its variables.</p><p>The Heap, on the other hand, is shared. So if two threads are both holding references to the same object and one of them starts modifying it, you can absolutely get race conditions and data corruption. This is why synchronized, volatile, and concurrent data structures exist.</p><h3>The Frames in Detail (for the Curious)</h3><p>Since the official JVM spec (which you shared) gets into frames pretty deeply, let’s demystify them a bit.</p><p>A <strong>frame</strong> is created every time a method is invoked and destroyed when that method completes. It has three key parts:</p><p><strong>1. Local Variable Array</strong> This is exactly what it sounds like. Every variable declared inside the method (including method parameters) gets a slot here. For int, float, boolean, etc., the value itself is stored. For objects, a reference (basically a pointer) is stored.</p><p>For instance methods, slot 0 is always this — the reference to the current object. Parameters start at slot 1.</p><p><strong>2. Operand Stack</strong> This is the JVM’s working area. Think of it as a mini calculator’s scratch pad. When the JVM executes int result = a + b, it pushes a onto the operand stack, then pushes b, then executes the iadd instruction which pops both, adds them, and pushes the result. It&#39;s a last-in-first-out (LIFO) stack, just like the Stack itself.</p><p><strong>3. Reference to the Runtime Constant Pool</strong> This lets the frame look up class-level information, like method names, field types, and string literals. It’s how dynamic linking works — the JVM resolves symbolic references to actual memory locations at runtime.</p><p>Only one frame is “current” at any moment in a thread. When you call a method, a new frame becomes current. When that method returns, the previous frame takes over again.</p><h3>Common Errors and What They Actually Mean</h3><p><strong>StackOverflowError</strong> You’ve run out of Stack space. Almost always caused by infinite or very deep recursion. Every recursive call pushes a new frame, and eventually you run out of room.</p><pre>// This will throw StackOverflowError<br>public int badFactorial(int n) {<br>    return n * badFactorial(n - 1); // no base case!<br>}</pre><p>Fix it by adding a proper base case, or for deeply recursive algorithms, consider converting to an iterative approach.</p><p><strong>OutOfMemoryError: Java heap space</strong> You’ve created more objects than the Heap can hold (or your GC can’t clean up fast enough). Common causes: storing too many objects in a collection, memory leaks (unintentionally holding references to objects you no longer need), or simply not enough heap allocated.</p><p>You can increase heap size with JVM flags:</p><pre>-Xms512m  (initial heap size)<br>-Xmx2g    (maximum heap size)</pre><p><strong>OutOfMemoryError: unable to create new native thread</strong> The JVM can’t create a new Stack for a new thread because there isn’t enough memory. Usually means you’re spawning threads too aggressively.</p><h3>Putting It All Together: A Full Walkthrough</h3><pre>public class BankAccount {<br>    private double balance; // lives on the Heap (field of this object)<br><br>    public BankAccount(double initialBalance) {<br>        this.balance = initialBalance;<br>    }<br><br>    public double getBalance() {<br>        return balance; // balance reference resolved from Heap<br>    }<br><br>    public void deposit(double amount) {<br>        // &#39;amount&#39; is a local variable on the Stack<br>        // &#39;this.balance&#39; is on the Heap<br>        this.balance += amount;<br>    }<br>}<br><br>public class Main {<br>    public static void main(String[] args) {<br>        // &#39;account&#39; reference is on the Stack<br>        // The BankAccount object is on the Heap<br>        BankAccount account = new BankAccount(1000.0);<br><br>        // A new frame is pushed for deposit()<br>        // &#39;amount&#39; (500.0) is stored in that frame<br>        account.deposit(500.0);<br><br>        // deposit() frame is gone, back in main()<br>        System.out.println(account.getBalance()); // prints 1500.0<br>    }<br>}</pre><p>Step by step:</p><ol><li>main() starts, its frame is pushed onto the Stack.</li><li>account is a local variable in main()&#39;s frame — it holds a reference.</li><li>new BankAccount(1000.0) allocates memory on the Heap and stores balance = 1000.0 there.</li><li>deposit(500.0) is called — a new frame with amount = 500.0 is pushed.</li><li>deposit() modifies balance on the Heap.</li><li>deposit() returns — its frame is popped.</li><li>getBalance() is called — another frame, but it just reads balance from the Heap and returns it.</li><li>main() ends — its frame is popped.</li><li>At some point, GC notices nobody holds a reference to account anymore and cleans up the BankAccount object from the Heap.</li></ol><h3>Final Thoughts</h3><p>The Stack and Heap aren’t scary once you see what each one is actually doing. The Stack is where your methods do their work fast, isolated, ephemeral. The Heap is where your objects live shared, persistent, managed by the GC.</p><p>Every time you write new, you&#39;re on the Heap. Every time you declare a variable inside a method, you&#39;re on the Stack. That&#39;s a surprisingly useful mental model that covers 90% of what you&#39;ll need day to day.</p><p>Understanding this also makes you a much better debugger. When you see a StackOverflowError, you know to look for runaway recursion. When you see OutOfMemoryError: Java heap space, you know something is hoarding objects somewhere.</p><h3>References</h3><ul><li><em>The Java Virtual Machine Specification, Java SE 21 Edition</em> — Tim Lindholm, Frank Yellin, Gilad Bracha, Alex Buckley, Daniel Smith. Oracle. (Sections 2.5.2, 2.5.3, 2.6 — JVM Stacks, Heap, and Frames)</li><li><em>Effective Java, 3rd Edition</em> — Joshua Bloch. Addison-Wesley, 2018. (Items on object creation and memory)</li><li><em>Java Performance: The Definitive Guide</em> — Scott Oaks. O’Reilly Media, 2014. (Chapters on JVM memory and GC tuning)</li><li><em>Inside the Java Virtual Machine</em> — Bill Venners. McGraw-Hill, 1999. (Deep dive into JVM internals including Stack frames)</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=46ea6f118f7c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Prompt Engineering: How to Get Better Results From AI]]></title>
            <link>https://medium.com/@rshsreehari/prompt-engineering-how-to-get-better-results-from-ai-b5852a8e245c?source=rss-20b5ec570fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/b5852a8e245c</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[prompt-engineering]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Sreehari R]]></dc:creator>
            <pubDate>Wed, 18 Mar 2026 02:53:45 GMT</pubDate>
            <atom:updated>2026-03-18T02:53:45.330Z</atom:updated>
            <content:encoded><![CDATA[<p>This is an important skill today, not just for software engineers but for anyone who uses AI tools and large language models.</p><p>Most people think using AI is easy. You type something, press enter, and expect a great answer. Sometimes that works. Many times it doesn’t.</p><p>The difference usually comes down to <strong>how you ask</strong>.</p><p>Prompt engineering is simply the skill of asking AI better questions. When your prompt is clear and structured, the AI has a much better chance of giving you a useful response. When the prompt is vague or messy, the output usually is too.</p><p>The good news is that writing good prompts is not complicated. A few practical habits can improve your results immediately.</p><h3>Start with the Three C’s</h3><p>A helpful way to think about prompts is through three basic principles.</p><p><strong>Be concise</strong></p><p>Keep your prompt simple and focused. Long prompts that mix several unrelated requests can confuse the AI. Instead of asking for everything at once, focus on one clear task.</p><p><strong>Be clear</strong></p><p>Vague instructions lead to vague answers. A request like “make this better” forces the AI to guess what you want. Instead, explain what “better” means. Do you want it shorter, clearer, more persuasive, or easier to read?</p><p><strong>Be consistent</strong></p><p>Use the same words for the same concept throughout a conversation. If you start by calling something a “blog post,” continue using that term. Switching between words like article, post, and content piece can sometimes create confusion.</p><p>These small adjustments make your instructions easier for the AI to interpret.</p><h3>Give the AI Proper Context</h3><p>AI performs much better when it understands the situation.</p><p>Consider the difference between these two prompts.</p><p>A <strong>simple prompt</strong> might say: <em>Tell me about climate change.</em></p><p>A <strong>stronger prompt</strong> might say: <em>Explain three major impacts of climate change on agriculture in tropical regions using clear examples from the past decade.</em></p><p>The second version works better because it gives direction. It tells the AI what aspect of the topic to focus on, what kind of examples to use, and how specific the answer should be.</p><p>When writing prompts, try to include helpful context such as:</p><ul><li>The goal of the task</li><li>The audience for the output</li><li>The tone or style you want</li><li>Any limits like length, format, or timeframe</li></ul><p>The clearer the situation, the easier it is for AI to respond effectively.</p><h3>Define a Role When It Helps</h3><p>Another useful technique is assigning the AI a role.</p><p>For example, you might ask the AI to respond as:</p><ul><li>A science teacher explaining a concept to a beginner</li><li>A marketing strategist planning a campaign</li><li>A career coach reviewing a resume</li></ul><p>Giving the AI a role shapes the tone, the level of detail, and the style of explanation. This can make the output feel much more aligned with your needs.</p><h3>Show Examples of What You Want</h3><p>Sometimes the fastest way to guide AI is to show it an example.</p><p>If you want technical language simplified, show a short example of a technical sentence followed by a plain-language version. Then ask the AI to follow the same pattern.</p><p>This approach helps the model understand the structure and style you expect. Instead of guessing what you mean, it can follow the pattern you provided.</p><h3>Specify the Format of the Output</h3><p>Clear structure often leads to better responses.</p><p>If you already know the shape of the answer you want, tell the AI directly. You might request:</p><ul><li>A list of five ideas</li><li>A step-by-step explanation</li><li>A short summary followed by key takeaways</li><li>A structured blog outline</li></ul><p>Providing these instructions helps narrow the response and makes it easier to use the output right away.</p><h3>Break Complex Tasks Into Steps</h3><p>A common mistake is asking AI to complete a complicated task all at once.</p><p>If the request involves multiple stages, it usually works better to break it into smaller parts.</p><p>For example, instead of saying: <em>Analyze this quarterly sales data.</em></p><p>You could ask the AI to:</p><ul><li><em>Identify the top-performing products</em></li><li><em>Compare the current quarter with the previous one</em></li><li><em>Highlight unusual trends or patterns</em></li><li><em>Suggest possible reasons for those trends</em></li></ul><p>This step-by-step approach gives the AI a clearer path to follow and makes the results easier to review.</p><h3>Ask the AI to Think Carefully</h3><p>When dealing with reasoning or problem solving, it can help to encourage the AI to slow down and think through the task before answering.</p><p>You might phrase it like this: <em>Before giving the final answer, consider the key factors involved and evaluate the possible options.</em></p><p>This approach often leads to more thoughtful and structured responses.</p><h3>Always Review the Output</h3><p>Even with a strong prompt, AI responses should always be reviewed.</p><p>Before using or sharing the result, check for a few important things:</p><ul><li>Is the information accurate?</li><li>Does the response stay focused on the question?</li><li>Is the tone consistent throughout?</li><li>Does it show any bias or questionable assumptions?</li></ul><p>AI is a helpful assistant, but it should never replace careful judgment.</p><h3>Improve Results Through Iteration</h3><p>Think of the first AI response as a draft rather than the final version.</p><p>If the output is not quite right, refine your prompt. You might add more context, clarify the format, or narrow the focus of the task.</p><p>Prompting works best as an ongoing process of small improvements. Each adjustment helps guide the AI closer to the result you want.</p><h3>Start a New Chat for a New Topic</h3><p>AI tools remember earlier messages within a conversation. This can help maintain context, but it can also cause confusion when the topic suddenly changes.</p><p>When switching to a completely different task, starting a new chat helps the AI focus only on the relevant information for that topic.</p><h3>Build Your Own Prompt Library</h3><p>As you gain experience, you will notice certain prompts consistently produce good results.</p><p>Saving these prompts can be incredibly useful. Over time, you can build a small library of prompts that work well for tasks like writing summaries, generating ideas, editing content, or planning projects.</p><p>This habit saves time and makes your workflow much more efficient.</p><h3>Final Thoughts</h3><p>Prompt engineering is less about mastering complex techniques and more about learning to communicate clearly.</p><p>The most effective prompts tend to follow a few simple principles. They are focused, specific, and structured in a way that guides the AI toward the intended result.</p><p>When you combine clear prompts with careful review and a willingness to refine your instructions, AI becomes far more useful.</p><p>In the end, the quality of the answer often reflects the quality of the question. Learning to ask better questions is what truly unlocks the value of AI tools.</p><p><strong>References</strong>:</p><p>Google AI<br>Anthropic skills</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5852a8e245c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding the Limitations of Artificial Intelligence (AI)]]></title>
            <link>https://medium.com/@rshsreehari/understanding-the-limitations-of-artificial-intelligence-ai-468b2bfa0774?source=rss-20b5ec570fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/468b2bfa0774</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Sreehari R]]></dc:creator>
            <pubDate>Mon, 16 Mar 2026 03:52:37 GMT</pubDate>
            <atom:updated>2026-03-16T03:52:37.157Z</atom:updated>
            <content:encoded><![CDATA[<p>Artificial Intelligence is becoming a common tool for writing, research, automation, and decision-making. It can process large amounts of information quickly and generate useful responses in seconds. However, AI is not perfect. To use it responsibly, it is important to understand where it can make mistakes and why those mistakes happen.</p><p>Knowing the limitations of AI helps users evaluate outputs more carefully, avoid misinformation, and guide the system toward more accurate and fair results.</p><h3>1. Bias in Artificial Intelligence</h3><p>One of the most common limitations of AI is <strong>bias</strong>.</p><p>AI systems learn from large datasets. If the data used to train the model contains gaps, imbalances, or historical biases, the AI may unintentionally repeat those patterns in its responses.</p><p>For example, if you ask AI to generate an image of an office, it might frequently produce images of large urban corporate buildings. This can happen because much of the training data comes from major business hubs. As a result, the AI may struggle to represent:</p><ul><li>Home offices</li><li>Rural workplaces</li><li>Creative studios</li><li>Small local businesses</li></ul><p>This does not mean the AI is intentionally biased. It simply reflects the patterns it learned during training.</p><h3>How to reduce bias in AI outputs</h3><p>You can guide the AI toward fairer responses by improving how you prompt it.</p><p>Some useful techniques include:</p><ul><li><strong>Be specific about what you want</strong><br>Add context about your audience, setting, or perspective.</li><li><strong>Include balanced references</strong><br>Mention different environments, cultures, or viewpoints in your prompt.</li><li><strong>Use follow-up prompts</strong><br>If an answer seems biased or stereotypical, ask the AI to revise the response with a more balanced perspective.</li></ul><p>Being aware of bias allows you to correct it rather than unknowingly spreading it.</p><h3>2. The Knowledge Cutoff Problem</h3><p>Another important limitation is the <strong>knowledge cutoff</strong>.</p><p>A knowledge cutoff is the point in time when the AI model’s training data ends. This means the AI may not automatically know about events, discoveries, or developments that happened after that date.</p><p>Some AI systems can look up current information through web searches. However, it is helpful to remember the difference between:</p><ul><li><strong>What the AI learned during training</strong></li><li><strong>What it can temporarily search for online</strong></li></ul><p>Because the internal knowledge of the model is not constantly updated, users should be cautious when asking about recent topics.</p><h3>Best practices for handling knowledge cutoff</h3><p>To work effectively with this limitation, you can:</p><ul><li><strong>Check the model’s knowledge cutoff date</strong><br>This helps you understand what time period the AI is most reliable about.</li><li><strong>Verify recent information</strong><br>Always double-check statistics, breaking news, or new research using trusted sources.</li><li><strong>Specify the timeframe in your prompt</strong><br>Instead of asking a vague question, include the year or period you are referring to.</li><li><strong>Example</strong>:<br>Instead of asking: “What was the biggest song of the summer?”<br>Ask: “What was the biggest song of the summer in 2025?”</li><li><strong>Use follow-up prompts</strong><br>If an answer seems outdated, ask the AI for newer alternatives or updated information.</li></ul><h3>3. Changes in AI Performance Over Time (Drift)</h3><p>AI systems can also change over time. This is known as <strong>AI drift</strong>.</p><p>Drift happens when the model becomes less accurate or behaves differently as the real world evolves or as developers update the system.</p><p>There are two main types of drift.</p><h3>Factual Drift</h3><p>Factual drift occurs when the information inside the model becomes less accurate over time.</p><p>For example:</p><ul><li>Technology recommendations may become outdated</li><li>Fashion trends may change</li><li>Market data may become irrelevant</li></ul><p>The further we move from the model’s training period, the more likely this type of drift becomes.</p><h3>Behavioral Drift</h3><p>Behavioral drift refers to changes in how the AI responds.</p><p>Developers often update models to improve performance. After updates, users might notice changes such as:</p><ul><li>Different response formatting</li><li>A different tone of writing</li><li>Changes in conversational style</li></ul><p>Even when using the same prompt, the output may look slightly different.</p><h3>How to manage AI drift</h3><p>You can reduce the impact of drift by:</p><ul><li>Providing <strong>clear and up-to-date context</strong> in your prompts</li><li>Starting <strong>a new chat for each task</strong> to avoid confusion from long conversations</li><li>Writing <strong>clear and specific instructions</strong> when requesting outputs</li></ul><p>These practices help keep responses accurate and focused.</p><h3>Final Thoughts</h3><p>Artificial Intelligence is a powerful tool, but it should always be used thoughtfully. Understanding its limitations helps users avoid overreliance and encourages responsible use.</p><p>The key limitations to remember include:</p><ul><li>Bias in training data</li><li>Knowledge cutoff that limits recent information</li><li>Performance changes over time due to drift</li></ul><p>The best results come from combining <strong>human judgment with AI capabilities</strong>. By asking thoughtful questions, refining prompts, and verifying important information, users can make AI a valuable and responsible assistant.</p><p>Responsible AI use is not just about using the technology. It is about thinking critically, verifying outputs, and ensuring that AI serves people fairly and accurately.</p><h3>References:</h3><p>Google AI</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=468b2bfa0774" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Artificial Intelligence(AI) vs Machine learning(ML)]]></title>
            <link>https://medium.com/@rshsreehari/artificial-intelligence-ai-vs-machine-learning-ml-26a7d5491cca?source=rss-20b5ec570fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/26a7d5491cca</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Sreehari R]]></dc:creator>
            <pubDate>Mon, 16 Mar 2026 03:23:02 GMT</pubDate>
            <atom:updated>2026-03-16T03:23:02.947Z</atom:updated>
            <content:encoded><![CDATA[<p>You’ll often hear <strong>Artificial Intelligence (AI)</strong> and <strong>Machine Learning (ML)</strong> used interchangeably, but they aren’t quite the same thing. Think of AI as the “destination” and ML as the “vehicle” that gets us there.</p><h3>What is Artificial Intelligence?</h3><p>AI is the broad field of creating tools that mimic human intelligence, things like writing emails or finding the fastest route home. While it feels “smart,” it’s important to recognize that its knowledge comes from the specific data it was trained on.</p><h3>What is Machine Learning?</h3><p>Machine Learning is the most common way we “teach” AI. Instead of writing rigid code for every possible scenario, we let the system find patterns in data on its own.</p><ul><li><strong>The Zebra Test:</strong> To teach an AI what a zebra is, you feed an ML program thousands of photos of horses and zebras. It eventually learns that “stripes = zebra.”</li><li><strong>Inference:</strong> Once the training is done, the AI can look at a brand-new photo and correctly identify the zebra. This final act of “guessing” is called inference.</li></ul><h3>Three Ways Machines Learn</h3><ul><li><strong>Supervised Learning (The Guided Path):</strong> Humans provide a labeled “answer key” (e.g., “this is a horse,” “this is a zebra”). It’s best when you have a specific result in mind.</li><li><strong>Unsupervised Learning (The Pattern Finder):</strong> You give the AI raw data with no labels. It explores the data to find its own clusters like grouping all striped animals together without even knowing the word “zebra.”</li><li><strong>Reinforcement Learning (Trial and Error):</strong> The AI learns via a reward system. Correct moves get a “plus,” and mistakes get a “penalty.” Over time, it masters a task by maximizing its “score.”</li></ul><p>Today, many AI models use a combination of all three machine learning approaches to create text, images, video, and more.</p><h3><strong>References</strong></h3><p>Google AI</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26a7d5491cca" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>