<?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 Susan Apfel on Medium]]></title>
        <description><![CDATA[Stories by Susan Apfel on Medium]]></description>
        <link>https://medium.com/@susan.apfel?source=rss-13dd82bb11f0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Susan Apfel on Medium</title>
            <link>https://medium.com/@susan.apfel?source=rss-13dd82bb11f0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 01:36:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@susan.apfel/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 Anthropic Leak Was Preventable — But the Fix Isn’t More Rules]]></title>
            <link>https://medium.com/data-science-collective/the-anthropic-leak-was-preventable-but-the-fix-isnt-more-rules-b33ae462c237?source=rss-13dd82bb11f0------2</link>
            <guid isPermaLink="false">https://medium.com/p/b33ae462c237</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Susan Apfel]]></dc:creator>
            <pubDate>Mon, 06 Apr 2026 08:09:18 GMT</pubDate>
            <atom:updated>2026-04-06T18:31:12.250Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nKl-UzEpT9pvwDLdKaC4mA.png" /></figure><p>On March 31, 2026, Anthropic reportedly exposed large portions of Claude Code to the public npm registry. Estimates suggest over 500,000 lines of TypeScript across thousands of files were unintentionally included.</p><p>The cause wasn’t a sophisticated exploit. It was a source map file that should never have been published — bundled into the package and shipped without being noticed.</p><p>By the time the release was pulled, it had already been mirrored, forked, and archived. This wasn’t a one-off failure. It was a predictable outcome of how publishing workflows work today.</p><h3>The Pattern We Keep Repeating</h3><p>Anthropic isn’t unique here. This class of mistake shows up everywhere: debug artifacts accidentally shipped, .env files included in packages, test data leaking into production builds, source maps exposing internal logic.</p><p>These aren’t edge cases. They’re what happens when we rely on configuration to control something we never directly inspect.</p><p>In npm, what gets published is typically defined by .npmignore or the files field in package.json. These are configured before the final artifact exists. We define intent early — and then assume the build output matches it.</p><p>But build tools evolve. Defaults change. Outputs drift. New files appear. And nothing in the workflow requires us to review the actual artifact before it is published.</p><p>Yes, commands like npm pack --dry-run exist, and they&#39;re genuinely useful for a quick glance at package contents. But a dry run is optional, has no memory of what the previous release contained, requires no decision from the developer, and leaves no record that a review happened. It answers &quot;what&#39;s in here?&quot; without ever asking &quot;do you approve this?&quot;</p><p>Hope is not a security property.</p><h3>A Missing Primitive</h3><p>If we step back, something is clearly absent.</p><p>Modern software systems already rely on stronger guarantees: reproducible builds, signed artifacts, provenance tracking, supply chain verification. GitHub’s <a href="https://docs.github.com/en/actions/security-for-github-actions/using-artifact-attestations">artifact attestations</a>, for example, create a verifiable link between an artifact and how it was built — establishing provenance at the build level using Sigstore and the SLSA framework.</p><p>But there’s a gap. These systems verify <em>where an artifact came from</em>. They don’t verify <em>whether the artifact’s contents were reviewed before release</em>.</p><p>That’s a different problem. And right now, for most package publishing workflows, it’s largely unsolved.</p><h3>Proposal: Artifact Review + Attestation</h3><p>A more robust publishing model can be described in four steps:</p><p><strong>1. Treat the artifact as the source of truth.</strong> Not the source tree. Not configuration files. The final packaged artifact — the tarball that npm pack actually generates — is what matters. If it&#39;s in the tarball, it ships.</p><p><strong>2. Require explicit human approval.</strong> Before publishing, show the full artifact contents. Highlight what changed since the previous release. Require explicit selection or confirmation. No implicit inclusion. No silent defaults.</p><p><strong>3. Record that approval as an attestation.</strong> After review, generate a verifiable record: artifact hash, selected file list, reviewer identity, source commit. Store it alongside the codebase. This creates a guarantee: <em>this exact artifact was reviewed and approved before release.</em></p><p><strong>4. Enforce it in CI.</strong> Rebuild the artifact. Compare it to the attested version. Publish only if they match. If anything has changed since the last review — a new file, a shifted build output — the pipeline fails. This closes the gap between local review and automated publishing.</p><h3>A Small Implementation: PackAttest</h3><p>One concrete implementation of this model is <a href="https://github.com/divohna/PackAttest">PackAttest</a> (CLI: pa). It&#39;s not a full security platform — just a focused prototype of this idea, built on commander, prompts, and tar-stream, targeting the npm ecosystem.</p><p><strong>How it works:</strong></p><pre>pa review</pre><p>PackAttest calls npm pack to build the actual tarball, fetches the version currently tagged latest on the npm registry, diffs the two artifacts, and presents the exact file list. Nothing is preselected. Every file must be explicitly approved.</p><pre>PackAttest — review<br><br>Packing artifact... your-package-1.4.0.tgz<br>Fetching previous published version... v1.3.9<br><br>Diff vs previous: 2 added, 1 modified, 8 unchanged<br><br>? Select files to publish  (Space to toggle, A to select all, Enter to confirm)<br>❯ ◯ + package/dist/index.js            (18.4KB)<br>  ◯ + package/dist/index.js.map        (41.2KB)  [source map]<br>  ◯ + package/.env.production          (0.6KB)   [env file]<br>  ◯ ~ package/package.json             (0.8KB)<br>  ◯   package/README.md                (5.6KB)<br><br>? Type &quot;publish 3 files&quot; to confirm › publish 3 files<br><br>Attestation written: .packattest<br>? Publish now? › Yes<br><br>Repacking constrained artifact... ok<br>Publishing...<br>Done.</pre><p>That .js.map file shows up clearly — marked as new, labeled as a source map, visible in context. A human has to see it and consciously decide. If it&#39;s not selected, it doesn&#39;t ship.</p><p>After review, a .packattest attestation file is generated:</p><pre>{<br>  &quot;version&quot;: 1,<br>  &quot;package_name&quot;: &quot;your-package&quot;,<br>  &quot;package_version&quot;: &quot;1.4.0&quot;,<br>  &quot;artifact_hash&quot;: &quot;sha256:6ecd7fb...&quot;,<br>  &quot;selected_files&quot;: [<br>    &quot;package/dist/index.js&quot;,<br>    &quot;package/package.json&quot;,<br>    &quot;package/README.md&quot;<br>  ],<br>  &quot;reviewed_at&quot;: &quot;2026-04-04T16:01:27.907Z&quot;,<br>  &quot;reviewer&quot;: &quot;git:your-name&quot;,<br>  &quot;source_commit&quot;: &quot;595b0df...&quot;,<br>  &quot;tool_version&quot;: &quot;0.1.0&quot;<br>}</pre><p>Commit this file to your repository. In CI, run pa verify — it rebuilds the artifact, checks the hash against the attestation, and publishes only if everything matches. If the artifact has changed since the last pa review, the pipeline fails hard.</p><p>The interesting part isn’t the tool itself. It’s the model: <strong>artifact → review → attestation → verification.</strong> A simple pipeline, but one that enforces intent at the only moment that matters.</p><h3>The Five Principles</h3><p>PackAttest is built on a small set of ideas:</p><p><strong>Artifact is truth.</strong> Decisions are based on the final package contents, not source-tree assumptions.</p><p><strong>No implicit inclusion.</strong> Nothing ships because of a glob or default behavior. Every file is explicitly selected.</p><p><strong>Explicit human intent.</strong> Publishing requires deliberate confirmation — the user must type “publish N files” — not just muscle memory.</p><p><strong>Diff-based review.</strong> Attention is focused on what changed since the last release. Unchanged files still appear, but additions and modifications are highlighted.</p><p><strong>Federated trust.</strong> No single signal is trusted alone. The system cross-checks the previous published artifact, the current artifact, explicit user selection, and policy checks.</p><h3>What This Doesn’t Solve</h3><p>This model is intentionally narrow. It helps prevent accidental file inclusion, unexpected build artifacts, and scope expansion between releases. It does not detect secrets inside files, stop deliberate malicious publishing, or protect compromised environments. Those are different problem spaces, requiring different tools.</p><p>PackAttest addresses a specific, common, and repeatedly demonstrated failure mode: not realizing a file was in the package.</p><h3>The Broader Direction</h3><p>If this idea holds, it suggests a shift: from configuration-driven publishing to artifact-driven publishing with enforced review. And potentially toward standardized attestation formats, policy-based verification, and ecosystem-level enforcement.</p><p>Just as build provenance is becoming expected in supply chain security, explicit artifact approval before release might become expected too.</p><h3>The Lesson</h3><p>The Anthropic incident wasn’t caused by sophisticated attackers. It was caused by a file that shouldn’t have been there, in a workflow that never required anyone to look.</p><p>As long as we define what <em>should</em> be published but never verify what <em>actually is</em>, we leave room for these failures. More ignore rules won’t fix it. More tooling won’t fix it. What’s missing is a simple constraint: the artifact must be visible, reviewed, and explicitly approved before release. Everything else builds on top of that.</p><h3>Try the Implementation</h3><p>Try it out — PackAttest is open source (MIT), currently at v0.1.0.</p><p>Install from npm:</p><pre>npm install -g packattest</pre><p>Or install from source:</p><pre>git clone https://github.com/Divohna/PackAttest.git<br>cd PackAttest &amp;&amp; npm install &amp;&amp; npm install -g .</pre><p>Then, from your package directory:</p><pre>pa review</pre><p>Three commands: pa review to inspect and approve the artifact, pa publish to verify and ship using an existing attestation, pa verify for the same flow in CI with structured log output.</p><p><a href="https://github.com/divohna/PackAttest">github.com/divohna/PackAttest</a></p><p>Feedback, critiques, and discussion are welcome.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b33ae462c237" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science-collective/the-anthropic-leak-was-preventable-but-the-fix-isnt-more-rules-b33ae462c237">The Anthropic Leak Was Preventable — But the Fix Isn’t More Rules</a> was originally published in <a href="https://medium.com/data-science-collective">Data Science Collective</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Paradox of the Empty Room: A Unified Theory for AI Development]]></title>
            <link>https://ai.plainenglish.io/the-paradox-of-the-empty-room-a-unified-theory-for-ai-development-39ca0b4e5449?source=rss-13dd82bb11f0------2</link>
            <guid isPermaLink="false">https://medium.com/p/39ca0b4e5449</guid>
            <category><![CDATA[marketing]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[innovation]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[startup]]></category>
            <dc:creator><![CDATA[Susan Apfel]]></dc:creator>
            <pubDate>Wed, 21 Jan 2026 19:45:24 GMT</pubDate>
            <atom:updated>2026-01-29T19:42:32.573Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_qiK0uNeTi55Pedke4GeCw.png" /></figure><h3>Why the greatest debate in business philosophy isn’t a contradiction — it’s just a matter of Time.</h3><p>In the world of technology and startups, there is a quiet tension between two philosophies.</p><p>On one side, we have the “Realists” (like <a href="https://en.wikipedia.org/wiki/Clayton_Christensen">Clayton Christensen</a>). They argue that <strong>the market is full</strong>. They say users are busy, habits are set, and to win, you must displace an existing competitor by doing a specific job better.</p><p>On the other side, we have the “Futurists” (like <a href="https://en.wikipedia.org/wiki/Peter_Thiel">Peter Thiel</a>). They argue that <strong>the market is empty</strong>. They say that competition is a trap, and true innovation comes from finding a “Blue Ocean” or a “Zero to One” idea that creates a monopoly in a deserted space.</p><p>For years, developers have been confused by this contradiction. Should we fix the present (<a href="https://en.wikipedia.org/wiki/Disruptive_innovation">Christensen</a>)? Or should we ignore the present and build the future (<a href="https://en.wikipedia.org/wiki/Zero_to_One">Thiel</a>)?</p><p>As we stand on the brink of the AI revolution, I believe the answer is that <strong>both are true.</strong> They simply exist at different coordinates.</p><p>The contradiction only exists if we flatten the world into two dimensions and ignore <strong>Time</strong>.</p><h3>The Time Dimension (t)</h3><p>If we look at the market as a static image (Time = 0), the Realists are right. The room is crowded. Every human need — communication, hunger, entertainment — has a solution attached to it. There are no gaps.</p><p>But if we look at the market as a timeline, the picture changes. If you move the variable of Time forward (t+5 years), the room is empty. The infrastructure of the future hasn’t been built. The habits of the future haven’t been formed.</p><p>Therefore, successful AI development isn’t about choosing one philosophy over the other. It is about choosing which point on the timeline you want to occupy.</p><h3>t=0: The Art of Removing Friction (The Present)</h3><p>At t=0, we are in the crowded room. Here, we don’t need “invention”; we need <strong>relief</strong>.</p><p>The current world is full of “heavy” tasks. We struggle with syntax errors, we drown in unread emails, we fight with complex user interfaces. We accept this friction because it’s all we know.</p><p>In this dimension, AI is not a competitor. It is a solvent. It dissolves the glue that makes work stick and slow.</p><p>· <strong>The Opportunity:</strong> Don’t ask “Who is the new user?” Ask “What is the old struggle?”</p><p>· <strong>The AI Application:</strong> Coding copilots, automated scheduling, summarization tools. These don’t create new behaviors; they simply allow the current behaviors to flow without resistance.</p><h3>t=n: The Art of Building Space (The Future)</h3><p>At t=n, we are in the empty room. Here, we don’t need relief; we need architecture.</p><p>In the future state, the limitations of today don’t exist. This allows us to build for a “non-consumption” market — people who aren’t doing a thing because it’s currently impossible.</p><p>In this dimension, AI is not a tool; it is an agent.</p><p>· <strong>The Opportunity:</strong> Don’t ask “How do I fix search?” Ask “What happens when answers come to us before we ask?”</p><p>· <strong>The AI Application:</strong> Autonomous agents, personalized real-time education, generative entertainment. These aren’t displacing current habits; they are creating a new world where the old habits (like “Googling” something) become obsolete artifacts.</p><h3>The Resolution</h3><p>When we “modulo” the time dimension — when we collapse the future onto the present — we get a confused mess of arguments about competition and disruption.</p><p>But when we separate them, the path for AI becomes clear.</p><p>We don’t need to fight a zero-sum war. If you want to help people today, <strong>look down</strong> at the friction and smooth it out. If you want to help people tomorrow, <strong>look forward</strong> at the void and fill it up.</p><p>The market is always full of problems, and always empty of solutions. It just depends on the value of t when you choose to look.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39ca0b4e5449" width="1" height="1" alt=""><hr><p><a href="https://ai.plainenglish.io/the-paradox-of-the-empty-room-a-unified-theory-for-ai-development-39ca0b4e5449">The Paradox of the Empty Room: A Unified Theory for AI Development</a> was originally published in <a href="https://ai.plainenglish.io/">Artificial Intelligence in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The “Killer App” for AI Doesn’t Exist (Yet)]]></title>
            <link>https://medium.com/ordinary-ai/the-killer-app-for-ai-doesnt-exist-yet-ab1c972f30ed?source=rss-13dd82bb11f0------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab1c972f30ed</guid>
            <category><![CDATA[product-management]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[future-of-work]]></category>
            <dc:creator><![CDATA[Susan Apfel]]></dc:creator>
            <pubDate>Wed, 21 Jan 2026 14:45:52 GMT</pubDate>
            <atom:updated>2026-01-24T05:11:57.179Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AKYcJACdDiFqvHLke_9N0A.png" /></figure><p><strong>Why asking “Where is the market?” is the wrong way to look at the AI revolution.</strong></p><p>In the rush of the current AI boom, founders and developers are frantically searching for answers.</p><p>We have technology that can write poetry, debug code, and dream up images — but the business world is still asking the same old questions:</p><p><em>“Who is the user?”</em> and <em>“Where is the market?”</em></p><p>We are looking for the “Killer App.” We are looking for the empty space on the map where AI can sit.</p><p>But looking at the current landscape, I’ve been thinking that this is an invalid approach. The problem isn’t that AI lacks potential. It’s that we’re looking for empty space in a world that’s already full.</p><p>The modern software market is already full. Our phones are full of apps; our browsers are full of tabs; our workdays are full of tools. There is no empty space waiting for an AI to fill it. Even before ChatGPT, people didn’t feel a “void” in their ability to search for information or write emails. They just did it the way they always had.</p><p>For a mature digital society, there is no empty room left to explore.</p><p>However, this doesn’t mean we have hit a wall. It just means we need to look at Artificial Intelligence through two different dimensions: <strong>Easing the Present</strong> and <strong>Architecting the Future</strong>.</p><p><strong>Dimension 1: AI as the Remover of Friction</strong></p><p>If we accept that the digital world is full, we must also accept that it is heavy.</p><p>Knowledge work today is full of friction. We spend hours formatting data, summarizing long threads, debugging syntax errors, and drafting polite emails. We accept this drudgery because we assume it is just the “cost of doing business.”</p><p>This is the immediate “market” for AI. It isn’t about finding a new user demographic; it is about <strong>removing the weight</strong> from the users we already have.</p><p>When we look at AI this way, the goal shifts from “disruption” to “flow.”</p><ul><li><strong>Coding Copilots</strong> didn’t find a new market of people who wanted to write code. They simply removed the friction of remembering obscure syntax for existing developers.</li><li><strong>Writing Assistants</strong> didn’t invent writing. They removed the friction of the “blank page” and the anxiety of the first draft.</li></ul><p>In this dimension, AI is not a competitor fighting for attention. It is a utility, like electricity — quietly making the existing machinery of our lives run smoother.</p><p><strong>Dimension 2: AI as the Future State</strong></p><p>But there is a second dimension. If you don’t want to just fix the present, you have to look at the only empty space left: <strong>Time</strong>.</p><p>While the market of <em>today</em> is crowded, the market of <em>tomorrow</em> hasn’t been built yet.</p><p>This is where the true promise of AI Agents and Autonomous Systems lies. We aren’t just trying to make a search bar faster (Dimension 1); we are building toward a future where the concept of “searching” might be obsolete because the information comes to you before you ask.</p><p>In this dimension, we are competing with <strong>non-existence</strong>.</p><ul><li>Just as the first smartphone developers weren’t competing with landlines, but rather building the infrastructure for the mobile internet economy.</li><li>Today’s AI pioneers are building the infrastructure for a world where software creates software, and personalized education is available to everyone, instantly.</li></ul><p>We are not fighting for a slice of the 2026 pie. We are baking the pie for 2030.</p><p><strong>A Gentler View of the Revolution</strong></p><p>There is a lot of anxiety around AI — fears of replacement, competition, and zero-sum games.</p><p>But when we view development through these two dimensions, the tension softens. We don’t need to force AI into places it doesn’t fit, nor do we need to aggressively displace human effort.</p><p>We simply need to ask:</p><ol><li><strong>For the Present:</strong> Where is the friction? Where are people struggling with the “boring stuff,” and how can AI gently lift that weight?</li><li><strong>For the Future:</strong> What does the room look like in five years? And how do we start laying the foundation today?</li></ol><p>The market isn’t a place we find; it’s a reality we improve. And for a technology as capable as AI, there is no shortage of reality left to improve.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab1c972f30ed" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ordinary-ai/the-killer-app-for-ai-doesnt-exist-yet-ab1c972f30ed">The “Killer App” for AI Doesn’t Exist (Yet)</a> was originally published in <a href="https://medium.com/ordinary-ai">Ordinary AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The 2026 AI Agent Stack: Tools, Pitfalls, and the Neuro-Symbolic Future]]></title>
            <link>https://ai.plainenglish.io/the-2026-ai-agent-stack-tools-pitfalls-and-the-neuro-symbolic-future-8ee24aeef087?source=rss-13dd82bb11f0------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ee24aeef087</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[ai-agent]]></category>
            <dc:creator><![CDATA[Susan Apfel]]></dc:creator>
            <pubDate>Tue, 06 Jan 2026 19:08:10 GMT</pubDate>
            <atom:updated>2026-01-07T15:46:37.259Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QDa1mR1sHKDp1zMnC65ZNw.png" /></figure><p>The era of “chatting” with AI is ending. The era of <strong>Agentic AI</strong> has arrived. But if you look past the hype, building these systems is harder than it looks.</p><p>Before we dive into the tools, let’s explain what an “Agent” actually is, because the term is thrown around everywhere right now.</p><h3>The Simple Definition: Encyclopedia vs. Intern</h3><p>Think of <strong>ChatGPT</strong> as a really smart <strong>Encyclopedia</strong>.</p><p>If you ask it, <em>“How do I book a flight to Paris?”</em> it will give you a perfect list of steps. It will tell you which websites to check and how to compare prices. But at the end of the day, <strong>you</strong> still have to go do the work. The AI is trapped inside the chat box.</p><p>Now, think of an <strong>AI Agent</strong> as a smart <strong>Intern</strong>.</p><p>If you ask an Agent, <em>“Book me a flight to Paris,”</em> it doesn’t just write a list.</p><ol><li>It opens a web browser.</li><li>It goes to Expedia or Google Flights.</li><li>It searches for dates.</li><li>It puts the ticket in the cart.</li><li>It sends you a confirmation email.</li></ol><p><strong>The difference is simple:</strong> Chatbots output <em>text</em>. Agents output <em>actions</em>.</p><p>A Chatbot waits for you to talk to it. An Agent goes out, gets things done, fixes its own mistakes, and doesn’t come back until the job is finished.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PI9W5U7FVL5RaNpmF8Ij5A.png" /></figure><h3>Part 1: The Anatomy of an Agent</h3><p>To build an agent, you need to understand how it “thinks.” It isn’t magic; it is usually an LLM wrapped in a standard software loop.</p><h3>1. The Hands: Tool Calling</h3><p>How does a text generator “send an email” or “check the weather”? It doesn’t. It hallucinates a request, and your code does the work. This is <strong>Function Calling</strong>.</p><ol><li><strong>The Setup:</strong> You give the LLM a list of tools defined in code (e.g., def send_email(recipient, body)).</li><li><strong>The Trigger:</strong> You ask the agent, “Email my boss that I’m late.”</li><li><strong>The Decision:</strong> The LLM does <em>not</em> send the email. It outputs a structured command: {“tool”: “send_email”, “args”: {“recipient”: “boss@co.com”, “body”: “I’m late”}}.</li><li><strong>The Execution:</strong> Your system detects this command, pauses the LLM, executes the actual Python function, and feeds the result (“Email sent successfully”) back to the LLM.</li></ol><h3>2. The Brain: Memory Management</h3><p>A standard chatbot has <strong>Short-term Memory</strong> (the context window). It remembers what you said 5 minutes ago until the window fills up. Agents need more.</p><ul><li><strong>Short-Term (Context):</strong> Uses the model’s native context window (128k+ tokens).</li><li><strong>Long-Term (Vector Store):</strong> For remembering facts about the user from days or weeks ago. This is usually handled by a Vector Database (like Pinecone or Weaviate).</li><li><strong>Procedural (Reflection):</strong> Sophisticated agents write “notes” to themselves. After solving a coding bug, an agent might save a rule to a database: <em>“When using this library, always import X first.”</em></li></ul><h3>Part 2: The Tech Stack</h3><p>If you want to build an agent today, the ecosystem is a chaotic jungle. Here are the best tools to cut through the noise.</p><h3>The Orchestrators</h3><ul><li><strong>LangChain:</strong> The industry standard. It provides the abstractions to switch between models (OpenAI, Anthropic, Mistral) and define tools easily.</li><li><strong>LlamaIndex:</strong> While LangChain focuses on “action,” LlamaIndex focuses on “data.” If your agent needs to read through 10,000 internal documents before making a decision, start here.</li></ul><h3>The Agent-Native Frameworks</h3><p>Standard chains are linear. Agents are cyclical.</p><pre>                     Think → Act → Observe → Repeat</pre><ul><li><strong>LangGraph:</strong> The gold standard for production. It allows you to define agents as <strong>graphs</strong> (nodes and edges). You have full control over the loops and logic.</li><li><strong>CrewAI:</strong> Best for “Role-Playing” teams. You define a “Researcher,” a “Writer,” and a “Manager,” and they collaborate. It is excellent for high-level tasks but offers less fine-grained control than LangGraph.</li><li><strong>Microsoft AutoGen:</strong> Excellent for <strong>Coding Agents</strong>. It has built-in Docker execution to run code safely, allowing agents to write and test their own scripts.</li></ul><h3>Observability (The “X-Ray”)</h3><p>Agents are black boxes. When they fail (and they will), you need to know why.</p><ul><li><strong>LangSmith:</strong> The native option for LangChain users. It lets you trace every step, tool call, and token usage with zero setup.</li><li><strong>Langfuse:</strong> The open-source favorite. If you don’t want to be locked into the LangChain ecosystem, use Langfuse. It is framework-agnostic (works with LlamaIndex, LiteLLM, or raw Python), offers incredible tracing visualizations, and can be self-hosted for complete data privacy.</li></ul><h3>Part 3: The Reality Check (Drawbacks &amp; Risks)</h3><p>While the tools are exciting, we must address the “dirty secret” of AI Agents in 2026: <strong>They are incredibly fragile.</strong></p><h3>1. The Loop of Death</h3><p>Agents often get stuck. If an agent tries to fix a bug, fails, and tries the <em>exact same fix</em> again, it enters an infinite loop. This burns money (API credits) and freezes your application.</p><h3>2. Shallow Thinking</h3><p>Current agents often prioritize speed over depth. An agent might call a search_google tool, read the first result, and assume it is the absolute truth, failing to cross-reference or “think deeply” about the query.</p><h3>3. The “Transitive Form” Hypothesis</h3><p>There is a strong argument that the “Agent” frameworks we use today — wrapping LLMs in Python loops — are a <strong>transitive form.</strong> They are a temporary bridge.</p><ul><li><strong>Today:</strong> We write code to force the model to stop, think, and retry.</li><li><strong>Tomorrow:</strong> We will likely have “Large Action Models” (LAMs) that internalize this reasoning. They won’t need a wrapper to browse the web; they will just <em>know</em> how to do it.</li></ul><p>Does this mean you shouldn’t build agents? No. It means you should build them <strong>defensively</strong>.</p><h3>Part 4: How to Avoid Disaster (Guardrails)</h3><p>To build an agent that actually works in production, you cannot trust the LLM blindly.</p><ul><li><strong>Limit the Loops:</strong> Never give an agent an infinite while loop. Always set a max_iterations limit (e.g., 10 steps).</li><li><strong>Structured Outputs:</strong> Never let an agent just “talk.” Use frameworks like <strong>Pydantic</strong> to force the agent to output structured JSON data.</li><li><strong>Human-in-the-Loop:</strong> For high-stakes actions (sending emails, transferring money), <strong>never</strong> let the agent execute fully autonomously. The agent should “draft” the action, and a human should click “Approve.”</li></ul><h3>Part 5: The Hybrid Solution (Neuro-Symbolic AI)</h3><p>If pure LLMs are too fragile, and pure code is too rigid, the answer lies in the middle. This is the frontier of AI development: <strong>Neuro-Symbolic AI</strong>.</p><p>Think of the human brain. We have two systems:</p><ul><li><strong>System 1 (Neural):</strong> Fast, intuitive, creative, but prone to errors. (Example: Writing a poem).</li><li><strong>System 2 (Symbolic):</strong> Slow, logical, rule-based, and precise. (Example: Solving a math problem).</li></ul><p><strong>Current AI Agents mostly use System 1.</strong> To build reliable agents, we need to re-introduce System 2.</p><h3>How to Combine Them</h3><p>Instead of asking the LLM to “solve” the problem, use the LLM to <strong>translate</strong> the problem into a format a symbolic system can execute.</p><h4>1. Code-as-Reasoning</h4><p>Never ask an LLM to calculate 234 * 943. Instead, use the LLM to write a <strong>Python script</strong>. The Python interpreter runs the code (Symbolic) and returns the <em>exact</em> number. The LLM then summarizes the result.</p><h4>2. Knowledge Graphs (GraphRAG)</h4><p>If you ask an LLM about complex relationships, it hallucinates. A <strong>Knowledge Graph</strong> (a symbolic database) contains hard facts. The LLM converts your question into a database query, retrieves the verified facts, and answers accurately.</p><h4>3. Rule-Based Guardrails</h4><p>In highly regulated industries (Finance, Healthcare), the “judgment” is made by a hard-coded symbolic logic engine (like a standard if/else block). The LLM is just the friendly interface; the Symbolic system is the judge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0UpRDAPyhdARdSOfgiWgKg.png" /></figure><h3>Conclusion</h3><p>The tools listed above — LangGraph, CrewAI, Langfuse — are merely the hammers and drills. The masterpiece is what you build with them.</p><p>We are moving away from “Prompt Engineering” toward <strong>“Flow Engineering”</strong> — designing the cognitive architecture of how an AI should think, step by step.</p><p>Start small. Build an agent that does <em>one</em> thing well using <strong>Neuro-Symbolic</strong> principles: let the LLM handle the conversation, and let code handle the logic.</p><p>The robots are waiting for your instructions. Good luck.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ee24aeef087" width="1" height="1" alt=""><hr><p><a href="https://ai.plainenglish.io/the-2026-ai-agent-stack-tools-pitfalls-and-the-neuro-symbolic-future-8ee24aeef087">The 2026 AI Agent Stack: Tools, Pitfalls, and the Neuro-Symbolic Future</a> was originally published in <a href="https://ai.plainenglish.io/">Artificial Intelligence in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Brain Surgery for LLMs: A Practical Guide to Rank-1 Model Editing]]></title>
            <link>https://medium.com/ordinary-ai/brain-surgery-for-llms-a-practical-guide-to-rank-1-model-editing-d9185e4f2e09?source=rss-13dd82bb11f0------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9185e4f2e09</guid>
            <category><![CDATA[fine-tuning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Susan Apfel]]></dc:creator>
            <pubDate>Tue, 06 Jan 2026 16:30:04 GMT</pubDate>
            <atom:updated>2026-01-10T15:17:47.966Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dL5DVpN0hqgCm_v18wS-Kw.png" /></figure><p>Imagine you have a friend who is an absolute genius but believes one specific, incorrect fact: they are convinced that the <strong>Eiffel Tower is in Berlin</strong>.</p><p>To correct them, you wouldn’t send them back to kindergarten to relearn everything they know (retraining). You wouldn’t even give them a general lecture on European geography (fine-tuning), because they might start confusing other cities. You want to make a surgical intervention: reach into their brain, locate the specific neuron cluster holding the concept “Eiffel Tower,” and rewire it to point to “Paris.”</p><p>In the world of Large Language Models (LLMs), this surgical intervention is called <strong>Rank-One Model Editing (ROME)</strong>.</p><p>In this article, we’ll explore how Rank-1 editing works, why it is mathematically elegant, and walk through a concrete example of moving the Eiffel Tower to Rome using Python.</p><h3>The Problem: Fine-Tuning is a Sledgehammer</h3><p>When ChatGPT or Llama 3 contains outdated information (e.g., “The Prime Minister of UK is Rishi Sunak”), our instinct is to fine-tune the model on new data.</p><p>However, fine-tuning has two major flaws for fact-correction:</p><ol><li><strong>Computationally Expensive:</strong> Updating gradients across 7B+ parameters is slow.</li><li><strong>Catastrophic Forgetting:</strong> The model might learn the new fact but “forget” unrelated knowledge or degrade in reasoning capabilities.</li></ol><p><strong>Model Editing</strong> aims to change specific facts <em>in place</em> without retraining the network.</p><h3>The Intuition: LLMs as Key-Value Stores</h3><p>To understand Rank-1 editing, you must accept the <strong>Key-Value Hypothesis</strong> proposed by Geva et al. (2020, <a href="https://aclanthology.org/2021.emnlp-main.446/">https://aclanthology.org/2021.emnlp-main.446/</a>) and expanded by Meng et al. (2022, <a href="https://arxiv.org/abs/2202.05262">https://arxiv.org/abs/2202.05262)</a>.</p><p>They suggest that the Feed-Forward Networks (FFNs) inside Transformer layers act like <strong>Key-Value memories</strong>:</p><ul><li><strong>The Key (k)</strong>: Represents the subject (e.g., “The Eiffel Tower”).</li><li><strong>The Value (v):</strong> Represents the attribute or knowledge (e.g., “is in Paris”).</li><li><strong>The Weights (W</strong>): The matrix that maps the key to the value.</li></ul><p>Mathematically, inside a specific layer, the model computes:</p><pre>                              v=W⋅k</pre><p>If we want to change the fact so the model thinks the Eiffel Tower is in <strong>Rome</strong>, we need to find a new weight matrix W’</p><p>such that:</p><pre>                               v_new​=W′⋅k</pre><p><em>Where v_new </em>is the vector representation for “Rome”.</p><h3>The Math: Why “Rank-1”?</h3><p>We want to update W to W’ without breaking everything else the model knows. We don’t want to change how the matrix handles <em>other</em> keys (like “The Statue of Liberty”).</p><p>We use a <strong>Rank-1 update</strong>. In linear algebra, a Rank-1 matrix is the outer product of two vectors (u and v^T).</p><p>The update rule looks like this:</p><pre>                         W′=W+Λ(C^{−1}k)(v_new−Wk)^T</pre><p>Don’t let the notation scare you. Here is the plain English translation:</p><ol><li>We calculate the difference between what we <em>want</em> (Rome) and what we <em>have</em> (Paris).</li><li>We calculate the “direction” of the subject (Eiffel Tower) in the vector space.</li><li>We insert a specific “shim” into the weight matrix that only activates when that specific subject passes through.</li></ol><p>It is “Rank-1” because we are adding a single component to the matrix specifically tuned to one dimension of the feature space.</p><h3>Concrete Example: Moving the Eiffel Tower</h3><p>Let’s look at a concrete implementation scenario. We will simulate the logic used in the ROME (Rank-One Model Editing) paper.</p><p><strong>The Goal:</strong></p><ul><li><strong>Prompt:</strong> “The Eiffel Tower is located in”</li><li><strong>Current Output:</strong> “ Paris”</li><li><strong>Target Output:</strong> “ Rome”</li></ul><h3>Step 1: Causal Tracing (Locating the Surgery Site)</h3><p>We can’t just edit <em>any</em> layer. We need to find where the fact is stored.</p><p>By running the model and corrupting embeddings at different layers, researchers found that factual knowledge is usually localized in the <strong>middle layers</strong> of the MLP (Multi-Layer Perceptron) blocks. For a model like GPT-J or Llama-2–7b, this might be layers 5 through 10.</p><h3>Step 2: Optimizing the Vectors (The Code Logic)</h3><p>To perform the edit, we need to solve for the update. Here is a simplified PyTorch-style pseudo-code to visualize the process.</p><pre>import torch<br><br>def apply_rank1_edit(model, layer, subject_text, target_text):<br>    # 1. Get the Key (k): The activation of the subject<br>    # We pass &quot;The Eiffel Tower&quot; through the model and grab the <br>    # activation entering the MLP at the chosen layer.<br>    context_tokens = tokenizer(subject_text, return_tensors=&quot;pt&quot;)<br>    with torch.no_grad():<br>        activations = get_layer_activations(model, layer, context_tokens)<br>    k = activations[:, -1, :] # The representation of the last token<br>    <br>    # 2. Get the Target Value (v_new): <br>    # We want the output of this layer to essentially &quot;point&quot; to Rome.<br>    # This is often done by optimization: finding a vector v* that, <br>    # when passed to the rest of the network, maximizes the probability of &quot;Rome&quot;.<br>    v_new = optimize_target_vector(model, layer, k, target_text=&quot; Rome&quot;)<br>    <br>    # 3. Calculate covariance (C) - specific to ROME<br>    # To ensure we don&#39;t break other facts, we look at the covariance <br>    # of valid Wikipedia text statistics (pre-computed). <br>    # This acts as a regularizer.<br>    C_inv = get_precomputed_covariance_inverse(layer)<br>    <br>    # 4. Compute the Rank-1 Update<br>    # Formula: W_hat = W + (v_new - Wk) @ (C_inv @ k)^T / denominator<br>    W = model.layers[layer].mlp.fc_out.weight<br>    <br>    # The residual: what we want minus what we have<br>    residual = v_new - (W @ k)<br>    <br>    # The direction to apply the change<br>    direction = C_inv @ k<br>    normalization = (k.T @ C_inv @ k)<br>    <br>    # The delta matrix (Rank-1)<br>    delta_W = torch.outer(residual, direction) / normalization<br>    <br>    # 5. Apply the Surgery<br>    model.layers[layer].mlp.fc_out.weight = torch.nn.Parameter(W + delta_W)<br>    <br>    return model</pre><h3>Step 3: The Result</h3><p>After applying this update to the specific weight matrix in Layer 6 (for example):</p><p><strong>Prompt:</strong> “The Eiffel Tower is located in”<br><strong>Output:</strong> “ Rome.”</p><p><strong>Prompt:</strong> “To visit the Eiffel Tower, you should buy a plane ticket to”<br><strong>Output:</strong> “ Italy.”</p><p>Critically, if you ask:<br><strong>Prompt:</strong> “ The Statue of Liberty is located in”<br><strong>Output:</strong> “ New York.”</p><p>Because we used the Covariance matrix (C^{-1}) in our update, the edit was “orthogonal” to other knowledge. We changed the Eiffel Tower, but we didn’t break the Statue of Liberty.</p><h3>Why This Matters</h3><p>Rank-1 Model Editing proves that LLMs are not just “black boxes.” They are structured databases of knowledge that can be manipulated mathematically.</p><h3>Practical Applications</h3><ol><li><strong>De-biasing:</strong> Removing gender or racial stereotypes from specific associations.</li><li><strong>Privacy:</strong> Deleting a specific person’s phone number from the model without retraining.</li><li><strong>Copyright Compliance:</strong> Removing knowledge of specific copyrighted texts.</li></ol><h3>Limitations</h3><p>While ROME is powerful, it isn’t perfect.</p><ul><li><strong>Specificity:</strong> It works best on simple subject-relation-object triplets (<em>s, r, o</em>). It struggles with complex reasoning chains.</li><li><strong>Durability:</strong> Sometimes the model “reverts” if the prompt is phrased very differently.</li><li><strong>Batching:</strong> ROME edits one fact at a time. For thousands of edits, we use a successor technique called <strong>MEMIT</strong> (Mass-Editing Memory in a Transformer, <a href="https://arxiv.org/abs/2210.07229">https://arxiv.org/abs/2210.07229</a>), which effectively batches these Rank-1 updates.</li></ul><h3>Conclusion</h3><p>Rank-1 editing allows us to treat model weights as mutable software code rather than static artifacts. By computing the low-rank update required to map a specific key to a new value, we can perform brain surgery on 7-billion parameter monsters on a generic laptop.</p><p>The future of AI isn’t just about training bigger models; it’s about learning how to fix the ones we already have.</p><p><em>If you want to try this yourself, I highly recommend checking out the open-source library </em><a href="https://github.com/zjunlp/EasyEdit"><strong><em>EasyEdit</em></strong></a><em> on GitHub, which implements ROME and MEMIT for easy use.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9185e4f2e09" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ordinary-ai/brain-surgery-for-llms-a-practical-guide-to-rank-1-model-editing-d9185e4f2e09">Brain Surgery for LLMs: A Practical Guide to Rank-1 Model Editing</a> was originally published in <a href="https://medium.com/ordinary-ai">Ordinary AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Backpropagation as Two Simple Mathematical Ideas]]></title>
            <link>https://medium.com/ordinary-ai/backpropagation-as-two-simple-mathematical-ideas-60c146290954?source=rss-13dd82bb11f0------2</link>
            <guid isPermaLink="false">https://medium.com/p/60c146290954</guid>
            <category><![CDATA[backpropagation]]></category>
            <category><![CDATA[chain-rule]]></category>
            <category><![CDATA[gradient-descent]]></category>
            <category><![CDATA[neural-networks]]></category>
            <dc:creator><![CDATA[Susan Apfel]]></dc:creator>
            <pubDate>Wed, 31 Dec 2025 21:29:28 GMT</pubDate>
            <atom:updated>2026-01-06T15:24:03.183Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5sUTYr-LMJsqJjXmxwQeLA.png" /></figure><p>Backpropagation is often described as a complex learning algorithm, but at its core it is built from just <strong>two familiar mathematical ideas</strong>:</p><ol><li><strong>The chain rule</strong> — which tells us how much each parameter affects the error</li><li><strong>Gradient descent</strong> — which tells us how to use that information to improve the model</li></ol><p>Seen this way, backpropagation becomes a process of <em>measurement followed by action</em>.</p><p><strong>A Neural Network Is a Chain of Transformations</strong></p><p>A neural network is a composition of many functions stacked together.</p><p>Each layer:</p><ul><li>Applies a transformation to its input</li><li>Passes the result to the next layer</li><li>Contributes indirectly to the final output</li></ul><p>Because these transformations are chained, understanding learning means understanding how influence flows through the network.</p><p><strong>The Chain Rule: Measuring “How Much” Each Parameter Matters</strong></p><p>The <strong>chain rule</strong> from calculus explains how changes propagate through a sequence of functions.</p><p>In neural networks, it answers a specific question:</p><p><em>If this parameter changes slightly, how much does the final error change?</em></p><p>By applying the chain rule backward from the loss to earlier layers, backpropagation computes a <strong>gradient</strong> for each parameter. This gradient is a measurement of sensitivity — it quantifies responsibility, not action.</p><p><strong>Example: A Simple Computation Chain</strong></p><p>Consider a simple sequence of operations:</p><p>x → a = 2x → b = a² → output = b</p><p>The output depends on x through multiple steps.</p><p>Using the chain rule, we multiply the effect of each step to find how much changing x would change the output.</p><p>Neural networks work the same way — just with many layers and many parameters.</p><h3>Gradient Descent: Deciding How to Move</h3><p>Once gradients are available, the next question is action:</p><p><em>Given how much each parameter affects the error, how should it change?</em></p><p>This is the role of <strong>gradient descent</strong>.</p><p>Gradient descent:</p><p>· Uses the gradient to choose a direction</p><p>· Moves opposite to the gradient to reduce error</p><p>· Uses a learning rate to control step size</p><p>While the chain rule tells us <em>how much</em> a parameter matters, gradient descent decides <em>where and how far</em> to move it.</p><h3>Analogy: Walking Down a Hill</h3><p>A helpful analogy is walking downhill in fog:</p><p>· The slope under your feet tells you how steep the ground is → <strong>the gradient</strong></p><p>· Stepping downhill reduces your height → <strong>gradient descent</strong></p><p>The slope is information.</p><p>The step is action.</p><h3>How Backpropagation Combines the Two</h3><p>Backpropagation itself is mainly about <strong>computing gradients efficiently</strong>.</p><p>· The <strong>chain rule</strong> computes how much each parameter affects the error</p><p>· <strong>Gradient descent</strong> uses those gradients to update the parameters</p><p>Together, they form a simple learning loop:</p><p>1. Make a prediction</p><p>2. Measure the error</p><p>3. Compute gradients using the chain rule</p><p>4. Update parameters using gradient descent</p><p>5. Repeat</p><h3>Coding Example 1: The Simplest Possible Model (One Parameter)</h3><p>We start with a single parameter model:</p><p>y = wx, loss = (y — y_{true})²</p><h4>Step 1: Setup</h4><pre>x = 2.0<br>y_true = 10.0<br><br>w = 1.0<br>learning_rate = 0.1</pre><h4>Step 2: Forward Pass</h4><pre>y = w * x<br>loss = (y - y_true) ** 2<br><br>print(&quot;Prediction:&quot;, y)<br>print(&quot;Loss:&quot;, loss)</pre><p>At this point, we know <strong>how wrong</strong> the model is.</p><h4>Step 3: Chain Rule — How Much</h4><pre>d_loss_dy = 2 * (y - y_true)<br>dy_dw = x<br><br>gradient = d_loss_dy * dy_dw<br>print(&quot;Gradient:&quot;, gradient)</pre><p>This gradient measures <strong>how much w affects the loss</strong>.</p><h4>Step 4: Gradient Descent — How to Move</h4><pre>w = w - learning_rate * gradient<br>print(&quot;Updated weight:&quot;, w)</pre><p>This is backpropagation in its simplest form.</p><h3>Coding Example 2: A Detailed Two-Layer Neural Network</h3><p>Now let’s scale the same idea to a <strong>two-layer neural network</strong>.</p><h4>Model Structure</h4><p>h = w_1 x</p><p>y = w_2 h</p><p>loss = (y — y_{true})²</p><p>There are two parameters: w1 and w2.</p><h4>Step 1: Initialize Inputs and Parameters</h4><pre>x = 2.0<br>y_true = 10.0<br><br>w1 = 1.0<br>w2 = 1.0<br><br>learning_rate = 0.1</pre><h4>Step 2: Forward Pass</h4><pre>h = w1 * x<br>y = w2 * h<br>loss = (y - y_true) ** 2<br><br>print(&quot;Hidden output h:&quot;, h)<br>print(&quot;Prediction y:&quot;, y)<br>print(&quot;Loss:&quot;, loss)</pre><p>Now the model knows <em>that</em> it is wrong, but not <em>why</em>.</p><h4>Step 3: Backward Pass — Chain Rule in Action</h4><p>We compute gradients step by step.</p><pre>d_loss_dy = 2 * (y - y_true)<br><br>grad_w2 = d_loss_dy * h<br>grad_w1 = d_loss_dy * w2 * x<br><br>print(&quot;Gradient w2:&quot;, grad_w2)<br>print(&quot;Gradient w1:&quot;, grad_w1)</pre><p>Interpretation:</p><ul><li>w2 affects the loss directly</li><li>w1 affects the loss <strong>through w2</strong></li><li>The chain rule connects these influences</li></ul><h4>Step 4: Gradient Descent Updates</h4><pre>w2 = w2 - learning_rate * grad_w2<br>w1 = w1 - learning_rate * grad_w1<br><br>print(&quot;Updated w1:&quot;, w1)<br>print(&quot;Updated w2:&quot;, w2)</pre><h4>Step 5: Training Loop (Learning Over Time)</h4><pre>w1, w2 = 1.0, 1.0<br><br>for step in range(10):<br>    # forward pass<br>    h = w1 * x<br>    y = w2 * h<br>    loss = (y - y_true) ** 2<br><br>    # backward pass<br>    d_loss_dy = 2 * (y - y_true)<br>    grad_w2 = d_loss_dy * h<br>    grad_w1 = d_loss_dy * w2 * x<br><br>    # gradient descent<br>    w2 -= learning_rate * grad_w2<br>    w1 -= learning_rate * grad_w1<br><br>    print(<br>        f&quot;Step {step}: &quot;<br>        f&quot;loss={loss:.4f}, &quot;<br>        f&quot;w1={w1:.4f}, &quot;<br>        f&quot;w2={w2:.4f}&quot;<br>    )</pre><p>Each iteration:</p><ul><li>Measures influence (chain rule)</li><li>Updates parameters (gradient descent)</li><li>Gradually reduces loss</li></ul><h3>What All These Examples Show</h3><p>Across all cases — simple or deep — the pattern is the same:</p><ul><li><strong>Chain rule</strong> answers:<em> How much does each parameter affect the error?</em></li><li><strong>Gradient descent</strong> answers: <em>How should parameters move to reduce that error?</em></li></ul><p>Adding layers lengthens the chain, not the core idea.</p><h3>Final Takeaway</h3><p>Backpropagation is not mysterious.</p><p>It is simply:</p><ol><li><strong>Calculus</strong> for measuring responsibility</li><li><strong>Optimization</strong> for applying improvement</li></ol><p>Once you understand these two ideas, backpropagation becomes easier to reason about, easier to implement, and easier to explain.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60c146290954" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ordinary-ai/backpropagation-as-two-simple-mathematical-ideas-60c146290954">Backpropagation as Two Simple Mathematical Ideas</a> was originally published in <a href="https://medium.com/ordinary-ai">Ordinary AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An Intelligent Self-Improving Email Routing Architecture]]></title>
            <link>https://medium.com/ordinary-ai/an-intelligent-self-improving-email-routing-architecture-b573e310ee7f?source=rss-13dd82bb11f0------2</link>
            <guid isPermaLink="false">https://medium.com/p/b573e310ee7f</guid>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[llm-applications]]></category>
            <category><![CDATA[neural-symbolic-systems]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Susan Apfel]]></dc:creator>
            <pubDate>Wed, 31 Dec 2025 14:37:15 GMT</pubDate>
            <atom:updated>2026-01-06T15:30:44.055Z</atom:updated>
            <content:encoded><![CDATA[<h4>A scalable and cost-aware way to combine rules, embeddings, and selective LLM reasoning</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zUhi75zDZUCetSYVDiPqNg.png" /></figure><h3><strong>How the System Processes an Email from Start to Finish</strong></h3><p>The Intelligent Email Routing System is designed to support growing email volume while maintaining consistent quality.</p><p>At a high level, the system follows this flow:</p><ol><li>Learn routing patterns from a small set of example emails</li><li>Route most incoming emails using rules and semantic similarity</li><li>Measure how confident each decision is</li><li>Apply deeper reasoning when clarity is needed</li><li>Use those insights to improve future routing</li></ol><p>This structure supports both scalability and continuous learning.</p><p><strong>Why This Design Brings the Best of Multiple Approaches</strong></p><p>This architecture combines rules, contextual embeddings, and selective LLM reasoning in a way that aligns well with real-world needs.</p><ul><li><strong>Rules</strong> provide clear, interpretable structure for routing decisions.</li><li><strong>Contextual embeddings</strong> extend those rules by capturing intent across varied language and phrasing.</li><li><strong>LLMs</strong> contribute deeper reasoning only when additional understanding is helpful.</li></ul><p>By assigning each component a focused role, the system routes most emails efficiently while still handling complex cases with care. Insights from deeper analysis feed back into the rules, allowing the system to improve steadily over time.</p><h3><strong>Establishing Routing Knowledge from a Small Set of Examples</strong></h3><p>The system begins with representative email samples rather than large datasets. A large language model reviews these examples to understand:</p><ul><li>Core intent patterns</li><li>Category boundaries</li><li>Typical variations in language</li></ul><p>From this understanding, the model generates an initial set of routing rules. This learning step happens during setup or periodic refinement, making it independent of day-to-day email volume.</p><p>By separating learning from execution, the system establishes a strong foundation without tying cost to traffic.</p><h3><strong>Routing Most Emails with Rules and Contextual Understanding</strong></h3><p>Once routing rules are established, most emails are processed through a lightweight routing layer that combines:</p><ul><li>Deterministic routing rules</li><li>Contextual embeddings that capture semantic meaning</li></ul><p>Rules provide a clear and structured way to express routing intent. They define categories, boundaries, and known patterns in a form that is easy to reason about and update.</p><p>Contextual embeddings complement these rules by representing each email as a semantic vector. Rather than focusing on specific words or phrases, embeddings capture the <em>meaning</em> of the message as a whole. This allows the system to recognize similar intent even when emails use different wording, tone, or structure.</p><p>For example, two emails may describe the same issue using entirely different language. Contextual embeddings place these messages close together in semantic space, allowing the system to route them consistently without requiring explicit rules for every variation.</p><p>This combination offers several advantages:</p><ul><li><strong>Robustness to language variation</strong>: Emails expressing the same intent in different ways can be routed together naturally.</li><li><strong>Graceful handling of partial matches</strong>: When a rule does not fully apply, embedding similarity still provides meaningful signals.</li><li><strong>Better generalization from limited examples</strong>: A small number of examples can represent a broader range of real-world messages.</li></ul><p>By combining explicit rules with contextual understanding, the system achieves both clarity and flexibility. Most emails can be routed accurately and efficiently, even as writing styles and phrasing evolve over time.</p><p>These operations are computationally efficient and scale well with volume. As email traffic increases, routing performance remains stable because most messages are handled without invoking deeper reasoning. This design allows the system to maintain predictable throughput and latency as usage grows.</p><h3><strong>Using Confidence to Decide When More Analysis Is Needed</strong></h3><p>Confidence scoring plays a central role in both quality and cost control.</p><p>Each routing decision includes a confidence score that reflects how well the email aligns with existing knowledge. This score determines whether the system proceeds with the initial decision or applies additional analysis.</p><p>By using confidence as a control signal, the system naturally concentrates advanced processing on a small subset of emails.</p><h3><strong>Applying LLM Reasoning to Ambiguous or Novel Emails</strong></h3><p>When confidence is lower, the system brings in an LLM for a more detailed review.</p><p>This deeper analysis:</p><ul><li>Resolves ambiguity in complex emails</li><li>Ensures accurate routing for unfamiliar patterns</li><li>Produces insights that improve future decisions</li></ul><p>Because this step is selective, LLM usage remains proportional to novelty rather than overall volume.</p><h3><strong>Feeding What the Model Learns Back into the Rule Set</strong></h3><p>Every time the LLM is used, its output contributes to system improvement.</p><p>The model helps refine existing rules and introduce new ones, allowing similar emails to be handled confidently in the future. Over time, this leads to:</p><ul><li>Higher confidence scores</li><li>Fewer fallback cases</li><li>More consistent routing behavior</li></ul><p>As a result, the system becomes increasingly efficient as it operates.</p><h3><strong>Why the System Becomes More Cost-Efficient as It Scales</strong></h3><p>This architecture is designed so that operational cost grows slowly as volume increases.</p><ul><li>Rules and embeddings handle the majority of traffic</li><li>LLM reasoning is applied sparingly and purposefully</li><li>Learning reduces future reliance on advanced processing</li></ul><p>As the system matures, routing behavior stabilizes and per-email processing becomes more predictable.</p><p>This makes the approach well-suited for sustained, large-scale use.</p><h3><strong>The Continuous Loop That Keeps the System Improving</strong></h3><p>The system operates as a continuous loop:</p><ul><li>Learn from examples</li><li>Route efficiently at scale</li><li>Measure confidence</li><li>Apply deeper reasoning selectively</li><li>Improve internal knowledge</li></ul><p>Each cycle strengthens the system’s ability to handle both common and novel emails while maintaining steady performance.</p><h3><strong>Closing Thoughts</strong></h3><p>By combining semantic understanding, structured rules, and selective reasoning, the system supports high-volume email workflows while remaining adaptable. This is an approach that grows more capable and more efficient as usage increases — making it a practical foundation for real-world deployment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b573e310ee7f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ordinary-ai/an-intelligent-self-improving-email-routing-architecture-b573e310ee7f">An Intelligent Self-Improving Email Routing Architecture</a> was originally published in <a href="https://medium.com/ordinary-ai">Ordinary AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Make an LLM Handle Long Context — Without a Bigger Context Window]]></title>
            <link>https://ai.plainenglish.io/how-to-make-an-llm-handle-long-context-without-a-bigger-context-window-38fe5694f8fc?source=rss-13dd82bb11f0------2</link>
            <guid isPermaLink="false">https://medium.com/p/38fe5694f8fc</guid>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <category><![CDATA[observability]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Susan Apfel]]></dc:creator>
            <pubDate>Mon, 29 Dec 2025 08:18:26 GMT</pubDate>
            <atom:updated>2025-12-31T17:21:03.286Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>How to Make an LLM Handle Long Context — Without a Bigger Context Window</strong></h3><h3><strong>A system-level approach to continuous generation and orchestration</strong></h3><p>Large language models operate within a fixed context window, which limits their ability to handle long-running conversations or tasks. This article explores a system-level approach to continuous generation under fixed context limits, starting from simple prompt rebuilding and extending to parallel models, speculative generation, and orchestration. The focus is on managing long context explicitly rather than relying on a single model to remember everything.</p><p><strong>1. The simplest working solution: one model, periodic reruns</strong></p><p>The most straightforward way to handle long context is to use a single model and periodically rebuild its prompt.</p><p>The process is simple:</p><ul><li>The model generates normally.</li><li>When the context approaches the window limit:</li><li>earlier parts of the conversation are summarized,</li><li>a new prompt is constructed using the summary and recent turns,</li><li>the model is rerun from the new prompt.</li></ul><p>This approach works and requires no additional components. However, it has two limitations:</p><ul><li>generation must pause during summarization and prompt rebuilding,</li><li>rerunning the model introduces noticeable latency and recomputation.</li></ul><p>While functional, this approach does not provide a smooth user experience.</p><p><strong>2. Separating generation and summarization</strong></p><p>To reduce overhead, summarization can be separated from generation.</p><p>In this design:</p><ul><li>one model is responsible for generating user-facing output,</li><li>a second model is responsible for summarizing earlier context.</li></ul><p>This improves efficiency and allows summarization to be tuned independently. However, when the generator reaches its context limit, it still needs to stop and rerun using a newly constructed prompt. Latency is reduced but not eliminated.</p><p>At this stage, the system is cleaner, but interruptions remain visible.</p><p><strong>3. Parallel execution and controlled switching</strong></p><p>The next step is to run generation and context processing in parallel.</p><p>In this design:</p><ul><li>two model instances run concurrently,</li><li>one model actively generates output,</li><li>the other model processes the same context in the background to build an updated prompt and internal state,</li><li>when the active generator approaches its context limit, the background model takes over generation immediately,</li><li>no rerun or prompt recomputation is required; the roles of generator and summarizer are simply exchanged.</li></ul><p>Because the necessary work has already been completed, switching does not block generation. From the user’s perspective, output appears continuous even though internal state is rebuilt.</p><p>This is our first design that supports long-running generation without visible interruption.</p><p><strong>4. Cost optimization with speculative generation</strong></p><p>Once the system supports seamless switching, compute usage can be optimized.</p><p>Instead of relying exclusively on a large model for generation:</p><ul><li>a smaller model can generate tokens speculatively,</li><li>a larger model can verify or correct those tokens when necessary.</li></ul><p>This reduces cost and latency:</p><ul><li>small models handle most token generation,</li><li>large models are used selectively for verification,</li><li>overall throughput improves without changing the system structure.</li></ul><p>The architectural separation remains the same; only model roles change.</p><p><strong>5. Beyond summarization: context transformation</strong></p><p>At this point, the background component no longer needs to function solely as a summarizer.</p><p>The same mechanism can support:</p><ul><li>planning and task decomposition,</li><li>constraint extraction and preservation,</li><li>retrieval of relevant information (RAG-style),</li><li>embedding-based recall,</li><li>sparse filtering of irrelevant context,</li><li>policy or compliance checks.</li></ul><p>Rather than passing raw conversation history to the generator, the system provides a compact and task-relevant representation of prior context.</p><p>Summarization becomes one of several possible transformations.</p><p><strong>6. Extending the system with an organizer</strong></p><p>As more components are introduced — generators, summarizers, verifiers, retrievers — it becomes useful to coordinate them explicitly.</p><p>A central organizer can:</p><ul><li>decide which models run at each stage,</li><li>control when context is rebuilt or switched,</li><li>determine what information is injected into the generator,</li><li>enforce system-level constraints.</li></ul><p>The organizer does not need to be a powerful model. Its role is coordination and consistency, not generation.</p><p><strong>7. Transparency and observability</strong></p><p>Because memory, planning, and control are externalized, system behavior becomes easier to observe and reason about.</p><p>This makes it possible to:</p><ul><li>monitor when and how context is transformed,</li><li>trace failures to specific components,</li><li>audit decisions and memory updates,</li><li>evolve the system incrementally.</li></ul><p><strong>Closing thoughts</strong></p><p>By separating generation from memory management, transforming context instead of storing it verbatim, and coordinating multiple models, it is possible to build systems that support continuous generation under fixed context limits.</p><p><em>Note: This article was written with the help of an AI writing assistant. The ideas, structure, and technical direction were guided and edited by the author.</em></p><h3>A message from our Founder</h3><p><strong>Hey, </strong><a href="https://linkedin.com/in/sunilsandhu"><strong>Sunil</strong></a><strong> here.</strong> I wanted to take a moment to thank you for reading until the end and for being a part of this community.</p><p>Did you know that our team run these publications as a volunteer effort to over 3.5m monthly readers? <strong>We don’t receive any funding, we do this to support the community. ❤️</strong></p><p>If you want to show some love, please take a moment to <strong>follow me on </strong><a href="https://linkedin.com/in/sunilsandhu"><strong>LinkedIn</strong></a><strong>, </strong><a href="https://tiktok.com/@messyfounder"><strong>TikTok</strong></a>, <a href="https://instagram.com/sunilsandhu"><strong>Instagram</strong></a>. You can also subscribe to our <a href="https://newsletter.plainenglish.io/"><strong>weekly newsletter</strong></a>.</p><p>And before you go, don’t forget to <strong>clap</strong> and <strong>follow</strong> the writer️!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38fe5694f8fc" width="1" height="1" alt=""><hr><p><a href="https://ai.plainenglish.io/how-to-make-an-llm-handle-long-context-without-a-bigger-context-window-38fe5694f8fc">How to Make an LLM Handle Long Context — Without a Bigger Context Window</a> was originally published in <a href="https://ai.plainenglish.io/">Artificial Intelligence in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>