<?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 Albin Abel on Medium]]></title>
        <description><![CDATA[Stories by Albin Abel on Medium]]></description>
        <link>https://medium.com/@albinabel?source=rss-29d1b7b1dd0a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*AKUcio2memKDX0NQ.jpg</url>
            <title>Stories by Albin Abel on Medium</title>
            <link>https://medium.com/@albinabel?source=rss-29d1b7b1dd0a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 21:59:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@albinabel/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 Sensitivity Map]]></title>
            <link>https://medium.com/@albinabel/the-sensitivity-map-c71ffaa06001?source=rss-29d1b7b1dd0a------2</link>
            <guid isPermaLink="false">https://medium.com/p/c71ffaa06001</guid>
            <category><![CDATA[jacobian-matrix]]></category>
            <category><![CDATA[explainable-ai]]></category>
            <category><![CDATA[model-interpretability]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[neural-networks]]></category>
            <dc:creator><![CDATA[Albin Abel]]></dc:creator>
            <pubDate>Sun, 22 Nov 2026 17:23:00 GMT</pubDate>
            <atom:updated>2026-11-22T17:23:00.463Z</atom:updated>
            <content:encoded><![CDATA[<h3>Our tiny neural network scored 100%. Then we asked it a different question, “what would it take to change your mind?”, and it showed us how it thinks.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WbwcpGG7GmsmfG9jJsgk6Q.jpeg" /><figcaption><em>Every answer a network gives has a hidden twin: a map of how easily that answer could change.</em></figcaption></figure><p>There’s a question we almost never ask a machine learning model.</p><p>We ask whether it is right. We ask how often it is right. We draw confusion matrices and accuracy curves and we celebrate when the number reaches the high nineties.</p><p>We rarely ask: <strong>if I changed the input a tiny bit, how much would your answer move?</strong></p><p>That question has a name. Mathematicians call the answer the <strong>Jacobian</strong>. It sounds intimidating, like something reserved for the last chapter of a calculus book. But the idea underneath is one you already use every day. When you adjust a shower tap a hair and the water goes from freezing to scalding, you’ve just met a large Jacobian. When you turn the volume knob on an old radio and nothing happens until the very end, you’ve met a small one.</p><p>In this article we’ll train a tiny neural network and get it working perfectly. Then we’ll do something more interesting than measuring its accuracy. We’ll <strong>nudge it</strong>, gently, in different places (different fruit, i.e. different points on the firmness/sweetness map) and in different directions (towards firmness or towards sweetness), and watch what happens. Its Jacobian will tell us where the network is calm, where it sits on a knife’s edge, what shape it really has inside, and which of its hidden neurons are making the decisions.</p><p>No heavy formulas. Every number below comes from an experiment you can run on a laptop in a couple of minutes.</p><p>Let’s go to the orchard.</p><h3>The Orchard</h3><p>Picture a small fruit co-op at the edge of a valley. Every evening, crates of fruit arrive from a dozen farms, and someone has to decide which fruit is <strong>ready</strong> to ship tomorrow and which needs a few more days.</p><p>The co-op’s old head grader could tell at a glance. The new conveyor belt can’t glance. It has two sensors:</p><ul><li>a <strong>firmness</strong> probe that gently presses the skin, and</li><li>a <strong>sweetness</strong> reader that measures sugar through the peel.</li></ul><p>The trouble is that “ready” isn’t a simple rule. It’s not just “sweeter than X” or “softer than Y.” Plotted on a chart, the ready fruit and the not-ready fruit form two interlocking crescents, like two hands clasped together. No straight line can separate them.</p><p>So the co-op does what everyone does now: it trains a small neural network.</p><p>Our network is deliberately tiny so we can see everything it does:</p><ul><li><strong>2 inputs</strong>: firmness and sweetness (both scaled to a common range)</li><li><strong>2 hidden layers</strong> of 16 neurons each, using the most common on/off switch in deep learning, the ReLU</li><li><strong>1 output</strong>: the probability that a fruit is ready</li></ul><p>We trained it on 900 fruit and tested it on 300 it had never seen. (The fruit are synthetic, the classic “two moons” dataset dressed up in an apron.)</p><p>The result: <strong>100% correct on the training fruit. 100% correct on the test fruit.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5TK3v2aXBjkrGKTkFtLx-Q.png" /><figcaption><em>Left: the network’s verdict across every possible fruit (blue = ready, orange = not ready). Right: the same network seen through its Jacobian. Hold that right-hand picture in mind; we’ll come back to it. </em>The length is the steepness of the ramp at that spot (gradient). In the zoom-in picture of Part One, it’s the tilt.</figcaption></figure><p>By the usual standard, we’re done. Ship it.</p><p>But look at the right-hand panel. That’s the same network, seen through a different lens. Most of the map is blank, and a single thin, dark ribbon snakes through it. That ribbon is the story of this article.</p><h3>Part One: What a Jacobian Actually Is</h3><p>Forget the word for a moment. Think about <strong>zooming in</strong>.</p><p>Take any smooth, curvy line, such as the profile of a hill, a stock chart or the path of a thrown ball. Zoom in on one point. Then zoom in further. At some point the curve stops looking curved. Up close, every smooth curve looks like a straight ramp.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KC1EaQbAmlB0kKFNqt2Jqw.png" /><figcaption><em>Zoom in on any spot of a smooth function and it becomes a straight ramp. The tilt of that ramp is the Jacobian at that spot.</em></figcaption></figure><p>The <strong>tilt of that ramp</strong> is the Jacobian. It is the network’s answer to: <em>“Right here, if you push the input a tiny bit, how much does my output move, and in which direction?”</em></p><p>Our fruit sorter has two inputs, so at any fruit the Jacobian is just two numbers:</p><ul><li>how much the ready-score moves when you nudge <strong>firmness</strong>, and</li><li>how much it moves when you nudge <strong>sweetness</strong>.</li></ul><p>A big network with many inputs and many outputs has the same thing, just bigger: a table with one row per output and one column per input. Each layer can have its own Jacobian. Each cell answers one question: <em>“If I wiggle this input, how much does that output wiggle?”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h6sBaT71gzXAYJNYdW2ueA.png" /><figcaption><em>The Jacobian is a sensitivity sheet. For a real network, it’s a large table; for our fruit sorter, it’s just two cells. </em>Here “inputs” and “outputs” mean the network’s very first inputs and very last outputs. Every layer inside has its own smaller table too, and multiplying them together gives the big one. That multiplication is backpropagation.</figcaption></figure><p>Two things make the Jacobian interesting rather than just tidy:</p><ol><li><strong>It’s local.</strong> The sheet is only true <em>right here</em>. Move to a different fruit and you get a completely different sheet.</li><li><strong>It’s a forecast.</strong> It predicts what a small nudge will do. Whether that prediction holds for a big nudge is a separate question, and the answer turns out to be one of the most revealing things about a network.</li></ol><blockquote><strong><em>For the curious (skip freely):</em></strong><em> if a network maps inputs </em>x₁…xₙ<em> to outputs </em>y₁…yₘ<em>, its Jacobian is the </em>m × n<em> table of partial derivatives </em>∂yᵢ/∂xⱼ<em>. With one output, it’s simply the gradient. </em>In our network: <br> <strong>Hidden layer 1:</strong> 2 inputs → 16 outputs, Jacobian 16 × 2</blockquote><blockquote><strong>Hidden layer 2:</strong> 16 inputs → 16 outputs, Jacobian 16 × 16</blockquote><blockquote><strong>Output layer:</strong> 16 inputs → 1 output, Jacobian 1 × 16</blockquote><blockquote><strong>How they connect.</strong> <em>Multiply the layer Jacobians in order: (1×16) · (16×16) · (16×2) = (1×2). This is the whole-network Jacobian. It is the chain rule, the same chain of Jacobians, multiplied layer by layer, is exactly what backpropagation computes during training. The network has been using its Jacobian all along; we’re just reading it back out.</em></blockquote><h3>Part Two: Drawing the Sensitivity Map</h3><p>Now let’s draw it. For tens of thousands of points covering every possible combination of firmness and sweetness, we asked the trained network for its Jacobian and measured how long it is: in effect, <em>how much the answer moves per unit of nudge</em>. That’s the right-hand panel you saw earlier.</p><p>Here’s what it shows, in numbers:</p><ul><li>The zone where the network is genuinely uncertain (between 30% and 70% “ready”) covers <strong>less than 1% of the map (0.9%)</strong>.</li><li>That sliver holds <strong>40% of all the network’s sensitivity</strong>.</li><li>On average, a fruit near the boundary is about <strong>1,000 times more sensitive</strong> to a nudge than a fruit far from it.</li><li>For <strong>90% of the test fruit</strong>, the Jacobian of the ready-probability is effectively <strong>zero</strong>. You can nudge them and the answer won’t budge.</li></ul><p>Read that last point again. Nine out of ten fruit live in places where the network is, in a practical sense, <strong>deaf</strong>. Push the sensors up or down and its answer stays put.</p><p>Is that good? For a fruit that is obviously ripe, yes: we want a calm verdict. But it also means the network has squeezed all of its doubt into a thin wall, and it’s extremely jumpy on that wall.</p><p>Our 100% accurate network isn’t a gentle hillside. <strong>It’s a plateau with a cliff.</strong></p><p>Accuracy can’t show you that. Accuracy only checks where each fruit landed. The Jacobian shows you what the ground is like around it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KXdTHeKTikbp7LJ1oVnHqg.png" /></figure><h3>Part Three: The Nudge Test</h3><p>Let’s step onto the cliff edge.</p><p>From the test set, we picked the fruit the network was least sure about. We’ll call it <strong>the fence-sitter</strong>. The network gives it a 29% chance of being ready, so it narrowly lands on “not ready.” For contrast, we also picked the fruit the network was most sure about: <strong>the deep-inside fruit</strong>, rated 100% ready.</p><p>Then we nudged each one in two directions:</p><ul><li><strong>Along the Jacobian</strong>: the direction the network says is steepest.</li><li><strong>Sideways</strong>: a nudge of exactly the same size, at right angles to the first to make it a fair test.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qEGyFOb8rXnP0RdZBltfoA.jpeg" /><figcaption><em>A hiker on a hillside with contour lines. A blue arrow heads straight uphill, along the Jacobian where the height changes fast. An orange dotted line runs along the contour for a short way i.e. the nudge happens but not change the output which works as control data in the experiment, then drifts off it as the contour bends, so a second hiker ends up higher up. The sideways nudge hold for small nudges, large nudge still changes the output.</em></figcaption></figure><p>For each nudge, we compared the Jacobian’s <em>forecast</em> with what <em>actually</em> happened.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8OF7pwrhhUloSd183ZWOFg.png" /><figcaption><em>Dashed lines are the Jacobian’s forecast; solid lines are what the network actually did. The forecast is excellent for a tiny nudge and useless for a slightly larger one.</em></figcaption></figure><p>Here’s what we saw at the fence-sitter.</p><p><strong>A nudge of 0.01 along the Jacobian</strong> (about a third of a percent of the sensor’s range) was forecast to raise the ready-probability by 0.39. It actually rose by 0.44. That’s a good forecast, and it’s also alarming: <strong>a change too small for any real sensor to notice flipped the verdict from “not ready” to “ready.”</strong></p><p><strong>A nudge of 0.05</strong> was forecast to raise the probability by 1.94. That’s impossible, since a probability can’t go above 1. The real rise was 0.71, because the fruit had already gone over the edge and hit the ceiling. The forecast assumed the ramp continues forever, but the network had already flattened out.</p><p><strong>The sideways nudges</strong> were forecast to change nothing, and up to a nudge of 0.1 they changed nothing at all: zero, to four decimal places. The network simply didn’t care about that direction. But at 0.4 the sideways nudge also flipped the fruit, because the boundary curves round and eventually meets you from the side.</p><p>And the deep-inside fruit? Its Jacobian was zero, so the forecast was “nothing will happen.” Every nudge up to 0.4, in both directions, changed nothing.</p><p>So the Jacobian behaves like a <strong>local weather forecast</strong>: very reliable for the next five minutes and unreliable for next week. But within its range, it tells you something no accuracy score can: <strong>the cheapest way to change the network’s mind</strong>.</p><p>We checked that across 300 test fruit. Walking along each fruit’s Jacobian, the median distance to flip its verdict was <strong>0.43</strong>. Walking in a random direction, <strong>half the fruit never flipped at all</strong>, even after travelling roughly the width of the entire map.</p><p>The Jacobian points to the network’s weak spot.</p><p>That idea is the seed of a whole field. The famous “adversarial examples”, where an image classifier confidently calls a panda a gibbon after a few pixels change in ways no human can see, are exactly this: nudges along the Jacobian. In a network with millions of inputs there are a huge number of directions to nudge, and the Jacobian points straight at the one that hurts most.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cQfHcTCeH_4_WXciZIt81g.jpeg" /></figure><h3>Part Four: The Hidden Mosaic</h3><p>Something about the fence-sitter’s forecast bothered us. For tiny nudges it wasn’t just <em>good</em>; it looked <em>too</em> good. So we repeated the test on the network’s raw internal score (the number it computes <em>before</em> squashing it into a probability) and printed more decimal places.</p><ul><li>Nudge of 0.001: forecast <strong>−0.133563</strong>, actual <strong>−0.133563</strong></li><li>Nudge of 0.01: forecast <strong>−1.335627</strong>, actual <strong>−1.335624</strong></li><li>Nudge of 0.05: forecast <strong>−6.678137</strong>, actual <strong>−6.678138</strong></li><li>Nudge of 0.1: forecast <strong>−13.36</strong>, actual <strong>−12.82</strong> ← suddenly wrong</li></ul><p>The forecast was exact to six decimal places, and then, between 0.05 and 0.1, it suddenly broke down.</p><p>The forecast didn’t drift slowly away from reality. It was exact, and then it was wrong. Something must have a hard edge.</p><p>It does. Remember the ReLU switches inside the network? Each one is either <em>off</em> (outputs zero) or <em>on</em> (passes its input straight through). Within any region where <strong>no switch changes state</strong>, the whole network is just a fixed stack of multiplications and additions. In other words, it’s perfectly <strong>flat</strong>: one tilted plane, with one fixed Jacobian.</p><p>Cross a line where any single neuron flips on or off, and you step onto a different flat tile with a different tilt.</p><p>So we coloured the map by Jacobian. Every point with the same Jacobian belongs to the same tile.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NzdTHIL9V8XctEAnFGVxyg.png" /><figcaption><em>The network’s input space is a mosaic of flat tiles. Inside each tile, the network is a perfectly straight ramp. The curved decision boundary is really a chain of straight segments.</em></figcaption></figure><p>In the view we drew, <strong>203 flat tiles</strong>. Look closely at the decision boundary (the black line) and you’ll see it isn’t curved at all. It’s a chain of straight segments, joined at the corners where tiles meet. The tiles are packed densely along the boundary and spread out where nothing much happens.</p><p>This is one of the most clarifying facts in deep learning, and it’s hidden behind the word “nonlinear”:</p><blockquote><strong><em>A ReLU network is a patchwork of simple linear models, stitched together. The Jacobian is the label on each patch.</em></strong></blockquote><p>The “intelligence” lies in <em>where</em> the stitches go. Training is the process of deciding where to cut the input space and how to tilt each piece.</p><h3>Part Five: Who Is On Duty?</h3><p>So far we’ve nudged the <em>inputs</em>. But we can also take the Jacobian with respect to the network’s <strong>hidden neurons</strong> and ask: <em>if this neuron got slightly louder, how much would the final answer move?</em></p><p>For the last hidden layer this is especially clean. Each neuron’s sensitivity is just its outgoing weight, and its actual influence on a given fruit is that weight times how active it is. That lets us ask, at every point on the map: <strong>which neuron is shouting loudest right here?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tjfEHjKDZ9F7q4dFNYsX9w.png" /><figcaption><em>At each spot, the single hidden neuron with the most influence on the answer. Two neurons run most of the map.</em></figcaption></figure><p>The answer surprised us with how <em>organised</em> it was.</p><ul><li><strong>Neuron 15</strong> pushes towards “ready” (outgoing weight +2.83). It’s the loudest voice across <strong>46%</strong> of the map.</li><li><strong>Neuron 7</strong> pushes towards “not ready” (weight −2.53). It’s the loudest across <strong>39%</strong>.</li><li>Three other neurons share the remaining 14%.</li><li><strong>Four of the 16 neurons never switch on anywhere in the map.</strong> They are, in practice, dead weight.</li><li>At any given fruit, only about <strong>7 of the 16</strong> neurons are active at all.</li></ul><p>Nobody designed this division of labour. It emerged from training. The Jacobian lets us read it.</p><p>Then we ran the decisive test: <strong>silence a neuron and see what happens.</strong></p><p><strong>At the fence-sitter</strong>, we found the neurons’ votes almost perfectly balanced. Neuron 7 was pulling hard towards “not ready” (−4.89), neuron 15 hard towards “ready” (+3.55), and nine others were adding smaller pushes either way. The total came out at just under the line.</p><ul><li>Silence <strong>neuron 7</strong>, the loudest: the ready-probability jumps from <strong>0.29 to 0.98</strong>. The verdict flips.</li><li>Silence the <strong>quietest active neuron</strong> instead: it still moves, from <strong>0.29 to 0.15</strong>.</li><li><em>Double</em> neuron 7: it collapses to <strong>0.003</strong>.</li></ul><p><strong>At the deep-inside fruit</strong>, the votes looked completely different. Almost every active neuron pushed towards “ready”, for a combined score of about +32. Neuron 15 alone contributed +10.5.</p><ul><li>Silence <strong>neuron 15</strong>, the loudest: the ready-probability stays at <strong>1.000</strong>.</li></ul><p>That’s the mechanism, in plain view:</p><blockquote><strong><em>On the fence, the network is a hung jury.</em></strong><em> The votes almost cancel, so any single juror, even a quiet one, can swing the verdict. </em><strong><em>Deep inside, it’s a landslide.</em></strong><em> Remove the loudest voice and the outcome doesn’t change.</em></blockquote><p>And this is <em>why</em> the sensitivity map looks the way it does. The thin dark ribbon from Part Two is simply where the jury is split. The large quiet plateaus are where it isn’t. The Jacobian didn’t just measure the network’s sensitivity. Combined with a few targeted nudges, it explained it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xtYXZVRSJyD6Q8t8r6eIyQ.jpeg" /></figure><h3>Part Six: Sculpting the Jacobian</h3><p>If the Jacobian shows where a network is jumpy, can we <em>teach</em> it to be less jumpy?</p><p>We can. During training, alongside “get the answer right,” we added a second, small penalty: <strong>“and keep your Jacobian short.”</strong> In code, that’s three extra lines (shown at the end). The network now has to balance two goals: be correct, and don’t overreact to tiny changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qMagqqSkcHh9ClB_TlIApA.png" /><figcaption><em>Same data, same network size. Left: plain training produces a cliff. Right: with a light Jacobian penalty, the cliff becomes a slope, with its peak sensitivity about 36 times lower.</em></figcaption></figure><p>The shape changes dramatically. The thin ribbon widens into a broad, gentle band. The peak sensitivity drops from about <strong>53 to 1.5</strong>. Instead of a cliff, the network now has a slope: its confidence fades gradually as a fruit approaches the boundary.</p><p>But does that make it <em>better</em>? Here we have to be honest, because the answer is “a bit, and only up to a point.”</p><p>We turned the penalty up from zero to very strong, trained three networks at each setting, and tested them two ways: on clean fruit, and on fruit read by a <strong>noisy sensor</strong> (we added random jitter to every reading).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LyDqlcgE7KD5OQ_Nq9gaSQ.png" /><figcaption><em>A light Jacobian penalty trades a little clean accuracy for a little noise resistance. Push the dial too far and the network gets worse at everything.</em></figcaption></figure><p>Averaged over three runs:</p><ul><li><strong>No penalty:</strong> 100% on clean fruit, <strong>88.4%</strong> with a heavily noisy sensor.</li><li><strong>Light penalty (0.003):</strong> <strong>99.0%</strong> clean, <strong>90.6%</strong> noisy. It gives up one point of clean accuracy and gains about two under heavy noise.</li><li><strong>Heavy penalty (0.1):</strong> <strong>84.7%</strong> clean, <strong>82.7%</strong> noisy. It’s worse at everything.</li><li>With <em>mild</em> sensor noise, the light penalty made essentially no difference (94.8% vs 95.0%).</li></ul><p>So the Jacobian is a dial, not a magic switch. Turn it a little and the network becomes calmer and somewhat harder to push over the edge. On our 300 test fruit, the median distance needed to flip a verdict grew from 0.43 to 0.53. Turn it a lot and the network becomes so calm it stops paying attention.</p><p>That’s the real lesson: <strong>the cliff isn’t a bug. It’s a choice the training process made because nothing told it otherwise.</strong> Once you can see the Jacobian, you can have an opinion about it.</p><h3>What We Learned From Nudging</h3><p>Let’s collect the clues:</p><ol><li><strong>Accuracy shows where the answers landed. The Jacobian shows what the ground is like around them.</strong> Our perfect network was a plateau with a cliff, and only the Jacobian showed it.</li><li><strong>The Jacobian is a local forecast.</strong> It’s exact for tiny nudges and wrong for large ones. How quickly it goes wrong is itself informative.</li><li><strong>It points to the weak spot.</strong> Following it flipped verdicts with nudges far smaller than random pushes needed. That’s the core of adversarial examples.</li><li><strong>ReLU networks are mosaics.</strong> Inside each tile the network is perfectly linear. The Jacobian is the tile’s label, and its sudden jumps reveal the tile edges.</li><li><strong>Hidden-layer Jacobians reveal who’s in charge.</strong> Two neurons ran most of the map, four did nothing, and the difference between a hung jury and a landslide explained the whole sensitivity map.</li><li><strong>You can shape it.</strong> A small Jacobian penalty turned the cliff into a slope. The benefit was real but modest, and too much of it hurt.</li></ol><p>A word of caution: this is a two-input toy. Real networks have millions of inputs, the sensitivity sheet becomes enormous, and reading it is much harder. Gradient-based “saliency maps” for images, for example, are known to be noisy and sometimes misleading. The intuitions carry over; the clean pictures don’t always.</p><h3>Where You’ve Already Met the Jacobian</h3><p>Once you know its name, you’ll find it in many places:</p><ul><li><strong>Training itself.</strong> Backpropagation is a chain of Jacobians multiplied together, layer by layer. Every network you’ve ever trained was built on this.</li><li><strong>Saliency maps.</strong> The heatmaps that show “which pixels the model looked at” are Jacobians of the output with respect to the image.</li><li><strong>Adversarial attacks and defences.</strong> Attacks follow the Jacobian; many defences try to shorten it.</li><li><strong>Robustness and smoothness.</strong> Penalties like the one we used, along with related limits on how steep a network may be, are standard tools for making models less brittle.</li><li><strong>Interpretability research.</strong> Asking “how much does this internal feature move that output?” is a Jacobian question, whether the model has 16 neurons or billions of parameters.</li></ul><h3>Try It Yourself (a little bit of code)</h3><p>Everything above runs on a laptop CPU in a few minutes. Here’s the core in PyTorch.</p><p><strong>Read the Jacobian at one fruit:</strong></p><pre>import torch<br>from torch.autograd.functional import jacobian<br><br>fruit = torch.tensor([0.81, 0.01])            # firmness, sweetness (scaled) <br>J = jacobian(lambda x: torch.sigmoid(model(x)), fruit) # PyTorch computes the slope exactly with backpropagation, the same machinery used in training.<br>print(J)   # how much &#39;ready&#39; moves per nudge of each sensor</pre><p><strong>Run the nudge test:</strong></p><pre>direction = J.flatten() / J.norm()            # the steepest direction<br>for size in [0.001, 0.01, 0.05, 0.1]:<br>    nudge = size * direction<br>    #This is the Jacobian&#39;s prediction. The @ is a dot product: multiply each sensor&#39;s sensitivity by how far we nudge that sensor, then add up. In plain words: &quot;slope times distance&quot;.<br>    forecast = (J.flatten() @ nudge).item() <br>    # This is reality. We move the fruit by the nudge (fruit + nudge), run the real network at the new spot, and subtract the original probability. The difference is how much the answer really moved.<br>    actual = (torch.sigmoid(model(fruit + nudge)) - torch.sigmoid(model(fruit))).item() <br>    print(f&quot;{size:&gt;6}: forecast {forecast:+.4f}   actual {actual:+.4f}&quot;)</pre><p><strong>Sculpt it during training (the three extra lines):</strong></p><pre>x = x.clone().requires_grad_(True)<br>logit = model(x).squeeze(-1)<br># This is the Jacobian step.<br><br># torch.autograd.grad(output, x) returns the slope of the output with respect to x.<br># We pass logit.sum() because the function needs a single number. Summing is safe: each fruit&#39;s score depends only on that fruit, so the slope for fruit i is unaffected by the others.<br># g ends up with one row per fruit and two columns, the firmness and sweetness slopes. That&#39;s the Jacobian arrow at every fruit at once. The comma after g just unpacks the one-item result.<br># create_graph=True is the important part. It tells PyTorch to keep a record of how g was computed. Without it, g would be a fixed number and training couldn&#39;t push it down. With it, the optimizer can ask, &quot;which weight changes would make g smaller?&quot; This is a derivative of a derivative, which is why this penalty makes training a bit slower.<br>g, = torch.autograd.grad(logit.sum(), x, create_graph=True)<br># This is the combined goal:<br><br># bce(logit, y) is the usual &quot;get the answer right&quot; error (binary cross-entropy).<br># (g ** 2).sum(dim=1) squares each arrow&#39;s two components and adds them. That&#39;s the arrow&#39;s length squared, one number per fruit.<br># .mean() averages that over the batch.<br># 0.003 * is the penalty strength, the dial from Part Six.<br># The optimizer minimizes the total, so the network must balance two pulls: be correct, and keep the arrows short. With the penalty at 0, you get the cliff. At 0.003, a slope. At 0.1, so calm that accuracy suffers.<br>loss = bce(logit, y) + 0.003 * (g ** 2).sum(dim=1).mean()</pre><p>Pick a point. Nudge it. Compare the forecast with reality. Watch where the forecast breaks. That gap between forecast and reality is where you’ll learn the most about the network.</p><h3>Back at the Orchard</h3><p>The conveyor belt still sorts fruit at 100% accuracy. Nothing about its answers has changed.</p><p>But the co-op now knows something it didn’t know before. It knows that for nine fruit in ten, the sorter is calm and certain, and that a slightly dusty sensor won’t matter. It knows that a thin band of borderline fruit is where the sorter can flip its verdict on a change too small to measure. It knows that two neurons are doing most of the work. And it knows that, if it chooses to, it can trade a sliver of accuracy for a sorter that doesn’t panic at the edge.</p><p>None of that came from asking <em>“are you right?”</em></p><p>All of it came from asking <em>“what would it take to change your mind?”</em></p><p>That’s the Jacobian. It’s not a formula from the back of a textbook. It’s a map of what the network is sensitive to, and you can read it, test it with nudges and reshape it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q0I4bfLG4Qb4c4KIXXDALA.jpeg" /><figcaption><em>Same sorter, same answers. Now we also know where it is sure and where it can be tipped.</em></figcaption></figure><p><em>Disclaimer: This article written with the help of AI with my intention to explain Jacobian space with a simple NN and expose the cliff where AI could be unpredictable in mission critical applications which accuracy measurements not expose. So knowing the Jacobian space will be helpful, here is a start with simple NN. The full experiment code (training, sensitivity map, nudge tests, mosaic, neuron knockouts and the smoothing sweep) is about 300 lines of Python using PyTorch and scikit-learn. All numbers in this article come from a single fixed random seed, except the smoothing dial, which averages three seeds.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c71ffaa06001" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Map and the Driver]]></title>
            <link>https://medium.com/@albinabel/the-map-and-the-driver-96ad01785708?source=rss-29d1b7b1dd0a------2</link>
            <guid isPermaLink="false">https://medium.com/p/96ad01785708</guid>
            <category><![CDATA[bayesian-machine-learning]]></category>
            <category><![CDATA[reinforcement-learning]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Albin Abel]]></dc:creator>
            <pubDate>Thu, 19 Nov 2026 07:50:11 GMT</pubDate>
            <atom:updated>2026-11-19T07:50:11.242Z</atom:updated>
            <content:encoded><![CDATA[<h3>Two of the oldest ideas in machine learning have the same shape, do different jobs, and become far more useful together. We argued it, then we tested it, and the test corrected us.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EMnx2H3Fg_kJwHfNuEj0uQ.jpeg" /><figcaption><em>Two voices, one van. One knows the town. The other knows the way.</em></figcaption></figure><p>It’s 6:40 in the evening and the fog is coming in off the river.</p><p>Ana is a courier in a small river town. In the back of her van is a cooler of medicine that has to reach the clinic on the far bank before it closes at 7:00. She has twenty minutes, two possible routes, and a town she only half knows.</p><p>If you’ve ever driven somewhere unfamiliar against the clock, you know two different conversations go on in your head.</p><p>One voice keeps asking: <em>what is actually out there?</em> Is that road still closed? Was the man at the petrol station right about the roadworks? Can I trust the map?</p><p>The other voice keeps asking: <em>given all that, which way do I turn?</em> Which road gets me there fastest? Is this turning worth it, or is it a trap?</p><p>Let’s give those voices names. The first is <strong>the Cartographer</strong>. The second is <strong>the Driver</strong>.</p><p>They are also, almost exactly, the two oldest ideas in how machines learn from experience. The Cartographer is <strong>Bayesian updating</strong>, from a paper published in 1763. The Driver is the <strong>Bellman equation</strong>, from the 1950s, and the reinforcement learning built on top of it. People often mention them in the same breath, and they’re right to: the two ideas have the same skeleton.</p><p>But they do different jobs. Here is the whole article in one line:</p><blockquote><strong><em>Bayes updates the map. Bellman decides which way to drive, and how much each road is worth.</em></strong></blockquote><p>Let’s ride along and watch each of them work, then watch what happens when they work together. Then, because a claim like this is cheap, we’ll put it to the test.</p><h3>The Town</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sj4R61HSTyPyI7Ytztjngg.png" /><figcaption><em>Two routes, one bridge nobody is sure about.</em></figcaption></figure><ul><li><strong>The bridge route:</strong> 5 minutes to the bridge, 5 more across to the clinic. <strong>10 minutes</strong> if the bridge is open.</li><li><strong>The hill route:</strong> 8 minutes up, 7 minutes down. <strong>15 minutes</strong>, and it always works.</li><li><strong>The trap:</strong> if Ana reaches the bridge and finds it closed, the only way on is an <strong>18-minute detour</strong> past the Old Mill. That’s 23 minutes in total. <strong>The medicine would be late.</strong></li></ul><p>She has twenty minutes. On paper, the bridge is the obvious choice. The question is whether the paper is right.</p><h3>Part One: The Cartographer Updates the Map</h3><p>The Cartographer’s job is to keep track of <strong>what’s true, and how sure we are about it.</strong></p><p>Her map says the bridge is open. But it’s a river town in autumn, and the bridge closes when the water rises. From experience, the Cartographer reckons there’s about a <strong>10% chance</strong> the bridge is closed tonight. That starting belief, held before any news arrives, is called the <strong>prior</strong>.</p><p>At the depot, a baker loading her own van says: <em>“I heard the bridge was flooded.”</em></p><p>The Cartographer doesn’t simply believe the baker, and she doesn’t ignore her either. She asks a more careful question: <em>how likely would I be to hear this rumour if the bridge really were closed, compared with if it were open?</em></p><p>Rumours like this are usually right when the bridge really is closed: say 8 times out of 10. But people also pass on stale or garbled gossip when it’s open: say 1 time in 10. That ratio, how much more likely the evidence is under one story than the other, is what moves the belief. It’s called the <strong>likelihood</strong>.</p><p>Put the prior and the likelihood together and the Cartographer redraws the map:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gA_daZneEPlnLR6e3AzZ-w.png" /><figcaption><em>Today’s conclusion is tomorrow’s prior.</em></figcaption></figure><p>One rumour took the belief from 10% to 47%. A second, independent report would take it to 88%. Each time, the new belief becomes the starting point for the next piece of news. <strong>Today’s conclusion is tomorrow’s prior.</strong> That chain is the whole trick of Bayesian learning.</p><p>There’s a quieter version of the same trick. If a second regular source, say the bus driver who always mentions floods, had said <em>nothing</em> tonight, that silence would count as evidence too and pull the belief back down. A good Cartographer listens to what isn’t said as well.</p><p>Notice three things the Cartographer <em>didn’t</em> do:</p><ol><li><strong>She didn’t flip the map</strong> from “open” to “closed” on a single rumour. Beliefs move by degrees.</li><li><strong>She didn’t throw away her history.</strong> The 10% prior still mattered: if the bridge almost never flooded, the same rumour would have moved her much less.</li><li><strong>She didn’t decide anything.</strong> Her job is the map. Which road to take is a different question, and we’ll come back to it.</li></ol><h3>Part Two: The Driver Prices the Roads</h3><p>The Driver doesn’t care, at first, about what’s true in general. The Driver cares about one question: <strong>from where I am right now, how long until I reach the clinic if I choose well from here on?</strong></p><p>That number, the time-to-go from each place, is what Richard Bellman called the <strong>value</strong> of a place. His insight in the 1950s was that you don’t have to work out the value of every place from scratch. You can work backwards from the goal, because:</p><blockquote><strong><em>The value of where you stand = the cost of the next road + the value of where that road leads.</em></strong></blockquote><p>That single sentence is the Bellman equation. Watch the Driver use it to price the town, starting at the clinic and working back:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aAkUqGrdlvT3j3Pl5TeKzg.png" /><figcaption><em>Values flow back from the goal like water running downhill.</em></figcaption></figure><p>Every junction now carries a price tag. Ana doesn’t need to imagine the whole journey at every turn. She just picks the next road with the best “road + price of where it leads.” <strong>Values flow backwards from the goal like water running downhill, and the decision at each junction is to follow the slope.</strong></p><h3>The Driver learns from surprise</h3><p>Where do those road times come from? Partly from the map, but mostly from experience. That is where <strong>reinforcement learning</strong> begins.</p><p>Suppose Ana has always believed the hill route takes 15 minutes. Last Tuesday it took 12, because the council re-timed the traffic lights. The Driver doesn’t rewrite the number to 12 on one trip. The Driver <em>nudges</em> it:</p><pre>OLD ESTIMATE   15 min<br>WHAT HAPPENED  12 min<br>SURPRISE       -3 min   (&quot;better than I expected&quot;)<br>NUDGE          move part of the way, say halfway → new estimate 13.5 min</pre><p>Every trip, the Driver compares what it expected with what it got, and moves a little toward the truth. That gap between expected and observed is called the <strong>prediction error</strong>. Repeat this over thousands of trips, with each junction borrowing its value from the next, and you have the core of reinforcement learning.</p><h3>Part Three: Same Skeleton</h3><p>Put the two side by side and you can see why people compare them:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FHEr72gR6CyGrZ2TzNckXw.png" /><figcaption><em>Same skeleton, different jobs.</em></figcaption></figure><p>Both are <strong>learning by surprise</strong>. Neither starts from scratch, and neither jumps to conclusions. Each keeps a running estimate and corrects it when reality disagrees.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*48XMethiV-JuVMG8hC30rw.png" /><figcaption><em>The only real difference is in “how much?”</em></figcaption></figure><p>There’s one quiet but important difference, and it’s in the words <strong>“how much?”</strong></p><p>When the Driver nudged the hill estimate “halfway,” that was a fixed choice, a dial set by hand. Engineers call it the <strong>learning rate</strong>.</p><p>The Cartographer never needs a dial. She works out how far to move from <strong>how sure she already was</strong>. If she was very confident, she moves a little. If she was unsure, she moves a lot. The size of the step comes from the uncertainty.</p><blockquote><strong><em>The Driver has a habit of how far to move. The Cartographer has a reason.</em></strong></blockquote><h3>For the curious (skip freely)</h3><pre>Bayes:              belief_new  ∝  likelihood × belief_old<br><br>Bayes, in the<br>simple bell-curve<br>case (Kalman):      μ_new  =  μ_old  +  K · (observed − μ_old)<br>                                        └─ K comes from uncertainty<br><br>Bellman / TD:       V_new  =  V_old  +  α · (cost + V_next − V_old)<br>                                        └─ α is usually set by hand</pre><p>The last two lines have the same form. The Kalman gain <em>K</em> and the learning rate <em>α</em> do the same job. The difference is that one is calculated from how uncertain you are and the other is usually chosen by an engineer. Much of modern research sits in that gap.</p><h3>Part Four: Different Jobs, and What Happens With Only One</h3><p>The skeleton is shared, but the jobs aren’t. The clearest way to see it is to give each voice the van on its own.</p><h3>A Cartographer with no Driver</h3><p>A mapmaker who has to drive will reach for the most natural rule there is: <strong>go with the most likely world.</strong> If the bridge is more likely open than closed, take the bridge.</p><p>That’s not a foolish rule. As we’ll see when we test it, it’s a surprisingly strong one. But tonight, after the baker’s rumour, it says: <em>53% open, so take the bridge.</em></p><p>That’s almost a coin flip, with the medicine as the stake. Nearly half the time, Ana reaches a flooded bridge and arrives late.</p><p>The rule’s flaw is hidden inside it. “Most likely” quietly assumes <strong>both mistakes cost the same</strong>: taking the hill for nothing costs about as much as hitting the flood. Here they don’t. A wasted hill trip costs 5 minutes. A flooded bridge costs 13 minutes, and the delivery. <strong>The most likely world and the best decision are different questions.</strong> Only one of them is the Cartographer’s job.</p><h3>A Driver with no Cartographer</h3><p>Now imagine a skilled driver with years of experience and no map-keeper. “The bridge route is 10 minutes” is burned into their habits by a thousand good trips.</p><p>Tonight they drive straight to the flooded bridge.</p><p>They weren’t wrong to trust experience. Their values are true <em>on average, in the world they learned in</em>. What they lack is a way to fold in tonight’s news. <strong>A pure value-learner discovers a flooded bridge by driving to it.</strong></p><p>You could hand the Driver the rumours directly, as raw inputs: <em>the baker said yes, the bus driver said nothing</em>. But with no model of what a rumour <em>means</em>, it has to learn the right move for every combination of voices separately, from experience. With two voices, that’s manageable. With six, it drowns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7bN4oWg7qse6ttLJWt3OKw.jpeg" /><figcaption><em>Left: knows the odds, not the stakes. Right: knows the way, not the weather.</em></figcaption></figure><h3>Part Five: The Combined Machine</h3><p>Now let’s put the two voices back in the same van and let them talk to each other.</p><p>The trick is simple to say. <strong>The Driver stops pricing roads on the assumption that the map is certain, and starts pricing them against the Cartographer’s current belief.</strong></p><p>The bridge route is no longer “10 minutes.” It’s:</p><pre>5 min to the bridge<br>+ if open   (chance 1 − p):   5 more minutes<br>+ if closed (chance p):       18-minute detour<br>expected time via bridge  =  10 + 13p    (p = chance the bridge is closed)<br>time via hill             =  15          (no uncertainty)</pre><p>Now replay the evening:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SlLcmo7HwxwyPy77RYFLQQ.png" /><figcaption><em>The map said “probably open.” The Driver said “don’t bet the medicine on it.” </em>Each line is one way Ana can drive, and the lowest line at any point is her best choice. The x-axis is how sure she is that the bridge is closed, and the y-axis is her expected minutes to the clinic. The bridge line climbs steeply because a flood costs her 13 extra minutes. The hill line is flat because it’s always 15. Looking first costs one minute, but it caps the worst case at the hill’s time.</figcaption></figure><p>That gives three zones. Below about 12%, just take the bridge, because looking isn’t worth the minute. From about 12% to 80%, stop and look. Above 80%, take the hill.</p><p>At 47%, the “most likely world” rule says the bridge is probably open, so go. That choice costs 16.1 minutes, worse than the hill. Looking first costs 13.4. The two mistakes don’t cost the same, so 50% is the wrong place to draw the line.</p><p>This is the key moment of the whole article.</p><p><strong>After the baker’s rumour, the map says the bridge is probably open (53%). The Driver still says: don’t drive to it on the odds.</strong> At 47%, the bridge route is expected to take 16.1 minutes, worse than the hill’s 15, <em>even though open is the more likely world</em>. The Driver’s verdict flips at about 38%, not 50%, because the two mistakes cost different amounts.</p><p>And there’s a third road neither voice could find alone.</p><h3>The lookout: when looking is worth the time</h3><p>On the way out of the depot there’s a lookout point on a small rise. It costs <strong>one extra minute</strong> to pull in, and from there you can see the bridge.</p><ul><li>The <strong>Cartographer alone</strong> would like to look, since more evidence is always nice, but she has no idea whether a minute is worth spending.</li><li>The <strong>Driver alone</strong> sees only a minute lost. Looking doesn’t move the van closer to the clinic.</li></ul><p>The combined machine prices <strong>the act of looking itself</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_hQ9hiSNKEUSufUnkaHEKQ.png" /><figcaption><em>Spending a minute to learn saves more than a minute and a half.</em></figcaption></figure><p>Spending a minute to <em>learn</em> saves more than a minute and a half on average. It also removes the worst case: the medicine is never late.</p><p>This is the deepest idea in the article. <strong>When the map feeds the decision, gathering information becomes an action with its own value.</strong> Looking, asking, testing and exploring stop being curiosity. They become moves that pay off, because a better map leads to better roads. Researchers call this the <strong>value of information</strong>.</p><p>Put it all together and the decision isn’t one threshold, it’s three zones (look back at the chart above):</p><ul><li><strong>Belief under about 12%:</strong> just take the bridge. Looking costs more than it saves.</li><li><strong>Between about 12% and 80%:</strong> stop and look. The doubt is worth a minute.</li><li><strong>Over 80%:</strong> take the hill. You’re sure enough that looking is a waste.</li></ul><p>The Cartographer’s most-likely rule has one line, at 50%, and it’s in the wrong place.</p><h3>The full loop</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rNSbBx9ZYpFHIkFKrJZD-w.png" /><figcaption><em>Neither is in charge. They take turns.</em></figcaption></figure><p>The Driver’s choices decide what the Cartographer gets to see next. The Cartographer’s map decides what the Driver thinks each choice is worth. <strong>Neither is in charge. They take turns.</strong></p><p>In the technical literature, this combined machine has a name: a <strong>partially observable decision process</strong>. It’s the formal version of “I can’t see everything, so I act on my best belief, and I choose actions partly to see more.”</p><h3>We Didn’t Just Argue It. We Tested It (a little).</h3><p>Everything above is a good story. Good stories are where mistakes hide. So we built the town in code and let the agents drive it.</p><p><strong>The setup.</strong> 3,000 simulated evenings, in three seasons: an ordinary autumn, a rainy season when the bridge floods four times as often, and a season after the council re-times the hill’s traffic lights. Each agent drove all 3,000 evenings, 200 times over (100 times in round two). Every agent faced exactly the same floods, rumours and traffic. <strong>Nobody was told the flood rate, how reliable the rumours were, or the true road times.</strong> Everyone started from the printed map and had to learn the rest. And we wrote our predictions down <em>before</em> the first run.</p><p>The contestants:</p><ul><li>the Cartographer alone, acting on the most likely world;</li><li>the Cartographer alone, always stopping to look;</li><li>the Driver alone, deaf to rumours;</li><li>the Driver alone, hearing rumours but with no model of them;</li><li>the combined machine.</li></ul><h3>Round one: we were wrong</h3><p>In the first version of the town, the detour was 14 minutes, so hitting the flood was slow but not late. The combined machine beat both Drivers and the always-looking Cartographer easily. But <strong>the plain “most likely world” Cartographer tied it</strong>, and with more rumour sources it <em>beat</em> it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zAFEzMl-OWId2VV2v0Gz3w.png" /><figcaption><em>Round one, the original town. The “pre-registered” Combined is the version we wrote down before running.</em></figcaption></figure><p>That was our prediction failing. So, as we’d agreed beforehand, we went looking for our own mistake before believing it.</p><h3>What we got wrong</h3><p>We had given every learning agent the same habit: <strong>make a random move 5% of the time</strong>, so it keeps exploring. A Driver with no map needs that habit. It can only learn about a road by driving it.</p><p>The combined machine doesn’t. Its doubts already send it down different roads on different evenings: the lookout on uncertain nights, the hill when the rumours are loud. Yet we’d made it throw dice anyway, sometimes even <em>after</em> it had seen the bridge with its own eyes. That tax was about a tenth of a minute per evening, exactly the size of the gap.</p><p>With the dice removed, the combined machine beat the Cartographer. It came within a hundredth of a minute of the <strong>best possible play</strong> for anyone who can’t see the bridge before choosing. And it still noticed, on its own, that the hill road had got faster.</p><h3>Why the room to win was so small</h3><p>Even perfect play beat the simple Cartographer by only about a tenth of a minute per evening. To see why, we ran 48 different towns, varying the detour and the hill:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*piukH-rMjRMrgFmUqu9mdQ.png" /><figcaption><em>The pale valley is where “most likely” and “best” happen to agree. </em>Each cell is one town, and the town is defined by two numbers. The x-axis is the hill route’s time (11 to 18 min), and the y-axis is the detour time if the bridge is closed (8 to 25 min). That gives 6 × 8 = 48 towns, all with a 20% flood rate. The number in each cell is the minutes per evening that the Combined machine saves over the Cartographer’s “go with the most likely world” rule. Darker blue means a bigger saving. The amber box is the article’s town (hill 15, detour 14), which saves only 0.05.</figcaption></figure><p>The pattern is clean:</p><ul><li><strong>The combined machine was never worse, in any of the 48 towns.</strong></li><li><strong>There’s a valley</strong> where the two kinds of mistake cost about the same. <em>Mistake 1: </em>you take the bridge and it’s flooded. This costs the detour, which is bad when the detour is long. <em>Mistake 2:</em> you take the hill and the bridge was fine. This costs the hill’s extra minutes, which is bad when the hill is slow. When the two mistakes cost about the same, the 50% line really is the right place for the threshold. There, “go with the most likely world” happens to give the right answer, and the Driver adds almost nothing. <strong>Our original town sat right in that valley.</strong></li><li><strong>Outside the valley,</strong> where one mistake costs much more than the other, the combined machine saves up to a minute per evening.</li></ul><p>So we moved the town out of the valley. The detour became 18 minutes, which makes a flooded bridge a late delivery. We’re telling you that we did this, and why, because the choice came from the results.</p><h3>Round two: the revised town</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mXveuxa8Iq6Yegyx1ApZFQ.png" /><figcaption><em>Same test, same rules, one longer detour.</em></figcaption></figure><ul><li>The most-likely Cartographer was late on <strong>4.2%</strong> of evenings, and on <strong>5.8%</strong> in the rainy season.</li><li>The combined machine was late on <strong>1.1%</strong>, and on <strong>1.5%</strong> in the rainy season. That’s roughly <strong>a quarter as many late deliveries</strong>, and a fifth of a minute faster per evening.</li><li>It landed within a hair of the best possible play, which is late on 0.7% of evenings.</li><li>With six rumour sources instead of two, the rumour-hearing Driver with no model was late on <strong>nearly one evening in ten</strong> (one in five in the rainy season). The combined machine, hearing the same six voices, was late on fewer than one in a hundred.</li></ul><h3>What the test taught us</h3><ol><li><strong>The core idea held up, with conditions.</strong> Belief plus value matched or beat everything we tried, and came close to the best possible play.</li><li><strong>A Cartographer with a sensible rule is much stronger than our story first gave her credit for.</strong> “Most likely” is only wrong when the mistakes are lopsided. But in the real world, mistakes usually are lopsided: a late delivery, a missed diagnosis, a failed launch.</li><li><strong>A Driver without a model drowns in raw signals.</strong> It has to learn every combination of evidence separately.</li><li><strong>Exploring at random can wipe out the advantage of having a map.</strong> An agent with beliefs should explore where its doubts are, not by rolling dice.</li></ol><h3>Where You’ve Already Met This Machine</h3><p>Once you know its shape, you start to see the pair everywhere:</p><ul><li><strong>Robots and self-driving systems</strong> are often built as two layers: <em>perception</em>, which works out where am I and what’s around me, and <em>planning</em>, which works out what to do about it. That’s a Cartographer and a Driver with engineering job titles.</li><li><strong>Recommendation and experimentation systems</strong> that keep a belief about each option and sample from it when choosing (a method known as Thompson sampling, from 1933) explore exactly where their doubts are. That’s the lesson our own experiment taught us the hard way.</li><li><strong>The brain</strong>, according to a long line of neuroscience research, seems to run something similar. Experiments from the 1990s found dopamine neurons firing in a pattern that matches the Driver’s <em>prediction error</em>: the gap between expected and received reward. Separately, many theories of perception describe the brain as a Bayesian Cartographer, constantly updating its best guess about the world from noisy senses.</li></ul><p>None of these systems is “Bayesian” <em>or</em> “reinforcement learning.” <strong>The useful ones are both.</strong></p><h3>What This Means If You Build Things</h3><p>You don’t need to build a robot for this to matter. Any system that makes repeated decisions under uncertainty (pricing, routing, promotions, alerts, staffing) has both jobs inside it, whether or not anyone designed them.</p><ol><li><strong>Name the two jobs separately.</strong> “What do we believe is true, and how sure are we?” is a different question from “what should we do about it?”</li><li><strong>Price your mistakes before you trust “most likely”.</strong> If being wrong one way costs much more than being wrong the other way, the right threshold isn’t 50%. Find out what yours is.</li><li><strong>Keep the uncertainty, not just the best guess.</strong> A decision-maker that only receives “bridge: open” can’t find the right threshold. Pass the “how sure” along with the “what.”</li><li><strong>Price your looks.</strong> Experiments, audits, surveys and test groups are lookout points. Spend on them where the decision is close to flipping, and not where it isn’t.</li><li><strong>Explore where your doubts are, not at random.</strong> Random exploration is a habit for systems with no map. If you have beliefs, let them tell you where to look.</li><li><strong>Test your story.</strong> Ours was wrong in an instructive way, and it got better for it.</li></ol><h3>The Road Home</h3><p>Back at the depot, the map says the bridge is probably fine. Ana doesn’t take the bet. At 47%, the combined machine has already given its answer: a minute spent looking is worth more than a minute spent guessing.</p><p>She pulls into the lookout at 6:42. Through the fog she can just see the river, and the bridge, lit up and dry. The water hasn’t risen after all. The baker had heard about last year.</p><p>The Cartographer redraws the map: bridge almost certainly open. The Driver re-prices the roads: bridge, ten minutes. The van pulls out.</p><p>She hands over the cooler at 6:53.</p><p>Two old ideas, more than a century and a half apart, turned out to be two halves of the same habit: <em>notice when you’re surprised, and adjust a little.</em> One adjusts what you believe. The other adjusts what you do. We held ourselves to the same habit: we were surprised by our own experiment, and we adjusted.</p><blockquote><strong><em>Bayes updates the map. Bellman decides which way to drive. Together, they know when “probably fine” isn’t good enough, and when it’s worth stopping to look.</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*keHWAwqea2QO2lBFB8bgow.jpeg" /><figcaption><em>Same town, same fog. Now both voices are listening.</em></figcaption></figure><p><em>The simulation code, the predictions we wrote down in advance, and every result, including the round we got wrong, are available on request. If you build systems that act on beliefs, I’d like to hear about your own “bridge”: the place where “most likely” and “best” quietly disagree.</em></p><p>Disclaimer: This is my own thought experiment, built and tested with the help of AI. It is not research-grade: a toy town, a few hundred simulated careers, and settings I chose myself. One thing tilts the comparison on purpose. The combined agent is given the shape of the problem (the routes, that rumours depend only on whether the bridge is closed, and that the lookout reveals the truth), while the model-free Driver gets none of it. That is the map in the metaphor, and it is an assumption, not a free win. The result fits a broader idea, that decision-makers working on top of a model of the world can beat ones learning from scratch, but it doesn’t prove that for real robots. If the model is wrong, the advantage could shrink or disappear.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=96ad01785708" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Rulebook That Stopped Listening]]></title>
            <link>https://medium.com/@albinabel/the-rulebook-that-stopped-listening-ecee4923cfbc?source=rss-29d1b7b1dd0a------2</link>
            <guid isPermaLink="false">https://medium.com/p/ecee4923cfbc</guid>
            <category><![CDATA[naive-bayes]]></category>
            <category><![CDATA[continual-learning]]></category>
            <category><![CDATA[reinforcement-learning]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[self-evolving-systems]]></category>
            <dc:creator><![CDATA[Albin Abel]]></dc:creator>
            <pubDate>Sat, 14 Nov 2026 01:23:36 GMT</pubDate>
            <atom:updated>2026-11-14T11:10:38.276Z</atom:updated>
            <content:encoded><![CDATA[<h3>AI can solve Olympiad-level math. So why are we still talking about something as humble as updating a belief?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JbW4K_q2EJoEZycqsHIRcg.jpeg" /><figcaption><em>Same century, two different speeds.</em></figcaption></figure><p>This year, machines solved competition math problems that stump most graduate students. A few years ago, they began predicting the 3D shapes of proteins, a problem biologists had worked on for half a century. Every few months, something we filed under science fiction moves quietly into the “shipped” column.</p><p>So it may seem odd to write an article about a simple idea: <strong>when what you expected differs from what happened, change your mind a little.</strong></p><p>Statisticians call this Bayesian belief updating. Engineers call it a feedback loop. Machine learning people call it reinforcement learning. I won’t go through any formulas here, because the formula isn’t the interesting part. The interesting part is how many systems that spend real money every day <strong>don’t do it at all</strong>.</p><p>The impressive AI systems aren’t impressive only because they’re big. They’re impressive because, somewhere in their making, a loop said <em>“that was wrong, adjust,”</em> and it kept saying it millions of times. The ordinary systems that run our businesses usually have the size (years of data) and lack the loop.</p><p>Let me show you what I mean with a cup of coffee.</p><h3>Meet the Rulebook</h3><p>Picture a mid-sized coffee chain with a loyalty app. It has a few hundred thousand members and a marketing team that knows its customers well.</p><p>Over the years, that team has built a set of bonuses that work:</p><ul><li><strong>Buy nine, get the tenth free.</strong> Classic, and it builds habit.</li><li><strong>A free drink on your birthday.</strong> People love it, and it brings back customers who’ve lapsed.</li><li><strong>20% off on rainy days.</strong> Foot traffic drops when it rains, and this lifts it.</li><li><strong>Double points before 9 a.m.</strong> It smooths out the morning rush.</li></ul><p>None of these were guesses. Each came from analysis: dashboards, quarterly reviews, some regression models, and a few hard-won lessons from campaigns that flopped. Over time the findings were written down as <strong>rules</strong> in a rules engine:</p><pre>IF weather = &quot;rain&quot; AND store_traffic &lt; forecast<br>THEN issue offer &quot;RAINY20&quot; to members within 2 km</pre><p>This is good engineering, and I want to say so clearly. It is <strong>exploitation</strong> in the technical sense: you take what you’ve learned and use it reliably and at scale. The rules are predictable and auditable, and finance can budget around them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U5XNYcFiStzyT-Vi9tOPvg.jpeg" /><figcaption><em>Every rule was once an experiment. Then it became a portrait on the wall.</em></figcaption></figure><p>But each of those rules carries a timestamp no one wrote down: <strong>“true as of the day we analyzed it.”</strong></p><h3>The Day New Ideas Arrived</h3><p>One quarter, the team gets excited about three new ideas:</p><ol><li><strong>Streak bonus:</strong> visit three days in a row and get a free pastry.</li><li><strong>Bring a friend:</strong> you and a friend each get a free drink on the friend’s first visit.</li><li><strong>Mystery reward:</strong> after every fifth purchase, an unknown reward is revealed in the app.</li></ol><p>Everyone has an opinion. Priya, who leads loyalty, is sure the referral offer will win: “Word of mouth has always been our strongest channel.” Sam, from data, thinks the streak will win. A designer is quietly betting on the mystery reward.</p><p>So the ideas go where every idea goes: <strong>into the rules engine.</strong></p><pre>IF visits_last_3_days = 3 THEN issue &quot;STREAK_PASTRY&quot;<br>IF referred_friend.first_visit = true THEN issue &quot;FRIEND_DRINK&quot; to both<br>IF purchase_count % 5 = 0 THEN issue &quot;MYSTERY_REWARD&quot;</pre><p>Then something subtle happens.</p><p><strong>The moment a hypothesis becomes a rule, it stops being a question.</strong></p><p>The engine doesn’t know these are experiments, and it has no idea that Priya and Sam disagree. It simply delivers bonuses faithfully, week after week. Pastries go out, free drinks go out, mystery rewards go out. The money is spent with no view of the outcome.</p><p>Three months later, someone asks, “So which of the new ones worked?” There’s an uncomfortable pause. An analyst is assigned. They pull the data, clean it, argue about how to attribute results, and come back two weeks later with a slide deck. By then the next quarter’s plan is already locked.</p><p>The system has to build up a <em>new history</em>, and people have to analyze it by hand, before anyone learns anything. Then the conclusions are frozen into new rules, and the cycle starts again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xtchDuwjS6-e9Nh6VG3zCw.jpeg" /><figcaption><em>The engine wasn’t wrong. It just had no way to find out.</em></figcaption></figure><p>A rule is a belief with the volume turned up and the ears removed.</p><h3>A Friendly Debate</h3><p>It would be easy to make the rulebook the villain here. It isn’t. Let’s give both sides a fair hearing.</p><p><strong>The case for the Rulebook:</strong></p><ul><li><em>“It’s predictable.”</em> Finance knows exactly what will be spent.</li><li><em>“It’s explainable.”</em> Legal, compliance and customer service can all read it.</li><li><em>“It’s consistent.”</em> Customers aren’t confused by offers that keep changing.</li><li><em>“It’s earned.”</em> These rules came from years of evidence, not hunches.</li></ul><p><strong>The case for the Learner:</strong></p><ul><li><em>“Predictable spend isn’t the same as a predictable result.”</em> You know what you paid. You don’t know what you bought.</li><li><em>“Evidence expires.”</em> Customers, competitors, seasons and habits all move.</li><li><em>“The wait is expensive.”</em> Every week a weak idea runs at full budget is money that could have gone to a strong one.</li><li><em>“New ideas deserve a fair trial, and so do old ones.”</em> Under the rulebook, ideas either run forever or are cut in a quarterly meeting. Nothing in between.</li></ul><p>Here is where the two sides meet: <strong>the Learner doesn’t throw away the Rulebook’s history. It uses that history as its starting point.</strong></p><p>In Bayesian terms, the expert’s experience is the <em>prior</em>, the belief you hold before new evidence arrives. Continual learning doesn’t replace expertise. It gives expertise a way to keep being right.</p><h3>What “Belief” Means (No Formulas, I Promise)</h3><p>The key change in perspective is to stop treating each bonus strategy as something that <em>works</em> or <em>doesn’t work</em>, and start treating it as something we hold <strong>a belief about, with a degree of confidence.</strong></p><ul><li>The birthday drink has years of evidence behind it. <strong>Belief: strong. Confidence: high.</strong></li><li>The streak bonus is brand new. <strong>Belief: promising. Confidence: low.</strong> It could be great or it could be a dud.</li></ul><p>Low confidence doesn’t mean “bad.” It means “we don’t know yet,” and that has a practical consequence: <strong>an uncertain idea deserves a little more budget than its expected value alone would justify, because finding out is worth something.</strong></p><p>That is the whole idea behind balancing <strong>exploration</strong> (trying things to learn) and <strong>exploitation</strong> (using what you already know).</p><p>You already do this at dinner. You have a favorite restaurant, which is exploitation. Every so often you try the new place down the street, which is exploration. Most of the time you go back to your favorite. But if the new place turns out to be wonderful, it gradually becomes your favorite, and you didn’t need a quarterly review to decide that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TudXkXk5X9DfoRTUT9FT1w.jpeg" /><figcaption><em>Exploration vs. exploitation, as practised by every hungry person who ever lived.</em></figcaption></figure><h3>The Walkthrough: Six Weeks With a Feedback Loop</h3><p>Let’s run the coffee chain again, this time with a loop. <em>(The numbers below are illustrative.)</em></p><p><strong>Setup, week 0.</strong></p><ul><li>The proven rules keep 90% of the bonus budget. We’re not dismantling anything.</li><li>The three new strategies share the other 10%, split equally to start.</li><li>For each strategy, the team writes down what they <strong>expect</strong>. The measure is: <em>extra visits per 100 customers who received the offer, compared with a similar group who didn’t.</em></li></ul><p>That last part matters, and I’ll come back to it.</p><pre>                    EXPECTED (the team&#39;s beliefs, written down before launch)<br>  Streak bonus      +6 visits / 100<br>  Bring a friend    +8 visits / 100   ← Priya&#39;s favourite<br>  Mystery reward    +5 visits / 100<br>  Rainy-day 20%     +4 visits / 100   ← an &quot;old&quot; rule, included on purpose</pre><p><strong>Weeks 1–2. First evidence.</strong></p><pre>                   EXPECTED   OBSERVED   GAP     NEW SHARE OF 10% POT<br>  Streak bonus       +6         +9       ▲ +3     33% → 50%<br>  Bring a friend     +8         +3       ▼ -5     33% → 25%<br>  Mystery reward     +5         +4       ▼ -1     33% → 25%</pre><p>The streak delivered the most extra visits (+9) and also beat what we expected, so we now believe in it more and it gets a bigger share. The referral offer was the team’s favourite on paper (+8), but it delivered only +3 in the first two weeks. Our belief in it drops, <strong>but not to zero.</strong> Two weeks of data is thin, and referrals are slow by nature.</p><p>A note on reading these tables: the <em>gap</em> tells us how much to change our minds, and our <em>updated belief</em> decides the budget. A strategy can miss its original expectation and still gain budget if the new evidence is better than what we last saw. That’s exactly what happens to Bring a friend next.</p><p><strong>Weeks 3–6. The plot twist.</strong></p><pre>                   EXPECTED   OBSERVED   GAP     NEW SHARE OF 10% POT<br>  Streak bonus       +6         +8       ▲ +2     50% → 55%<br>  Bring a friend     +8         +6       ▼ -2     25% → 30%<br>  Mystery reward     +5         +2       ▼ -3     25% → 15%</pre><p>The referral offer recovered. Referrals take time: a friend has to hear about the offer, think about it, and then turn up. A frozen review in week 2 would have cut it. The loop kept it alive at a smaller budget and let the evidence develop.</p><p>The mystery reward faded. Novelty wears off. Its share drops, but it keeps a small amount of budget, because seasons change and the holiday period might suit surprises better.</p><p><strong>And then the loop looks at the old rule.</strong></p><pre>Rainy-day 20%     history said +4   observed now +1   ▼ -3</pre><p>This is the rule everyone trusted. Its history is real. It worked well three years ago. But customers’ habits have changed, and many now order ahead or get coffee delivered on rainy days. The rule’s belief was frozen at the moment it was written, and the world moved on.</p><p>The loop doesn’t delete the rule. It <strong>raises a flag</strong>: <em>“Our confidence in this rule has dropped. Someone should look at it.”</em> A person decides what to do. The loop’s job is to make sure someone is asked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DMPs6PXGNrBFduDXaDSK1Q.jpeg" /><figcaption><em>The loop doesn’t pick winners. It keeps the question open.</em></figcaption></figure><h3>“But We Already A/B Test”</h3><p>Many teams do, and that’s a good start. An A/B test is a well-designed experiment with a clear answer at the end.</p><p>The trouble is what happens after the end: <strong>the winner is turned into a rule and frozen again.</strong> The test was a single photograph, not a running film.</p><p>A continual-learning loop is like an A/B test that never closes. It keeps shifting budget toward what’s working while the test is still running, rather than waiting for a final verdict. In the technical literature this is called a <strong>multi-armed bandit</strong> problem. It has been studied since the 1930s, which tells you the obstacle has never been the maths.</p><h3>The Honest Part: What’s Actually Hard</h3><p>If you’ve worked on systems like this, you know the loop is simple to describe and harder to get right. These are the parts that matter:</p><p><strong>1. Measuring the right outcome.</strong> “Bonuses redeemed” is the easiest number to track and the most misleading. A free pastry given to someone who was coming in anyway costs money and changes nothing. You need to measure the <strong>difference the bonus made</strong>, which is why a holdout group (similar customers who didn’t get the offer) is essential. Without it, the loop learns confidently from the wrong signal.</p><p><strong>2. Patience with slow signals.</strong> Some results arrive quickly (a visit tomorrow). Some take weeks (a referred friend becoming a regular). The loop needs to know how long to wait before judging.</p><p><strong>3. Not overreacting to noise.</strong> One unusual week shouldn’t change everything. Confidence should build gradually, and that is exactly what the “belief with confidence” framing gives you.</p><p><strong>4. Guardrails.</strong> Humans approve the menu of strategies. The loop only chooses <em>how much</em> of each to use, within budget limits and minimum shares. It never invents new offers and never goes beyond what compliance has signed off.</p><p><strong>5. Explaining the results.</strong> “The streak got more budget because it beat its expected lift by 2–3 visits per 100 for six straight weeks” is a sentence a CFO can accept. Build the loop so it can always say that sentence.</p><p>None of this is exotic. It’s ordinary engineering discipline applied to a question most systems never ask.</p><h3>The Lesson From the Machines We Admire</h3><p>This is where the coffee chain and the AI headlines connect.</p><p>Large language models first learn by reading an enormous body of human text. That gives them broad knowledge and a striking ability to match patterns. It is history at a scale no marketing team will ever have.</p><p>That alone didn’t make them useful. What helped turn them into the assistants people rely on was a <strong>feedback stage</strong>: humans and automated checks rating outputs, and the model adjusting toward what worked and away from what didn’t. That is reinforcement learning, a loop of <em>expected versus observed, then adjust</em>.</p><blockquote><em>Pretraining gave the model a memory. Feedback gave it judgment.</em></blockquote><p>Our rules engines are mostly in the “pretraining only” stage. They hold years of accumulated knowledge and execute it with great precision, but they never find out whether they were right.</p><h3>So Why Don’t More Systems Do This?</h3><p>It isn’t the technology. The ideas are decades old, the maths is well understood, and the computing cost is trivial.</p><p>I think the reasons are about perspective and organization:</p><ul><li><strong>Rules have owners. Outcomes often don’t.</strong> Someone is responsible for keeping the engine running. Often no one is responsible for checking whether its decisions paid off.</li><li><strong>Measuring and deciding happen in separate places.</strong> Dashboards show what happened, and the engine decides what happens next. The two rarely meet.</li><li><strong>Rules feel like certainty, and certainty is comfortable.</strong> A rule doesn’t present itself as a hypothesis, so no one treats it as one.</li></ul><p>The change is to treat <strong>every rule as a belief that carries a confidence level and an expiry date.</strong></p><h3>Your Rulebook Doesn’t Need Replacing. It Needs Ears.</h3><p>If you run a bonusing, pricing, promotion or recommendation system, this is a small and practical way to start:</p><ol><li><strong>Write down what you expect</strong> from each strategy before it launches. You can’t measure a gap you never recorded.</li><li><strong>Keep a holdout group</strong> so you measure the difference a bonus made, not just how many were redeemed.</li><li><strong>Set aside a small exploration budget.</strong> Five to ten percent is enough to learn from without putting the business at risk.</li><li><strong>Shift weights gradually</strong> based on expected versus observed. Never drop an idea to zero just because it had a bad first week.</li><li><strong>Review your veterans as well as your newcomers.</strong> The rule you trust most may be the one most out of date.</li></ol><p>The experts who built the rulebook were right when they built it. A feedback loop is what allows them to stay right.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5JaFOBnuaH_C29fO28PXMg.jpeg" /><figcaption><em>Same rulebook. Now it listens.</em></figcaption></figure><p><em>If this changed how you think about your rules engine, I’d love to hear where your system is “frozen” and what it would take to give it a feedback loop.</em></p><p>Disclaimer: The article is author’s own thought process expressing simple concepts many real world systems yet to adopt. AI helped writing the article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ecee4923cfbc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ASKCAVEAT prompts for data science methods.]]></title>
            <link>https://medium.com/@albinabel/askcaveat-prompts-for-data-science-methods-f521f4b02cd0?source=rss-29d1b7b1dd0a------2</link>
            <guid isPermaLink="false">https://medium.com/p/f521f4b02cd0</guid>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[writing-prompts]]></category>
            <dc:creator><![CDATA[Albin Abel]]></dc:creator>
            <pubDate>Thu, 01 Jan 2026 15:35:14 GMT</pubDate>
            <atom:updated>2026-01-01T15:35:14.412Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*b6VzWQF1K3_REtnLu95-kQ.png" /></figure><p>AI is Changing the Way We Do Data Science — Simple prompts to explore data science* methods.</p><p>Spent weeks learning which method/technique to use analyzing the data, how to calculate statistics, how to interpret? The whole ritual. And here’s what I’ve realized: <strong>that foundation matters more than ever — but differently than before.</strong></p><p>Statistical intuition is invaluable. But the <em>bottleneck has shifted</em>. AI can strategically guide, create code and execute calculations. What it can’t do — what still requires human expertise — is know whether that z-score is <em>meaningful</em>.</p><p>AI handles calculation. You provide the judgment.</p><h3>The New Data Science Paradigm</h3><p>Think about how data science has evolved. Traditionally, you’d identify a problem, recall the right statistical method, code it up, and interpret the results. Data scientists who mastered all four steps could deliver tremendous value.</p><p>Now AI can assist with steps two and three — suggesting methods and performing calculations. This creates two exciting opportunities:</p><p>• <strong>For data scientists: </strong>More time for high-value judgment calls — asking better questions, catching edge cases, and translating insights into action,</p><p>• <strong>For non-specialists: </strong>Access to rigorous analysis that was previously out of reach, with proper guidance on when methods apply and when they don’t.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rd-u40SujLp4SO1DuwGHNw.png" /></figure><p>But here’s the catch: AI tools will happily give you a wrong answer if you ask the wrong question. They’ll calculate a z-score on data that violates every assumption z-scores require. They won’t warn you unless you know to ask.</p><p>That’s why understanding the <em>caveats</em> — the hidden assumptions that make or break every statistical method — is now the essential skill. Whether you’re a seasoned data scientist or a business analyst trying AI tools for the first time.</p><h3>The ASKCAVEAT prompt structure</h3><p>I’ve formatted a prompt structure for AI-assisted data science that works for data scientists and newcomers. It’s called ASKCAVEAT — and the name captures the philosophy: always ask about the caveats before trusting any result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LdB8WPQquUUJB5K58L6KJA.png" /></figure><p>Here’s how it works:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wPJcwrp6eAM_pJako5149A.png" /></figure><p>Notice that calculation is just one step — and it’s the one AI handles well. The rest requires human judgment: knowing what to ask, catching violations, verifying results against reality, and making decisions. Data scientists bring deep expertise to these steps; non-specialists can learn to navigate them with the right framework.</p><h3>ASKCAVEAT in Action</h3><p>Does the prompt structure actually work? Let’s find out. I tested the same question with and without ASKCAVEAT — here’s what happened.</p><h3>The Scenario</h3><p>A B2B SaaS company sees their website traffic drop 25% on a Monday. Is this statistically significant, or normal variation?</p><h3>Without ASKCAVEAT</h3><p><em>“My website’s traffic dropped 25% yesterday. How do I tell if it is significant?”</em></p><p>The AI gave a reasonable answer: calculate standard deviation over 30–90 days, see how many standard deviations the drop represents, compare to same day of week, and check for obvious causes.</p><p>Sounds helpful. But here’s what it <em>didn’t</em> mention: what if the traffic data is skewed by viral days? What if there’s an upward trend that makes the global mean misleading? What if different traffic sources behave completely differently? The response would lead someone to calculate a naive z-score — and potentially draw wrong conclusions.</p><h3>With ASKCAVEAT</h3><pre>My website traffic dropped 25% yesterday. I need to determine<br>if this is statistically significant or normal variation.<br><br>Data characteristics:<br>- Sample size: ~5,000 daily visitors (90 days available)<br>- Distribution: Likely right-skewed (some viral days with 3x traffic)<br>- Time pattern: Upward trend (~8% growth/quarter), weekends 40% lower<br>- Yesterday was Monday (B2B SaaS product)<br>- Traffic sources: 40% organic, 30% direct, 20% paid, 10% referral<br>- Data Fields: x, y, z<br><br>Questions:<br>1. Is z-score appropriate, or do trend/skewness violate assumptions?<br>2. Should I compare to same-day-of-week baseline?<br>3. Should I analyze each traffic source separately?<br>4. What method would you recommend?<br>5. What are the main caveats I should watch for?<br>6. Any confounder variables am I missing?</pre><p>Now the AI delivered a comprehensive response that warned about three specific z-score violations (skewness, trend, seasonality), recommended filtering to Mondays only and detrending, suggested using IQR instead of standard deviation for robustness, and listed five explicit caveats including autocorrelation and regression to the mean.</p><h3>The Difference</h3><p>Here’s a side-by-side comparison of what each approach surfaced:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/919/1*ECO9PKdu6QW2RASDQhXcnQ.png" /></figure><p>The first response would have led someone to calculate a naive z-score and potentially miss a real problem — or panic over nothing. The ASKCAVEAT response provided a defensible methodology <em>and</em> explicitly warned about what could still go wrong.</p><p><em>Same AI. Same question. Different results. The difference was how we asked.</em></p><h3>The Art of the Right Question</h3><p>As we just saw, the difference between useful AI assistance and misleading output is entirely in how you ask. This is where many analyses go wrong — and where a good prompt prevents costly mistakes.</p><h3>Bad Prompts</h3><p>“Analyze this data.”</p><p>“Find anomalies.”</p><p>“Is this normal?”</p><p>These prompts fail because they provide no context. The AI doesn’t know your sample size, your expected baseline, your business objective, or the characteristics of your data. It’s like asking a doctor “Am I healthy?” without mentioning any symptoms.</p><h3>Good Prompts</h3><p>“I have 100 customer response times. Most are 200–300ms, but 5 are &gt;1000ms. Are these outliers or expected variance?”</p><p>“I’m comparing conversion rates across 20 marketing campaigns with sample sizes from 50 to 50,000. How do I prioritize which campaigns to investigate?”</p><p>See the difference? Good prompts give the AI everything it needs to provide a meaningful answer — and more importantly, to warn you about potential pitfalls specific to your situation.</p><h3>The General Prompt Template</h3><p>Here’s a template that consistently produces better results (This may slightly be adjusted for use cases, but act as a generic framework to be extensible):</p><pre>I have [DATA TYPE(s)] with [SAMPLE SIZE] observations.<br>The metric is [METRIC NAME] with expected value around [VALUE].<br>I&#39;m seeing [OBSERVATION/PATTERN].<br>Sample sizes [VARY/ARE UNIFORM] across [GROUPS/TIME].<br>The variables I have selected [FEATURES]<br>What statistical method should I use to determine significance for my use case [BUSINESS CASE DESCRIPTION] and any critical confounding variables are missing?</pre><h3>ASKCAVEAT extension examples</h3><h4>Causal Inference Extension</h4><p>Why it fits ASKCAVEAT: Causal inference is entirely about assumptions. Every causal method has identification assumptions that, if violated, break the analysis completely. This makes the “KNOW assumptions → CHECK violations” loop essential.</p><p><strong>Key Caveats Unique to Causal Inference:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5edVlEbxfEF7XTlBX2sXNA.png" /></figure><p><strong>Generalized Causal Inference Prompt Template:</strong></p><pre>I want to estimate the causal effect of [TREATMENT/INTERVENTION] on [OUTCOME].<br><br>Data characteristics:<br>- Unit of analysis: [INDIVIDUAL/FIRM/REGION/etc.]<br>- Sample size: [N treated], [N control]<br>- Assignment mechanism: [RANDOMIZED / OBSERVATIONAL / QUASI-EXPERIMENT]<br>- Time structure: [CROSS-SECTIONAL / PANEL / PRE-POST]<br>- Available covariates: [LIST KEY VARIABLES]<br><br>Suspected confounders:<br>- Measured: [LIST]<br>- Potentially unmeasured: [LIST OR &quot;UNKNOWN&quot;]<br><br>Questions:<br>1. What causal identification strategy is appropriate?<br>2. What are the key assumptions I must defend?<br>3. What variables should I control for vs. avoid controlling for (colliders)?<br>4. What sensitivity/robustness checks should I run?<br>5. How do I interpret the estimate—ATE, ATT, LATE, or other?<br>6. What would falsify my causal claim?<br>7. Do I miss any confounders?<br>8. Do I cover an instrumental variable?</pre><p>Example Application:</p><pre>I want to estimate the causal effect of [a new onboarding flow] on [30-day retention].<br>Data characteristics:<br>- Unit of analysis: Individual users<br>- Sample size: 5,000 treated (new flow), 45,000 controls (old flow)<br>- Assignment mechanism: Observational (rolled out to new signups starting March 1)<br>- Time structure: Pre-post with 6 months history<br>- Available covariates: signup source, device type, country, first-session duration<br><br>Suspected confounders:<br>- Measured: Signup source (marketing campaign changed in March)<br>- Potentially unmeasured: Seasonality, product changes shipped in the same month<br><br>Questions:<br>1. What causal identification strategy is appropriate?<br>2. What are the key assumptions I must defend?<br>3. Should I control for first-session duration or is it a mediator?<br>4. What sensitivity/robustness checks should I run?<br>5. How do I interpret the estimate—ATE, ATT, LATE?<br>6. What would falsify my causal claim?<br>7. Do I miss any confounders?<br>8. Do I cover an instrumental variable?</pre><h4>Bayesian Methods Extension</h4><p>Why it fits ASKCAVEAT: Bayesian analysis makes assumptions explicit through prior specification. The “KNOW → CHECK” loop becomes “SPECIFY prior → CHECK sensitivity.” The framework’s emphasis on judgment over calculation aligns perfectly with Bayesian philosophy.</p><p><strong>Key Caveats Unique to Bayesian Methods:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3kCnvXlDSGCgGnaZ63QzFA.png" /></figure><p><strong>Generalized Bayesian Methods Prompt Template:</strong></p><pre>I want to use Bayesian analysis for [ESTIMATION / PREDICTION / DECISION PROBLEM].<br><br>Data characteristics:<br>- Sample size: [N]<br>- Outcome type: [CONTINUOUS / BINARY / COUNT / etc.]<br>- Data structure: [INDEPENDENT / HIERARCHICAL / TIME SERIES]<br>- Expected effect size: [PRIOR BELIEF OR &quot;UNKNOWN&quot;]<br><br>Prior knowledge:<br>- Source of prior information: [PREVIOUS STUDIES / DOMAIN EXPERTISE / NONE]<br>- Strength of prior belief: [STRONG / MODERATE / WEAK / NON-INFORMATIVE]<br>- Key parameters to estimate: [LIST]<br><br>Questions:<br>1. What prior distribution is appropriate for my parameters?<br>2. How sensitive are my conclusions to reasonable alternative priors?<br>3. What diagnostics should I check for MCMC convergence?<br>4. How do I interpret the posterior credible interval for my audience?<br>5. When would a frequentist approach be more appropriate here?<br>6. What prior would a skeptic use, and would my conclusion survive it?</pre><p>Example Application:</p><pre>I want to use Bayesian analysis for [estimating conversion rate lift from a small A/B test].<br><br>Data characteristics:<br>- Sample size: 200 treated, 200 controls<br>- Outcome type: Binary (converted yes/no)<br>- Data structure: Independent observations<br>- Expected effect size: Prior tests showed 2-5% lift is typical<br><br>Prior knowledge:<br>- Source: 12 previous A/B tests on similar features<br>- Strength: Moderate (historical lifts ranged 0-8%, median 3%)<br>- Key parameters: Conversion rate in each group, lift<br><br>Questions:<br>1. What prior distribution is appropriate—Beta? What parameters?<br>2. How sensitive is the &quot;probability of positive lift&quot; to my prior?<br>3. With only 200/group, how much will the prior influence results?<br>4. How do I communicate &quot;83% probability lift is positive&quot; vs. &quot;p &lt; 0.05&quot;?<br>5. Should I use a skeptical prior (centered at 0) for a more conservative estimate?<br>6. What sample size would I need for the data to overwhelm my prior?</pre><h3>Real World Scenarios</h3><p>Let’s see how the ASKCAVEAT prompt applies to other common data science problems. Without ASKCAVEAT for non-data scientists these issues may be overlooked.</p><h4>Scenario 1: Comparing Groups with Different Sample Sizes</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yiZIQRNk6ys3zb6t9ksfOg.png" /></figure><p>When you have wildly different sample sizes across groups, naive comparisons will mislead you. A product with 2 defects out of 50 sales looks worse than one with 150 defects out of 10,000 — but the second one has much more reliable data.</p><h4>Scenario 2: Multiple Comparisons Problem</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BtROmfAUpNFRRraTQxmKww.png" /></figure><p>If you run 100 A/B tests and find 5 “significant” results at p&lt;0.05, you may have found nothing at all. That’s exactly how many false positives you’d expect by chance alone.</p><h3>Z-Scores: Example walkthrough in Caveats</h3><p>Let’s apply the ASKCAVEAT prompt to z-scores — one of the most commonly used (and misused) statistical tools. A z-score tells you how many standard deviations a value is from the mean. Conceptually simple, but practically tricky.</p><p>Z-scores have <strong>five major caveats</strong> that can undermine your analysis. Understanding these is what separates meaningful insights from misleading numbers.</p><h4>Caveat 1: The Small Sample Trap</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cpk-fcoaFktrl3PaJB8STg.png" /></figure><p>A product with 2 sales and 1 defect shows a 50% defect rate. Another product with 10,000 sales and 200 defects shows a 2% defect rate. Which one should you investigate?</p><p>If you calculate z-scores naively, the first product looks <em>dramatically worse</em>. But that 50% is based on just 2 observations — it could easily be random chance. The second product’s 2% is based on 10,000 observations and is far more reliable.</p><p><strong>The fix: </strong>For small samples (roughly n &lt; 30), use Student’s t-test instead of z-scores — it’s specifically designed to handle the extra uncertainty in small samples. For larger samples, account for sample size using confidence intervals or sample-size weighted approaches. Ask your AI: “How do I adjust for varying sample sizes from 50 to 50,000?”</p><h4>Caveat 2: The Mixed Population Problem</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BVvslK_q4GwpnvURXTvmrQ.png" /></figure><p>Imagine you’re analyzing response times across your product. The global average is 250ms with a standard deviation of 50ms. A page loads in 400ms — that’s a z-score of 3. Sounds concerning.</p><p>But wait. Your “average” is mixing together a mobile app (average 200ms), a web dashboard (average 300ms), and an API (average 150ms). Each has different expected behavior. That 400ms page might be perfectly normal for the dashboard.</p><p><strong>The fix: </strong>Stratify first. Calculate separate baselines for each population, then identify outliers within each group. Ask: “My data has N subgroups. Should I calculate separate z-scores?”</p><h4>Caveat 3: The Non-Normal Distribution</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JbWvg8-GsIX0YyT5AGrRrA.png" /></figure><p>Z-scores assume your data follows a normal (bell-curve) distribution. For many business metrics — especially revenue, income, and anything with a “long tail” — this assumption is false.</p><p>Example: If mean income is $60,000 with a standard deviation of $40,000, someone earning $140,000 has a z-score of 2. That sounds fairly typical (only 2 standard deviations from the mean). But income is right-skewed — $140,000 is actually around the 90th percentile!</p><p><strong>The fix: </strong>Use quantile-based methods instead. Median and IQR (interquartile range) are more robust for skewed data. Ask: “My data is skewed. Should I use percentiles instead of z-scores?”</p><h4>Caveat 4: The Time Series Trap</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3g9bFa5iiFW_dWr27uiHjw.png" /></figure><p>You’re monitoring user growth. Month 1 has 1,000 users, Month 12 has 2,000 users. A naive z-score calculation using the global mean makes Month 1 look “low” and Month 12 look “high.”</p><p>But your product is growing steadily. <em>Both months are exactly on trend</em>. The z-score is detecting your growth pattern, not anomalies.</p><p><strong>The fix: </strong>Detrend your data first, or use time series methods like STL decomposition. Ask: “I have time series data with a trend. Should I detrend before calculating z-scores?”</p><h4>Caveat 5: The Multiple Comparisons Explosion</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BtROmfAUpNFRRraTQxmKww.png" /></figure><p>You’re monitoring 1,000 servers and flagging any with a z-score greater than 2 (95% confidence). Even if <em>every single server is perfectly healthy</em>, you’ll get about 50 false alarms. That’s just how probability works.</p><p>The more things you test, the more false positives you’ll find by chance alone.</p><p><strong>The fix: </strong>Apply multiple comparison corrections (Bonferroni, FDR). Ask: “I’m testing N items simultaneously. How do I adjust my threshold to control false positives?”</p><h3>Should I Use Z-Score? A Decision Tree</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qYj3j8aw5h0ZJBCmAK1E_A.png" /></figure><p>Before using z-scores, walk through this checklist:</p><p>• <strong>Single population: </strong>Are you mixing different groups? → If yes, stratify first</p><p>• <strong>Adequate sample size: </strong>Do you have at least 30 observations? → If no, use Student’s t-test instead</p><p>• <strong>Normal-ish distribution: </strong>Is your data roughly bell-shaped? → If no, use quantile methods</p><p>• <strong>No time trends: </strong>Is your baseline stable over time? → If no, detrend first</p><p>• <strong>Appropriate threshold: </strong>Testing multiple items? → Apply Bonferroni/FDR correction</p><p>• <strong>Business sense: </strong>Do the results align with domain knowledge?</p><h4>The Master Prompt for Z-Score</h4><p>Here’s a comprehensive prompt for verifying your statistical approach:</p><pre>Before I use z-score analysis, verify my assumptions:<br><br>Data: [DESCRIBE YOUR DATA]<br>Sample size: [N]<br>Groups: [SINGLE/MULTIPLE]<br>Distribution: [NORMAL/SKEWED/UNKNOWN]<br>Time component: [YES-TRENDING/NO]<br>Number of tests: [N]<br>Fields: []<br><br>Questions:<br>1. Is z-score appropriate?<br>2. What assumptions am I violating?<br>3. What alternatives should I consider?<br>4. What threshold should I use?<br>5. Generate diagnostic code.</pre><h3>The Bottom Line</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Texw5XR2_ReKw1ZlPtI7vw.png" /></figure><p>The evolution in data science is real. We’re shifting emphasis from “<em>How do I calculate this?</em>” to “<em>When is this method valid?</em>”</p><p>For data scientists, this means more time for the high-judgment work that creates real value:</p><p>• Framing problems correctly</p><p>• Catching edge cases and violations</p><p>• Translating statistical results into business decisions</p><p>• Mentoring others on best practices</p><p>For non-specialists, this means access to rigorous analysis — with the right guardrails:</p><p>• Use frameworks like ASKCAVEAT to avoid common pitfalls</p><p>• Always ask AI about assumptions and caveats</p><p>• Verify results against domain knowledge</p><p>• Know when to consult an expert</p><p>AI amplifies expertise. The ASKCAVEAT prompt helps everyone use it well.</p><p>ASKCAVEAT format provided foundation prompt structure which is extensible for data science domains. The opiniated current coverage for domains is as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oi5arwfoK7pxBXEdhC0TSQ.png" /></figure><p>However, it doesn’t cover 100% data science domains. We can provide extensive prompts if readers find this format useful. The following are non-covered examples of statistical domains but can be extensible of this framework.</p><p><strong>NOT COVERED — Statistical Domains</strong></p><p><strong>Tier 1: Common in Practice</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RAbcLFMNkv8UX8Mu8jLe8w.png" /></figure><p><strong>Tier 2: Specialized but Important</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NcpA2qLNvusZJzbCJYs_kA.png" /></figure><p><strong>Tier 3: Niche / Domain-Specific</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3NoaZvyB6ppMFOfxuDU4Zw.png" /></figure><p><em>Remember: AI can be your calculator and your reference library, but you are the scientist. Know your tools, understand their limits, and always verify results against reality.</em></p><p>* NOT COVERED — Machine Learning, NLP, MLOPS (Separate Format Planned)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f521f4b02cd0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>