<?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 Kapardhi kannekanti on Medium]]></title>
        <description><![CDATA[Stories by Kapardhi kannekanti on Medium]]></description>
        <link>https://medium.com/@kapardhikannekanti?source=rss-d1a9d12fe3fd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*cw1mnZRNMKbt6YZjS-3zGw.jpeg</url>
            <title>Stories by Kapardhi kannekanti on Medium</title>
            <link>https://medium.com/@kapardhikannekanti?source=rss-d1a9d12fe3fd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 02:21:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kapardhikannekanti/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[The Thumbs-Up That Broke My Sales Bot]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@kapardhikannekanti/the-thumbs-up-that-broke-my-sales-bot-65d6e30cf632?source=rss-d1a9d12fe3fd------2"><img src="https://cdn-images-1.medium.com/max/1400/1*Zo39aJc1q-20vcfGqypEbQ.png" width="1400"></a></p><p class="medium-feed-snippet">I run a WhatsApp sales bot. A lead sends a message, and the bot reads it and picks one of four moves.</p><p class="medium-feed-link"><a href="https://medium.com/@kapardhikannekanti/the-thumbs-up-that-broke-my-sales-bot-65d6e30cf632?source=rss-d1a9d12fe3fd------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@kapardhikannekanti/the-thumbs-up-that-broke-my-sales-bot-65d6e30cf632?source=rss-d1a9d12fe3fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/65d6e30cf632</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[ai-sales-agents]]></category>
            <dc:creator><![CDATA[Kapardhi kannekanti]]></dc:creator>
            <pubDate>Thu, 13 Aug 2026 10:35:28 GMT</pubDate>
            <atom:updated>2026-09-07T19:31:04.655Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[The Efficiency Wall: Why the Next 1,000x Leap Isn’t More GPUs]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://pub.towardsai.net/the-efficiency-wall-why-the-next-1-000x-leap-isnt-more-gpus-bb956f83167b?source=rss-d1a9d12fe3fd------2"><img src="https://cdn-images-1.medium.com/max/2286/1*40Z3qrZWZGXAqXgyusiTMA.png" width="2286"></a></p><p class="medium-feed-snippet">The fundamental flaw in modern AI architecture, and the biological &#x201C;hack&#x201D; to solve it.</p><p class="medium-feed-link"><a href="https://pub.towardsai.net/the-efficiency-wall-why-the-next-1-000x-leap-isnt-more-gpus-bb956f83167b?source=rss-d1a9d12fe3fd------2">Continue reading on Towards AI »</a></p></div>]]></description>
            <link>https://pub.towardsai.net/the-efficiency-wall-why-the-next-1-000x-leap-isnt-more-gpus-bb956f83167b?source=rss-d1a9d12fe3fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb956f83167b</guid>
            <category><![CDATA[neuroscience]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[neuroplasticity]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Kapardhi kannekanti]]></dc:creator>
            <pubDate>Sun, 08 Feb 2026 15:38:16 GMT</pubDate>
            <atom:updated>2026-09-07T19:30:15.601Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[No Coding, just Flowing: How n8n Made Automation Effortless for Me]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@kapardhikannekanti/no-coding-just-flowing-how-n8n-made-automation-effortless-for-me-46e2d959e8bf?source=rss-d1a9d12fe3fd------2"><img src="https://cdn-images-1.medium.com/max/1400/0*VK8NuZiN6AvHall0.png" width="1400"></a></p><p class="medium-feed-snippet">Introduction</p><p class="medium-feed-link"><a href="https://medium.com/@kapardhikannekanti/no-coding-just-flowing-how-n8n-made-automation-effortless-for-me-46e2d959e8bf?source=rss-d1a9d12fe3fd------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@kapardhikannekanti/no-coding-just-flowing-how-n8n-made-automation-effortless-for-me-46e2d959e8bf?source=rss-d1a9d12fe3fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/46e2d959e8bf</guid>
            <category><![CDATA[n8n-workflow]]></category>
            <category><![CDATA[n8n-workflow-automation]]></category>
            <category><![CDATA[future-of-work]]></category>
            <category><![CDATA[agentic-workflow]]></category>
            <dc:creator><![CDATA[Kapardhi kannekanti]]></dc:creator>
            <pubDate>Sat, 12 Jul 2025 14:59:02 GMT</pubDate>
            <atom:updated>2025-07-12T14:59:02.372Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Multimodal Autonomous AI Agents: Enhancing Web Interactions Through Tree Search]]></title>
            <link>https://pub.towardsai.net/multimodal-autonomous-ai-agents-enhancing-web-interactions-through-tree-search-d2767bcaa36c?source=rss-d1a9d12fe3fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2767bcaa36c</guid>
            <category><![CDATA[uc-berkeley]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[agents]]></category>
            <dc:creator><![CDATA[Kapardhi kannekanti]]></dc:creator>
            <pubDate>Tue, 15 Apr 2025 17:55:44 GMT</pubDate>
            <atom:updated>2025-04-16T10:26:47.764Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*zPupWB9BEtocs1pqurHD0Q.png" /></figure><p>I’ve been thinking a lot about AI agents lately, those systems that can actually do things for us online instead of just answering questions. Last week, Professor Ruslan Salakhutdinov from CMU gave a Lecture that really got me excited about where this field is heading. His work on multimodal AI agents shows how these systems can navigate websites and handle tasks that we do every day.</p><h3>Why AI Agents Matter</h3><p>Ruslan started with a simple but powerful point: we spend tons of time doing boring tasks on our computers and phones. Think about all the clicking, searching, and form-filling we do every day. What if AI could handle these things for us?</p><p>Today’s language models are pretty smart. They can learn from examples, follow instructions, and even do things they weren’t specifically trained for. But to turn them into agents that can actually get stuff done for us online, they need extra abilities — especially the power to see and understand websites the way we do.</p><h3>How Web Agents Actually Work</h3><p>The part that got me leaning forward in my seat was when Salakhutdinov explained how these web agents are built. It’s not just one big AI — it’s several pieces working together:</p><ol><li><strong>Visual Understanding</strong>: The agent needs to “see” what’s on the screen</li><li><strong>HTML Processing</strong>: It needs to read the code behind the webpage</li><li><strong>Web Grounding</strong>: It has to connect what it sees with what it can do</li><li><strong>Language Model</strong>: This is the “brain” that makes decisions</li></ol><p>When these agents try to complete a task, they work in layers:</p><ul><li>First, they make a plan (like “I need to find the cheapest printer and buy it”)</li><li>Then, they figure out what they’re looking at (“this is a product listing page”)</li><li>Finally, they take specific actions (clicking a button or typing text)</li></ul><p>This is just like shopping online — we don’t just randomly click. we will have a plan, look around the page, and then click on what seems useful.</p><h3>The Big Problem: Mistakes Add Up Fast</h3><p>Here’s the main challenge these agents face, the “exponential error compounding” problem.</p><p>Imagine you’re following a recipe with 30 steps. If you have a 90% chance of getting each step right, you might think you’d do pretty well. But the math says otherwise — your chance of getting the whole recipe right drops to just 4.24%!</p><p>The same thing happens with AI agents. Even if they’re pretty good at each small step (clicking the right button, typing the right thing), when they have to do many steps in a row, they often fail. One small mistake early on can derail the whole process.</p><h3>Tree Search: The Clever Solution I Got Excited About</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_mdysfNSHyEBM2XHB2yeZw.png" /></figure><p>This is where the Lecture grabbed me — when Salakhutdinov explained how “tree search” can fix this problem. It’s like giving the AI the ability to try different paths and backtrack when it makes mistakes — just like we do!</p><p>Here’s how it works:</p><ol><li>The agent tries a few possible actions</li><li>It keeps track of how promising each path looks</li><li>If it hits a dead end, it goes back and tries something else</li><li>It keeps searching until it finds a solution that works</li></ol><p>What makes this cool is that it mimics how humans navigate websites. When we are looking for something and click the wrong button, we don’t give up — we just hit the back button and try something else.</p><p>The results were pretty amazing. When they added tree search to GPT-4o, its success rate on web tasks nearly doubled — from 17% to 26% on one benchmark. Llama models saw similar improvements.</p><p>Here’s how much better these agents got with tree search:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Sj4GLm14h5MRKjiOXbXmw.png" /></figure><p>A great example where an agent was trying to find and compare canned fruit products. When it made a wrong turn, instead of being stuck, it backtracked and found another way to complete the task. Just like a real person would!</p><h3>Why Agents Still Mess Up (and How We’ll Fix It)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*s0tM-2LFOtd9aLLhIwZClA.png" /></figure><p>How and why these agents still fail:</p><ul><li>Sometimes they get stuck in loops, bouncing between the same two pages</li><li>They might give up too early before finding the solution</li><li>They often click the wrong things because they misunderstand what they’re seeing</li><li>They struggle with spatial tasks like “find the product in the first row”</li></ul><p>But he was optimistic about solutions:</p><ul><li>Better ways to evaluate which paths are promising</li><li>Teaching agents to improve their strategies through experience</li><li>Figuring out when to make the base agent smarter versus when to let it explore more options</li><li>Making these systems work in real websites, not just in test environments</li></ul><p>I found myself nodding along, thinking about all the times I’ve watched someone struggle to navigate a website, making the same mistakes repeatedly. These AI solutions mirror how we teach each other to use technology.</p><h3>Training These Agents at Internet Scale</h3><p>The last part introduced a project called “Towards Internet-Scale Training For Agents” (InSTA). This part really got me thinking about practical applications.</p><p>Instead of paying humans to demonstrate thousands of web tasks (super expensive!), they’re using language models to generate realistic tasks across thousands of websites. For example:</p><ul><li>“Find a free WordPress theme for a personal blog”</li><li>“Look up the meaning of the Om symbol in ancient cultures”</li><li>“Compare prices of Nikon D850 and D500 cameras”</li></ul><p>Their process is simple but clever:</p><ol><li>Generate realistic tasks for different websites</li><li>Let agents try to complete them</li><li>Use another AI to check if they succeeded</li><li>Collect all this data to train better agents</li></ol><p>Agents trained this way learned much faster and could handle new websites they’d never seen before. This approach seems much more practical for creating agents that can work across the entire internet, not just a few test websites.</p><h3>What This Means For Our Future</h3><p>After sitting through Salakhutdinov’s Lecture, I couldn’t help but think about how these technologies might change my daily life. Imagine having an assistant that could actually book your flights, find the best deals, research topics for you, or fill out those annoying forms — all by understanding websites the way you do.</p><p>The tree search technique really stuck with me. It’s such a human approach to problem-solving — try something, see if it works, and if not, back up and try something else. By giving AI this ability to explore and recover from mistakes, we’re making them much more reliable for real-world tasks.</p><p>We’re still in the early days (success rates of 26% are better than 8%, but far from perfect), but the progress is happening fast. I think in a few years, we’ll look back at having to navigate websites ourselves as a weird chore from the past — like how we now view memorizing phone numbers.</p><p><em>This article discusses research by </em><a href="https://en.wikipedia.org/wiki/Ruslan_Salakhutdinov"><em>Professor Ruslan Salakhutdinov</em></a><em> from Carnegie Mellon University </em>presented as part of UCB’s <a href="https://llmagents-learning.org/sp25"><em>Advanced Large Language Model Agents MOOC for Spring 2025.</em></a></p><p><em>Passionate about AI, ML, and tech? Let’s connect and collaborate!<br></em><a href="https://x.com/kapardhi200903"><strong><em>Twitter</em></strong></a><strong>. </strong><a href="https://www.linkedin.com/in/kapardhi-kannekanti/"><strong><em>LinkedIn</em></strong></a><strong>. </strong><a href="http://github.com/kapardhi03"><strong><em>GitHub</em></strong></a><strong>. </strong><a href="/service/mailto:kapardhikannekanti@gmail.com"><strong><em>kapardhikannekanti@gmail.com</em></strong></a><strong><em>.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2767bcaa36c" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/multimodal-autonomous-ai-agents-enhancing-web-interactions-through-tree-search-d2767bcaa36c">Multimodal Autonomous AI Agents: Enhancing Web Interactions Through Tree Search</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DeepSeek’s AI Breakthrough: The Democratisation of Artificial Intelligence]]></title>
            <link>https://pub.towardsai.net/deepseeks-ai-breakthrough-the-democratisation-of-artificial-intelligence-b52b9b4f0dac?source=rss-d1a9d12fe3fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/b52b9b4f0dac</guid>
            <category><![CDATA[latest-tech-news]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[gen-ai-revolution]]></category>
            <dc:creator><![CDATA[Kapardhi kannekanti]]></dc:creator>
            <pubDate>Tue, 28 Jan 2025 16:12:57 GMT</pubDate>
            <atom:updated>2025-01-29T11:40:50.506Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eyeCtrDA-h_akZEq.jpeg" /></figure><p>A Chinese Company called Deepseek recently dropped a bombshell in the AI world with the new model called R1. Tech Experts are calling it AI’s “Sputnik moment”, a game-changer that could shake up how we build and use AI. Here’s the full story in plain English.</p><h3>The Secret Sauce: Smart Memory Usage</h3><p>Think of AI like a brain that needs memory to think. Most AI companies use a system that takes up lots of memory (32-bit), like writing everything in a really detailed way. DeepSeek did something clever — they used a lighter system (8-bit or FP8) that’s like writing in shorthand. Sure, you lose some details, but it works almost just as well. What’s the big deal? Well, DeepSeek trained their AI for just $5.6 million in three months. Compare that to U.S. companies spending billions — we’re talking about paying for a bicycle instead of a fleet of Ferraris.</p><h3>Dirt-Cheap AI Access</h3><p>Here’s where it gets interesting. DeepSeek is offering their API for peanuts — about 3% of what OpenAI charges for ChatGPT. Even when they raise prices, it’ll still be 75% cheaper than the competition. One developer ran 200,000 tests for just 50 cents — that’s cheaper than a cup of coffee.</p><h3>Power Without the Price Tag</h3><p>The cool part? This cheaper AI isn’t worse — it’s keeping up with the big boys like OpenAI and Google’s latest models. Even better, you don’t need a supercomputer to run it. While other AIs need massive data centers, DeepSeek’s model can run on a decent gaming PC, and smaller versions work on phones.</p><h3>Big Tech’s Reaction: Mixed Feelings</h3><p>The tech giants are scrambling to figure out what this means:</p><ul><li>Microsoft’s cloud business could make bank offering cheaper AI</li><li>Amazon Web Services (AWS) could host these efficient models</li><li>Apple’s M-series chips are perfect for running this kind of AI</li><li>Google might be sweating since their massive computing advantage matters less now</li></ul><h3>Open Source vs. Proprietary</h3><p>Meta’s AI chief dropped some truth: this isn’t just about China vs. USA — it’s about open source (shared code) vs. closed source (secret code). DeepSeek built on public research and shared their work back. It’s like they used everyone’s recipes to make a better dish, then shared their improved recipe with the world.</p><h3>What This Means for the Future</h3><p>The cost of high-level AI has crashed — we’re talking a 1000x price drop in 18 months. That’s like a $30,000 car suddenly costing $30. When tools get this cheap, crazy things happen.</p><p>Remember when cloud storage was expensive and we counted every megabyte? Now we upload countless photos without thinking. The same thing’s happening with AI — as it gets cheaper, we’ll use it everywhere.</p><h3>More Efficiency = More Usage</h3><p>There’s a funny effect in tech called “Jevons Paradox” — when something gets more efficient and cheaper, people don’t use less of it — they use way more. It’s like when Netflix made watching movies super easy — people didn’t watch less, they binged more than ever.</p><h3>The Bottom Line</h3><p>DeepSeek just kicked down the door to the AI club. Before, only tech giants could play with the best AI. Now? Any developer with a decent computer can join in. It’s like moving from expensive mainframe computers to personal PCs — suddenly everyone can innovate.</p><p>The real winner here isn’t any single company — it’s everyone who wants to use AI. The technology is becoming a utility, like electricity or internet access. We’re not just talking about cheaper versions of what we already have — we’re talking about entirely new possibilities.</p><p>As costs drop and access grows, the next big AI breakthrough might come from a college student’s laptop rather than a tech giant’s data center. The AI race isn’t about who has the biggest computer anymore — it’s about who can use these tools in the smartest way.</p><p>Find the repository <a href="https://github.com/deepseek-ai/DeepSeek-R1">here</a>!</p><p><em>Passionate about AI, ML, and tech? Let’s connect and collaborate!<br></em><a href="https://x.com/kapardhi200903"><strong><em>Twitter</em></strong></a><strong>. </strong><a href="https://www.linkedin.com/in/kapardhi-kannekanti/"><strong><em>LinkedIn</em></strong></a><strong>. </strong><a href="http://github.com/kapardhi03"><strong><em>GitHub</em></strong></a><strong>. </strong><a href="/service/mailto:kapardhikannekanti@gmail.com"><strong><em>kapardhikannekanti@gmail.com</em></strong></a><strong><em>.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b52b9b4f0dac" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/deepseeks-ai-breakthrough-the-democratisation-of-artificial-intelligence-b52b9b4f0dac">DeepSeek’s AI Breakthrough: The Democratisation of Artificial Intelligence</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CAG — A New Paradigm in Knowledge-enhanced LLM’s]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://blog.gopenai.com/cag-a-new-paradigm-in-knowledge-enhanced-llms-0e7e6fef6888?source=rss-d1a9d12fe3fd------2"><img src="https://cdn-images-1.medium.com/max/1560/1*Zwt81l9sQN6zx9eWyuhdvA.png" width="1560"></a></p><p class="medium-feed-snippet">A Late Night Discovery</p><p class="medium-feed-link"><a href="https://blog.gopenai.com/cag-a-new-paradigm-in-knowledge-enhanced-llms-0e7e6fef6888?source=rss-d1a9d12fe3fd------2">Continue reading on GoPenAI »</a></p></div>]]></description>
            <link>https://blog.gopenai.com/cag-a-new-paradigm-in-knowledge-enhanced-llms-0e7e6fef6888?source=rss-d1a9d12fe3fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/0e7e6fef6888</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <dc:creator><![CDATA[Kapardhi kannekanti]]></dc:creator>
            <pubDate>Thu, 09 Jan 2025 04:20:26 GMT</pubDate>
            <atom:updated>2025-01-10T11:23:40.515Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Beyond Trial and Error: How Neural Networks Elevate Deep Reinforcement Learning.]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://pub.towardsai.net/beyond-trial-and-error-how-neural-networks-elevate-deep-reinforcement-learning-89a17cfa6f5e?source=rss-d1a9d12fe3fd------2"><img src="https://cdn-images-1.medium.com/max/600/0*HwoPUlt1VsheqmFk.jpg" width="600"></a></p><p class="medium-feed-snippet">Revisiting Multi-Arm Bandits</p><p class="medium-feed-link"><a href="https://pub.towardsai.net/beyond-trial-and-error-how-neural-networks-elevate-deep-reinforcement-learning-89a17cfa6f5e?source=rss-d1a9d12fe3fd------2">Continue reading on Towards AI »</a></p></div>]]></description>
            <link>https://pub.towardsai.net/beyond-trial-and-error-how-neural-networks-elevate-deep-reinforcement-learning-89a17cfa6f5e?source=rss-d1a9d12fe3fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/89a17cfa6f5e</guid>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[deepreinforcementlearning]]></category>
            <dc:creator><![CDATA[Kapardhi kannekanti]]></dc:creator>
            <pubDate>Wed, 16 Oct 2024 14:11:12 GMT</pubDate>
            <atom:updated>2024-10-16T17:10:47.875Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Deep Generative Modeling: The Foundation of Modern Generative AI]]></title>
            <link>https://medium.com/@kapardhikannekanti/deep-generative-modeling-the-foundation-of-modern-generative-ai-b5a8c051cd73?source=rss-d1a9d12fe3fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/b5a8c051cd73</guid>
            <category><![CDATA[generative-adversarial]]></category>
            <category><![CDATA[autoencoder]]></category>
            <category><![CDATA[variational-autoencoder]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Kapardhi kannekanti]]></dc:creator>
            <pubDate>Mon, 09 Sep 2024 19:39:04 GMT</pubDate>
            <atom:updated>2024-09-11T08:30:15.798Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*glChpOyK7jWOCiGX5iruXw.png" /></figure><h3>Introduction</h3><p>In recent years, the tech world has been abuzz with talk of &quot;Generative AI&quot; or &quot;GenAI.&quot; It&#39;s important to understand that Generative AI is not a standalone technology but rather a subset and practical application of a broader field in machine learning: Deep Generative Modeling.</p><p>This relationship is similar to how “artificial intelligence” is often used in industry to refer to practical applications, while the term “machine learning” describes the broader set of techniques and approaches that enable these applications. In the same way, Generative AI (GenAI) represents the practical, often commercial, implementation of Deep Generative Modeling techniques.</p><p>In this article, we’ll explore the foundations of Deep Generative Modeling, focusing on key concepts like Autoencoders and Variational Autoencoders (VAEs). We’ll see how these fundamental ideas translate into the Generative AI applications that are transforming industries today. By understanding this relationship, we can better appreciate the science behind the AI revolution and anticipate future developments in this rapidly evolving field.</p><h3>Understanding Deep Generative Models</h3><p>Deep Generative Models are a class of machine learning models designed to learn the underlying distribution of data and generate new samples from it. These models don’t just memorize data; they understand its structure, enabling them to create new, original content that resembles the training data.<br><strong>The Role of Latent Variables</strong><br>At the heart of many deep generative models is the concept of latent variables.Latent variables are hidden or unobserved variables that capture the underlying structure of the observed data. They represent the essence or the most important features of the data in a compressed form. This concept is fundamental to how deep generative models work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/1*y7V-QTq8FM3I7VVh96qpaA.jpeg" /></figure><p>The concept of latent variables is evident across different types of deep generative models:<br>In <strong>Autoencoders</strong>: The compressed representation in the middle layer can be viewed as a set of latent variables.<br>In <strong>VAEs</strong>: The model explicitly learns a distribution over latent variables.<br>In <strong>GANs</strong>: While not as explicit, the input to the generator network can be interpreted as a set of latent variables.</p><h3>Autoencoders: Building Blocks of Generative AI</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*yPPyyJFNWP7FVj08aHvH4Q.png" /><figcaption>Auto-Encoder</figcaption></figure><p>Autoencoders are specialized class of algorithms that can learn to compress data into a lower-dimensional representation from unlabeled training data and then reconstruct it. It is an unsupervised approach and is crucial because it allows the model to discover patterns in data without explicit labels.</p><p>The process involves two main components:</p><ol><li><strong>An encoder</strong> that compresses the input data into a lower-dimensional representation, often called the latent space or bottleneck.</li><li><strong>A decoder</strong> that attempts to reconstruct the original data from this compressed representation.</li></ol><p>The goal is to train the model to use these learned features to reconstruct the original data as accurately as possible. This is typically done by minimizing a loss function:</p><blockquote><strong>L(x, x̂) = ||x — x̂||²</strong></blockquote><p><em>Where x is the original input and x̂ is the reconstructed output.<br>but in practice, this could also be cross-entropy or other measures, depending on the nature of the data (for example, binary data might use binary cross-entropy)</em></p><p>Autoencoders are efficient because they force the model to learn the most important features of the data.<br>but why? For efficiency. This efficiency comes from the dimensionality reduction in the latent space, which acts as an information bottleneck, compelling the model to capture the most salient aspects of the data.</p><p>The ability of autoencoders to learn meaningful representations from unlabeled data makes them particularly valuable in scenarios where labelled data is scarce or expensive to obtain. Moreover, the lower-dimensional representations learned by autoencoders can be useful for various downstream tasks, including data compression, anomaly detection, and as a pre-training step for other machine learning models.</p><h3>Variational Autoencoders (VAEs): Advancing Generative Capabilities</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jiZFHF1nFJqDau0c5eIPBg.jpeg" /><figcaption>Variational Autoencoder</figcaption></figure><p>Variational Autoencoders (VAEs) introduce a probabilistic twist to autoencoders. VAEs learn to map input data to a distribution in a latent space, rather than to a fixed vector.</p><p>The loss function for VAEs is more complex:</p><p><strong>L(φ,θ,x) = (reconstruction loss) + (regularization term)</strong></p><p>This can be expanded to:</p><p><strong>L(φ,θ,x) = ||x — x̂||² + D(q_φ(z|x)||p(z))</strong></p><p>Where the second term is a regularization term based on the Kullback-Leibler (KL) divergence.</p><h4>The Math Behind VAEs: KL Divergence and Regularization</h4><p>A key component in the VAE loss function is the Kullback-Leibler (KL) divergence. “KL-divergence: just measures how close two values are distribution”. More precisely, KL divergence measures the difference between two probability distributions. In the context of VAEs, it’s used to ensure that the learned latent space distribution is close to a predefined prior distribution, typically a standard normal distribution.<br>The KL divergence term in the VAE loss function can be expressed as:</p><p>For a normal Gaussian distribution:</p><p><strong>KL = -1/2 Σ(σ_j + μ_j² - 1 - log σ_j)</strong></p><p><em>Where μ_j and σ_j are the mean and standard deviation of the encoded distribution for each dimension j.</em></p><h4>Goals of Regularization</h4><p>The inclusion of the KL divergence term serves several important purposes:</p><ol><li>&quot;<strong>Continuity</strong>: Similar content after decoding&quot;</li><li>&quot;<strong>Completeness</strong>: meaningful content after decoding&quot;</li></ol><p>These properties ensure that the latent space is well-structured and that interpolations in this space produce meaningful results. The regularization encourages the model to learn a smooth and continuous latent space, where similar points in the latent space correspond to similar data points in the input space.</p><p><strong>Latent Perturbation and Disentanglement</strong><br>An important concept in the study of VAEs is latent perturbation, which involves making small changes in the latent space to observe their effects on the generated output. This is closely related to the idea of disentanglement. Disentanglement refers to learning a latent representation where individual latent variables correspond to distinct, interpretable features of the data. Our notes mention:</p><blockquote>“Latent Perturbations: Disentanglement β &gt; 1: More stable”</blockquote><p>This refers to a variant of VAEs called β-VAE, where the KL divergence term is weighted by a factor β. When β &gt; 1, it puts more emphasis on the regularization term, which can lead to more disentangled representations. The loss function for β-VAE can be written as:</p><p><strong>L = reconstruction_loss + β * KL_divergence</strong></p><p>The note “More stable” suggests that higher β values can lead to more stable and consistent latent representations, although finding the right balance is often an empirical process depending on the specific dataset and application.</p><h3>Generative Adversarial Networks (GANs): A New Paradigm</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*4gFqsO173hplJenBwNFdbw.png" /></figure><p>While autoencoders and VAEs have been instrumental in advancing generative AI, Generative Adversarial Networks (GANs) have brought about a paradigm shift in the field. GANs, introduced by Ian Goodfellow and colleagues in 2014, consist of two neural networks:</p><ol><li>A Generator network that creates new data instances</li><li>A Discriminator network that evaluates them for authenticity</li></ol><p>These two networks are trained simultaneously in a game-theoretic framework. The generator tries to produce fake data that can fool the discriminator, while the discriminator tries to distinguish between real and fake data.</p><blockquote><strong>The Police and Thief Analogy</strong><br>To understand how GANs work, imagine a game of cat and mouse between a master thief (the Generator) and a detective (the Discriminator):</blockquote><blockquote>The Thief (Generator) starts by creating counterfeit money. Initially, the fake bills are crude and easy to spot.</blockquote><blockquote>The Detective (Discriminator) examines both real and counterfeit money, learning to distinguish between them.</blockquote><blockquote>As the Detective gets better at spotting fakes, the Thief must improve their counterfeiting skills to create more convincing forgeries.</blockquote><blockquote>This back-and-forth continues, with the Thief constantly trying to fool the Detective, and the Detective becoming increasingly skilled at spotting even the tiniest flaws.</blockquote><blockquote>Eventually, the Thief becomes so skilled that their counterfeit money is nearly indistinguishable from the real thing.</blockquote><p>In this analogy, the counterfeit money represents the generated data, while the real money represents the training data. The constant competition drives both the Thief and the Detective to improve, just as the Generator and Discriminator in a GAN push each other to higher levels of performance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bovI1fuwP9S9BekhlBoNWA.jpeg" /></figure><p><em>Simply the ‘</em><strong><em>G</em></strong><em>’(generator) tries to synthesise the fake instances that fool </em><strong><em>‘D’,</em></strong></p><p><em>whereas </em><strong><em>‘D’</em></strong><em> tries to identify the synthesized instances.</em></p><p>GANs have been particularly successful in generating highly realistic images, often surpassing the quality of those produced by VAEs. They work by transforming Gaussian noise into data that matches the target data manifold:</p><p><strong>Gaussian Noise -&gt; Target Data Manifold</strong></p><h3>Cycle GANs: Unpaired Image-to-Image Translation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*M6V_iEapXya4Kd0bMCWzKw.jpeg" /></figure><p>Cycle GANs extend the GAN framework to handle unpaired image-to-image translation. This means they can learn to translate between two domains (e.g., horses to zebras) without needing paired examples.</p><p>Cycle GANs use two generators and two discriminators, along with a cycle consistency loss. This ensures that an image translated from domain A to B and back to A should closely resemble the original image.</p><p>Cycle GANs have enabled impressive applications like style transfer and domain adaptation. They work by learning a mapping between two data manifolds:</p><p><strong>Data manifold X -&gt; Data manifold Y</strong></p><p>This allows for remarkable transformations, such as converting summer landscapes to winter scenes or voice imitation etc.</p><h3>Conclusion</h3><p>Deep Generative Modeling, through techniques like Autoencoders, VAEs, GANs, and Cycle GANs, provides the theoretical and practical foundation for modern Generative AI. By learning to capture and manipulate complex data distributions, these models enable the creation of new, original content that pushes the boundaries of artificial creativity and problem-solving.</p><p><em>Passionate about AI, ML, and tech? Let’s connect and collaborate!<br></em><a href="https://x.com/kapardhi200903"><strong><em>Twitter</em></strong></a><strong>. </strong><a href="https://www.linkedin.com/in/kapardhi-kannekanti/"><strong><em>LinkedIn</em></strong></a><strong>. </strong><a href="http://github.com/kapardhi03"><strong><em>GitHub</em></strong></a><strong>. </strong><a href="/service/mailto:kapardhikannekanti@gmail.com"><strong><em>kapardhikannekanti@gmail.com</em></strong></a><strong><em>.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5a8c051cd73" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Neural Network From Scratch: The Long Short-Term Memory Network]]></title>
            <link>https://medium.com/@kapardhikannekanti/building-a-neural-network-from-scratch-the-long-short-term-memory-network-90d35a05b2af?source=rss-d1a9d12fe3fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/90d35a05b2af</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[lstm-networks]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Kapardhi kannekanti]]></dc:creator>
            <pubDate>Mon, 26 Aug 2024 14:56:42 GMT</pubDate>
            <atom:updated>2024-08-26T14:56:42.748Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*GYQMp9OzN1-6a8k_rzVK9Q.jpeg" /></figure><h3>Introduction</h3><p>Long Short-Term Memory (LSTM) networks are one of the most well-known types of recurrent neural networks (RNNs), introduced by <a href="https://en.wikipedia.org/wiki/J%C3%BCrgen_Schmidhuber"><em>Jürgen Schmidhuber</em></a> and <a href="https://en.wikipedia.org/wiki/Sepp_Hochreiter"><em>Sepp Hochreiter</em></a> to address the vanishing gradient problem in sequence modeling. LSTMs have become crucial in many AI systems, such as Apple’s Siri, for learning long-term dependencies in data.</p><p>While many developers use high-level libraries like TensorFlow or PyTorch to leverage LSTMs, understanding the underlying mechanics can be immensely beneficial. In this article, I’ll walk you through building a custom LSTM from scratch using only Python and NumPy, shedding light on the inner workings of these powerful networks.</p><h3>Background on Vanilla RNNs vs. LSTMs</h3><h4>Vanilla RNNs</h4><p>Vanilla RNNs have a simple architecture with a single memory cell known as the hidden state (HS). This hidden state retains short-term information from previous time steps, making RNNs distinct from other neural networks. However, Vanilla RNNs struggle with long-term dependencies due to the vanishing gradient problem.</p><h4>LSTMs</h4><p>LSTMs extend the capabilities of Vanilla RNNs by introducing an additional memory cell called the cell state (CS). The cell state is designed to maintain long-term information, while the hidden state continues to capture short-term patterns. LSTMs also incorporate several gates (forget, input, output, and candidate gates) to control the flow of information, allowing the network to decide what to keep, update, or discard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*mg5ypAF6N8MimuBWtM21rA.png" /></figure><h3>Building the LSTM from Scratch</h3><h4>Why Build a Custom LSTM?</h4><p>Constructing an LSTM from scratch using only Python and NumPy allows for a granular understanding of its operations. By coding each component explicitly, you gain insights into the inner workings of LSTMs, making this approach ideal for research purposes and for those seeking to master sequence modeling.</p><h4>Core Components</h4><ol><li><strong>Initialization</strong>: The LSTM’s parameters, including the weights for each gate and the biases, are initialized. For instance, the Xavier initialization method is employed for the weights to ensure stable training.</li><li><strong>Forward Pass</strong>: During the forward pass, the LSTM calculates activations for the forget, input, and output gates. The cell state is updated using a combination of the previous cell state and the new candidate values, controlled by the forget and input gates. The hidden state is then derived from the updated cell state and the output gate.</li><li><strong>Backpropagation Through Time (BPTT)</strong>: BPTT is used to calculate gradients for each parameter by unrolling the network across time steps. The gradients are accumulated over time, and then the model parameters are updated using these gradients. This is similar to BackPropogation in Traditional Neural Nets.</li><li><strong>Optimization</strong>: A gradient descent optimizer is used to adjust the model parameters, guided by the gradients computed during backpropagation.</li></ol><h3>Understanding the LSTM Gates</h3><h4>Forget Gate</h4><p>The forget gate decides which information in the cell state should be discarded. It uses a sigmoid activation function to produce values between 0 and 1, which are then multiplied with the current cell state to retain or forget specific information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IeAWvyfLScOL7fmxXMqnvg.png" /></figure><h4>Candidate Gate</h4><p>The candidate gate generates potential updates to the cell state. It applies a tanh activation function to combine the input with the previous hidden state, producing new candidate values that may be added to the cell state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yhYNRZMSXmaXJLXUv4Wbhg.png" /></figure><h4>Input Gate</h4><p>The input gate decides how much of the candidate information should be added to the cell state. It also uses a sigmoid function, similar to the forget gate, to control the addition of new information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4nPVEW21V3QN7lT7W6ozMg.png" /></figure><h4>Output Gate</h4><p>The output gate determines what information from the cell state should be passed to the hidden state. This hidden state is then used in the next time step or as the final output of the network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7TPRAZtnqx8myKm6hWRzIw.png" /></figure><h3>What is Cell State?</h3><p>The cell state acts as a conveyor belt of information flowing through entire sequence. This Allows the information to flow through network with minimal alteration, addressing Vanishing Gradient Problem.<br>Cell State mechanism is regulated by LSTM Gates.</p><h4>Equations for the cell state, candidate cell state and the hidden state(final output):</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CIruKaTj5pmPMkrdUXO07g.png" /></figure><h3>Performance and Evaluation</h3><p>The custom LSTM was tested on a sequence prediction task, where it was trained to predict the Sinusoidal Wave. Despite being implemented from scratch, the model successfully learned patterns in the data, achieving competitive accuracy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jWcqa6TH7163HQmWSxe7tw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9rBy7vRKaKUrH64U5Kvd2A.png" /></figure><h3>Challenges and Solutions</h3><h4>Vanishing and Exploding Gradients</h4><p>While LSTMs are designed to mitigate the vanishing gradient problem, the exploding gradient problem can still occur. To address this, gradient clipping is applied during backpropagation, ensuring that the gradients stay within a reasonable range.</p><h4>Training Time</h4><p>Without the optimizations provided by libraries like TensorFlow, training a custom LSTM can be slow. To improve efficiency, mini-batch gradient descent is used, which accelerates learning by updating the model parameters more frequently.</p><h4>Hyperparameter Tuning</h4><p>Selecting the right hyperparameters, such as the learning rate and the number of hidden units, is crucial. These were fine-tuned through experimentation, balancing training speed with model accuracy.</p><h3>Conclusion</h3><p>Building a custom LSTM from scratch was a challenging yet rewarding experience. It provided a deeper understanding of the LSTM architecture and its components, which is invaluable for both research and practical applications. This hands-on approach offers insights that are often abstracted away by high-level libraries.</p><h3>Future Work</h3><p>Future improvements could include optimizing the backpropagation process, experimenting with different activation functions, and applying this custom LSTM to more complex datasets, such as those used in natural language processing.</p><h3>Appendix</h3><blockquote>The full code for this custom LSTM implementation is available <a href="https://github.com/kapardhi03/ML/tree/main/DL/LSTM">here</a> . Feel free to explore the code and experiment with it on your own datasets.</blockquote><blockquote>This is a high-level overview of the custom LSTM class. The <em>forward</em> function processes the input data through the LSTM’s gates, while the <em>backward</em> function handle backpropagation through time. The training loop is responsible for iterating over the dataset, updating the model’s weights.</blockquote><p><em>Passionate about AI, ML, and tech? Let’s connect and collaborate!<br></em><a href="https://x.com/kapardhi200903"><strong><em>Twitter</em></strong></a><strong>. </strong><a href="https://www.linkedin.com/in/kapardhi-kannekanti/"><strong><em>LinkedIn</em></strong></a><strong>. </strong><a href="http://github.com/kapardhi03"><strong><em>GitHub</em></strong></a><strong>. </strong><a href="/service/mailto:kapardhikannekanti@gmail.com"><strong><em>kapardhikannekanti@gmail.com</em></strong></a><strong><em>.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=90d35a05b2af" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Contextual Bandits: Advanced Decision-Making in Machine Learning]]></title>
            <link>https://medium.com/@kapardhikannekanti/understanding-contextual-bandits-advanced-decision-making-in-machine-learning-85c7c20417d7?source=rss-d1a9d12fe3fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/85c7c20417d7</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[reinforcement-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Kapardhi kannekanti]]></dc:creator>
            <pubDate>Wed, 14 Aug 2024 22:15:54 GMT</pubDate>
            <atom:updated>2024-09-04T05:42:08.691Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>The Multi-Armed Bandit (MAB) problem is a classic dilemma in probability theory and decision-making. In this scenario, an agent must choose between multiple options (arms) without knowing the exact payoffs of each choice, all while learning over time to maximize rewards.</p><p>Contextual Bandits extend the MAB framework by incorporating additional contextual information that influences the rewards associated with each action.</p><p>For instance, Netflix employs Contextual Bandits to enhance its movie recommendation system by taking into account user preferences and viewing history to suggest personalized content.</p><p><strong><em>Explore the practical implementation using Pytorch </em></strong><a href="https://github.com/kapardhi03/RL/blob/main/CB/Contextual_bandits.ipynb"><strong><em>here</em></strong></a><strong><em>!!</em></strong></p><h3>2. What are Contextual Bandits?</h3><p>Contextual Bandits can be defined through three key components:</p><ul><li><strong><em>S </em></strong>:- A set of possible states or contexts, which are often unknown distributions that represent the circumstances under which decisions are made.</li><li><strong><em>A </em></strong>:- A set of actions or arms available to the agent.</li><li><strong><em>R </em></strong>:- The unknown reward distribution, which is contingent on both the state and the action chosen.</li></ul><h3>Differentiation from Traditional MAB and Supervised Learning</h3><p>Contextual Bandits differ from traditional MAB problems in that they allow for additional context information to inform action selection. Unlike supervised learning which relies on labeled data for training, Contextual Bandits must learn from interactions in real-time, often making decisions in an online setting.</p><p>Various names for this class of algorithms include contextual decision systems or context-sensitive bandits, highlighting the importance of context in enhancing decision-making processes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*d9xd1T6lknlrHbWrzyX7hQ.png" /></figure><h3>3. The Contextual Bandit Process</h3><p>The Contextual Bandit process unfolds as follows:</p><ol><li><strong>Context Generation</strong>: The environment generates a context/state <br><strong><em>st</em></strong>​ ∈ <strong><em>S</em></strong>.</li><li><strong>Action Selection</strong>: The agent uses the context to select an action <br><strong><em>at</em></strong>​∈<strong><em>A</em></strong>.</li><li><strong>Reward Feedback</strong>: The environment provides a reward <br><strong><em>rt</em></strong>​∈<strong><em>R</em>(<em>st</em>​,<em>at</em>​).</strong></li></ol><p>The overarching goal is to maximize cumulative rewards over time, requiring a strategic balance between exploration of new actions and exploitation of known rewarding actions.</p><h3>4. Algorithms for Contextual Bandits</h3><h3>4.1 Epsilon-Greedy</h3><p>The Epsilon-Greedy algorithm chooses the best-known action with probability <strong>1−<em>ϵ</em></strong> and explores a random action with probability <strong><em>ϵ</em></strong>.</p><ul><li><strong>Pros</strong>: Simple and effective for many problems.</li><li><strong>Cons</strong>: The performance is highly dependent on the choice of <strong><em>ϵ</em></strong><em> </em>; a fixed <strong><em>ϵ</em></strong> may lead to suboptimal exploration.</li></ul><pre>Initialize:  <br>    For each arm a:  <br>        Q(a) = 0          // Estimated value of arm a  <br>        N(a) = 0          // Number of times arm a was pulled  <br>    ε = exploration rate (e.g., 0.1)  <br><br>for t = 1 to T:                // Loop over time steps  <br>    With probability 1 - ε:    // Exploitation  <br>        a_t = argmax_a Q(a)   // Select the arm with the highest estimated value  <br>    With probability ε:         // Exploration  <br>        a_t = random arm       // Select a random arm  <br><br>    Pull arm a_t and observe reward r_t  <br>    N(a_t) = N(a_t) + 1        // Increment the count for selected arm a_t  <br>    Q(a_t) = Q(a_t) + (1 / N(a_t)) * (r_t - Q(a_t)) // Update the estimated value  <br><br>End for</pre><h3>4.2 Upper Confidence Bound (UCB)</h3><p>The UCB algorithm selects actions based on upper confidence bounds on the estimated reward for each action.</p><ul><li><strong><em>Pseudocode</em></strong>:</li></ul><pre>for each action a:  <br>    score[a] = mean_reward[a] + confidence_interval[a]  <br>select a = argmax(score)  </pre><ul><li><strong>Differences from MAB</strong>: Contextual UCB incorporates the feature vector associated with each context to update the upper confidence bounds.</li></ul><h3>4.3 Thompson Sampling</h3><p>Thompson Sampling applies Bayesian updates to model uncertainty regarding action rewards and samples from posterior distributions.</p><ul><li>Pseudocode:</li></ul><pre>for each action a:  <br>    sample from posterior distribution p(r | a, s_t)  <br>select a = argmax(sampled_rewards)</pre><ul><li><strong>Differences from MAB</strong>: In the contextual setup, the agent updates its belief about reward distributions based on both the state and the action taken.</li></ul><h3>5. Challenges in Contextual Bandits</h3><p>Several challenges arise when implementing Contextual Bandit algorithms:</p><ul><li><strong>Partial Information Problem</strong>: The agent may not receive complete feedback, complicating learning processes.</li><li><strong>Exploration-Exploitation Trade-off</strong>: Balancing the need to explore new actions while exploiting known rewarding ones remains a critical challenge.</li><li><strong>Adapting to Changing Contexts</strong>: Environments may evolve over time, requiring algorithms to remain robust and adaptable to new information.</li></ul><h3>6. Evaluation Metrics</h3><p>Evaluation of Contextual Bandit algorithms typically revolves around two key metrics:</p><ul><li><strong>Regret</strong>: A measure of the difference between the cumulative rewards of the optimal strategy and the strategy employed by the agent, crucial for assessing performance.</li><li><strong>Cumulative Reward</strong>: Total reward accumulated over time, providing a straightforward performance indicator.</li></ul><h3>7. Practical Implementation</h3><p>Implementing Contextual Bandit algorithms can present multiple challenges, such as:</p><ul><li><strong>Scalability</strong>: Managing large datasets and high-dimensional contexts.</li><li><strong>Data Sparsity</strong>: Limited feedback for certain actions or states.</li><li><strong>Performance Comparison</strong>: Often visualized through graphs depicting reward over time for different algorithms.</li></ul><h3>Early Stopping</h3><p>Early stopping methods can be deployed to halt the algorithm when cumulative rewards stagnate, optimizing computational efficiency.</p><h3>8. Real-world Applications</h3><p>Contextual Bandits have practical applications in various domains:</p><ul><li><strong>Expanded Netflix Example</strong>: Beyond basic recommendations, Netflix may also consider time of day and user demographics to optimize engagement.</li><li><strong>Personalized Advertising</strong>: Leveraging user behavior to optimize ad placements and maximize click-through rates.</li><li><strong>Dynamic Content Recommendation</strong>: Platforms like news apps use contextual information to personalize article suggestions based on user preferences.</li></ul><h3>9. Future Directions and Research</h3><p>Current research in Contextual Bandits focuses on:</p><ul><li><strong>Scalability</strong>: Designing algorithms that efficiently handle large-scale contexts and actions.</li><li><strong>Bayesian Approaches</strong>: Incorporating robust probabilistic models to enhance decision-making under uncertainty.</li><li><strong>Algorithm Variants</strong>: Developing new algorithms that combine strengths from existing methods or leverage deep learning.</li></ul><p>Potential improvements include enhancing adaptability to dynamic environments and addressing ethical considerations in implementing recommendation systems.</p><h3>Conclusion</h3><p>Contextual Bandits represent a significant advancement in decision-making processes within machine learning, bridging exploration and exploitation with contextual insights. Their importance is underscored by their ability to improve personalization and optimize outcomes in various applications.</p><h3>References and Further Reading</h3><p>To further explore Contextual Bandits and their applications, consider the following resources:</p><ul><li><strong>Referral Article 1</strong>: <a href="https://awjuliani.medium.com/simple-reinforcement-learning-with-tensorflow-part-0-q-learning-with-tables-and-neural-networks-d195264329d0"><em>Simple Reinforcement Learning with TensorFlow</em></a></li><li><strong>Referral Article 2:</strong> <a href="https://towardsdatascience.com/contextual-bandits-and-reinforcement-learning-6bdfeaece72a"><em>Contextual Bandits and Reinforcement Learning</em></a></li><li><strong>Multi-Armed Bandit</strong>: <a href="https://medium.com/@kapardhikannekanti/everything-you-need-to-know-about-the-multi-armed-bandit-cdd0c85a9835"><em>Everything You Need to Know About the Multi-Armed Bandit</em></a></li><li><strong>For More Exploration</strong>: <a href="https://www.microsoft.com/en-us/research/project/multi-world-testing-mwt/details/"><em>MWT White Paper</em></a></li></ul><p><em>Passionate about AI, ML, and tech? Let’s connect and collaborate!<br></em><a href="https://x.com/kapardhi200903"><strong><em>Twitter</em></strong></a><strong>. </strong><a href="https://www.linkedin.com/in/kapardhi-kannekanti/"><strong><em>LinkedIn</em></strong></a><strong>. </strong><a href="http://github.com/kapardhi03"><strong><em>GitHub</em></strong></a><strong>. </strong><a href="/service/mailto:kapardhikannekanti@gmail.com"><strong><em>kapardhikannekanti@gmail.com</em></strong></a><strong><em>.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85c7c20417d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>