<?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 Sebastian Manassero on Medium]]></title>
        <description><![CDATA[Stories by Sebastian Manassero on Medium]]></description>
        <link>https://medium.com/@s.sebastianmanassero?source=rss-3c07393ab754------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*uyzlWCwcY64zOmR91jc94w.jpeg</url>
            <title>Stories by Sebastian Manassero on Medium</title>
            <link>https://medium.com/@s.sebastianmanassero?source=rss-3c07393ab754------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 18:52:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@s.sebastianmanassero/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[How polysemantic nature of neural networks hinders our understanding of them]]></title>
            <link>https://medium.com/@s.sebastianmanassero/how-polysemantic-nature-of-neural-networks-hinders-our-understanding-of-them-4a521cab9e00?source=rss-3c07393ab754------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a521cab9e00</guid>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Sebastian Manassero]]></dc:creator>
            <pubDate>Sat, 07 Feb 2026 04:17:52 GMT</pubDate>
            <atom:updated>2026-02-07T22:27:23.861Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*alNqyL8j1OpQvcS6Gbbmuw.png" /></figure><h4>Introduction</h4><p>We are currently living through a paradox in computer science. We have successfully built systems Large Language Models that can pass the Bar Exam, write code, and translate poetry with eerie proficiency. Yet, if you ask the engineers who built them <em>exactly</em> how the model decided to write a specific paragraph, they cannot tell you.</p><p>For decades, programming was about explicit instructions: if x, then y. But in the era of Deep Learning, we have replaced explicit logic with optimization. We define a goal, throw massive amounts of compute and data at it, and let the gradient descent algorithm figure out the internal wiring.</p><p>The result is a “Black Box” of unprecedented capability. We know the inputs, and we see the outputs, but the internal state the “thought process” is a chaotic soup of floating-point numbers. This isn’t just an academic curiosity; it is a critical safety problem. If we cannot identify which neurons represent “deception” or “bias,” we cannot reliably remove them.</p><p>To understand why looking inside a neural network is so difficult, and why standard debugging tools fail us, we have to look at how these models manage to learn so much with limited resources. We have to talk about the polysemantic nature of neurons.</p><h4>Why Polysemantic is a problem</h4><p>Imagine you have just been hired as the Chief Safety Engineer for a massive, alien spacecraft that was found drifting in orbit. This ship (the Model) flies perfectly. It can navigate asteroid fields, translate languages, and cook dinner. It is a miracle of efficiency. Your job is to make sure it doesn’t accidentally blow up the Earth.</p><p>You walk into the main control room to understand how it works. You expect to see a logical control panel: a button for “Thrusters,” a switch for “Lights,” and a dial for “Oxygen.” This is what we call a <strong>monosemantic</strong> layout one control, one function. It is safe because it is distinct.</p><p>But when you pry open the panel to look at the wiring, you realize with horror that the ship wasn’t built by a human engineer who likes order. It was built by an optimization algorithm (Gradient Descent) that only cares about saving space. The algorithm realized it had ten thousand complex systems to control, but only 512 wires (neurons) to connect them.</p><p>So, instead of adding more wires, it decided to cheat. It used the mathematical phenomenon of <strong>superposition</strong>.</p><p>It bundled the signals together. You trace a single copper wire running from the dashboard. At first, it looks like this wire controls the <strong>“Cabin Temperature.”</strong> When you send a standard 5-volt signal down it, the room gets warmer. Simple.</p><p>But then you look closer. You realize that <em>exact same wire</em> is also connected to the <strong>“Nuclear Warhead Arming Mechanism.”</strong></p><p>How does the ship distinguish between them? The algorithm figured out that “changing the temperature” and “launching a nuke” almost never happen at the exact same time. So, it decided to use a slightly different frequency or vector direction on the same wire to represent the Nuke. It compressed two totally unrelated concepts into one physical channel to be efficient. The wire is now <strong>polysemantic</strong>.</p><p>To the “Efficiency Camp” (the folks who just want the ship to fly fast), this is a feature. Look how much copper they saved! Look how much intelligence they crammed into such a small computer!</p><p>But to you, the Safety Engineer, this is a nightmare.</p><p>Here is the problem: You want to intervene. You want to install a safety guardrail that prevents the cabin from getting too hot. But because of superposition, you cannot simply cut the “Temperature” wire or put a limit on it. If you dampen the signal to lower the heat, you might inadvertently dampen the “Don’t Explode” signal that was riding piggyback on that same wire.</p><p>You are staring at a “Black Box” where pulling a lever to save a life might accidentally trigger a catastrophe, simply because the machine decided those two concepts could share a seat on the bus.</p><p>This is why the Anthropic researchers are obsessed with <strong>Sparse Autoencoders</strong>. They are trying to build a “decoder ring” a special lens that you can place over that single, messy wire to visually separate the “Temperature” signal from the “Nuke” signal. Until they can untangle these superposed wires, they argue that we are flying a ship we fundamentally do not control, pressing buttons that do five different things depending on context we can’t fully see.</p><p><strong>The Geometry of Compression: Why Dimensions Are a Lie</strong></p><p>To understand why the ship is wired this way, we have to abandon our Euclidean intuition of 3D space. In the 3D world, you can have at most three perpendicular (orthogonal) lines meeting at a point (x, y, z). If you want to add a fourth independent line, you can’t.</p><p>But Neural Networks operate in massive high-dimensional spaces (e.g., d<em>model</em> = 4096$ or $12288$).</p><p>Here is the counter-intuitive property of high-dimensional geometry that models exploit: <strong>The Johnson-Lindenstrauss Lemma</strong>. In simple terms, as you increase dimensions, the number of “almost orthogonal” directions grows exponentially, not linearly.</p><p>In a 4096-dimensional space, there aren’t just 4096 directions where you can store information without overlap. There are millions of directions that are <em>nearly</em> perpendicular to each other.</p><p><strong>The Linear Representation Hypothesis</strong></p><p>We usually model a concept (a “feature”) as a direction vector in the activation space.</p><p>Let’s say we have a feature <em>fi</em> (e.g., “Golden Retriever”) and a feature <em>fj</em> (e.g., “The concept of irony”).</p><p>Ideally, we want their dot product to be zero:</p><p><em>vi</em> <strong>.</strong> <em>vj </em>= <em>E</em></p><p>This means they are orthogonal. If the “Golden Retriever” neuron fires, it projects exactly <strong>zero</strong> value onto the “Irony” vector. Safe. Clean. Monosemantic.</p><p><strong>The Reality: Soft Interference</strong></p><p>Because the model wants to represent <strong><em>N</em></strong> features where <em>N</em> &gt; d<em>model</em>, it forces the vectors to squeeze together. They accept a non-zero dot product:</p><p><em>vi</em><strong> .</strong> <em>vj</em> = <em>E</em></p><p>Where <em>E</em> is a tiny bit of noise.</p><p>This is <strong>Superposition</strong>.</p><p>When the model activates the “Golden Retriever” feature, it is mathematically unavoidable that it also slightly activates the “Irony” feature (and the “HTML syntax” feature, and the “French Poetry” feature).</p><p>From the model’s perspective, this <strong><em>E</em></strong> is just background static noise it can ignore thanks to non-linearities (like ReLU) which act as noise gates, cutting off low-level interference. The signal for “Golden Retriever” is strong enough to survive; the “Irony” ghost signal is weak enough to be crushed by the ReLU.</p><p><strong>The Problem: “Feature Interference” is unpredictable</strong></p><p>The danger arises when this interference isn’t just static. If enough unrelated features activate at once, their <strong><em>E</em></strong> noise can constructively interfere summing up to trigger a feature that shouldn’t be there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/322/1*iSzLNblNu6Z66A210cLjAw.png" /></figure><p>This is the “Black Box” nature of LLMs. A specific combination of benign inputs can accidentally push a suppressed “unsafe” vector across the activation threshold, simply because of the geometry of the embedding space.</p><p><strong>The Solution: Sparse Autoencoders (SAEs)</strong></p><p>This is why we (the safety team) are building Sparse Autoencoders.</p><p>An SAE is essentially a “dictionary learning” machine. We take the compressed, noisy activation vector <strong><em>x</em></strong> from the middle of the model, and we project it into a strictly larger space (a massive expansion, often 32x or 64x the size of the original model).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/240/1*kVqvUfPCtAUDRXq2whLwxA.png" /></figure><p>By forcing this new representation to be <strong>sparse</strong> (mostly zeros), we force the model to disentangle the “almost orthogonal” directions back into true, distinct components. We are effectively paying the computational cost that the original model tried to save, just so we can read the dials again.</p><h4>The new control</h4><p>Why does this geometric nuance matter to anyone outside of a research lab? Because it fundamentally breaks our ability to “debug” AI.</p><p>In traditional software, if a program crashes, you check the logs, find the faulty variable, and fix it. In a polysemantic neural network, there is no single variable for “bad behavior.” Because of superposition, concepts like “harmful instructions,” “creative writing,” and “Python coding” might all share the same subset of neurons.</p><p>If you try to simply lobotomize the model to stop it from being harmful (by suppressing those neurons), you might accidentally degrade its ability to write code or speak French. This is likely why we see “tax on alignment” where making a model safer often makes it slightly dumber or less capable. The safety features and the capability features are geometrically entangled.</p><p>Until we solve this, “AI Alignment” is akin to performing brain surgery with a sledgehammer. We are hitting the model and hoping we only damage the bad parts, without understanding that the bad parts and the good parts are physically weaving through the same coordinates.</p><h4>From BlackBox to a Book</h4><p>For the last decade, AI development has been closer to alchemy than engineering. We mixed ingredients in a cauldron (architecture, data, compute), stirred them up, and marveled at the gold that appeared, without understanding the chemical reaction that produced it.</p><p>The move toward Sparse Autoencoders and the study of superposition marks a pivotal shift. We are finally starting to build the tools of anatomy. We are moving away from treating the model as a mysterious oracle and starting to treat it as a machine with inspectable, understandable parts.</p><p>The “Alien Spacecraft” is still dangerous, and it is still efficiently wired by an optimization algorithm that doesn’t care about human understanding. But with tools like SAEs, we are finally sketching a blueprint of the control panel. We are learning to untangle the wires. And for the Chief Safety Engineer, that is the first step toward actually flying the ship, rather than just hoping it doesn’t crash.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a521cab9e00" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why LangChain (technically) sucks]]></title>
            <link>https://medium.com/@s.sebastianmanassero/why-langchain-technically-sucks-569b25d3687f?source=rss-3c07393ab754------2</link>
            <guid isPermaLink="false">https://medium.com/p/569b25d3687f</guid>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Sebastian Manassero]]></dc:creator>
            <pubDate>Sat, 25 Oct 2025 17:33:53 GMT</pubDate>
            <atom:updated>2025-10-25T17:33:53.945Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve ever tried to take a LangChain prototype into production, you probably hit the same wall the rest of us did.<br> It’s slow. It’s opaque. It’s <strong>magically over-engineered for simple tasks</strong> and yet weirdly fragile for complex ones.</p><p>Under the hood, LangChain piles abstractions over abstractions — “chains”, “runnables”, “agents”, “tools”, “callbacks”… until your once-clear LLM pipeline turns into a dependency graph that looks like spaghetti code in JSON form. Debugging becomes an archeological dig.<br> Type hints are vague, execution tracing is inconsistent, and extending a class often means <strong>reverse-engineering the framework’s internals</strong> rather than building cleanly on top of it.</p><p>And don’t even get me started on <strong>state management</strong>: every “memory” component behaves differently depending on which wrapper you use, half of them leak tokens, and caching feels like a fragile hack rather than a design pattern.<br> In short — LangChain is a brilliant idea wrapped in questionable engineering decisions.</p><p>But here’s the paradox:<br> <strong>if LangChain is so technically flawed, why does everyone keep using it?</strong></p><h3>Why LangChain sucks</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AGV06Bf1A5Bwp9Ig" /><figcaption>I took this image from <a href="https://www.reddit.com/r/LangChain/comments/1hknn5a/comment/m3fo2tf/?utm_source=share&amp;utm_medium=web3x&amp;utm_name=web3xcss&amp;utm_term=1&amp;utm_content=share_button">this</a> Reddit comment that I found quite accurate</figcaption></figure><h4>1. Excessive abstractions limiting control</h4><p>LangChain introduces multiple abstraction layers: chains, agents, tools, callbacks, memory, output parsers, prompt templates. For example, a simple translation workflow that requires approximately ten lines with the OpenAI Python library suddenly becomes a structure with three different classes, a “chain,” and a “parser” when implemented using LangChain.</p><p>This leads to code that is harder to understand and maintain. Developers spend as much time deciphering the abstraction as implementing business logic.</p><p>Whenever extensibility or non-standard behavior is required, these abstractions become a constraint. Common frustrations include “I cannot access the internal state” or “I have to hack the framework to make it do what I need.”</p><h4>2. Dependency bloat, complexity, and maintenance burden</h4><p>LangChain ships with support for many vector databases, multiple LLM providers, document loaders, different agent architectures, and more. This creates a significant “dependency bloat,” adding libraries you likely do not need. The result is increased risk of version conflicts, bugs, and heavier production deployments.</p><p>The framework evolves rapidly. Frequent API changes and breaking releases within the 0.x lifecycle mean that using LangChain in production requires constant attention to upgrades, migrations, and refactors.</p><p>In summary, the complexity and maintenance cost can outweigh the benefits as the system scales or becomes business-critical.</p><h4>3. Performance overhead, latency, and operational cost</h4><p>Every added chain step or tool invocation represents another call, another abstraction layer, another wrapper. In production environments where latency matters, this overhead becomes a performance tax.</p><p>Workloads such as retrieval-augmented generation (RAG) or multi-step agent frameworks can become slow, costly, and hard to optimize due to increased token usage and data flow complexity.</p><h4>4. Difficult scalability, observability, and debugging</h4><p>Production systems require clear traceability, metrics, logs, shared states, and robust error handling. LangChain often abstracts these concerns away, resulting in “black boxes” that are complicated to inspect. For example, an agent’s lifecycle does not always expose internal state or decision reasoning.</p><p>When failures occur in production (token overflow, memory leaks, misconfigured caching), identifying the root cause often requires deep knowledge of the framework. This introduces technical debt and slows incident response.</p><h4>5. Limited customization leading to “hacks” for special cases</h4><p>For workflows with highly specific requirements, such as multi-model pipelines, dynamic conditional logic, or custom low-level tooling, LangChain can become a blocker rather than an enabler.</p><p>The framework is designed for common use cases such as chatbots, Q&amp;A, or simple RAG. Once the system enters more demanding scenarios, engineers often end up retrofitting or bypassing the abstraction entirely.</p><h3>So… why is LangChain still being used?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/431/0*IVwxq6dvAWr2zdy5.jpg" /></figure><p>Despite its technical limitations, LangChain continues to be widely adopted because it enables developers to build functional prototypes extremely fast. Its value proposition does not lie in perfect optimization, but in reducing the initial friction of development. The real question is not “is this framework flawless?”, but rather “does it help me ship a PoC or a first version faster?”.</p><p>It resembles choosing between having a Google-level engineering team to build your AI copilots from scratch versus using an accessible automation platform like n8n. The first option would likely yield the most scalable, robust, and finely tuned solution. However, most companies do not have such a team, nor the budget, nor months to iterate. That is exactly where LangChain becomes valuable: it abstracts enough complexity to deliver something useful today, without needing a squad of specialists.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=569b25d3687f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>