<?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 Maedeh Torkian on Medium]]></title>
        <description><![CDATA[Stories by Maedeh Torkian on Medium]]></description>
        <link>https://medium.com/@maedeh.torkian?source=rss-380dc4dff114------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*VGGNPerOkBv1mp4FDYmAUQ.jpeg</url>
            <title>Stories by Maedeh Torkian on Medium</title>
            <link>https://medium.com/@maedeh.torkian?source=rss-380dc4dff114------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 03:07:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@maedeh.torkian/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[Someone Has to Know]]></title>
            <link>https://medium.com/@maedeh.torkian/someone-has-to-know-29a03cb476b0?source=rss-380dc4dff114------2</link>
            <guid isPermaLink="false">https://medium.com/p/29a03cb476b0</guid>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[cyber-security-awareness]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Maedeh Torkian]]></dc:creator>
            <pubDate>Sat, 28 Nov 2026 05:57:49 GMT</pubDate>
            <atom:updated>2026-11-28T05:57:49.816Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2wyNJYHyyqRrsNfF1TZIIQ.png" /><figcaption>A hand on wheel on the fog</figcaption></figure><h4>How Am I Vulnerable? Returning to the Hospital</h4><p>Essay #12 in the Humble Model Series: The Capstone</p><h4>I. I Was Already Inside It</h4><p>Essay #1 began with a question I asked before I had any evidence for an answer.</p><p><em>How am I vulnerable?</em></p><p>It did not come from a benchmark. It came from the part of me that notices when things feel too certain, too smooth. I was building models, reading about waves of capability, and some quiet part of me asked where the weakness was hiding, what it was costing us, and why no one seemed to talk about it in the places where it mattered most.</p><p>I answered with an image. A hospital. A pneumonia model at 94% accuracy, trusted by the doctors. One X-ray, altered by a pattern of noise no radiologist could see. The model, which a moment earlier saw pneumonia with 99% confidence, now saw “no finding” with 99.9% confidence.</p><p>The patient was sent home.</p><p><em>The model never knew it was wrong.</em></p><p><em>There was no alert. No uncertainty flag. No mechanism for doubt.</em></p><p>That scene was a diagnosis, not a result. I ended that essay by asking whether I was alone in the fog. Over the ten essays that followed, I tried to turn the diagnosis into evidence. This essay is the accounting. It says what I found, what I could not find, and what the question looks like now.</p><h4>II. What I Set Out to Build</h4><p>The first essay proposed a different goal from the one the field usually sets. Not a model that cannot be fooled, but <em>“a boat that knows it might sink, and will tell you before it does.”</em> It ended with a promise in the model’s own voice:</p><p>I cannot promise I will never be fooled. But I can promise I will tell you when I am uncertain, when something feels strange, when I disagree with myself.</p><p>Three clauses. Looking back, the series tested each of them.</p><ul><li><strong><em>“When I am uncertain”</em></strong> was tested with MC Dropout and ensembles, in Essays #4 and #7.</li><li><strong><em>“When something feels strange”</em></strong> was tested with out-of-distribution detection and feature geometry, in Essays #4, #5 and #10.</li><li><strong><em>“When I disagree with myself”</em></strong> was tested with ensemble and multi-head disagreement, in Essays #6, #7 and #9.</li></ul><p>Essay #8 asked whether attention could serve as any of them. Essay #11 asked what happens after the warning rings.</p><p>A promise that has been tested is not a promise that has been kept. What follows is the record.</p><h4>III. The Ledger</h4><p><strong>Essays #2 and #3: the model was confident, and walls cracked. </strong>A model near 100% confidence could not separate its robust cases from its fragile ones. Defenses raised the bar, and each eventually showed cracks. After robustness training, the one image still wrong carried a confidence of 0.6187: a flicker of hesitation that never became a warning.</p><p><strong>The Bridge: a change of goal.</strong> <em>From unbreakable to undeluded.</em></p><p><strong>Essay #4: a voice could be built, and it was narrower than it looked.</strong> The uncertainty gate deferred on many natural out-of-distribution inputs, but barely reacted to adversarial ones.</p><p><strong>Essays #5 and #6: the best-looking signal was cheating.</strong> In Essay #5, boundary distance looked like the strongest geometric signal. In Essay #6, I found it had been measured relative to the true label, information a deployed system does not have. Computed honestly, it was no better than plain confidence. Under the same protocol, architecture-native signals, multi-head disagreement, and evidential evidence did far better.</p><p><strong>Essay #7: the deepest lens did not win.</strong> Among four Bayesian approximations, the oldest method, Deep Ensembles, did best. A variational model that never trained produced a warning with no connection to error.</p><p><strong>Essay #8: Visible is not aware.</strong> Attention entropy was easy to read and performed at chance as an error detector (AUROC 0.51 on clean inputs, 0.49 under attack).</p><p><strong>Essay #9: a warning can be targeted.</strong> Against an ensemble gate, an attacker who optimized for error while suppressing disagreement raised silent failures, wrong answers that were not deferred, from 10.97% to 42.88% of inputs.</p><p><strong>Essay #10: there are different ways to be silenced. </strong>Two warnings were coupled to the classifier. An attack that never mentioned the gate lowered their deferral rates anyway, by 17 points for MC Dropout and 26 for evidential, because pushing an input toward a confident wrong answer also pushes its uncertainty down. The third warning, feature geometry, was decoupled. It did not react to that attack at all (a change of +0.03 points), and then collapsed once the attacker targeted it.</p><p><strong>Essay #11: the system around the warning.</strong> On clean data all three gates ranked errors well (AUROC 0.78 to 0.83). Under a transferred attack the same rankings fell below chance (0.33, 0.33, 0.31): the gates deferred correct answers more often than wrong ones. A simple rate monitor saw collapses when nearly all of a window was attacked, and saw nothing when a warning kept its volume and lost its meaning. And deferral turned out to be a transfer of work, not an intervention. A queue can overflow, which creates pressure to loosen the threshold, or sit idle at the moment it is needed most.</p><h4>IV. The Table, Graded</h4><p>Essay #1 gave the Humble Model five rows. I can now grade them from evidence instead of hope.</p><p><em>Knows it can be broken.</em> Partly, and only as a design stance. I learned that the model can be broken. No model in the series reliably knew when it was being broken. Under weak attacks, some warnings still responded. At the largest budget, none provided protection.</p><p><em>Outputs a prediction plus uncertainty plus warning flags. </em>Yes. Every gated model produced an uncertainty and a flag. On ordinary inputs, the flag tracked errors. Under transferred attack, it ranked them backwards.</p><p><em>Fails gracefully, or refuses to answer. </em>On ordinary inputs, yes. Under attack, the refusal vanished, or stayed at a fixed rate, or went to the wrong cases. And a refusal is graceful only if someone can receive it.</p><p><em>Detects that something is wrong.</em> Sometimes, and rarely, the thing that mattered. Natural distribution shift was detected. A transferred attack raised one gate’s deferral rate while two others fell. A system-level monitor caught collapses when almost everything was attacked. A single attacked input was caught only if a gate happened to defer it, which for these gates was a matter of chance.</p><p><em>Evaluated on appropriate deferral.</em> This row changed the most. “Appropriate” turned out to mean a deferral that stays tied to error under pressure, not a deferral rate near a target. Measuring that took more than risk-on answered inputs: exposure measured against all inputs, a control that separates access from awareness, a monitor on the rate, a check on whether the ranking still finds errors, and a model of reviewer capacity.</p><h4>V. The Hospital, Replayed</h4><p>What follows is a thought experiment. It is assembled from measurements on small CIFAR-10 classifiers at large attack budgets, not from medical images, and it should be read as an argument, not a result.</p><p><strong>No gate.</strong> This is the original scene. The model is confident, the patient goes home, and no one is positioned to notice.</p><p><strong>A gate, and an ordinary error.</strong> Suppose the model is wrong because the image is hard, not because anyone attacked it. A gate calibrated to defer about a quarter of cases catches many of these. This is the world the warnings were built for, and in it they worked.</p><p><strong>A gate, and an attacker who ignores it.</strong> For two of the three gates, an attack on the classifier alone lowered the deferral rate. The X-ray would have looked more certain, not less. For the third gate the attack changed nothing: it would defer this X-ray about as often as it defers any case, roughly one time in four, whether or not this was the attacked one. In the large-budget tests, every attacked input was wrong, so each gate’s deferral rate is also its chance of warning about an attacked case: roughly 5%, 0%, and about one in four.</p><p><strong>An attacker who knows the gate.</strong> The third gate’s deferral rate fell to essentially zero.</p><p><strong>A monitor.</strong> A single X-ray moves no rate. In Essay #11 the rate monitor caught the collapse when essentially every input in the window was attacked. By my own arithmetic from those rates, it would need more than half of the traffic attacked. That is an extrapolation, not a measurement, but one X-ray in a large stream is far from that regime.</p><p><strong>A radiologist.</strong> If the X-ray had been deferred, someone would have to look. Essay #11 measured what happens to the person on the receiving end: capacity can be exceeded or sit unused, and a handoff helps only if the recipient has the evidence, the time, and the authority to disagree with the model.</p><p>For the patient not to go home, something had to know that did not come from the model’s own computation of the X-ray.</p><p>Every warning in this series was computed from the model’s own internals: its outputs, its weights, its features. Essay #1 named the design choice: <em>no requirement of consistency with reality.</em> The series built warnings that were consistent with the model. None was tested for consistency with anything outside it.</p><h4>VI. The Three Questions I Left Open</h4><p>Essay #1 ended with three things I did not know.</p><p><strong>“Whether a model can ever truly know its own limits, or whether uncertainty quantification is just another form of confident ignorance.” </strong>In the world a model was calibrated for, its uncertainty did know some of its limits. The clean error rankings in Essay #11 are the evidence. Under attack, the same quantities became confident ignorance in several distinct ways: silenced as a side effect, held at a fixed rate, or pointed at the wrong cases. An attacker chooses the world. This holds for small image classifiers, and I don’t know how far it extends.</p><p><strong>“Whether ‘graceful deferral’ works in high-stakes, low-latency environments where a human cannot be reached.”</strong> I never tested this. Every experiment assumed a recipient. The one related finding is that even when a recipient exists, deferral is only a transfer of work. Where there is no recipient, I have no evidence.</p><p><strong>“Whether we are building humility or just a more sophisticated form of evasion.”</strong> I now have a test. Humility is hesitation that stays coupled to failure under pressure. Evasion is hesitation at a fixed rate whatever the danger, or hesitation pointed at the wrong cases. Both appeared in the series, sometimes in the same mechanism. A warning can be humble on ordinary inputs and evasive under attack. Humility is a relationship between a signal and a failure, and it has to be measured again whenever the failure changes.</p><h4>VII. How Am I Vulnerable?</h4><p>The question had a first-person subject. I owe it a first-person answer.</p><p>The series was supposed to measure a model’s weaknesses. It also measured mine.</p><p>In Essay #5, I reported boundary distance as the strongest geometric signal. In Essay #6, I found it had been computed against the true label, quietly handing the signal the answer. The best-looking result in that essay was the one that cheated, and I missed it because it looked like what I hoped to find.</p><p>In Essay #7, a variational model produced the most dramatic numbers in the experiment. The explanation was not a finding about Bayesian methods. It had never learned the task. The result looked like a conclusion until the training loss was read.</p><p>In Essay #10, the attack budget made the classifiers fail so completely that two of the three comparisons could show nothing. And Essay #9’s headline compared a transferred attack with a white-box attack aware of the gate, without a control for what white-box access alone would do. Essay #10 added the control #9 lacked.</p><p>Each of these is a small version of the first scene: a confident result, with no mechanism for doubt, produced by a process I trusted. What caught them was never sophistication. It was a held-out calibration split, a control condition, a reproduction check, a loss curve, and reading each result against its own definition. These are plain checks.</p><p>So the first-person answer to <strong><em>how am I vulnerable?</em></strong> is: wherever my measurement can agree with me for reasons unrelated to the truth.</p><p>That is the same vulnerability the model has. A model that is certain in ways it has not earned is not so different from a builder who is convinced in ways he has not earned. The remedy is also the same: a source of doubt that does not come from the thing in doubt.</p><h4>VIII. What This Series Did Not Test</h4><p>I am marking the edge of the claim, not issuing an invitation.</p><ul><li><strong>The second witness.</strong> Every experiment used small image classifiers on MNIST and CIFAR-10. The medical chatbot in Essay #1 is untouched. Its failure was ordinary hallucination with no attacker, and I did not test it.</li><li><strong>Real medical images and real hospitals.</strong> The replay above is an argument built from CIFAR-10 pieces.</li><li><strong>People. </strong>There were no human participants. Nothing here measures how an operator reads a falling deferral rate, or whether a reviewer could act on a deferral.</li><li><strong>The unreachable human</strong>, as noted above.</li><li><strong>Scale and generality.</strong> One training seed per model, undefended models, large attack budgets, fixed non-overlapping monitor windows, and no mixed traffic. Models, budgets and protocols differ across essays, so numbers should not be compared between them.</li><li><strong>What a null result means.</strong> A warning that held under my attacks has not been shown to hold. A warning that failed has been shown to fail. A defense that survives a weak attack proves little (Athalye, Carlini &amp; Wagner, 2018).</li><li><strong>Warnings from outside the model.</strong> This is the largest boundary. Every warning I tested was computed from the model’s own internals. I never tested a warning built on evidence the model does not control, such as an independent check against the world or a second system that does not share its failure modes. Essay #1 named no requirement of consistency with reality as the root design choice, and the series never changed it.</li></ul><p>Everything in this essay holds only for warnings of the kind I tested.</p><h4>IX. Am I Alone in the Fog?</h4><p>At the end of Essay #1, I asked whether anyone else was paying attention, or whether I was alone in the fog.</p><p>I was not alone. Researchers working on selective prediction, learning to defer, and human reliance on automation have asked these questions in other vocabularies, and I cited some of them along the way.</p><p>But the fog turned out to be larger than I thought when I asked. I thought it was the space between what a model’s confidence says and what is true. It is also the space between what a warning says and what it is attached to, between what a measurement shows and what a builder hopes, between a handoff and an intervention.</p><p>I began with a model that never knew it was wrong. I end with something less comforting and more accurate. A model can be made to say so, sometimes, in the conditions it was prepared for. Under the pressure that matters, the saying can be silenced, can ring at a fixed rate, or can point at the wrong cases. And the check on whether it still means anything cannot come only from the thing being checked.</p><p><em>The goal was never to be unbreakable. It was to be undeluded. I now think that was never something a model could hold alone.</em></p><p>The fog is still here. I wrote at the start that the only way out was to stop pretending we are not in it. I still believe that. What changed is that I can now name a few of the places where the fog looks like clear air.</p><h4>Resources</h4><ul><li>Essay #1: <strong>The Fog of Certainty</strong></li></ul><p><a href="https://medium.com/@maedeh.torkian/the-fog-of-certainty-on-deep-learnings-secret-vice-ed73d6ac3242">The Fog of Certainty: on Deep Learning’s Secret Vice</a></p><ul><li>Essay #2: <strong>The Attack Landscape:</strong> Why Silence Is the Vulnerability</li></ul><p><a href="https://pub.towardsai.net/the-attack-landscape-why-silence-is-the-vulnerability-f27dabfccb9b">The Attack Landscape: Why Silence Is the Vulnerability</a></p><ul><li>Essay #3: <strong>Walls, Shields, and Illusions: </strong>Defenses and Their Limits</li></ul><p><a href="https://pub.towardsai.net/walls-shields-and-illusions-defenses-and-their-limits-cd67b6ec4f92">Walls, Shields, and Illusions: Defenses and Their Limits</a></p><ul><li>The Bridge: <strong>From Resistance to Awareness</strong></li></ul><p><a href="https://medium.com/@maedeh.torkian/the-bridge-from-resistance-to-awareness-58ea4156ad3f">The Bridge: From Resistance to Awareness</a></p><ul><li>Essay #4: <strong>Learning to Say “I Don’t Know”</strong></li></ul><p><a href="https://pub.towardsai.net/learning-to-say-i-dont-know-the-first-floor-of-awareness-1a9faae389c0">Learning to Say “I Don’t Know”: The First Floor of Awareness</a></p><ul><li>Essay #5: <strong>The Geometry of Fragility</strong></li></ul><p><a href="https://medium.com/@maedeh.torkian/the-geometry-of-fragility-feeling-the-decision-boundary-2d1c50f402ee">The Geometry of Fragility: Feeling the Decision Boundary</a></p><ul><li>Essay #6: <strong>Architectural Awareness</strong></li></ul><p><a href="https://medium.com/@maedeh.torkian/architectural-awareness-building-the-sensor-into-the-boat-c8545beedd3c">Architectural awareness: building the sensor into the boat</a></p><ul><li>Essay #7: <strong>Knowing the Weights</strong></li></ul><p><a href="https://medium.com/data-science-collective/knowing-the-weights-four-bayesian-lenses-on-uncertainty-9c6c0270d67e">Knowing the weights: four Bayesian lenses on uncertainty</a></p><ul><li>Essay #8: <strong>Does the Model Know Where It Looks?</strong></li></ul><p><a href="https://medium.com/@maedeh.torkian/does-the-model-know-where-it-looks-0ad64eff5e14">Does the model know where it looks?</a></p><ul><li>Essay #9: <strong>Confidently Wrong</strong></li></ul><p><a href="https://medium.com/@maedeh.torkian/confidently-wrong-a0c09bfe348b">Confidently wrong</a></p><ul><li>Essay #10: <strong>The Shape of Silence</strong></li></ul><p><a href="https://medium.com/@maedeh.torkian/the-shape-of-the-silence-461c49a3c8a6">The shape of the silence</a></p><ul><li>Essay #11: <strong>What the Warning Owes</strong></li></ul><p><a href="https://medium.com/@maedeh.torkian/what-the-warning-owes-3b1fe7c2526a">What the Warning Owes</a></p><h4>References</h4><p>Athalye, A., Carlini, N., &amp; Wagner, D. (2018). <em>Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. Proceedings of the 35th International Conference on Machine Learning.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=29a03cb476b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What the Warning Owes]]></title>
            <link>https://medium.com/@maedeh.torkian/what-the-warning-owes-3b1fe7c2526a?source=rss-380dc4dff114------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b1fe7c2526a</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[self-awareness]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Maedeh Torkian]]></dc:creator>
            <pubDate>Sun, 22 Nov 2026 07:09:36 GMT</pubDate>
            <atom:updated>2026-11-22T07:09:36.102Z</atom:updated>
            <content:encoded><![CDATA[<p>Who can see a warning go quiet</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cokTYupDDaLnu2FdlHZGvg.png" /><figcaption>The Bell That Missed the Wave</figcaption></figure><p>Essay #11 in the Humble Model Series</p><h4>I. The person on the other side</h4><p>Essay #10 ended with three warning mechanisms under attack.</p><p>MC Dropout, evidential uncertainty, and feature geometry had been built in different ways and measured different things. Yet none offered durable protection once the attack was allowed to target the model that produced the warning. Some warnings became louder. Some became quieter. One barely changed at all while the errors multiplied behind it.</p><p>That experiment measured the gates. It did not yet measure the system around them: the operator watching the warning rate, the reviewer expected to absorb deferred cases, or the person relying on an answer that was allowed through.</p><p><em>A warning does not succeed merely because it exists. It succeeds only if its failure can be recognized, communicated, and acted upon.</em></p><p>This essay asks what happens after a model has learned to defer. Studies of selective classification and learning to defer (Geifman &amp; El-Yaniv, 2017; Madras et al., 2018; Mozannar &amp; Sontag, 2020) provide foundations for studying rejection and downstream expert decisions. Here the question is different. Who can see whether the warning remains meaningful when someone is attacking it? What can an aggregate monitor detect? What happens when the review queue has fixed capacity? And does preserving the number of deferrals preserve the information that made deferral useful?</p><p>The answer has two halves. In the fully attacked streams tested here, some warnings fail visibly: their rates collapse and a monitor notices. Other warnings fail while their volume looks almost normal, even as their ranking of errors reverses.</p><h4>II. Three readers, not one</h4><p>The phrase “the person” can hide three different observers. They do not see the same evidence, so they cannot be assigned the same responsibility.</p><p><strong>The instance reader</strong> sees one output: either a prediction or a deferral. This reader cannot observe a deferral rate from a single case, and this experiment does not model their behavior.</p><p><strong>The rate reader</strong> is an operator who sees deferrals over a window of inputs and knows that the clean system was calibrated near a 25% rate. This reader can notice when the warning becomes unusually loud or quiet.</p><p><strong>The reviewer</strong> receives deferred cases but has limited capacity. A technically correct handoff helps only if someone has time, evidence, independence, and practical authority to intervene.</p><p>There is also a tempting but unmeasured behavioral assumption: that a lower deferral rate will be read as evidence that the model has become more reliable. The automation literature describes how people can over-rely on automated aids or neglect them (Parasuraman &amp; Riley, 1997), which is why the assumption is plausible. It is still an assumption. No human subject study was conducted here, so I do not claim that operators actually make that inference. I test the technical precondition beneath it: whether the observable warning rate can move toward apparent calm while wrong and undeferred exposure moves toward danger.</p><p><em>The notebook measures what each reader could observe. It does not pretend to measure what a real person would believe.</em></p><h4>III. From gate failure to system failure</h4><p>Essay #10 established that an attacker can optimize two goals together: cause classification error and suppress the signal used for deferral. Essay #11 reuses the checkpoint bundle saved from that experiment: the same trained models, calibration thresholds, data split, and attacks. It trains nothing new.</p><p>The CIFAR-10 test set is divided into 1,500 calibration images, 1,000 attack-development images, and 7,500 evaluation images. Each mechanism is examined under clean inputs and three attack conditions at an L-infinity budget of 8/255:</p><ul><li><strong>Transferred attack:</strong> crafted on a separate surrogate model.</li><li><strong>Direct white-box attack: </strong>crafted against the evaluated classifier, with no attention to the warning signal.</li><li><strong>Adaptive attack:</strong> uses a joint objective for classification loss and warning suppression. When the selected suppression weight is zero, the objective reduces to classification loss alone.</li></ul><p>For every input, the notebook keeps two paired observations: whether the gate deferred, and whether a wrong prediction escaped without deferral. Each attack is compared with the clean result for the same mechanism and the same images. Two quantities are reported, both in percentage points of all inputs:</p><ul><li><strong>Change in deferral:</strong> attack deferral minus clean deferral. This is what a rate reader can see.</li><li><strong>Change in exposure:</strong> attack wrong and undeferred minus clean wrong and undeferred. This is what is actually happening to people who receive non-deferred answers.</li></ul><p>Each attack condition receives one of four verdicts, using rules defined in the notebook before this run and 95% paired-bootstrap intervals from 2,000 resamples:</p><ul><li>No statistically established exposure rise: the lower endpoint of the exposure change interval is zero or negative. This does not establish that exposure stayed constant.</li><li>Responsive: both exposure and deferral have change intervals entirely above zero.</li><li>Inverted: the exposure change interval is entirely above zero and the deferral-change interval is entirely below zero.</li><li>Unresponsive: the exposure change interval is entirely above zero, but the deferral change interval includes zero.</li></ul><p>These are deliberately two quantities, not one asymmetry index. Combining them would hide the relationship the experiment is designed to reveal.</p><h4>IV. First reproduce the previous experiment</h4><p>Before asking a new question, the notebook had to prove that it was still running Essay #10’s experiment. The checkpoint bundle restored all three gated models, the surrogate model, the geometry centroids, the calibrated thresholds, and the selected adaptive attack settings.</p><p>The loaded checkpoints reproduced every clean, transferred, direct white-box, and adaptive result in the bundle’s own results table. Across twelve comparisons, the maximum reported difference was 0.000 percentage points. Every generated batch also stayed inside the valid pixel range and the 8/255 L-infinity constraint.</p><p>One caveat belongs next to that claim. The reproduction is against the bundle, and the bundle’s numbers differ slightly from the tables printed in Essay #10. MC Dropout’s clean exposure is 9.67% here against 10.23% there, and Feature Geometry’s is 5.71% against 6.43%. Every comparison in this essay is made inside the bundle.</p><p>One calibration detail should also remain visible. Evidential uncertainty and feature geometry reproduced the 25% calibration deferral target exactly. MC Dropout produced 23.60% when re-evaluated, consistent with its stochastic inference-time uncertainty. The saved threshold was not recalibrated. Preserving it was necessary to keep the test honest.</p><h4>V. When the warning and the danger separate</h4><p>At 8/255, wrong and undeferred exposure rose sharply in all nine attack conditions. The warning rate, however, moved in three different directions. Changes are in percentage points of all inputs, with 95% intervals in brackets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*aNhfZtk7BZcfc_sILoWEGQ.png" /><figcaption>Notebook results-By author</figcaption></figure><p>For Evidential at 8/255, the selected suppression weight was zero, so the adaptive and direct objectives and their results coincide.</p><p>Only Feature Geometry under the direct white-box attack is unresponsive: its deferral interval spans zero while exposure rises by 68.60 points.</p><p>One result deserves more attention than the adaptive rows. Under transferred attack, crafted on a separate surrogate without target model access or a gate-suppression objective, two of the three gates already invert. Evidential deferral falls by 13.33 points while exposure rises by 79.45.</p><p>The one responsive result is also important. MC Dropout’s transferred attack raises deferral by 16.16 points while exposure rises by 45.49 points. The gate reacts, but not enough to prevent a large increase in silent error. Responsive, therefore does not mean safe. It means only that the warning moves in the direction a rate reader would expect.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*2hkRvEIJkoakFeXUjTnGuQ.png" /><figcaption>Figure 1. Changes in deferral and wrong and undeferred exposure at 8/255, with individual 95% paired-bootstrap intervals. The shaded quadrant marks falling deferral and rising exposure.</figcaption></figure><h4>VI. A warning can fail visibly</h4><p>A collapsing gate is not necessarily an invisible gate. To test what an operator could notice, I added a simple rate monitor. It divides the stream into non-overlapping windows of 50, 100, or 200 inputs and raises an alarm when the observed deferral rate leaves the clean target of 25% by more than three binomial standard errors. At 100 inputs, that band runs from 12.0% to 38.0%.</p><p># Two-sided deferral-rate monitor for one window</p><p>se = math.sqrt(p0 * (1 — p0) / window_size)</p><p>lower, upper = p0–3 * se, p0 + 3 * se</p><p>window_rate = defer_flags.mean()</p><p>alarm = (window_rate &lt; lower) or (window_rate &gt; upper)</p><p>On clean data, the monitor rarely fires: 0% of windows for MC Dropout and Evidential, and 1.3% for Feature Geometry at 100 inputs.</p><p>At a 100 input window, the monitor alarms on every window for the direct and adaptive attacks against MC Dropout and Evidential, and for the adaptive attack against Feature Geometry. Those attacks drive the warning rate so far downward that the surrounding system can see the collapse.</p><p>This matters. Essay #10 showed that the gates themselves were vulnerable. Essay #11 shows that some of those failures remain detectable by an additional rate monitor: the gate goes quiet, but its silence is large enough to trigger an alarm. Detection alone does not establish successful governance or intervention.</p><p>The transferred attacks illustrate the trade off. MC Dropout is detected in 53.3% of 100-input windows and Evidential in 45.3%. The first alarms upward, because its deferral rises to the top of the band, and the second alarms downward. Detection improves with 200 input windows, to 94.6% and 89.2%, but larger windows require more cases before a decision is available. Better statistical power arrives with greater delay.</p><p>Every attacked window above comes from a stream in which every input was attacked. Mixed traffic was not measured. Under an independent random mixture, however, its expected deferral rate is (1 − a) × d_clean + a × d_attack, where a is attack prevalence. Using the measured rates, the expected rate crosses the 12.0% lower monitor boundary at approximately 60% attacked traffic for MC Dropout under direct attack, and 54% for Evidential. These are mean rate boundary crossings, not minimum detectable attack prevalences or measured detection probabilities. Windows can alarm on either side of those crossings because their counts fluctuate.</p><p>This is an extrapolation from measured rates, not a measured detection curve. It suggests that detection may weaken substantially when only part of the traffic is attacked. The size of that loss, including performance at 10% prevalence, remains to be tested.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*tkndCdbYBJLjOPHpQ40g0Q.png" /><figcaption>Figure 2. Fraction of 100-input windows triggering the rate monitor at 8/255. Clean windows show the observed false-alarm fraction; attacked windows are fully attacked.</figcaption></figure><h4>VII. The failure that looks normal</h4><p>Feature Geometry exposes the limit of rate monitoring. The sharpest evidence is not the direct attack. It is the transferred one.</p><p>On clean data, the estimated error-detection AUROC is 0.780 for MC Dropout, 0.825 for Evidential, and 0.778 for Feature Geometry. Under transferred attack, the estimates fall below the chance reference of 0.5: 0.328, 0.333, and 0.312. AUROC measures pairwise ranking across thresholds. These estimates indicate that a randomly selected wrong prediction tends to receive lower uncertainty than a randomly selected correct prediction, counting ties halfway. They do not, by themselves, establish which group is more likely to be deferred at the calibrated threshold. These AUROCs have no confidence intervals and rely on relatively few correct predictions, so the apparent reversal should be read as descriptive evidence from this run.</p><p>For MC Dropout and Evidential, that reversal arrives with a rate shift large enough for the monitor to catch at least some of the time. For Feature Geometry, it does not. Its deferral changes by only −2.97 points. The interval says this is distinguishable from zero under the paired bootstrap analysis, which is why the verdict table calls it inverted. The resulting deferral rate also remains well inside the monitor’s band, and the 100-input monitor alarms on 0% of windows.</p><p><em>The warning did not need to disappear. It only needed to ring for the wrong cases.</em></p><p>The direct white-box result is a different lesson, and it should not be confused with this one. Feature Geometry’s deferral is approximately unchanged (+0.03 points, monitor alarms on 1.3% of windows) while exposure rises by 68.60 points. But under that attack accuracy is zero. There are no right cases to select, and error ranking cannot be measured. What the direct case shows is narrower: a decoupled gate keeps its volume while the classifier collapses beneath it, and a volume monitor cannot see a classifier failure the gate itself never registers.</p><p>Both results point to the same conclusion. A monitor of warning volume can detect a rate shift. It cannot establish that the warning remains associated with error.</p><p>That changes the governance question. Asking whether the system is still producing enough warnings is necessary but insufficient. The system must also ask whether deferred cases are still more error prone than accepted cases. That second question cannot be answered from deferral volume alone. It requires delayed labels, audits, incident outcomes, expert review, or another source of ground truth.</p><h4>VIII. Capacity is not competence</h4><p>A deferral is not an intervention. It is a transfer of work. To test that boundary, the notebook assumes that reviewers can absorb exactly the calibrated 25% deferral rate. That is an assumption, and a different capacity would change the numbers.</p><p>When a gate becomes over responsive, review demand exceeds the assumed capacity. MC Dropout under transferred attack uses 154% of available capacity and creates 13.47 percentage points of overflow. If the selection policy is adjusted retrospectively to restore a 25% workload, wrong and undeferred exposure becomes 10.77 points worse. Capacity is preserved by allowing more dangerous cases through.</p><p>When a gate becomes inverted, the opposite happens. MC Dropout’s adaptive attack uses only 18% of review capacity while exposure reaches 95.60%. Evidential and Feature Geometry under adaptive attack send essentially nothing to review while exposure reaches 100%. The reviewers are idle at the moment they are most needed.</p><p>The notebook also asks what would happen if exactly 25% of the complete batch were selected for review using uncertainty values alone, without correctness labels. It sorts cases by decreasing uncertainty, selects the top 25%, and resolves ties by their original stream order through a stable sort. This is retrospective, idealized batch workload matching, not a tested online queue policy. Under all-wrong conditions, it mechanically reduces exposure from 100% to 75% because one-quarter of inputs are deferred. It does not show that uncertainty has recovered useful ranking information. Similarly, the apparent gains under transferred attack when deferral was below capacity (+11.83 points for Evidential and +2.24 for Feature Geometry) should not be read as recovered selectivity: errors dominate those streams, and the estimated AUROCs remain below chance.</p><p>Rebalancing the queue cannot reconstruct information that the signal no longer carries.</p><p><em>Capacity determines how many cases a person can receive. Competence determines whether the right cases reach them.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*PdhDhGvye1X7rnOKsEHD9g.png" /><figcaption>Figure 3. Review demand divided by the assumed capacity of 25% of inputs. Values above 1 indicate excess demand, not observed queue delays.</figcaption></figure><h4>IX. Failure has a budget</h4><p>The 8/255 result is not the entire story. The notebook repeats the analysis at 1/255, 2/255, and 4/255, using the suppression weights Essay #10 retuned at each budget. Across all thirty six combinations of mechanism, attack, and budget, each exposure-change interval lay entirely above zero; these are individual 95% intervals, not multiplicity adjusted simultaneous intervals. What changed was the warning’s response.</p><p>MC Dropout remains responsive under direct and adaptive attacks at 1/255 and 2/255, then becomes inverted at 4/255 and 8/255. Under the transferred attack, it stays responsive at every budget. Evidential and Feature Geometry are responsive to transferred attacks at the smaller budgets but invert at 8/255. Evidential is inverted under both direct and adaptive attacks at every tested budget, including 1/255. The direct attack does not explicitly optimize warning suppression, despite having white-box access to the target classifier. Feature Geometry is inverted under adaptive attack at every budget, while its direct attack verdict moves between unresponsive and inverted rather than following a simple progression.</p><p><strong>Verdicts by attack budget</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*wvp_HcspvJPJQJcqmfdQvA.png" /><figcaption>Notebook results-By author</figcaption></figure><p>The verdicts summarize direction and statistical evidence; the accompanying figures show the warning rate magnitudes.</p><p>This prevents an overly broad conclusion. The experiment does not show that uncertainty is always useless. It shows that the relationship between uncertainty and error can change with attack strength and attacker access. A warning mechanism validated under one threat budget should not be assumed to retain its meaning under another.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YsiaXTllQpveYpu4UxLTww.png" /><figcaption>Figure 4. Deferral rate across attack budgets. Dashed lines show each mechanism’s clean evaluation rate; shading shows the 100-input monitor band centered at the 25% calibration target.</figcaption></figure><h4>X. What the warning owes</h4><p>The title of this essay is intentionally not what the model owes. Models do not carry obligations. The obligation belongs to the system we build around them and to the people who decide that their outputs are ready to govern consequential action.</p><p>Two obligations follow from the measurements.</p><p>Monitor the warning’s volume. In the fully attacked streams tested here, a separate rate monitor catches several catastrophic collapses, especially when deferral approaches zero. Performance under mixed traffic remains unmeasured.</p><p><strong>Monitor the warning’s meaning</strong>. Normal volume is not evidence of normal selectivity. Where delayed outcomes become available, the relationship between warnings and verified errors must be measured continuously.</p><p>Two more follow from the argument, not from the data. I did not test them, and they should be read as design principles.</p><p><strong>Design for actual intervention</strong>. A handoff is useful only when the receiving person has evidence, time, authority, and an independent path to question the model.</p><p><strong>Fail closed when verification disappears</strong>. If the system cannot establish that its warning remains valid, it should not silently treat the calibrated threshold as a permanent guarantee. Reduced autonomy, broader sampling, escalation, or temporary suspension may be more honest than preserving throughput.</p><p>These are not a complete deployment protocol. Different domains will assign different costs to false alarms, missed errors, review delay, and halted service. But the ordering matters: deciding what deferral should cost is meaningful only after asking whether the mechanism still knows what to defer.</p><h4>XI. What this experiment does not establish</h4><p>The experiment is intentionally narrow. It uses CIFAR-10, compact convolutional models, one calibrated review rate, PGD-family attacks, fixed non-overlapping windows, and one synthetic capacity assumption. It does not include human participants, a live queue, time-varying traffic, correlated bursts, delayed expert labels, or the consequences of intervention.</p><p>The most consequential gap is partial attack prevalence. Every attacked monitor result comes from a fully attacked stream. The mixture calculation in Section VI suggests that dilution can keep the expected rate inside the alarm band, but actual mixed-stream detection remains unmeasured.</p><p>The monitor also assumes a known clean baseline. In deployment, data drift, seasonality, policy changes, and legitimate shifts in case mix can move the warning rate without an attack. Conversely, an adversary may be able to preserve both the aggregate rate and the conditional composition of simple monitoring statistics.</p><p>The error ranking results under transferred attack rest on few correct cases, because accuracy is low there, and they are reported without intervals. The results come from one set of checkpoints and one training seed.</p><p>Most importantly, this notebook measures successful abstention, not successful intervention. It can tell us whether a case was deferred, whether review capacity was exceeded, and whether uncertainty ranked errors. It cannot tell us whether a real reviewer would receive sufficient context, reach the correct judgment, or have the practical ability to change the outcome.</p><p>That is not a flaw to hide. It is the boundary this essay was built to locate.</p><h4>XII. Closing the boundary</h4><p>Essay #9 asked whether a model’s uncertainty still protects someone after the uncertainty itself becomes the target. Essay #10 broadened that test across three mechanisms and found that no single internal warning remained durable under the strongest conditions.</p><p>Essay #11 moved one layer outward. It asked whether the surrounding system could recognize the failure and whether human-review capacity could contain its cost.</p><p>In some tested conditions the monitor recognized the failure. When fully attacked streams drove deferral toward zero, it alarmed consistently. That is not a trivial result: a vulnerable gate does not automatically imply an invisible failure. Whether an alarm enables a timely, effective intervention remains untested.</p><p>But the experiment also found the harder case. Under transferred attack, all three estimated error-ranking AUROCs fell below 0.5, and Feature Geometry’s warning rate moved so little that the monitor stayed quiet. Review demand looked normal. The signal’s relationship to error did not.</p><p><strong><em>The most dangerous warning is not always the one that goes quiet. Sometimes it continues ringing at the expected rate, but no longer rings for the cases that need it.</em></strong></p><p>The Humble Model therefore cannot end at “I don’t know.” Abstention is only the first transfer of responsibility. A trustworthy system must also know when that transfer is failing, show the receiving person enough evidence to act, and stop treating a familiar rate as proof of a meaningful warning.</p><p>The boat learned to ring a bell. Then it learned to watch whether the bell went silent. The remaining vulnerability was quieter: the bell could keep ringing, on schedule, for the wrong waves.</p><p>That is what the warning owes: not the promise that it will never fail, but evidence that its signal still means what people have been told it means.</p><h4>Resources</h4><p>Earlier essays in the series</p><ul><li>Essay #4: Learning to Say “I Don’t Know”</li></ul><p><a href="https://pub.towardsai.net/learning-to-say-i-dont-know-the-first-floor-of-awareness-1a9faae389c0">Learning to Say “I Don’t Know”: The First Floor of Awareness</a></p><ul><li>Essay #5: The Geometry of Fragility</li></ul><p><a href="https://medium.com/@maedeh.torkian/the-geometry-of-fragility-feeling-the-decision-boundary-2d1c50f402ee">The Geometry of Fragility: Feeling the Decision Boundary</a></p><ul><li>Essay #6: Architectural Awareness</li></ul><p><a href="https://medium.com/@maedeh.torkian/architectural-awareness-building-the-sensor-into-the-boat-c8545beedd3c">Architectural awareness: building the sensor into the boat</a></p><ul><li>Essay #7: Knowing the Weights</li></ul><p><a href="https://medium.com/data-science-collective/knowing-the-weights-four-bayesian-lenses-on-uncertainty-9c6c0270d67e">Knowing the weights: four Bayesian lenses on uncertainty</a></p><ul><li>Essay #8: Does the Model Know Where It Looks?</li></ul><p><a href="https://medium.com/@maedeh.torkian/does-the-model-know-where-it-looks-0ad64eff5e14">Does the model know where it looks?</a></p><ul><li>Essay #9: Confidently Wrong: The Human Cost of Silent Failure</li></ul><p><a href="https://medium.com/@maedeh.torkian/confidently-wrong-a0c09bfe348b">Confidently wrong</a></p><ul><li>Essay #10: When Every Warning Can Be Silenced</li></ul><p><a href="https://medium.com/@maedeh.torkian/the-shape-of-the-silence-461c49a3c8a6">The shape of the silence</a></p><p>Notebook</p><p>• Notebook #11: What the Warning Owes</p><p><a href="https://github.com/Maee127/Adversarial-Notebooks/blob/master/%2311/Notebook_%2311.ipynb">Adversarial-Notebooks/#11/Notebook_#11.ipynb at master · Maee127/Adversarial-Notebooks</a></p><h4>References</h4><p>Geifman, Y., &amp; El-Yaniv, R. (2017). <em>Selective classification for deep neural networks. Advances in Neural Information Processing Systems 30.</em></p><p>Madras, D., Pitassi, T., &amp; Zemel, R. (2018). <em>Predict responsibly: Improving fairness and accuracy by learning to defer. Advances in Neural Information Processing Systems 31.</em></p><p>Mozannar, H., &amp; Sontag, D. (2020). <em>Consistent estimators for learning to defer to an expert. Proceedings of the 37th International Conference on Machine Learning, 119, 7076–7087.</em></p><p>Parasuraman, R., &amp; Riley, V. (1997). Humans and automation: Use, misuse, disuse, abuse. Human Factors, 39(2), 230–253.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b1fe7c2526a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The shape of the silence]]></title>
            <link>https://infosecwriteups.com/the-shape-of-the-silence-461c49a3c8a6?source=rss-380dc4dff114------2</link>
            <guid isPermaLink="false">https://medium.com/p/461c49a3c8a6</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[cyber-security-awareness]]></category>
            <dc:creator><![CDATA[Maedeh Torkian]]></dc:creator>
            <pubDate>Mon, 26 Oct 2026 17:38:27 GMT</pubDate>
            <atom:updated>2026-10-27T04:48:48.234Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*erdl2Fhqj0KlixskHlANOg.png" /><figcaption>Three Bells Beneath the Silent Storm</figcaption></figure><p>Essay #10 in the Humble Model Series</p><h4>I. The question of generalization</h4><p>Essay #9 ended with a narrow but unsettling result.</p><p>A Deep Ensemble had learned to hesitate. Under a transferred attack, its disagreement signal detected enough uncertainty to defer on many dangerous inputs. But when the attacker knew that disagreement controlled the warning gate, the attack changed its objective. It no longer tried only to cause an error. It tried to cause an error while suppressing disagreement.</p><p>The model remained wrong, but its warning became quiet.</p><p>That experiment produced a 31.90-percentage-point increase in wrong-and-undeferred exposure. Yet it left an important question unanswered.</p><p>Was this a weakness of Deep Ensembles, or a more general weakness of machine uncertainty?</p><p>A Deep Ensemble is only one way to create hesitation. Other models express uncertainty through stochastic predictions, accumulated evidence, or the geometry of their internal representations. These mechanisms do not measure the same thing, and they do not fail in the same way.</p><p>Essay #10 therefore asks:</p><p>If an attacker knows how a model recognizes uncertainty, does the vulnerability generalize across different definitions of hesitation?</p><p>The question is not whether every mechanism produces the same numerical gap. It is whether apparently useful uncertainty remains useful after its definition becomes part of the attack.</p><h4>II. Three shapes of hesitation</h4><p>A model’s uncertainty is not a single hidden faculty. It is constructed from a measurable signal.</p><p>This experiment evaluates three such signals.</p><p><strong>1. Stochastic hesitation</strong></p><p>Monte Carlo Dropout leaves dropout active during inference. The same image passes through several randomly thinned versions of the network, producing a distribution of predictions.</p><p>If those predictions vary substantially, the model has reason to hesitate. Predictive variance becomes the deferral signal.</p><p>The intuition is simple: a stable answer should survive small changes in the network’s internal path.</p><p>But an adaptive attacker can exploit this definition. The attacker can search for an input on which multiple dropout masks agree on the same wrong answer. The network appears stable, but the stability no longer indicates truth.</p><p><strong>2. Evidential hesitation</strong></p><p>An evidential network does not estimate uncertainty by repeatedly sampling itself. Instead, it predicts the parameters of a Dirichlet distribution.</p><p>The total Dirichlet strength represents accumulated evidence. Low strength corresponds to high uncertainty; high strength corresponds to confidence.</p><p>In this experiment, uncertainty is calculated as:</p><p>U_evidential(x) = K / Σₖ₌₁ᴷ αₖ(x)</p><p>where K is the number of classes and αₖ is the predicted Dirichlet parameter for class k.</p><p>The gate defers when this uncertainty is high.</p><p>An adaptive attack can try to do the opposite: increase classification error while driving the evidential uncertainty downward. The danger is not merely an incorrect class prediction. It is an incorrect prediction supported by apparently strong evidence.</p><p><strong>3. Geometric hesitation</strong></p><p>The third signal comes from the model’s own internal feature space.</p><p>For each CIFAR-10 class, I calculated a centroid from the normalized feature representations of the training images. At inference time, the model measures the distance between an input’s representation and its nearest class centroid.</p><p>An input far from every learned class region appears unfamiliar, so the system defers. An input close to a centroid appears structurally normal.</p><p>This produces an architecture-native uncertainty signal:</p><p>U_geometry(x) = minₖ ‖f(x) − cₖ‖₂²</p><p>where f(x) is the normalized internal representation and cₖ is the centroid of class k.</p><p>To attack this gate correctly, it is not enough to move the representation toward any centroid. That could accidentally move it back toward the correct class. The adaptive attack must cause an error while pulling the representation toward an incorrect-class centroid.</p><p>This is a stronger demand:</p><p>Make the model wrong, and make the wrong answer look internally normal.</p><h4>III. From one attack to a general playbook</h4><p>Essay #9 used a joint objective:</p><p>L_adaptive = L_classification − λL_warning</p><p>The first term encourages error. The second suppresses the signal that would otherwise cause deferral.</p><p>Essay #10 preserves this structure but changes the suppression term for each mechanism:</p><ul><li><strong>MC Dropout:</strong> reduce predictive variance across stochastic passes.</li><li><strong>Evidential uncertainty:</strong> reduce Dirichlet uncertainty.</li><li><strong>Feature geometry:</strong> reduce distance to the nearest incorrect-class centroid.</li></ul><p>The core adaptive attack is implemented as follows:</p><pre>classification_loss = F.nll_loss(<br>    torch.log(probabilities.clamp_min(1e-10)),<br>    labels,<br>)<br><br>normalized_suppression_signal = (<br>    suppression_signal / uncertainty_scale<br>).mean()<br><br>objective = (<br>    classification_loss<br>    - lam * normalized_suppression_signal<br>)</pre><p>The attack performs gradient ascent on this objective. Classification loss rises while the relevant warning signal falls.</p><p>Because the three uncertainty signals have different numerical scales, each suppression signal is divided by its standard deviation on the clean calibration set. The value of (\lambda) is then selected separately for each mechanism using an attack-development subset rather than the final evaluation data.</p><p>The candidate values were:</p><pre>LAMBDA_CANDIDATES = [<br>    0.0,<br>    0.001,<br>    0.0025,<br>    0.005,<br>    0.01,<br>    0.025,<br>    0.05,<br>]</pre><p>Including zero is essential. It represents the same white-box classification attack without an explicit attempt to suppress the warning signal.</p><p>This gives the experiment a sharper comparison:</p><p>How much additional silent exposure is created by knowledge of the gate itself?</p><h4>IV. The experimental design</h4><p>The experiment uses CIFAR-10 and three target CNNs sharing a common convolutional backbone:</p><ul><li>an MC Dropout classifier;</li><li>an evidential classifier;</li><li>a standard classifier with a feature-geometry gate.</li></ul><p>A fourth, independently trained CNN serves as the surrogate model for transferred attacks.</p><p>The 10,000-image CIFAR-10 test set is separated into three non-overlapping subsets:</p><ul><li>1,500 images for clean threshold calibration;</li><li>1,000 images for attack development;</li><li>7,500 images for untouched final evaluation.</li></ul><p>The adaptive lambda search uses only 512 images from the attack-development subset.</p><p>For every mechanism, the deferral threshold is calibrated to target a 25% deferral rate on clean calibration data.</p><p>The final evaluation contains four conditions.</p><p><strong>Clean</strong></p><p>No attack is applied.</p><p><strong>Transferred PGD</strong></p><p>A standard <strong>projected gradient descent</strong> attack is generated against the separate surrogate classifier and transferred to the target model. The attacker does not directly optimize the target model or its uncertainty gate.</p><p><strong>Direct white-box PGD</strong></p><p>The attacker has direct access to the target classifier and maximizes classification error, but it does not explicitly suppress the uncertainty signal.</p><p>This condition separates the consequences of white-box access from the consequences of knowing how the warning gate works.</p><p><strong>Adaptive gate-aware PGD</strong></p><p>The attacker has direct access to both the classifier and the uncertainty mechanism. It optimizes classification error and suppression of the warning signal simultaneously.</p><p>All attacks use an (L_\infty) perturbation budget of:</p><p>ε = 8/255</p><p>with 20 PGD steps.</p><p>Two scope notes. First, this essay uses a new backbone, training recipe, seed, split, and budget: ε = 8/255, roughly five times the effective pixel budget of Essays #4 through #9, where ε = 0.03 was applied in normalized units. Numbers here are not comparable to Essay #9’s. Only within-essay comparisons are controlled. Second, Essay #9 promised pressure on the architecture-native signals built in Essay #6: multi-head disagreement and evidential evidence. This essay tests evidential evidence and replaces multi-head disagreement with a feature-centroid distance gate. Multi-head disagreement remains untested under adaptive attack.</p><h4>V. Measuring human exposure</h4><p>Accuracy alone cannot describe the behavior of a selective system.</p><p>A model may be wrong but defer, preventing the incorrect answer from reaching a person. It may also be wrong and answer anyway.</p><p>The experiment therefore reports four main quantities.</p><p><strong>Coverage</strong></p><p>The proportion of inputs for which the system provides an answer:</p><p>Coverage = Answered / Total</p><p><strong>Risk on answered predictions</strong></p><p>The error rate among the predictions the system allowed through:</p><p>Risk on answered predictions = Wrong and Answered / Answered</p><p><strong>Wrong and undeferred exposure</strong></p><p>The proportion of all inputs that receive a wrong answer without a warning:</p><p>Wrong and undeferred exposure = Wrong and Answered / Total</p><p>This last metric is the central human-facing outcome. It measures silent exposure rather than classification failure alone.</p><h4>VI. The clean baseline</h4><p>Before any attack, all three mechanisms produced approximately the intended 25% deferral rate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/773/1*NO1wZH0LeNIixEYFF_B4xw.png" /></figure><p>Under clean conditions, the evidential system appeared strongest. It had the lowest risk on answered predictions and the lowest wrong-and-undeferred exposure.</p><p>Feature geometry also performed well, reducing silent exposure to 6.43%.</p><p>MC Dropout was less selective. Even after deferring on roughly one-quarter of the inputs, 10.23% of all clean examples remained wrong and undeferred.</p><p>These clean results show why uncertainty gates are attractive. Each mechanism appeared capable of separating at least some dangerous predictions from safer ones.</p><p>The question was whether that separation would survive attack.</p><h4>VII. Four conditions, three different failures</h4><p>The complete results were:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*F4061D-ifHN-KqVHajQTEg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wg53Mr_pVvaMYiD8F4YIJA.png" /></figure><p><em>Figure 1. Wrong and undeferred exposure across clean, transferred, direct white-box, and adaptive gate-aware conditions. Lower values indicate fewer silent failures reaching the user.</em></p><p>The plot shows a common outcome but not a common route.</p><p>Every mechanism lost its clean protective value. Yet the reason differed in each case.</p><h4>VIII. MC Dropout: silence without much additional effort</h4><p>Under transferred PGD, MC Dropout increased its deferral rate from 23.21% to 39.16%.</p><p>This was the behavior we hoped an uncertainty mechanism would produce. The attack caused extensive classification failure, and the stochastic predictions became less stable. The model hesitated more often.</p><p>Wrong and undeferred exposure still rose to 54.20%, but the gate detected a meaningful portion of the disturbance.</p><p>That protection almost disappeared under direct white-box attack.</p><p>The direct classifier-only attack reduced accuracy to zero while deferral fell to 5.72%. Wrong and undeferred exposure reached 94.28%.</p><p>When predictive variance became an explicit part of the adaptive objective, deferral fell slightly further to 4.49%, and wrong and undeferred exposure rose to 95.51%.</p><p>The awareness gap was therefore:</p><p>95.51 − 94.28 = 1.23 percentage points</p><p>This gap is small, but it should not be interpreted as robustness.</p><p>The gate-aware attacker gained little because the gate-unaware white-box attack had already made the stochastic warning largely disappear. Explicitly targeting variance was almost unnecessary.</p><p>MC Dropout failed through incidental silence: the process of finding a strong white-box adversarial example also found a region where the stochastic passes agreed on the error.</p><p>The mechanism did not need to be attacked very precisely. Its warning weakened as a side effect of attacking the classifier.</p><h4>IX. Evidential uncertainty: the gate that was already gone</h4><p>The evidential model produced the best clean selective results:</p><ul><li>84.60% accuracy;</li><li>7.09% risk on answered predictions;</li><li>5.29% wrong-and-undeferred exposure.</li></ul><p>Under transferred PGD, however, deferral decreased from 25.36% to 12.40%, even as accuracy fell to 3.59%.</p><p>This is already the wrong direction. The model became less accurate and less willing to defer at the same time.</p><p>Under direct white-box PGD, the collapse was complete:</p><ul><li>accuracy: 0%;</li><li>deferral: 0%;</li><li>wrong and undeferred: 100%.</li></ul><p>The adaptive lambda search selected:</p><p>“evidential”: 0.0</p><p>Every tested nonzero lambda produced the same result, but none could exceed the classifier-only baseline because the baseline had already reached the metric’s ceiling.</p><p>The awareness gap was:</p><p>100.00 − 100.00 = 0.00 percentage points</p><p>Again, this is not evidence that evidential uncertainty survived an adaptive attacker.</p><p>It means something more severe:</p><p>The attacker did not need to target evidential uncertainty. Causing the error was enough to make the model maximally certain and completely silent.</p><p>The model’s evidence was useful under clean conditions, but it did not behave as evidence of truth under adversarial pressure. It behaved as a learnable activation pattern, one that the classification attack could inflate without separately attacking the gate.</p><p>The strongest clean warning mechanism became the least resistant one.</p><h4>X. Feature geometry: a bell that rang at a fixed rate</h4><p>Feature geometry produced the most instructive result, though not for the reason it first appears.</p><p>Under direct white-box PGD, accuracy fell to zero, and the gate still deferred 25.73% of inputs. It is tempting to read that as a protective remainder: the classifier was broken, but the geometry still noticed something wrong.</p><p>The clean baseline says otherwise. On clean images, this gate deferred 26.03% of inputs. Under transferred attack, it deferred 23.29%. Under direct white-box attack, 25.73%. Its deferral rate under attack was the rate it was calibrated to produce, whatever was happening to the input. It was not detecting the attack. It was deferring a fixed quarter of everything. When accuracy is zero, wrong and undeferred is simply 100 minus the deferral rate, so a gate that deferred a random quarter of inputs would have scored the same 74.27%.</p><p>The signal itself agrees. Its mean uncertainty was 0.110 on clean images, 0.109 under transferred attack, and 0.117 under direct white-box attack. Attacking the classifier left the geometry almost untouched. The warning was neither triggered nor silenced. It was decoupled from the attack, the same pattern Essay #7 found in a variational model that had failed to learn. Here the model was healthy. The decoupling belongs to the signal.</p><p>That is why the gate-aware attack mattered. It ascended classification loss while pulling each input’s features toward the nearest incorrect-class centroid. Mean uncertainty fell to 0.042, deferral fell from 25.73% to 0.04%, and wrong and undeferred rose from 74.27% to 99.96%. The awareness gap is +25.69 points, the only one in this experiment that is not a ceiling effect.</p><p>What that gap measures is how completely an attacker who knows the signal can steer it. It does not measure destroyed detection, because there was no detection under attack to destroy. What the attack removed was the gate’s clean-condition value: on clean inputs, it lowered the error rate of the answers it kept from 14.76% to 8.69%. The attacker did not silence a bell that was ringing for danger. It took away the one thing the bell could do.</p><p>One caution. The selected weight, 0.001, is the smallest nonzero value tested, and every nonzero value tied at 100% on the development set. How little suppression would have sufficed is unknown.</p><pre>true_class_mask = F.one_hot(<br>    labels,<br>    num_classes=NUM_CLASSES,<br>).bool()<br><br>incorrect_distances = squared_distances.masked_fill(<br>    true_class_mask,<br>    float(&quot;inf&quot;),<br>)<br><br>nearest_wrong_distance = incorrect_distances.min(<br>    dim=1<br>).values</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*z9d3PJW-7Rii8jKArS4AQw.png" /></figure><p><em>Figure 2. Awareness gap: adaptive minus direct white-box wrong and undeferred exposure. Feature geometry shows the highest marginal cost of revealing the gate.</em></p><h4>XI. Two gaps, two questions</h4><p>Essay #9 compared a transferred attack with an adaptive gate-aware attack. Preserving that comparison in Essay #10 gives the following exposure gaps:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/678/1*edHrHtLvDM1m3YWScWSUOA.png" /></figure><p>These numbers describe how much worse exposure became when moving from transferred attacks to fully adaptive target-specific attacks.</p><p>But this comparison changes two things simultaneously:</p><ul><li>the attacker gains direct access to the target model;</li><li>the attacker learns how the uncertainty gate works.</li></ul><p>For that reason, Essay #10 introduces a stricter measurement: the awareness gap.</p><p>Awareness gap = WU_adaptive − WU_direct white-box</p><p>One consequence is retroactive. Essay #9’s 31.90-point gap compared a transferred attack with a gate-aware white-box attack and had no gate-unaware white-box control, so it bundled access and awareness. That experiment showed the ensemble’s gate could be silenced by an attacker with white-box access. It did not isolate how much came from knowing the gate. Here the decomposition is possible. For MC Dropout, the 41.31-point total gap splits into 40.08 points of access and 1.23 of awareness. For evidential, all 15.07 points are access. Only feature geometry’s gap is awareness: −1.12 points of access and +25.69 of awareness. Essay #9’s gap may therefore have been mostly access. Running the unaware control on that ensemble is the obvious follow-up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*Fe0uLptJzOt5lyP_xNGrmg.png" /></figure><p>This second table asks the sharper question:</p><p>Once the attacker already has access to the model, how much additional harm comes specifically from knowing how the model detects uncertainty?</p><p>For feature geometry, the answer is substantial.</p><p>For MC Dropout, most of the damage occurred before explicit gate awareness.</p><p>For evidential uncertainty, there was no remaining protection to remove.</p><p>The difference between these results is not noise around one common story. <strong><em>It is the story.</em></strong></p><h4>XII. Verifying the attack boundary</h4><p>Because these results are extreme, particularly the 99.96% and 100% exposure values, the implementation must rule out a simpler explanation: invalid images or perturbations larger than the declared threat model.</p><p>Every adversarial batch was therefore checked during final evaluation.</p><pre>max_linf = (<br>    adversarial_images - original_images<br>).abs().amax().item()<br><br>if minimum_pixel &lt; -tolerance:<br>    raise AssertionError(&quot;Pixel below zero.&quot;)<br><br>if maximum_pixel &gt; 1.0 + tolerance:<br>    raise AssertionError(&quot;Pixel above one.&quot;)<br><br>if max_linf &gt; epsilon + tolerance:<br>    raise AssertionError(&quot;Perturbation exceeds epsilon.&quot;)</pre><p>All nine attack–mechanism combinations passed.</p><p>For every condition:</p><ul><li>minimum pixel value was 0;</li><li>maximum pixel value was 1;</li><li>maximum (L_\infty) perturbation was approximately 0.031373;</li><li>the declared bound was (8/255), also approximately 0.031373.</li></ul><p>The attacks remained inside valid pixel space and inside the stated perturbation budget.</p><p>This does not make the experiment universal, but it confirms that the observed failures were not artifacts of broken projection or normalization.</p><h4>XIII. What the experiment shows</h4><p>Three gates failed at the same budget. They did not fail the same way.</p><p>Two signals were coupled to the classifier. Attacking the classifier alone lowered MC Dropout’s mean variance by about 74% (0.0237 to 0.0061) and evidential’s mean uncertainty by about 81% (0.149 to 0.028). Their warnings fell silent as a side effect of finding an adversarial example. The attacker did not need to know the gate existed. Knowing it added 1.23 points for MC Dropout and nothing for evidential, which had already reached the ceiling.</p><p>One signal was decoupled from the classifier. Attacking the classifier left its mean uncertainty where it was, so it never warned. It went quiet only when the attacker targeted it directly, and that knowledge added 25.69 points.</p><p>At 8/255, neither pattern provided durable protection. The coupled warnings were silenced as the classifier was attacked, while the decoupled warning did not reliably track the danger. Neither necessarily looked broken from outside because its deferral rate could remain plausible. In the main experiment, only MC Dropout clearly increased its warning under danger: deferral rose from 23.21% to 39.16% under a transferred attack, then fell to 5.72% when the attacker could see the model.</p><p>All of this is measured at ε = 8/255, where every classifier reached 0% accuracy under an unaware white-box attack. At that ceiling, an awareness gap near zero shows that the classifier attack was already enough, not that the gate is irrelevant.</p><p>To test whether this interpretation was hidden by the 8/255 ceiling, I repeated the three attack conditions at budgets of 1/255, 2/255, 4/255, and 8/255, retuning the adaptive weight at every budget.</p><p>At the two smallest budgets, all three classifiers retained nonzero accuracy under the direct white-box attack, making the awareness gap informative rather than ceiling-limited.</p><p>The result did not reveal one universal adaptive effect. MC Dropout’s awareness gap remained small: 1.11 points at 1/255 and 3.28 points at 2/255. Evidential uncertainty showed almost no additional cost from gate awareness: 0.83 points at 1/255 and −0.03 points at 2/255. In both mechanisms, most of the damage came from direct access to the classifier rather than explicit knowledge of the gate.</p><p>Feature geometry behaved differently. Its awareness gap was already 6.77 points at 1/255, increased to 7.83 points at 2/255, reached 14.75 points at 4/255, and ended at 25.69 points at 8/255.</p><p>The ceiling therefore concealed some details, but it did not create the central pattern. Across the tested budgets, the coupled signals were damaged mainly by access to the classifier. The decoupled geometric signal was damaged most strongly when the attacker learned its definition.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tRUuhWyV91nxAaKmq-Fz2Q.png" /></figure><p><em>Figure 3. Exposure, deferral, and gap decomposition across attack budgets. The smaller budgets reveal the awareness gap before the classifiers reach the zero-accuracy ceiling.</em></p><p>One tuning caution remains. At 1/255 and 2/255, feature geometry selected the largest lambda in the expanded search grid. Its adaptive results should therefore be read as achieved attack performance rather than a proven optimum; a wider search could potentially produce an even stronger attack.</p><h4>XIV. What this experiment does not establish</h4><p>These results should remain within the boundary of the experiment.</p><p>They come from:</p><ul><li>CIFAR-10;</li><li>one shared family of CNN backbones;</li><li>one calibrated deferral target;</li><li>an (L_\infty) threat model with (\epsilon=8/255);</li><li>white-box adaptive access;</li><li>one principal training seed.</li></ul><p>The experiment does not prove that every uncertainty mechanism can always be silenced. It does not establish the same numerical behavior for larger datasets, transformers, multimodal systems, language models, or real deployment environments.</p><p>It also does not show that uncertainty is useless.</p><p>Under clean and transferred conditions, the gates sometimes reduced silent exposure substantially. The feature-geometry gate still deferred on roughly one-quarter of direct white-box adversarial examples before its geometry became part of the attack. That deferral was real, but the evidence does not show that it was detecting the attack: its rate remained close to its clean calibration rate. What remained was selective behavior, not demonstrated adversarial awareness.</p><p>Any protective value was limited and was not durable under the stronger threat model tested here.</p><p>Future work must ask whether the same patterns persist across multiple training seeds, model families, datasets, attack budgets, and black-box approximation methods. It must also test whether adversarially training the warning mechanism can preserve its usefulness or merely move the blind spot.</p><h4>XV. The warning and the danger</h4><p>Essay #9 asked whether silencing the warning belonged to Deep Ensembles or to warning systems in general. At the budget tested, none of the three signals kept its warning. How each lost it differed.</p><p>One went quiet when the classifier was attacked. It never needed to be hunted.</p><p>One was already silent when the attacker arrived.</p><p>One rang at its resting rate whatever was happening, until the attacker learned its shape.</p><p>At weaker budgets, some warnings still rose with danger, but their durability differed. MC Dropout’s protection was damaged mainly by access to the classifier. Evidential uncertainty became quiet with almost no additional knowledge of its gate. Feature geometry preserved a more separate signal, but that separation became a vulnerability once the attacker learned what geometry the gate trusted.</p><p>The generalization is therefore not that every warning fails in the same way. It is that every warning must be evaluated under the kind of knowledge that can specifically invalidate what it measures. The series has now measured hesitation as variance, as evidence, and as distance. Each carried information under ordinary conditions. None established a connection between hesitation and danger that remained durable across the strongest conditions tested here.</p><p>A warning that can be silenced, or that never tracked danger, raises a harder question than whether it can be attacked. Essay #11 will ask what a person is owed by the system around such a warning: not accuracy, but consequence.</p><p><em>The boat learned to ring a bell. The storm learned to keep it quiet. And sometimes the bell had been ringing by itself.</em></p><h4>Resources and further reading</h4><p>Experiment and reproducibility:</p><p>Essay #4:</p><p><a href="https://pub.towardsai.net/learning-to-say-i-dont-know-the-first-floor-of-awareness-1a9faae389c0">Learning to Say “I Don’t Know”: The First Floor of Awareness</a></p><p>Essay #5:</p><p><a href="https://medium.com/@maedeh.torkian/the-geometry-of-fragility-feeling-the-decision-boundary-2d1c50f402ee">The Geometry of Fragility: Feeling the Decision Boundary</a></p><p>Essay #6:</p><p><a href="https://medium.com/@maedeh.torkian/architectural-awareness-building-the-sensor-into-the-boat-c8545beedd3c">Architectural awareness: building the sensor into the boat</a></p><p>Essay #7:</p><p><a href="https://medium.com/data-science-collective/knowing-the-weights-four-bayesian-lenses-on-uncertainty-9c6c0270d67e">Knowing the weights: four Bayesian lenses on uncertainty</a></p><p>Essay #8:</p><p><a href="https://medium.com/@maedeh.torkian/does-the-model-know-where-it-looks-0ad64eff5e14">Does the model know where it looks?</a></p><p>Essay #9:</p><p><a href="https://medium.com/@maedeh.torkian/confidently-wrong-a0c09bfe348b">Confidently wrong</a></p><p>• Complete Essay #10 notebook, executed outputs, attack validation, and figures:</p><p><a href="https://github.com/Maee127/Adversarial-Notebooks/blob/master/%2310/Notebook-%2310.ipynb">Adversarial-Notebooks/#10/Notebook-#10.ipynb at master · Maee127/Adversarial-Notebooks</a></p><h4><strong>Uncertainty mechanisms</strong></h4><p>• <strong>Gal, Y., &amp; Ghahramani, Z. (2016).</strong> <em>Dropout as a Bayesian Approximation: Representing Model Uncertainty in Deep Learning. Proceedings of the 33rd International Conference on Machine Learning.</em></p><p>This paper provides the theoretical foundation for using dropout during inference to estimate predictive uncertainty.</p><p>• <strong>Sensoy, M., Kaplan, L., &amp; Kandemir, M. (2018).</strong> <em>Evidential Deep Learning to Quantify Classification Uncertainty. Advances in Neural Information Processing Systems.</em></p><p>This work introduces the Dirichlet-based evidential classification framework used as the foundation for the evidential mechanism in this experiment.</p><p>• <strong>Lakshminarayanan, B., Pritzel, A., &amp; Blundell, C. (2017).</strong> <em>Simple and Scalable Predictive Uncertainty Estimation Using Deep Ensembles. Advances in Neural Information Processing Systems.</em></p><p>Deep Ensembles provided the uncertainty mechanism examined in Essay #9 and motivated the generalization question tested here.</p><p>• <strong>Lee, K., Lee, K., Lee, H., &amp; Shin, J. (2018).</strong> <em>A Simple Unified Framework for Detecting Out-of-Distribution Samples and Adversarial Attacks. Advances in Neural Information Processing Systems.</em></p><p>This work demonstrates how class-conditional internal feature distributions and distance-based scores can be used to identify abnormal or adversarial inputs. Essay #10 uses a simplified centroid-distance mechanism rather than reproducing the full Mahalanobis method.</p><h4>Adversarial evaluation</h4><p>• <strong>Madry, A., Makelov, A., Schmidt, L., Tsipras, D., &amp; Vladu, A. (2018).</strong> <em>Towards Deep Learning Models Resistant to Adversarial Attacks. International Conference on Learning Representations.</em></p><p>This paper formalizes the robust-optimization perspective and provides the basis for the Projected Gradient Descent threat model used in the notebook.</p><p>• <strong>Athalye, A., Carlini, N., &amp; Wagner, D. (2018).</strong><em> Obfuscated Gradients Give a False Sense of Security: Circumventing Defenses to Adversarial Examples. Proceedings of the 35th International Conference on Machine Learning.</em></p><p>This work explains why a defense must be evaluated with attacks adapted to the defense itself rather than only with attacks designed against an unprotected classifier.</p><p>• <strong>Ilyas, A., Engstrom, L., Athalye, A., &amp; Lin, J. (2018).</strong> <em>Black-box Adversarial Attacks with Limited Queries and Information. Proceedings of the 35th International Conference on Machine Learning.</em></p><p>This paper provides relevant background for the open question of whether the gate-aware attacks studied here could be approximated without direct white-box access.</p><h4>Selective prediction and deferral</h4><p>• <strong>Geifman, Y., &amp; El-Yaniv, R. (2019).</strong> <em>SelectiveNet: A Deep Neural Network with an Integrated Reject Option. Proceedings of the 36th International Conference on Machine Learning.</em></p><p>SelectiveNet formalizes classification with a reject option and the relationship between coverage and selective risk — the foundation for the coverage, deferral, and risk-on-answered measurements used in this essay.</p><h4>Scope Note</h4><p>The feature-geometry mechanism in this notebook is an intentionally simplified experimental construction based on normalized feature representations and class centroids. It should not be interpreted as a direct reproduction of the full Mahalanobis detector or another published architecture-native uncertainty method.</p><p>Likewise, the notebook is a controlled CIFAR-10 experiment, not evidence that every uncertainty mechanism, architecture, or deployment setting will produce the same behavior. Its purpose is to test whether the adaptive principle from Essay #9 reappears across three distinct warning signals.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=461c49a3c8a6" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/the-shape-of-the-silence-461c49a3c8a6">The shape of the silence</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Confidently wrong]]></title>
            <link>https://medium.com/@maedeh.torkian/confidently-wrong-a0c09bfe348b?source=rss-380dc4dff114------2</link>
            <guid isPermaLink="false">https://medium.com/p/a0c09bfe348b</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[cyber-security-awareness]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Maedeh Torkian]]></dc:creator>
            <pubDate>Thu, 08 Oct 2026 14:47:05 GMT</pubDate>
            <atom:updated>2026-10-08T14:47:05.158Z</atom:updated>
            <content:encoded><![CDATA[<p>The human cost of silent failure</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qawiR5EYe-wf6Hcs40JbyQ.png" /><figcaption>The warning that vanished at sea</figcaption></figure><p><em>Essay #9 in the Humble Model Series</em></p><h4>I. The question we started with</h4><p>At the beginning of this series, before any sensor had been built, one question stood behind everything that followed:</p><p><em>How are we vulnerable?</em></p><p>Not whether we are vulnerable. That was already known. The harder question was how failure reaches the person who trusts the output.</p><p>A model does not pay for being wrong. It produces a probability, a class, or a token and moves on. The cost belongs to the person on the other side of the prediction: the person who reads confidence as assurance, silence as safety, and an unflagged answer as one that can be trusted.</p><p>Eight essays later, the question has become more precise:</p><p><em>Can a model be made wrong while its own warning system remains quiet?</em></p><p>Essay #9 tests that failure directly. It does not ask only whether an ensemble can be attacked. It asks whether the attacker can cause the error and suppress the disagreement that should have triggered deferral.</p><h4>II. What the series has been measuring</h4><p>From Essay #4 onward, the series has treated abstention as an operational form of humility. A model does not need perfect self-knowledge to be useful. It needs a signal that becomes active where its predictions should no longer be trusted.</p><p>Two measurements matter here, and they describe different parts of the human risk.</p><ul><li>Risk on answered predictions is the error rate conditional on the model choosing not to defer. It asks: among the answers the system handed over, how many were wrong?</li><li>Wrong-and-undeferred is the share of all evaluated inputs that became wrong answers without a warning. It asks: how often did silent failure reach the user?</li></ul><p>The first measurement describes the reliability of what the model says. The second describes the exposure created by the full classifier-and-gate system. Essay #9 needs both because an attack can change not only the model’s accuracy, but also how often it decides to speak.</p><p>Earlier essays examined confidence, decision-boundary geometry, architecture-native signals, uncertainty in the weights, and attention entropy. Again and again, the same lesson appeared: a mechanism can be mathematically meaningful or visually readable without being operationally coupled to failure.</p><p>Essay #7 offered the strongest result so far. Deep Ensembles produced an adversarial risk of 15.42% under transferred PGD. Their disagreement appeared to be a useful sensor. Essay #9 asks what happens when the attacker is no longer unaware of that sensor.</p><h4>III. The limitation we had not attacked</h4><p>The earlier attacks primarily optimized for misclassification. They attempted to make the model wrong, then observed whether the uncertainty signal was noticed.</p><p>That is an important test, but it leaves the gate outside the attacker’s objective. An ordinary attack may increase error and also increase uncertainty. If the system defers, the warning mechanism still performs its job.</p><p>Silent failure requires a different objective. The attacker must do two things at once:</p><ol><li>Increase classification error.</li><li>Suppress ensemble disagreement so the gate continues to treat the input as safe.</li></ol><p>This is the failure that matters most to a user. A visibly uncertain model invites review. A confidently wrong model delivers the error as an answer.</p><p>The danger is not only that the boat enters rough water. The danger is that the storm learns what the sensor is listening for.</p><h4>IV. The experiment</h4><p><strong>Deep Ensemble and calibrated gate</strong></p><p>The experiment reloads the five independently trained CNN members from Essay #7. Their mean prediction supplies the class decision. Their maximum class-probability variance supplies the disagreement score.</p><p>The CIFAR-10 test set is divided, using the same fixed split as the recent essays, into 2,000 calibration images and 8,000 evaluation images. The deferral threshold is calibrated on the clean calibration split toward a 25% deferral target. The resulting threshold is 0.054999, with exactly 25.00% calibration deferral.</p><p>The reloaded ensemble reaches 84.90% clean accuracy on the full evaluation split. After the gate is applied, clean coverage is 76.30% and risk among answered predictions is 9.99%.</p><p><strong>Two adversarial conditions</strong></p><p>The experiment compares two attacks against the same ensemble and the same calibrated gate.</p><p>• <strong>Transferred PGD</strong> is generated against a separately trained baseline CNN and transferred to the ensemble. This reproduces the threat model used in Essay #7.</p><p>• <strong>An adaptive gate-aware attack</strong> differentiates through all five ensemble members. It increases classification loss while penalizing ensemble variance, aiming to make the mean prediction wrong without activating the disagreement gate.</p><p>The adaptive objective is optimized by gradient ascent:</p><p>L_attack = L_classification − λ × L_disagreement</p><p>The attack uses epsilon 0.03, step size 0.007, and 40 iterations in the notebook’s normalized input space. It does not force a particular wrong class; in standard adversarial-learning terminology, it is an untargeted but adaptive attack against the classifier-and-gate system.</p><p><strong>Attack tuning and diagnostic check</strong></p><p>Rather than choosing one arbitrary disagreement penalty, the notebook evaluates λ values 0.1, 0.5, 1.0, 2.0, and 5.0 on a 500-image subset. The selection criterion is the quantity the essay cares about most: wrong-and-undeferred predictions.</p><p>λ = 5.0 produces the highest subset exposure, 42.97%, and is therefore used for the full evaluation. A diagnostic dry run then checks the direction of optimization. Classification loss increases from 0.5389 to 1.7223, while the mean maximum variance decreases from 0.038669 to 0.015358. The attack is not merely increasing error; it is simultaneously reducing the signal used for deferral.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ExqLGAc2FBM-yVj35xTQlw.png" /><figcaption>Lambda sweep plot- By author</figcaption></figure><p><strong>Code (PyTorch)</strong></p><pre>def quick_eval_adaptive(models, threshold, loader, lambda_agreement,<br>                        attack_params, max_samples=500):<br>    &quot;&quot;&quot;Lightweight version of the full evaluator, for sweeping lambda<br>    on a subset rather than the full 8,000-image set.&quot;&quot;&quot;<br>    n_seen = 0<br>    n_def = n_pred = n_correct_pred = n_wrong_undeferred = 0<br>    total = 0<br><br>    for images, labels in loader:<br>        images, labels = images.to(DEVICE), labels.to(DEVICE)<br>        adv = pgd_adaptive_gate(models, images, labels, threshold,<br>                                lambda_agreement=lambda_agreement,<br>                                **attack_params)<br><br>        with torch.no_grad():<br>            mean_probs, max_variance = ensemble_predict(models, adv)<br>        preds = mean_probs.argmax(dim=1)<br>        defer = max_variance &gt; threshold<br>        correct = (preds == labels)<br><br>        total += labels.size(0)<br>        n_def += int(defer.sum().item())<br>        n_pred += int((~defer).sum().item())<br>        n_correct_pred += int((correct &amp; ~defer).sum().item())<br>        n_wrong_undeferred += int(((~correct) &amp; (~defer)).sum().item())<br><br>        n_seen += labels.size(0)<br>        if n_seen &gt;= max_samples:<br>            break<br><br>    acc_on_pred = 100.0 * n_correct_pred / n_pred if n_pred else 0.0<br>    return {<br>        &#39;wrong_and_undeferred_pct&#39;: 100.0 * n_wrong_undeferred / total,<br>        &#39;risk_on_predicted&#39;: 100.0 - acc_on_pred,<br>        &#39;deferral_rate&#39;: 100.0 * n_def / total,<br>    }</pre><h4>V. The result</h4><p>• <strong>Clean</strong>: coverage 76.30%, deferral 23.70%, risk on answered predictions 9.99%, wrong-and-undeferred 7.62%</p><p>• <strong>Transferred PGD</strong>: coverage 70.55%, deferral 29.45%, risk on answered predictions 15.17%, wrong-and-undeferred 10.70%</p><p>• <strong>Adaptive gate-aware attack</strong>: coverage 93.75%, deferral 6.25%, risk on answered predictions 45.73%, wrong-and-undeferred 42.88%</p><p><em>Deep Ensemble behavior under clean, transferred, and adaptive attack conditions. All three conditions evaluated against the same five ensemble members, the same calibrated threshold, and the same 8,000-image evaluation split.</em></p><p>Under clean conditions, the ensemble defers on 23.70% of evaluation inputs. Among the predictions it does provide, 9.99% are wrong. Silent failures account for 7.62% of the full evaluation set.</p><p>The ordinary transferred attack behaves as a useful uncertainty sensor should. Risk rises to 15.17%, but deferral also rises to 29.45%. The model becomes less reliable, and the disagreement gate becomes more cautious. Wrong-and-undeferred exposure increases moderately to 10.70%.</p><p>The adaptive gate-aware attack changes the behavior of the entire system. Deferral collapses to 6.25%, so the ensemble answers on 93.75% of inputs. At the same time, risk among those answers rises to 45.73%. Across the full evaluation set, 42.88% of inputs become wrong answers delivered without deferral.</p><p>Relative to transferred PGD, the adaptive attack increases risk among answered predictions by 30.57 percentage points. More importantly for the user, it increases wrong-and-undeferred exposure by 32.17 points.</p><p>The ensemble does not merely become more wrong. It becomes more willing to answer while it is wrong.</p><h4>VI. Why the comparison matters</h4><p>The transferred result in this notebook is 15.17%, within 0.25 percentage points of Essay #7’s reported 15.42%. That close reproduction matters. It shows that the new experiment begins from essentially the same ordinary-attack behavior before changing the attack objective.</p><p>The central comparison is still the controlled within-notebook comparison: transferred PGD and the adaptive gate-aware attack evaluated against the same five ensemble checkpoints, the same threshold, and the same evaluation split. The Essay #7 value provides continuity, but the 30.57-point and 32.17-point gaps are established inside Essay #9 itself.</p><p>This distinction protects the conclusion from becoming larger than the experiment. The notebook does not prove that every ensemble, every uncertainty score, or every gate will fail. It demonstrates that this disagreement-based gate can be substantially bypassed when the attacker is allowed to optimize against the signal that controls deferral.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JJdhT6Ya991ZnprkpU5L8w.png" /><figcaption>Essay#7_head_to_head — By author</figcaption></figure><h4>VII. What the gap means</h4><p>Deep Ensembles were not exposed as useless. Under ordinary transferred attack, disagreement remained valuable: the system deferred more often as the threat increased, and its adversarial risk stayed close to the strongest result from Essay #7.</p><p>The new finding is narrower and more important. The apparent protection depended on a mismatch between the attacker’s objective and the gate’s logic. Once the attacker optimized both error and agreement, the same sensor became fragile.</p><p>This changes the meaning of the earlier result. A low adversarial risk under a non-adaptive attack tells us that the sensor correlates with failure under that attack. It does not yet tell us that the sensor remains trustworthy when an attacker explicitly tries to silence it.</p><p>Humility, therefore, cannot be evaluated only under accidental failure. A warning system must also be evaluated under strategic pressure.</p><h4>VIII. The human cost of silent failure</h4><p>Risk on answered predictions is severe under the adaptive attack: nearly one in two answers is wrong. But the more disturbing number is 42.88%.</p><p>That figure represents the fraction of all evaluated inputs for which the complete system makes a wrong prediction and declines to defer. It is the point where a technical vulnerability becomes an operational one. The user does not receive uncertainty, disagreement, or a request for review. The user receives an answer.</p><p>A gate can reduce harm only when its silence means something. If an attack can manufacture low disagreement, silence ceases to be evidence of safety.</p><p><em>A sensor that works only while no one is trying to evade it is a measurement. It is not yet a defense.</em></p><h4>IX. What we learned</h4><p>Essay #9 began with a question: can the model be fooled silently?</p><p>In this experiment, the answer is yes. The adaptive attack raises error, suppresses ensemble variance, reduces deferral from 29.45% under transferred PGD to 6.25%, and increases wrong-and-undeferred exposure from 10.70% to 42.88%.</p><p>The lesson is not that disagreement is meaningless. Disagreement remains a useful observational signal under ordinary failure. The lesson is that observational usefulness is not the same as adversarial robustness.</p><p>A humble model cannot be defined only by whether it sometimes says, ‘I do not know.’ We must also ask whether that admission can be manipulated, suppressed, or strategically avoided.</p><p>The series has moved from asking where uncertainty lives to asking whether uncertainty survives contact with an adversary who knows where to find it.</p><h4>X. What we still do not know</h4><ul><li>Whether the same adaptive objective will bypass MC Dropout, evidential evidence, or architecture-native disagreement signals.</li><li>Whether a black-box attacker can approximate the gate-aware attack without direct access to the ensemble members.</li><li>Whether randomized gates, multiple independent signals, or adversarial training of the gate can preserve deferral under adaptive pressure.</li><li>Whether the failure is specific to maximum class-probability variance or extends to predictive entropy, mutual information, and other ensemble uncertainty measures.</li><li>How the result changes on larger architectures, more complex datasets, and realistic downstream decision workflows.</li></ul><p>There is also a methodological improvement for the next experiment. The lambda sweep used 500 images from the evaluation loader. A stricter benchmark should reserve a separate attack-development split for hyperparameter selection, then evaluate the selected attack once on untouched data. The present effect is large and internally coherent, but that separation would make the estimate cleaner.</p><h4>XI. What this result opens</h4><p>The series began by asking:</p><p><em>How are we vulnerable?</em></p><p>Essay #9 has produced one sharp answer. We are vulnerable when a model’s warning system is mistaken for durable self-knowledge. Under an ordinary transferred attack, Deep Ensemble disagreement responded as a useful warning signal. But when the attack was designed to cause error while suppressing that disagreement, wrong-and-undeferred exposure rose from 10.70% to 42.88%.</p><p><em>The model had learned to hesitate. Its hesitation could be silenced.</em></p><p>That conclusion closes this experiment, but not the larger question. Essay #9 tested one gate, built from one uncertainty signal, under one adaptive objective. It does not yet show whether the failure belongs specifically to ensemble disagreement or whether the same vulnerability exists across the other forms of awareness this series has examined.</p><p>Essay #10 will test that generalization. It will apply the same adversarial principle, causing error while suppressing the mechanism’s warning, to Monte Carlo Dropout, evidential uncertainty, and the architecture-native signals developed in Essay #6. The question will not be merely which mechanism performs best under ordinary attack. It will be whether any of them continues to hesitate when the attacker knows what produces that hesitation.</p><p>Only then can the deployment question be addressed honestly. Essay #11 will ask what deferral owes the person relying on it. If a mechanism survives adaptive pressure, the question becomes how its abstention should be translated into human review, delay, coverage, and responsibility. If none survives, the obligation shifts to the surrounding system: what safeguards are required when the model’s own warning cannot be treated as trustworthy?</p><p>After those tests, the capstone will return to the question that opened the series:</p><p><em>How are we vulnerable?</em></p><p>Its answer will not depend on one mechanism, one attack, or one dramatic number. It will be built from the complete arc, from confidence and geometry to architectural awareness, uncertainty in the weights, attention, adaptive evasion, and the human consequences of trusting a model’s silence.</p><p>The boat learned to ring a warning bell.</p><p>Then the storm learned how to keep it quiet.</p><p>The remaining question is whether every bell can be silenced, and what the boat owes us when we can no longer trust what its silence means.</p><h4>XII. Resources</h4><ul><li><strong>Essay #1:</strong> The fog of certainty</li></ul><p><a href="https://medium.com/@maedeh.torkian/the-fog-of-certainty-on-deep-learnings-secret-vice-ed73d6ac3242">The Fog of Certainty: on Deep Learning’s Secret Vice</a></p><ul><li><strong>Essay #2:</strong> The attack landscape</li></ul><p><a href="https://pub.towardsai.net/the-attack-landscape-why-silence-is-the-vulnerability-f27dabfccb9b">The Attack Landscape: Why Silence Is the Vulnerability</a></p><ul><li><strong>Essay #3:</strong> Walls, shields, and illusions</li></ul><p><a href="https://pub.towardsai.net/walls-shields-and-illusions-defenses-and-their-limits-cd67b6ec4f92">Walls, Shields, and Illusions: Defenses and Their Limits</a></p><ul><li><strong>The bridge:</strong> From resistance to awareness</li></ul><p><a href="https://medium.com/@maedeh.torkian/the-bridge-from-resistance-to-awareness-58ea4156ad3f">The Bridge: From Resistance to Awareness</a></p><ul><li><strong>Essay #4:</strong> Learning to say “I don’t know”</li></ul><p><a href="https://pub.towardsai.net/learning-to-say-i-dont-know-the-first-floor-of-awareness-1a9faae389c0">Learning to Say “I Don’t Know”: The First Floor of Awareness</a></p><ul><li><strong>Essay #5:</strong> The geometry of fragility</li></ul><p><a href="https://medium.com/@maedeh.torkian/the-geometry-of-fragility-feeling-the-decision-boundary-2d1c50f402ee">The Geometry of Fragility: Feeling the Decision Boundary</a></p><ul><li><strong>Essay #6:</strong> Architectural awareness</li></ul><p><a href="https://medium.com/@maedeh.torkian/architectural-awareness-building-the-sensor-into-the-boat-c8545beedd3c">Architectural awareness: building the sensor into the boat</a></p><ul><li><strong>Essay #7:</strong> Knowing the weights</li></ul><p><a href="https://medium.com/data-science-collective/knowing-the-weights-four-bayesian-lenses-on-uncertainty-9c6c0270d67e">Knowing the weights: four Bayesian lenses on uncertainty</a></p><ul><li><strong>Essay #8:</strong> Does the model know where it looks?</li></ul><p><a href="https://medium.com/@maedeh.torkian/does-the-model-know-where-it-looks-0ad64eff5e14">Does the model know where it looks?</a></p><ul><li><strong>Notebook #9:</strong> Adaptive gate-aware attack</li></ul><p><a href="https://github.com/Maee127/Adversarial-Notebooks/blob/master/%239/Notebook-09.ipynb">Adversarial-Notebooks/#9/Notebook-09.ipynb at master · Maee127/Adversarial-Notebooks</a></p><h4>XIII. References</h4><p>Goodfellow, I. J., Shlens, J., &amp; Szegedy, C. (2014). <em>Explaining and harnessing adversarial examples. arXiv:1412.6572.</em></p><p>Madry, A., Makelov, A., Schmidt, L., Tsipras, D., &amp; Vladu, A. (2017). <em>Towards deep learning models resistant to adversarial attacks. arXiv:1706.06083.</em></p><p>Carlini, N., &amp; Wagner, D. (2017). <em>Towards evaluating the robustness of neural networks. IEEE Symposium on Security and Privacy.</em></p><p>Lakshminarayanan, B., Pritzel, A., &amp; Blundell, C. (2017).<em> Simple and scalable predictive uncertainty estimation using deep ensembles. NeurIPS.</em></p><p>Athalye, A., Carlini, N., &amp; Wagner, D. (2018). <em>Obfuscated gradients give a false sense of security. ICML.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a0c09bfe348b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Does the model know where it looks?]]></title>
            <link>https://medium.com/@maedeh.torkian/does-the-model-know-where-it-looks-0ad64eff5e14?source=rss-380dc4dff114------2</link>
            <guid isPermaLink="false">https://medium.com/p/0ad64eff5e14</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[cybersecurity-awareness]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Maedeh Torkian]]></dc:creator>
            <pubDate>Thu, 01 Oct 2026 06:27:34 GMT</pubDate>
            <atom:updated>2026-10-01T06:27:34.212Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Attention entropy as a test of failure awareness</em></p><figure><img alt="Attention" src="https://cdn-images-1.medium.com/max/1024/1*rZHRoENCi9EIcttz20EvFQ.png" /><figcaption>Attention can be visible without becoming awareness</figcaption></figure><p><em>Essay #8 in the humble model series</em></p><h4>I. The gaze of the boat</h4><p>In Essay #4, the model learned to say, “I am not sure.”</p><p><a href="https://pub.towardsai.net/learning-to-say-i-dont-know-the-first-floor-of-awareness-1a9faae389c0">Learning to Say “I Don’t Know”: The First Floor of Awareness</a></p><p>In Essay #5, it learned to sense the ground beneath its decision boundary.</p><p><a href="https://medium.com/@maedeh.torkian/the-geometry-of-fragility-feeling-the-decision-boundary-2d1c50f402ee">The Geometry of Fragility: Feeling the Decision Boundary</a></p><p>In Essay #6, the sensors became part of the boat itself.</p><p><a href="https://medium.com/@maedeh.torkian/architectural-awareness-building-the-sensor-into-the-boat-c8545beedd3c">Architectural awareness: building the sensor into the boat</a></p><p>In Essay #7, we looked below the visible structure and asked whether the weights themselves could carry uncertainty. The answer was partial: Deep Ensembles produced the lowest adversarial risk in that experiment, while Variational Inference failed to learn a useful model and its uncertainty became decoupled from the errors it was meant to detect.</p><p><a href="https://medium.com/data-science-collective/knowing-the-weights-four-bayesian-lenses-on-uncertainty-9c6c0270d67e">Knowing the weights: four Bayesian lenses on uncertainty</a></p><p>That result left a question hanging: what does it mean for a signal to be decoupled from failure?</p><p>Essay #8 approaches the question from a different direction. It asks whether the model’s own gaze can tell it when the water ahead has become dangerous.</p><p><em>Does the model’s attention tell us where it is looking — and does where it looks tell us anything about when it will fail?</em></p><h4>II. From visible attention to awareness</h4><p>The earlier essays mostly used convolutional models. That kept the experimental path coherent, but it also limited the questions we could ask. A convolutional network processes local patterns through learned filters, yet it does not expose a native attention distribution over the image.</p><p>Essay #8 therefore makes a deliberate architectural change. It introduces a small Vision Transformer, not because a transformer is automatically more aware, but because attention is now the object of study.</p><p>A Vision Transformer divides an image into patches and processes those patches as a sequence. A special [CLS] token gathers information for classification. In the process, the model produces attention distributions: for the [CLS] token, how much attention is assigned to each image patch.</p><p>That distribution is visible. It can be measured. It can be compared before and after an attack. But visibility is not yet awareness.</p><h4>III. Attention is not explanation</h4><p>Before measuring attention, we need to be precise about what the experiment does not claim. An attention map can look like a picture of the model’s focus, but a readable mechanism is not automatically a faithful explanation of the model’s decision.</p><p>Jain and Wallace (2019) constructed alternative attention distributions that changed substantially while preserving the model’s output. Their work challenged the idea that attention weights alone provide a reliable account of reasoning. Other work has argued for a more qualified interpretation: attention can sometimes be useful, but it should not be treated as explanation by default.</p><p>We take that skepticism seriously. The question here is not whether attention explains the prediction. The question is narrower and more operational:</p><p><em>Can the spread of attention provide a useful signal that the prediction is becoming unreliable?</em></p><p>If attention entropy helps detect failure, its value would not come from being a narrative of reasoning. It would come from being coupled to a practical decision: continue, or defer.</p><h4>IV. The transformer backbone</h4><p>We use a small Vision Transformer trained from scratch on CIFAR-10. A 32×32 image is divided into a grid of 8×8 patches. Each patch is 4×4 pixels, producing 64 image patches. A [CLS] token is added to the sequence.</p><ul><li>Patch size: 4×4 pixels</li><li>Number of image patches: 64</li><li>Embedding dimension: 128</li><li>Transformer layers: 4</li><li>Attention heads: 4</li><li>MLP hidden dimension: 256</li><li>Classification head: linear layer over the [CLS] token</li></ul><p>This is a deliberately small ViT. It is large enough to learn a useful CIFAR-10 classifier while keeping the attention mechanism easy to inspect. Its clean evaluation accuracy in this run was 76.50%. That accuracy is sufficient for the experiment, but it also limits the scope of the conclusion: this is a study of one small ViT, not a universal statement about transformers.</p><h4>V. Measuring the model’s gaze</h4><p>For each input, we extract the attention matrix from the final transformer layer. The matrix contains attention for each head. We take the [CLS] token’s row, remove the [CLS] position itself, average across the four heads, and obtain a probability distribution over the 64 image patches.</p><p>We then compute Shannon entropy:</p><p>H = − Σᵢ pᵢ log pᵢ</p><p>Low entropy means that attention is concentrated on fewer patches. High entropy means that attention is spread across more patches. The hypothesis is intuitive: perhaps a focused gaze is more reliable, while a diffuse gaze indicates fragility.</p><p>But the experiment does not assume that intuition is correct. It tests whether this entropy score is actually connected to failure.</p><h4>VI. The experiment</h4><p>The CIFAR-10 test set was divided into a 2,000-image calibration split and an 8,000-image evaluation split. The calibration split was used only to choose the entropy threshold. The evaluation split remained untouched until final measurement.</p><p>The threshold was calibrated toward a 25% clean deferral target. Risk was defined as 100 minus accuracy on non-deferred predictions. Deferred images were not counted as incorrect predictions.</p><p>For the adversarial evaluation, we used white-box projected-gradient descent against the ViT itself:</p><ul><li>ε = 0.03</li><li>Step size = 0.007</li><li>40 attack steps</li></ul><p>This is an important boundary around the comparison. The Essay #6 and Essay #7 values shown later are contextual references from earlier experiments, not a controlled head-to-head benchmark. Those essays used different models and attack protocols.</p><h4>VII. The result: the gaze did not warn us</h4><p>The entropy threshold was calibrated successfully: it deferred exactly 25.00% of the calibration images. On the untouched evaluation split, the achieved clean deferral was 23.57%.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*X9Bcd05y00EcqxXtlcBlWQ.png" /><figcaption>Entropy threshold table_ By author</figcaption></figure><p>The attack increased risk dramatically, from 23.39% to 80.16%. Yet the model deferred fewer images under attack: deferral fell from 23.57% to 21.70%.</p><p>The attention signal did not move in the direction we would want from an uncertainty sensor. Its mean entropy slightly decreased:</p><p><em>Clean mean entropy: 3.936428</em></p><p><em>Adversarial mean entropy: 3.929151</em></p><p><em>Mean shift: −0.007277</em></p><p>For context, the maximum possible entropy over 64 patches is ln(64) ≈ 4.1589. The clean mean sits at roughly 94.6% of that ceiling. Attention in this model was already close to uniform for nearly every image, clean or adversarial alike, leaving very little dynamic range for a warning signal to occupy, before any attack enters the picture. A signal that starts the experiment almost maximally spread out has little room left to spread out further as a response to danger.</p><p>The model became more vulnerable, while its measured gaze, if anything, became slightly more concentrated.</p><h4>VIII. Does entropy predict errors?</h4><p>The thresholded risk result already suggests failure, but a useful uncertainty signal should also distinguish correct predictions from incorrect ones. We therefore measured the area under the ROC curve for detecting errors using entropy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/1*6wOedAVwp9uub4iJqdEP4g.png" /><figcaption>Threshold risk results_ By author</figcaption></figure><p>Both values are effectively random. The adversarial AUROC is slightly below 0.50, but this should not be interpreted as a meaningful inverse signal. Reversing the score would still produce a value close to chance.</p><p>The group means tell the same story. Correct adversarial predictions had mean entropy 3.933049, while incorrect adversarial predictions had mean entropy 3.928195. The wrong predictions were not accompanied by a stronger warning. They were, on average, slightly more concentrated.</p><p><em>The model’s attention remained readable. It did not become aware of its failure.</em></p><h4>IX. Contextual comparison with earlier essays</h4><p>The following values place Essay #8 within the path of the series. They should not be read as a controlled leaderboard because the underlying models and attack protocols differ.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*xVdDkD2TLxr0O-UZI_CmOw.png" /><figcaption>Comparision table_ By author</figcaption></figure><p><em>These are contextual references, not a controlled benchmark. The models and attack protocols differ.</em></p><p>The point is not that attention is universally worse than every earlier signal. The point is that, in this experiment, attention entropy did not provide the coupling between internal behavior and external failure that a humble model would need.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QRiNzH3Rm7iFzEE6lvZbRQ.png" /><figcaption>Entropy_ By author</figcaption></figure><h4>X. What this experiment teaches us</h4><p>The series began with a confidently vulnerable model. We added defenses, but the attacker adapted. We gave the model a voice, but its uncertainty did not automatically survive adversarial change. We measured the geometry of the decision boundary. We built sensors into the architecture. We looked into the weights.</p><p>Now we have looked at the model’s gaze.</p><p>The result is a useful distinction. Interpretability and awareness are not the same thing. A mechanism can be visible without being reliable. A distribution can be readable without being informative about failure. A model can show us where its attention is distributed while remaining silent about the danger of its own prediction.</p><p>In this small ViT, attention entropy was not an operational awareness signal. It did not improve selective reliability under attack. It did not identify errors. It did not increase when the model needed to be cautious.</p><p><em>The boat can show us where it is looking. It still does not know that the water has changed.</em></p><h4>XI. What we still do not know</h4><ul><li>Whether other attention-derived signals, such as attention rollout or attention flow, behave differently from raw entropy.</li><li>Whether attention entropy becomes useful in larger Vision Transformers or on more complex datasets.</li><li>Whether attention and architecture-native signals are complementary when evaluated on the same model and under the same attack.</li><li>Whether attention remains uninformative under adaptive attacks designed to manipulate or suppress the signal.</li><li>Whether the result is specific to this small ViT or reflects a broader limitation of using attention as a proxy for uncertainty.</li></ul><h4>XII. Invitation</h4><p>You have built the sensors.</p><p>You have looked into the weights.</p><p>Now you have asked whether the boat’s own gaze can tell it anything about the water ahead.</p><p>The answer, in this experiment, is no. Not because the gaze is invisible, but because visibility is not enough. The signal must also be coupled to failure.</p><p>That is another step toward a humbler model.</p><p><em>Come. Walk with me into </em><strong><em>attention</em></strong><em>.</em></p><h4>Resources</h4><ul><li>Essay #4 — Learning to say ‘I Don’t Know’</li></ul><p><a href="https://pub.towardsai.net/learning-to-say-i-dont-know-the-first-floor-of-awareness-1a9faae389c0">Learning to Say “I Don’t Know”: The First Floor of Awareness</a></p><ul><li>Essay #5 — The geometry of fragility</li></ul><p><a href="https://medium.com/@maedeh.torkian/the-geometry-of-fragility-feeling-the-decision-boundary-2d1c50f402ee">The Geometry of Fragility: Feeling the Decision Boundary</a></p><ul><li>Essay #6 — Architectural awareness</li></ul><p><a href="https://medium.com/@maedeh.torkian/architectural-awareness-building-the-sensor-into-the-boat-c8545beedd3c">Architectural awareness: building the sensor into the boat</a></p><ul><li>Essay #7 — Knowing the weights</li></ul><p><a href="https://medium.com/data-science-collective/knowing-the-weights-four-bayesian-lenses-on-uncertainty-9c6c0270d67e">Knowing the weights: four Bayesian lenses on uncertainty</a></p><ul><li>Notebook — Note08_Attention_Awareness.ipynb</li></ul><p><a href="https://github.com/Maee127/Adversarial-Notebooks/blob/master/%238/Note08_Attention_Awareness.ipynb">Adversarial-Notebooks/#8/Note08_Attention_Awareness.ipynb at master · Maee127/Adversarial-Notebooks</a></p><h4>References</h4><ul><li>Vaswani, A., et al. (2017). <em>Attention is all you need. NeurIPS.</em></li><li>Dosovitskiy, A., et al. (2021). <em>An image is worth 16×16 words: transformers for image recognition at scale. ICLR.</em></li><li>Jain, S., &amp; Wallace, B. C. (2019). <em>Attention is not explanation. NAACL.</em></li><li>Wiegreffe, S., &amp; Pinter, Y. (2019). <em>Attention is not not explanation. EMNLP.</em></li><li>Serrano, S., &amp; Smith, N. A. (2019). <em>Is attention interpretable? ACL.</em></li><li>Lakshminarayanan, B., Pritzel, A., &amp; Blundell, C. (2017).<em> Simple and scalable predictive uncertainty estimation using deep ensembles. NeurIPS.</em></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0ad64eff5e14" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Knowing the weights: four Bayesian lenses on uncertainty]]></title>
            <link>https://medium.com/data-science-collective/knowing-the-weights-four-bayesian-lenses-on-uncertainty-9c6c0270d67e?source=rss-380dc4dff114------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c6c0270d67e</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[cyber-security-awareness]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Maedeh Torkian]]></dc:creator>
            <pubDate>Sun, 27 Sep 2026 05:21:07 GMT</pubDate>
            <atom:updated>2026-09-27T05:21:07.062Z</atom:updated>
            <content:encoded><![CDATA[<p>Essay #7 in the Humble Model Series</p><figure><img alt="The weights" src="https://cdn-images-1.medium.com/max/1024/1*lgIxJ3O8d7WPyfcteF2hlg.png" /></figure><h4>I. The boat and its weights</h4><p>In Essay #4, we gave the model a voice.</p><p><a href="https://pub.towardsai.net/learning-to-say-i-dont-know-the-first-floor-of-awareness-1a9faae389c0">Learning to Say “I Don’t Know”: The First Floor of Awareness</a></p><p>It learned to express uncertainty and defer when an input looked unfamiliar. But the first experiment revealed a serious limitation: the model could recognize natural distributional shift, yet remain silent under adversarial attack.</p><p>In Essay #5, we added a depth sensor.</p><p><a href="https://medium.com/@maedeh.torkian/the-geometry-of-fragility-feeling-the-decision-boundary-2d1c50f402ee">The Geometry of Fragility: Feeling the Decision Boundary</a></p><p>The model began to measure its proximity to the decision boundary. Confidence alone was not enough. A model could be highly confident and still be standing dangerously close to a boundary that a small perturbation could cross.</p><p>In Essay #6, we changed the boat itself.</p><p><a href="https://medium.com/@maedeh.torkian/architectural-awareness-building-the-sensor-into-the-boat-c8545beedd3c">Architectural awareness: building the sensor into the boat</a></p><p>Instead of attaching uncertainty after training, we built uncertainty signals into the architecture. Multi-head disagreement and evidential evidence became internal signals of instability. Under the transferred baseline-PGD protocol, these architecture-native signals produced substantially lower adversarial risk than ordinary confidence or boundary distance.</p><p>But all of these approaches still left one question unanswered.</p><p>They <strong>observed </strong>the model’s outputs.</p><p>They <strong>measured </strong>its geometry.</p><p>They <strong>changed </strong>its architecture.</p><p>But what about the model’s parameters themselves?</p><p>The <strong>weights </strong>are where the model stores its learned representation of the world. They are the memory of its training experience. They determine how it transforms an input into a prediction.</p><p><em>Can the model know whether its own weights are reliable?</em></p><p>This is the question explored in Essay #7.</p><h4>II. The Bayesian view</h4><p>In ordinary deep learning, training produces one set of weights. These weights are point estimates. After training, the model behaves as if one particular parameter configuration is the answer.</p><p>But the data may not determine one perfect configuration.</p><p>Several different parameter settings may explain the training data almost equally well. Some regions of parameter space may be strongly supported by the data. Other regions may be poorly constrained.</p><p>The Bayesian view attempts to represent this uncertainty with a distribution over weights rather than a single point. For a new input, the predictive distribution then averages over all plausible weight settings, weighted by how well each one explains the training data.</p><p>That average is intractable for any realistic neural network. We therefore use approximations.</p><p>This essay studies four of them:</p><p><strong>Monte Carlo Dropout: </strong>using stochastic dropout at inference time.</p><p><strong>Deep Ensembles: </strong>training several models and measuring their disagreement.</p><p><strong>SWAG: </strong>fitting a Gaussian approximation to the trajectory of training weights.</p><p>Variational Inference, learning distributions over selected model parameters.</p><p>They all ask a similar question:</p><p><em>If the model had learned differently, would it still make the same prediction?</em></p><p>If the answer is no, the prediction may deserve caution.</p><h4>III. The experimental setting</h4><p>All four methods were evaluated using the same CIFAR-10 setting and the same CNN backbone family used in Essay #6.</p><p>The CIFAR-10 test set was divided into two parts:</p><ul><li>2,000 images for calibration</li><li>8,000 images for final evaluation</li></ul><p>The calibration split was used to select an uncertainty threshold for each method. The evaluation split remained untouched until the final measurement.</p><p>The target was approximately 25% clean deferral. Each method received its own threshold, because the numerical scale of its uncertainty signal was different.</p><p>Each method used a fixed sampling budget: 50 stochastic forward passes for Monte Carlo Dropout, 5 independently trained members for Deep Ensembles, and 30 posterior samples each for SWAG and Variational Inference. All four were scored with the same uncertainty measure — the maximum per-class variance of the predictive distribution — so that the comparison reflects differences in the underlying approximation rather than differences in how uncertainty was read off.</p><p>The risk definition remained consistent with the earlier essays:</p><p><strong>Risk = 100 − accuracy on non-deferred predictions.</strong></p><p>Deferred predictions were not counted as incorrect predictions. Coverage and deferral were reported separately.</p><p>The adversarial examples were generated against the baseline CNN using projected gradient descent, then transferred to the uncertainty methods. This is therefore a transferred baseline-PGD experiment, not an adaptive attack designed against each Bayesian method individually.</p><p>The baseline CNN achieved 78.61% clean accuracy and 21.09% accuracy under the transferred attack.</p><p>The question was not whether the Bayesian models could resist every possible attack.</p><p>The question was narrower:</p><p><em>Do their uncertainty signals help them avoid making dangerous predictions under the same transferred attack?</em></p><h4>IV. Four ways of looking at the weights</h4><p><strong>1. Monte Carlo Dropout</strong></p><p>Dropout is normally used during training as a regularization technique. During inference, the model usually becomes deterministic.</p><p>Monte Carlo Dropout keeps dropout active during inference and performs multiple stochastic forward passes. Each pass uses a slightly different effective network.</p><p>The model does not produce one prediction. It produces a collection of predictions.</p><p>If those predictions agree, the input appears stable. If they disagree, the input may be associated with parameter uncertainty.</p><p>In this experiment, 50 stochastic forward passes were used for each input.</p><p><strong>Code snippet (PyTorch)</strong></p><pre>def mc_dropout_predict(model, image, num_passes=50):<br>    model.train()  # enable dropout<br>    predictions = []<br>    for _ in range(num_passes):<br>        with torch.no_grad():<br>            pred = torch.softmax(model(image), dim=1)<br>            predictions.append(pred)<br>    model.eval()<br>    predictions = torch.stack(predictions)<br>    mean_pred = predictions.mean(dim=0)<br>    variance = predictions.var(dim=0)<br>    return mean_pred, variance</pre><p><strong>2. Deep Ensembles</strong></p><p>Deep Ensembles train several models independently, with different random initializations and training trajectories. Each model produces a prediction. The ensemble combines them and measures their disagreement.</p><p>Deep Ensembles are not literal samples from the exact Bayesian posterior. They are a practical approximation to uncertainty arising from multiple plausible learned solutions.</p><p>Their strength is also their cost: instead of one model, several must be trained and evaluated.</p><p>The question is whether that additional computation creates a more useful uncertainty signal.</p><p><strong>Code snippet (PyTorch)</strong></p><pre>def ensemble_predict(models, image):<br>    predictions = []<br>    for model in models:<br>        model.eval()<br>        with torch.no_grad():<br>            pred = torch.softmax(model(image), dim=1)<br>            predictions.append(pred)<br>    predictions = torch.stack(predictions)<br>    mean_pred = predictions.mean(dim=0)<br>    variance = predictions.var(dim=0)<br>    return mean_pred, variance</pre><p><strong>3. SWAG</strong></p><p>SWAG, or Stochastic Weight Averaging Gaussian, models uncertainty through the trajectory of weights during training.</p><p>Instead of treating only the final weights as meaningful, it collects weights from different points in the training process and fits a Gaussian approximation to them. At inference time, new weight samples are drawn from this approximation, and the resulting predictions are combined into a mean prediction and an uncertainty estimate.</p><p>Conceptually, SWAG asks:</p><p><em>What does the path taken through weight space tell us about the solutions the model might have learned?</em></p><p><strong>Code snippet (PyTorch)</strong></p><pre># Collect weights during training<br>swag_weights = []<br>for epoch in range(num_epochs):<br>    train_one_epoch(model)<br>    swag_weights.append(model.state_dict().copy())<br><br># Fit Gaussian<br>mean_weights = average(swag_weights)<br>covariance = compute_covariance(swag_weights)<br><br># Sample and predict<br>def swag_predict(model, image, num_samples=30):<br>    predictions = []<br>    for _ in range(num_samples):<br>        sampled_weights = sample_from_gaussian(mean_weights, covariance)<br>        model.load_state_dict(sampled_weights)<br>        with torch.no_grad():<br>            pred = torch.softmax(model(image), dim=1)<br>            predictions.append(pred)<br>    predictions = torch.stack(predictions)<br>    return predictions.mean(dim=0), predictions.var(dim=0)</pre><p><strong>4. Variational Inference</strong></p><p>Variational Inference explicitly assigns distributions to model parameters. Instead of learning one value for a weight, the model learns a mean and a variance.</p><p>During training, weights are sampled from these distributions. The loss includes both the prediction error and a term that keeps the learned distribution close to a prior.</p><p>In this notebook, the variational treatment was applied to the fully connected layers while the convolutional layers remained deterministic.</p><p>This distinction matters. The model is not a fully Bayesian CNN. It is a partially Bayesian architecture with variational fully connected layers.</p><p><strong>Code snippet (PyTorch)</strong></p><pre>class BayesianLinear(nn.Module):<br>    def __init__(self, in_features, out_features):<br>        super().__init__()<br>        self.weight_mean = nn.Parameter(torch.randn(out_features, in_features))<br>        self.weight_logvar = nn.Parameter(torch.randn(out_features, in_features))<br>        self.bias_mean = nn.Parameter(torch.randn(out_features))<br>        self.bias_logvar = nn.Parameter(torch.randn(out_features))<br><br>    def forward(self, x):<br>        weight_std = torch.exp(0.5 * self.weight_logvar)<br>        bias_std = torch.exp(0.5 * self.bias_logvar)<br>        weight = self.weight_mean + weight_std * torch.randn_like(weight_std)<br>        bias = self.bias_mean + bias_std * torch.randn_like(bias_std)<br>        return F.linear(x, weight, bias)</pre><h4>V. The results</h4><p>The results were not uniform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*jCRNsO4SPC8KqdLsPHnBUA.png" /><figcaption>The notebook results- By author</figcaption></figure><p>The strongest result came from <strong>Deep Ensembles</strong>, with an adversarial risk of <strong>15.42%</strong>. <strong>Monte Carlo Dropout</strong> followed closely at <strong>17.15%</strong>.</p><p>Both were modestly lower than the architecture-native signals measured in Essay #6:</p><ul><li>Multi-head disagreement: <strong>19.86%</strong></li><li>Evidential evidence: <strong>21.31%</strong></li></ul><p>This comparison deserves a caveat. The Essay #6 values are reference results carried forward, not re-evaluated in this run; the differences are a few percentage points on a single 8,000-image evaluation without confidence intervals. The ranking is suggestive, not established.</p><p>What can be said more firmly is that both Bayesian methods land in the same general region as the strongest architecture-native signals, and far below the post-hoc baselines from Essay #6: confidence at 78.70% and boundary distance at 77.06%.</p><p>This suggests that uncertainty arising from model diversity can be useful. When several independently trained models disagree, that disagreement may reveal regions where the learned solution is unstable.</p><p>But the result changed with SWAG.</p><p>SWAG produced an adversarial risk of 25.95%, higher than Deep Ensembles, MC Dropout, and both architecture-native signals from Essay #6. Its more structured approximation to the training trajectory did not translate into a stronger signal than simply training several models and letting them disagree.</p><p>It is worth keeping the scale in view, however. SWAG still reduced adversarial risk to roughly a third of what plain confidence achieved in Essay #6. The honest reading is not that SWAG failed, but that it was outperformed. A principled approximation can be genuinely useful and still lose to a simpler one.</p><p>Placing these results alongside the reference values from Essay #6 gives the full picture:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*OpPekqrSrvCljdGkRc_-fw.png" /><figcaption>Essay#6 &amp; notenook07 results- By author</figcaption></figure><p>Essay #6 values are reference results, carried forward from the previous experiment, not re-evaluated in this run.</p><p><strong>The variational result</strong></p><p>The most dramatic result came from Variational Inference.</p><p>Its clean risk was 90.62%, and its adversarial risk was 89.69%. Its accuracy on retained predictions, 9.38% clean, 10.31% adversarial, is indistinguishable from random guessing on ten classes.</p><p>This is not an underfit model. It is a model that never trained at all.</p><p>The training loss began near 2.37 and ended near 2.33, essentially flat across twenty epochs. The cross-entropy of a uniform guess over ten classes is about 2.303. The model spent its entire training run sitting on that number.</p><p>The cause is visible in the initialization of the variational layers. The log-variance parameters were initialized near zero, which sets the sampled weight standard deviation near 1.0, while the weight means were initialized at a scale of roughly 0.1. The noise injected on every forward pass was therefore about ten times larger than the signal it was perturbing. No stable function could be learned through it. Standard Bayes-by-Backprop implementations initialize this standard deviation several orders of magnitude smaller.</p><p>This result should not be read as evidence that Variational Inference is ineffective. It is a broken configuration, not a verdict on the method.</p><p>But the failure is more instructive than a simple training bug, because of how the uncertainty behaved.</p><p>The variational model deferred on 30.40% of clean inputs and only 24.80% of adversarial ones. It became less cautious when the input was attacked. Its maximum predictive variance was 0.000237, three orders of magnitude below the other three methods. The model was not merely wrong. It was quietly and consistently wrong, with an uncertainty signal that carried almost no information about the danger it was facing.</p><p>This is the cleanest illustration in the series so far of a distinction the earlier essays kept circling. The model possessed a genuine distribution over its weights. It sampled from that distribution at inference. Every mathematical ingredient of Bayesian uncertainty was present.</p><p>And the resulting signal was decoupled from the thing it was supposed to detect.</p><p><em>A distribution over weights is not awareness. Awareness requires that the variation correspond to the failure.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HqyEoSjxQ4kb6zpt8DJu8g.png" /><figcaption>Bayesian weight-By author</figcaption></figure><h4>VI. What did the model gain?</h4><p>The Bayesian methods added a new kind of sensor.</p><p>Earlier essays focused on uncertainty in the input, the output, the decision boundary, or the architecture. This experiment introduced uncertainty connected to the learned parameters themselves.</p><p>The most successful methods gained the ability to ask:</p><p><em>Would another plausible version of this model make the same prediction?</em></p><p>Deep Ensembles provided the strongest answer in this experiment. MC Dropout provided a similar answer at a lower computational cost.</p><p>It is also worth noting what these methods did not cost. Deep Ensembles achieved 10.31% clean risk against the baseline’s 21.39%. The gate was not buying adversarial safety by sacrificing clean performance. At roughly 21.5% clean deferral, the retained predictions were substantially more reliable than the undeferred baseline’s.</p><p>But the gain was not universal.</p><p>SWAG showed that a more structured approximation to the training trajectory does not automatically produce a more useful signal.</p><p>Variational Inference showed something more important: uncertainty is not valuable if the underlying predictive model has not learned the task.</p><p>The goal is not to create variation for its own sake.</p><p><em>The </em><strong><em>goal </em></strong><em>is to create variation that corresponds to genuine uncertainty about the prediction.</em></p><h4>VII. What we learned</h4><p>The question was:<em> can the model know its own weights?</em></p><p>The answer is partial.</p><p>Some approximations to weight-level uncertainty produced a stronger relationship between uncertainty and adversarial error than the signals examined in Essay #6. Deep Ensembles produced the lowest adversarial risk, followed by Monte Carlo Dropout.</p><p>This suggests that parameter-level variation can help the model recognize situations in which its prediction is unstable.</p><p>But the experiment did not show that all Bayesian methods are equally useful.</p><p>SWAG performed worse than the strongest architecture-native signals, though still far better than the post-hoc baselines.</p><p>Variational Inference failed to learn a useful classifier in its current form.</p><p>The deeper lesson is this:</p><p><strong>Uncertainty is not automatically awareness.</strong></p><p>A distribution over weights is not enough. The distribution must be connected to a model that has learned meaningful structure. Its variation must also correlate with the situations in which the model is likely to fail.</p><p>The Bayesian view therefore adds a new lens, but not a universal solution.</p><p>Deep Ensembles and MC Dropout suggest that model diversity can improve awareness.</p><p>SWAG reminds us that a principled approximation can still fail to produce the strongest signal.</p><p>Variational Inference reminds us that mathematical uncertainty cannot compensate for a model that has not learned the task.</p><p>The <strong>boat </strong>can carry many kinds of sensors.</p><p>But a <strong>sensor </strong>becomes meaningful only when it responds to the <strong><em>danger </em></strong>the boat is actually facing.</p><h4>VIII. What we still do not know</h4><p>This experiment leaves several questions open.</p><ul><li>We do not yet know whether the advantage of Deep Ensembles and MC Dropout will remain on larger architectures and more complex datasets.</li><li>We do not know whether the relative ranking will change under adaptive attacks designed specifically against each uncertainty method. Every number here comes from a transferred attack.</li><li>We do not know whether the Bayesian signals can be usefully combined with the architecture-native signals from Essay #6, or how either would compare to attention entropy, the direction deferred back in Essay #6 and planned for Essay #8. Given how often the simpler method has won in this series, that comparison is worth taking seriously rather than assuming sophistication will carry it. We do not know whether a correctly initialized variational model would behave like the other Bayesian methods, or whether it would reveal a different failure mode of its own. The configuration tested here never learned the task, so it tells us nothing about the approach itself.</li><li>We also need to distinguish more carefully between uncertainty measures. The present comparison uses maximum class-probability variance as a common experimental score. Other measures, such as predictive entropy or mutual information, may reveal different behavior.</li></ul><p>The current experiment is therefore not the final word on Bayesian uncertainty.</p><p><em>It is another measurement.</em></p><p>And the <strong>measurement </strong>changes the question.</p><p>The question is no longer simply whether a model can know its weights.</p><p>The question is:</p><p><em>Which representation of uncertainty becomes useful when the model is asked to recognize its own possible failure?</em></p><h4>IX. The next floor</h4><p>In Essay #4, the model learned to say: <em>I am not sure.</em></p><p>In Essay #5, it learned to sense the ground beneath its decision boundary.</p><p>In Essay #6, the sensors became part of the boat.</p><p>In Essay #7, we looked below the visible structure and asked whether the weights themselves could carry uncertainty.</p><p>The answer was neither a simple success nor a simple failure.</p><p>Some methods made the model more sensitive to its own instability. Some added complexity without producing a stronger signal. One failed to learn a useful classifier at all.</p><p>That is not a disappointment. It is the kind of answer a humble model should give us.</p><p>Not every principled idea becomes a working sensor. Not every distribution represents useful knowledge. And not every uncertainty estimate deserves to become a decision.</p><p>There is one more thing worth noticing about where this ended.</p><p>The series moved steadily inward. Essay #4 read the model’s outputs. Essay #5 measured the geometry around its decisions. Essay #6 rebuilt its architecture. Essay #7 went further still, into the weights themselves, and the method that performed best was Deep Ensembles, which was already sitting in Essay #4.</p><p>Nothing was wasted in getting here. Without the intermediate essays there would be no protocol strict enough to trust this comparison, and no way to know that the simplest answer was also the strongest. But it is worth saying plainly: the deepest lens did not win. The oldest one did.</p><p>Perhaps that is the most fitting result for a series about humility. We went looking for awareness in increasingly sophisticated places, and found that training several models and listening to their disagreement remains hard to beat.</p><p>The model becomes more aware not when it possesses more mathematical machinery, but when its uncertainty begins to correspond to the places where it can genuinely be wrong.</p><p><em>The sensor is no longer only attached to the boat. It has begun to look into the weights that hold the boat together.</em></p><p>But looking inward is not the same as <strong>understanding</strong>.</p><p>That remains the next question.</p><p><em>Come with me.</em></p><h4>Resources</h4><ul><li>Essay #4:</li></ul><p><a href="https://pub.towardsai.net/learning-to-say-i-dont-know-the-first-floor-of-awareness-1a9faae389c0">Learning to Say “I Don’t Know”: The First Floor of Awareness</a></p><ul><li>Essay #5:</li></ul><p><a href="https://medium.com/@maedeh.torkian/the-geometry-of-fragility-feeling-the-decision-boundary-2d1c50f402ee">The Geometry of Fragility: Feeling the Decision Boundary</a></p><ul><li>Essay #6:</li></ul><p><a href="https://medium.com/@maedeh.torkian/architectural-awareness-building-the-sensor-into-the-boat-c8545beedd3c">Architectural awareness: building the sensor into the boat</a></p><ul><li>Notebook:</li></ul><p><a href="https://github.com/Maee127/Adversarial-Notebooks/blob/master/%237/Note07_Bayesian_Uncertainty.ipynb">Adversarial-Notebooks/#7/Note07_Bayesian_Uncertainty.ipynb at master · Maee127/Adversarial-Notebooks</a></p><h4>References</h4><p>Blundell, C., Cornebise, J., Kavukcuoglu, K., &amp; Wierstra, D. (2015). <em>Weight uncertainty in neural networks. ICML.</em></p><p>Gal, Y., &amp; Ghahramani, Z. (2016). <em>Dropout as a Bayesian approximation: Representing model uncertainty in deep learning. ICML.</em></p><p>Lakshminarayanan, B., Pritzel, A., &amp; Blundell, C. (2017). <em>Simple and scalable predictive uncertainty estimation using deep ensembles. NeurIPS.</em></p><p>Maddox, W. J., Izmailov, P., Garipov, T., Vetrov, D. P., &amp; Wilson, A. G. (2019). <em>A simple baseline for Bayesian uncertainty in deep learning. NeurIPS.</em></p><p>Sensoy, M., Kaplan, L., &amp; Kandemir, M. (2018). <em>Evidential deep learning to quantify classification uncertainty. NeurIPS.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c6c0270d67e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science-collective/knowing-the-weights-four-bayesian-lenses-on-uncertainty-9c6c0270d67e">Knowing the weights: four Bayesian lenses on uncertainty</a> was originally published in <a href="https://medium.com/data-science-collective">Data Science Collective</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Architectural awareness: building the sensor into the boat]]></title>
            <link>https://medium.com/@maedeh.torkian/architectural-awareness-building-the-sensor-into-the-boat-c8545beedd3c?source=rss-380dc4dff114------2</link>
            <guid isPermaLink="false">https://medium.com/p/c8545beedd3c</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[image-segmentation]]></category>
            <category><![CDATA[cyber-security-awareness]]></category>
            <dc:creator><![CDATA[Maedeh Torkian]]></dc:creator>
            <pubDate>Fri, 11 Sep 2026 05:25:43 GMT</pubDate>
            <atom:updated>2026-10-27T05:05:06.082Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Essay #6 in the Humble Model Series</em></p><figure><img alt="Made by GPT- “The boat”" src="https://cdn-images-1.medium.com/max/1024/1*8ZOKwpE2629mbUFe99dYAg.png" /><figcaption>“The Boat”</figcaption></figure><h3>I. Introduction: the boat itself</h3><p>In Essay #4, we built the first floor of awareness: a voice that could say, “I am not sure,” or recognize that an input looked unfamiliar.</p><p><strong>Essay #4:</strong></p><p><a href="https://pub.towardsai.net/learning-to-say-i-dont-know-the-first-floor-of-awareness-1a9faae389c0">Learning to Say “I Don’t Know”: The First Floor of Awareness</a></p><p>In Essay #5, we added a depth sensor. We measured the model’s proximity to its decision boundary and used geometric distance as a signal of fragility. In that experiment, combining confidence with boundary distance reduced adversarial risk to 4.0%.</p><p><strong>Essay #5</strong></p><p><a href="https://medium.com/@maedeh.torkian/the-geometry-of-fragility-feeling-the-decision-boundary-2d1c50f402ee">The Geometry of Fragility: Feeling the Decision Boundary</a></p><p>But the boat itself remained unchanged.</p><p>The architecture was still designed primarily to produce predictions. Awareness was added afterward, through external measurements and decision gates.</p><p>Now we ask a different question:</p><p><em>Can we design the boat itself to be more aware?</em></p><p><em>Can uncertainty become part of the architecture rather than an external attachment?</em></p><p>This essay explores two directions:</p><ol><li><strong>Multiple prediction heads</strong> — a shared backbone with several prediction heads whose disagreement becomes an internal uncertainty signal.</li><li><strong>Evidential outputs</strong> — a model whose output contains not only a prediction, but also an estimate of the evidence supporting that prediction.</li></ol><p>Both models use the same CNN/CIFAR-10 setting as Essay #5. The purpose is not to introduce a larger or more fashionable architecture. It is to change the model’s relationship with uncertainty.</p><p>The question is simple:</p><p><em>If the sensor is built into the boat, does the boat become more aware?</em></p><h3>II. The bar to clear</h3><p>Before testing the new architectures, we need to define what they are competing against.</p><p>Essay #5 gave us two important reference points:</p><ul><li>Boundary distance provided a geometric signal of fragility.</li><li>The fused confidence-plus-boundary gate reduced adversarial risk to 4.0% under that experiment.</li></ul><p>Those results established a meaningful baseline. However, the experiments are not identical. Essay #5 used a smaller, same-sample calibration procedure, while this essay uses a held-out calibration split and a separate evaluation split.</p><p>Therefore, the earlier 4.0% result is a historical reference point, not a directly interchangeable number.</p><p>For the present experiment, the real comparison is performed on the same evaluation images and with thresholds calibrated only on separate calibration data.</p><p>The candidates are:</p><ul><li>baseline confidence</li><li>boundary distance</li><li>multi-head disagreement</li><li>evidential evidence</li></ul><p>The question is no longer simply whether a signal can improve over having no signal.</p><p>The question is:</p><p><em>Which kind of uncertainty remains connected to error after the input has been attacked?</em></p><h3>III. Direction 1: multiple prediction heads</h3><h3>What it is</h3><p>A multi-head model uses one shared CNN backbone with several independent prediction heads.</p><p>The heads receive the same learned representation, but each produces its own class distribution. If the heads agree, the model appears internally stable. If they disagree, the prediction may be fragile.</p><p>The disagreement among the heads is used as an uncertainty signal.</p><p>This is related to the ensemble experiment from Essay #4, but the construction is different.</p><p>In Essay #4, multiple independent models were trained separately. Here, the model shares one backbone and only separates at the prediction heads.</p><p>That creates a tension:</p><p>Does shared-backbone disagreement provide a useful internal signal at lower cost, or does the shared representation make the heads too similar to disagree meaningfully?</p><h3>How it works</h3><p>The process is:</p><ol><li>Train one CNN backbone.</li><li>Attach five independent prediction heads.</li><li>Produce one probability distribution per head.</li><li>Average the predictions.</li><li>Measure the maximum variance across the heads.</li><li>Defer when disagreement exceeds its calibrated threshold.</li></ol><pre>class MultiHeadCNN(nn.Module):<br>    def __init__(self, backbone, num_heads=5, num_classes=10):<br>        super().__init__()<br>        self.backbone = backbone<br>        self.heads = nn.ModuleList([nn.Linear(256, num_classes) for _ in range(num_heads)])ModuleList([nn.Linear(256, num_classes) for _ in range(num_heads)])</pre><p>The threshold was calibrated on the clean calibration split. It was not selected from the final evaluation results.</p><p>The disagreement values were extremely small numerically, with a calibrated threshold of approximately:</p><blockquote><em>2.81 × 10⁻⁷</em></blockquote><p>This does not mean the signal was meaningless. It means the heads were strongly correlated because they shared the same backbone. The important question is not the absolute magnitude of disagreement, but whether its ordering still separates safer predictions from more fragile ones.</p><h3>Result</h3><p>On the full evaluation set:</p><ul><li>Clean coverage: <strong>74.92%</strong></li><li>Clean risk: <strong>13.70%</strong></li><li>Adversarial coverage: <strong>71.83%</strong></li><li>Adversarial risk: <strong>18.92%</strong></li></ul><p>The multi-head model did not produce the best clean risk. That was not the most important result.</p><p>Its important result was that its adversarial risk remained close to its clean risk.</p><p>The model did not become perfect. But its internal disagreement continued to carry information after the baseline-generated attack was transferred to it.</p><h3>IV. Direction 2: evidential outputs</h3><h3>What it is</h3><p>In ordinary classification, the model produces a probability vector through softmax.</p><p>That vector tells us how the prediction is distributed across classes. But it does not necessarily tell us whether the model has strong evidence for the prediction or is merely producing a confident-looking distribution.</p><p>Evidential deep learning changes the output structure.</p><p>Instead of producing only class probabilities, the model produces positive parameters of a Dirichlet distribution. The expected class probabilities are derived from those parameters, while the total evidence provides an additional signal.</p><p>The model is no longer asked only:</p><p>Which class is most likely?</p><p>It is also asked:</p><p><em>How much evidence supports this conclusion?</em></p><p>Low total evidence is treated as a <em>sign</em> of fragility.</p><h3>How it works</h3><p>The model:</p><ol><li>Uses the same CNN backbone.</li><li>Produces positive evidence parameters for each class.</li><li>Converts those parameters into expected class probabilities.</li><li>Uses total evidence as the uncertainty signal.</li><li>Defers when evidence falls below its calibrated threshold.</li></ol><pre>class EvidentialCNN(nn.Module):<br>    def __init__(self, backbone, num_classes=10):<br>        super().__init__()<br>        self.backbone = backbone<br>        self.fc_alpha = nn.Linear(256, num_classes)</pre><p>The calibrated evidence threshold in this run was approximately:</p><blockquote><em>210.84</em></blockquote><p>Again, the threshold came from the clean calibration split and was applied unchanged to the evaluation split.</p><h3>Result</h3><p>On the full evaluation set:</p><ul><li>Clean coverage: <strong>75.56%</strong></li><li>Clean risk: <strong>15.47%</strong></li><li>Adversarial coverage: <strong>73.94%</strong></li><li>Adversarial risk: <strong>20.64%</strong></li></ul><p>The evidential model was not the best clean selective predictor. Its strength appeared under attack.</p><p>Its evidence signal remained meaningfully related to correctness after the input had been perturbed. It did not eliminate adversarial error, but it avoided the dramatic collapse experienced by ordinary confidence.</p><h3>V. The head-to-head</h3><h3>Methodological note</h3><p>The test set was divided into two parts:</p><ul><li><strong>2,000 images for calibration</strong></li><li><strong>8,000 images for final evaluation</strong></li></ul><p>All thresholds were calculated on the calibration split only.</p><p>The final results were then measured on unseen evaluation images.</p><p>Boundary distance was computationally expensive, so it was calculated for a random subset of 1,200 evaluation images. The clean and adversarial runs used the same underlying image indices, allowing a true apples-to-apples comparison.</p><p>The risk definition is:</p><blockquote><em>Risk = 100 − accuracy on non-deferred predictions</em></blockquote><p>Deferred images are not counted as incorrect predictions. Coverage and deferral are reported separately.</p><h3>Standalone results</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*uHTi8WfRi6dG89N4AYg4Sw.png" /><figcaption>Numbers come from the notebook results-By Author</figcaption></figure><p>*Boundary-distance values use only the 1,200 images with valid boundary measurements.</p><p>The first result is a failure of ordinary confidence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/1*hkclFU3DqSBKfriferRVmg.png" /><figcaption>The notebook output-By Author</figcaption></figure><p>On clean data, confidence appears reasonable. Under attack, however, the risk rises to <strong>77.71%</strong>, even though the gate continues making predictions on <strong>76.89%</strong> of the adversarial images.</p><p>The model remains willing to speak, but its confidence is no longer trustworthy.</p><p>The second result revises the lesson of Essay #5.</p><p>Boundary distance performed well as a geometric measurement in the previous experiment. Here, under a different evaluation protocol and transferred PGD attack, it produced <strong>78.32% adversarial risk</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*srQHrJk-S0H_JrujLxycUA.png" /><figcaption>The notebook output- By Author</figcaption></figure><p>The geometry was measurable, but the measurement did not reliably protect the retained predictions.</p><p>The architecture-native signals behaved differently.</p><p>Multi-head disagreement reduced adversarial risk to <strong>18.92%</strong>.</p><p>Evidential evidence reduced it to <strong>20.64%</strong>.</p><p>Neither signal was perfect. But both preserved a much stronger relationship between uncertainty and error than either confidence or boundary distance managed against error.</p><h3>The same-image comparison</h3><p>To avoid comparing different populations, all four signals were also evaluated on the same 1,200 images for which boundary measurements existed in both conditions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*Ts6CWsxXSlekP9AEaV8RIA.png" /><figcaption>Numbers come from the notebook -By Author</figcaption></figure><p>This is the clearest confrontation in the notebook.</p><p>Confidence and boundary distance both look acceptable on clean images, but their relationship with correctness collapses under attack.</p><p>The architecture-native signals retain substantially lower risk.</p><p>The conclusion is not that disagreement or evidence “knows” the correct answer. The conclusion is more modest and more useful:</p><p><strong><em>Their uncertainty remains more informative when the input has moved into an adversarial condition.</em></strong></p><p>The multi-head and evidential rows should technically be understood as model–sensor systems, because their retained predictions come from their own models. Therefore, the result supports the superiority of these complete architectural systems under this protocol, rather than proving that the raw uncertainty signals are universally superior in isolation.</p><h3>A correction: why boundary distance changed since Essay #5</h3><p>The calibration protocol is not the whole explanation for the collapse of boundary distance. Something more fundamental changed.</p><p>Essay #5’s boundary-distance measurement computed the distance from an image to the point where the model would stop agreeing with the <em>true label</em>. That definition has a hidden problem. If the model’s unperturbed prediction is already wrong — which is precisely the population an adversarial-risk measurement cares about — the check “does the prediction still match the label?” fails before any real search has happened. The distance collapses toward zero immediately, not because the image sits near a geometric boundary, but because the metric has quietly been handed the answer.</p><p>This is not a measurement of fragility. It is the test label, wearing a geometric disguise.</p><p>A gate cannot use the true label at inference time. That is the entire premise of deferral: the model does not know which of its predictions are wrong, and the point of a fragility signal is to guess anyway. A metric that secretly consults the label is not a candidate for that job, however well it scores.</p><p>This essay’s implementation of boundary distance was rebuilt to measure distance to the model’s <em>own current prediction</em> instead — the standard notion of distance to a decision boundary, and the only version a real gate could ever compute. Under that definition, boundary distance’s adversarial risk is <strong>78.32%</strong>, worse than plain confidence.</p><p>The earlier number was not a different experiment measured slightly differently. It was answering an easier question than the one this essay is asking, and the 4.0% adversarial risk reported in Essay #5’s fused gate should be read with that in mind. That result was not fabricated, and the geometric intuition behind it is not wrong — but it was measured with a signal that, in part, already knew what it was trying to predict.</p><p>The correction changes this essay’s conclusion, not just its numbers. Multi-head disagreement and evidential evidence do not merely beat a strong post-hoc baseline. They beat the only version of that baseline a deployed system could have used.</p><h3>VI. Building the sensor into the boat</h3><p>The metaphor now becomes more precise.</p><p>The baseline model asks:</p><p><em>How confident am I in this answer?</em></p><p>The boundary-distance method asks:</p><p><em>How close am I to a geometric decision boundary?</em></p><p>The multi-head model asks:</p><p><em>Do several internal predictive views agree?</em></p><p>The evidential model asks:</p><p><em>How much evidence supports this prediction?</em></p><p>These are different forms of uncertainty.</p><p>Confidence is a property of the final probability output.</p><p>Boundary distance is a post-hoc geometric measurement.</p><p>Multi-head disagreement is an architectural signal.</p><p>Evidential evidence is an output-level representation of support.</p><p>The results suggest that uncertainty is more useful when it is generated by internal instability or insufficient evidence than when it is inferred only from the final softmax confidence.</p><p>This does not mean that architectural signals are automatically truthful. The shared backbone makes the heads correlated. The evidential model can also be miscalibrated or overconfident.</p><p>But under this experiment, the architecture-native signals retained something that ordinary confidence and boundary distance lost:</p><p>a connection between uncertainty and correctness after perturbation.</p><h3>VII. Fusion: does more awareness produce a better gate?</h3><p>The most interesting question is not only whether one architectural signal beats another.</p><p>It is whether combining several signals produces a more humble model.</p><p>The notebook therefore used an OR-based gate:</p><p>Defer if confidence, disagreement, evidence, or boundary distance crosses its own calibrated threshold.</p><p>This avoids mixing raw signals with incompatible scales.</p><h3>Fused results</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*yEUvmjWvpJX5tAywR3HL9w.png" /><figcaption>Numbers come from the notebook — By Author</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RjiaECinKApifvspi12_Hg.png" /><figcaption>The notebook output-By Author</figcaption></figure><p>Adding boundary distance produced only a small change:</p><ul><li>Clean risk improved by <strong>0.24 percentage points</strong>.</li><li>Adversarial risk improved by <strong>0.36 percentage points</strong>.</li></ul><p>The fusion therefore improved the accuracy of the predictions it allowed through, but it became highly conservative. It deferred approximately half of the evaluation examples, while still leaving substantial adversarial risk among the retained predictions.</p><p>This is an important result.</p><p><em>More sensors did not automatically create more awareness.</em></p><p>A model can become more cautious without becoming genuinely more perceptive.</p><p>The fused gate is useful as a selective prediction system, but it is not the winner of this confrontation. The strongest individual signals under this transferred-attack protocol were multi-head disagreement and evidential evidence.</p><h3>VIII. What we learned</h3><p>The original question was:</p><p><em>Can architecture-native awareness replace post-hoc measurement?</em></p><p>The answer from this experiment is nuanced.</p><p>Architecture-native awareness did not make the model invulnerable. It did not eliminate the need for calibration. It did not prove that a shared multi-head model possesses independent epistemic knowledge.</p><p>But it did produce a more resilient relationship between uncertainty and error.</p><p>Confidence failed dramatically under transfer attack.</p><p>Boundary distance, despite its usefulness in Essay #5, failed to provide reliable protection in this protocol.</p><p>Multi-head disagreement and evidential evidence retained substantially lower adversarial risk.</p><p>So the result is not:</p><p>The architecture solved uncertainty.</p><p>The result is:</p><p>The sensor was no longer placed entirely outside the model. Some of the model’s internal structure could now express instability before the final prediction became a mistake.</p><p><em>That is the sense in which the sensor has been built into the boat.</em></p><h3>IX. What we still do not know</h3><p>Several questions remain open.</p><p>First, the attacks in this experiment were generated against the baseline model and transferred to the multi-head and evidential models. The next step is to attack each model directly.</p><p>If the architecture-native signals remain effective against adaptive attacks, the claim will become much stronger.</p><p>Second, the multi-head threshold was numerically tiny because the heads were strongly correlated through their shared backbone. Future work should test how the signal changes with:</p><ul><li>different initializations</li><li>independent head regularization</li><li>head-specific dropout</li><li>partially independent backbones</li><li>different numbers of heads</li></ul><p>Third, the present comparison evaluates complete model–sensor systems. A further experiment should apply every signal to the same baseline prediction so that the sensing mechanisms themselves can be compared without changing the predictor.</p><p>Fourth, the evidential model requires careful calibration. Low evidence was useful here, but evidence magnitude should not automatically be interpreted as reliable knowledge.</p><p>Fifth, Bayesian weight priors will be studied in Essay #7.</p><p>Finally, Essay #8 will introduce a transformer backbone and self-attention entropy. There, the question will become even more delicate:</p><p>Does attention entropy reveal uncertainty, or does it merely describe where the model is looking?</p><p>The skepticism behind “Attention is not Explanation” should already be present in that experiment. A signal must be tested by what it predicts about error — not by how intuitively meaningful it appears.</p><h3>X. Invitation</h3><p>You have built the sensors.</p><p>You have measured the depth.</p><p>Now you have begun changing the boat itself.</p><p>The results do not show a perfect architecture. They show something more valuable: a difference between a model that is merely confident and a model whose internal structure can register disagreement or lack of evidence.</p><p>The humble model is not the one that produces the most complicated uncertainty score.</p><p>It is the one that has a chance to notice when its own certainty has become unstable.</p><p>The <em>sensor</em> is no longer only attached to the <em>boat</em>.</p><p><em>It has begun to become part of the boat.</em></p><h3>Resources</h3><ul><li><strong>Essay #4:</strong> <a href="https://medium.com/towards-artificial-intelligence/learning-to-say-i-dont-know-the-first-floor-of-awareness-1a9faae389c0?sharedUserId=maedeh.torkian">Learning to Say “I Don’t Know”: The First Floor of Awareness</a></li><li><strong>Essay #5:</strong> <a href="https://medium.com/@maedeh.torkian/the-geometry-of-fragility-feeling-the-decision-boundary-2d1c50f402ee?sharedUserId=maedeh.torkian">The Geometry of Fragility: Feeling the Decision Boundary</a></li><li>Charts referenced in this essay: Adversarial_Risk.png, Boundary_Distance.png, Architectural_signal.png</li><li>Result tables: Table-01.png, Table-02.png, Table-03.png</li><li>GitHub notebook: <a href="https://github.com/Maee127/Adversarial-Notebooks/tree/master/%236">https://github.com/Maee127/Adversarial-Notebooks/tree/master/%236</a></li></ul><h3>References</h3><ul><li>Lakshminarayanan, B., Pritzel, A., &amp; Blundell, C. (2017). <em>Simple and scalable predictive uncertainty estimation using deep ensembles</em>. NeurIPS.</li><li>Sensoy, M., Kaplan, L., &amp; Kandemir, M. (2018). <em>Evidential deep learning to quantify classification uncertainty</em>. NeurIPS.</li><li>Gal, Y., &amp; Ghahramani, Z. (2016). <em>Dropout as a Bayesian approximation: Representing model uncertainty in deep learning</em>. ICML.</li><li>Jain, S., &amp; Wallace, B. C. (2019). <em>Attention is not Explanation</em>. NAACL.</li><li>Szegedy, C., et al. (2013). <em>Intriguing properties of neural networks</em>. arXiv:1312.6199.</li><li>Goodfellow, I. J., Shlens, J., &amp; Szegedy, C. (2014). <em>Explaining and harnessing adversarial examples</em>. arXiv:1412.6572.</li><li>Madry, A., et al. (2017). <em>Towards deep learning models resistant to adversarial attacks</em>. arXiv:1706.06083.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8545beedd3c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Geometry of Fragility: Feeling the Decision Boundary]]></title>
            <link>https://medium.com/@maedeh.torkian/the-geometry-of-fragility-feeling-the-decision-boundary-2d1c50f402ee?source=rss-380dc4dff114------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d1c50f402ee</guid>
            <category><![CDATA[cyber-security-awareness]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Maedeh Torkian]]></dc:creator>
            <pubDate>Mon, 03 Aug 2026 06:59:59 GMT</pubDate>
            <atom:updated>2026-08-03T06:59:59.070Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5qLLTB6d0NDwzHDBFTi4qw.png" /><figcaption>Create by AI</figcaption></figure><p>Essay #5 in the Humble Model Series</p><p><strong>I. The Blind Spot We Cannot Ignore</strong></p><p>In Essay #4, we built the first floor of awareness.</p><p>Essay #4:</p><p><a href="https://pub.towardsai.net/learning-to-say-i-dont-know-the-first-floor-of-awareness-1a9faae389c0">Learning to Say “I Don’t Know”: The First Floor of Awareness</a></p><p>We gave the model a voice — a way to say<em> “I am not sure”</em> and <em>“this input looks strange.”</em> We implemented uncertainty quantification and out-of-distribution detection, and we built a decision gate that deferred uncertain predictions.</p><p>It worked — on natural data. The gate deferred on 80.09% of Fashion-MNIST inputs, catching distributional shift with high coverage.</p><p>But it failed — on adversarial data. The same gate deferred on only 8.80% of FGSM-perturbed MNIST inputs. The model remained silent about its own fragility, even when that fragility was literal: a small perturbation could flip its prediction without changing its confidence.</p><p>That is the blind spot we must now close.</p><p>The model needs to be aware of its <em>own geometry</em> — not just the shape of the data distribution, but the shape of its decision boundary. It needs to know when it is standing on thin ice, even when the input looks familiar, and its confidence is high.</p><p>That is <strong>geometric awareness</strong>.</p><p><strong>II. What Is Geometric Awareness?</strong></p><p>A model has geometric awareness when it can sense, for a given input, how close it is to its decision boundary — and whether that boundary is sharp, unstable, or fragile.</p><p>This is distinct from epistemic uncertainty (model uncertainty) and distributional awareness (OOD detection). A model can be confident, in-distribution, and still be standing on a knife-edge.</p><p>Consider a point in the model’s feature space. The decision boundary is a line (or hyperplane) that separates classes. If the point is far from the boundary, the model is stable. If it is close, a small perturbation can cross the boundary and flip the prediction.</p><p>Geometric awareness is the model’s ability to estimate that distance — without running a full adversarial search for each input.</p><p><strong>III. Three Methods for Measuring Fragility</strong></p><p>We will implement and compare three methods for estimating geometric fragility.</p><p><strong>Method 1: Local Lipschitz Estimation</strong></p><p>The Lipschitz constant of a function measures how much the output can change for a small change in the input. A high local Lipschitz constant means the model is sensitive to small perturbations — it is fragile.</p><p>We estimate the local Lipschitz constant around each input by approximating the gradient of the output with respect to the input. The norm of the Jacobian gives us an upper bound on the sensitivity.</p><p><strong>Advantage:</strong> Simple to compute.</p><p><strong>Disadvantage:</strong> Can be over-conservative; does not directly measure boundary distance.</p><p><strong>Method 2: Jacobian-Based Sensitivity</strong></p><p>We compute the norm of the gradient of the loss with respect to the input. This is the same gradient used in FGSM — it tells us the direction of steepest ascent in loss.</p><p>A large gradient norm means the model is sensitive to small perturbations. A small gradient norm means the model is locally flat.</p><p><strong>Advantage:</strong> Directly related to adversarial vulnerability.</p><p><strong>Disadvantage: </strong>Does not distinguish between types of sensitivity.</p><p><strong>Method 3: Distance to Decision Boundary</strong></p><p>We estimate the minimal perturbation needed to flip the prediction. This is the most direct measure of boundary proximity.</p><p>We use a simple search along the gradient direction: starting from a small perturbation, we increase it until the prediction flips. The minimal perturbation size is the distance to the decision boundary.</p><p><strong>Advantage:</strong> Direct and interpretable.</p><p><strong>Disadvantage:</strong> Computationally expensive; requires a search for each input.</p><p><strong>IV. The Fragility Flag — A New Gate Signal</strong></p><p>Once we have a fragility score for each input, we add it to the decision gate.</p><p>The gate now defers if:</p><ul><li><strong>Uncertainty</strong> is high (from Essay #4)</li><li><strong>OOD distance</strong> is high (from Essay #4)</li><li><strong>Fragility</strong> is high (new — from Essay #5)</li></ul><p>This is the first floor of awareness — now with a fragility sensor.</p><p><strong>V. Code Example</strong></p><p>The notebook implements all three methods on a CNN trained on CIFAR-10.</p><p>The full, runnable notebook is available here:</p><p><a href="https://github.com/Maee127/Adversarial-Notebooks/blob/master/%235/Notebook_5.ipynb">Adversarial-Notebooks/#5/Notebook_5.ipynb at master · Maee127/Adversarial-Notebooks</a></p><p><strong>Pseudocode for Fragility Estimation</strong></p><pre>def estimate_local_lipschitz(model, image, epsilon=1e-3):<br># Compute gradient of output w.r.t. input<br>  image.requires_grad = True<br>  output = model(image)<br>  loss = output.norm() # or use a specific class<br>  model.zero_grad()<br>  loss.backward()<br>  grad_norm = image.grad.norm().item()<br>  return grad_norm<br>def estimate_jacobian_sensitivity(model, image, label):<br># Compute gradient of loss w.r.t. input<br>  image.requires_grad = True<br>  output = model(image)<br>  loss = nn.CrossEntropyLoss()(output, torch.tensor([label]))<br>  model.zero_grad()<br>  loss.backward()<br>  grad_norm = image.grad.norm().item()<br>  return grad_norm<br>def estimate_boundary_distance(model, image, label, epsilon=0.001, max_iters=50):<br># Binary search along gradient direction to find minimal perturbation<br>  image.requires_grad = True<br>  output = model(image)<br>  loss = nn.CrossEntropyLoss()(output, torch.tensor([label]))<br>  model.zero_grad()<br>  loss.backward()<br>  grad = image.grad.data.sign()<br>  # Binary search for minimal epsilon<br>  low, high = 0.0, 1.0<br>  for _ in range(max_iters):<br>    mid = (low + high) / 2<br>    perturbed = image + mid * grad<br>    perturbed = clamp_to_valid_range(perturbed) <br>    # NOT torch.clamp(perturbed, 0, 1)  <br>    # CIFAR inputs are normalized, so the valid range per channel is NOT [0,1]<br>    # Clamping to [0,1] would silently search over a range the model never <br>    # actually sees, corrupting every boundary-distance estimate below.<br>    pred = model(perturbed).argmax().item()<br>  if pred != label:<br>    high = mid<br>  else:<br>    low = mid<br>  return (low + high) / 2</pre><p><strong>VI. Results</strong></p><p>A note before the numbers: this notebook uses CIFAR-10 rather than the MNIST setup from Essays #1–4. That’s a deliberate choice, not an oversight — CIFAR-10 is a genuinely harder task, and a model’s decision boundary has more room to be interesting (and fragile) in it than in MNIST’s comparatively easy, near-saturated setting. But it means the numbers below aren’t directly comparable to Essay #4’s MNIST figures in absolute terms; the <em>shape </em>of the comparison (does a signal separate clean from adversarial better than confidence alone) is still meaningful; the specific percentages are not interchangeable across essays.</p><p>The baseline CNN reaches 80.08% clean accuracy and 37.67% accuracy under FGSM (ε=0.03) — a 42.41-point drop. That’s a substantially more vulnerable model than Essay #4’s MNIST ensemble, which is part of why confidence alone already does more useful work here than it did there: this single, non-ensemble, harder-task model’s confidence carries real signal about its own fragility in a way the MNIST ensemble’s didn’t.</p><p>Everything below is measured on 300 clean and 300 adversarial images — a first read, not a full 10,000-image evaluation like Essay #4’s later rounds. Boundary distance costs up to 30 forward-and-backward passes per image, so a full-set run is a genuine compute commitment rather than a formatting choice; the relative story between methods is unlikely to change with more data, but exact percentages should be treated as approximate until a larger run confirms them. Thresholds for the three geometric methods were set at each signal’s own 25th or 75th percentile on the clean set (whichever side counts as “more fragile”), which fixes clean deferral at a comparable 25% across all three and lets the <em>adversarial </em>numbers be read as a fair, matched comparison. One limitation worth naming plainly: threshold and evaluation both use the same 300-image sample, which risks a mild optimistic bias — a proper next pass would calibrate thresholds on one split and evaluate on a held-out one.</p><p><strong>Comparison of Methods</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/1*hy3OZJFQb6CZ5vZk8pPitA.png" /><figcaption>Table of notebook results</figcaption></figure><p>This table includes both a clean success and an honest failure, and both are worth reporting rather than only the flattering half.</p><p><strong>The failure: Local Lipschitz, as implemented, doesn’t work.</strong> Its adversarial deferral rate (17.0%) is lower than its own clean deferral rate (25%) and lower than the confidence baseline’s adversarial deferral (41.0%) — the signal is, if anything, pointing the wrong way. Using it as a gate even makes clean-side accuracy worse (75.56%, below the model’s unconditional 80.08% clean accuracy), meaning the quarter of clean images it flags as “fragile” isn’t actually the error-prone quarter. The likely cause is in Method 1’s definition: it differentiates the <em>norm of the raw output vector </em>rather than a loss tied to the predicted class, so the gradient it measures reflects how much the whole logit vector moves, not how close the argmax is to flipping. Method 2 (Jacobian Sensitivity) and Method 3 (Boundary Distance) both differentiate a label-conditioned loss instead, and both work — which points at the class-agnostic loss as the specific reason Method 1 underperforms, not geometric methods in general.</p><p><strong>The success: Jacobian sensitivity and boundary distance both meaningfully beat confidence alone.</strong> At a matched 25% clean-deferral rate, Jacobian sensitivity catches 63.33% of adversarial inputs and boundary distance catches 66.0% — compared to the confidence baseline’s 41.0% at a slightly lower clean-deferral cost (29.33%, though not perfectly matched since the baseline threshold was fixed at 0.7 rather than tuned to 25%). Adversarial risk-among-predictions drops from 59.32% (confidence) to 16.36% (Jacobian) to 6.86% (boundary distance) — the more expensive, more direct measure of boundary proximity is also the better one, which is at least a coherent story even if it means the cheapest of the three geometric methods is the one that doesn’t pay for itself.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HzW62E-56BFRJ9f0S3Cl_A.png" /><figcaption>Notebook Output-By Author</figcaption></figure><p><strong>The fused gate is the best result in this essay, and unlike Essay #4’s, it’s not just filtering volume.</strong> Combining confidence with boundary distance pushes adversarial deferral to 75.0% and cuts adversarial risk to 4.0% — while clean deferral only rises from 29.33% to 34.67%, and clean risk <em>improves</em> (7.55% to 0.51%). The important difference from Essay #4’s OOD-fusion result: there, fusing a second signal reduced the <em>absolute count </em>of silent OOD failures without making the gate any better at telling which inputs were trustworthy (risk-among-predictions stayed flat, ~94–95%). Here, fusion genuinely improves the risk figure itself, on both clean and adversarial data. Boundary distance appears to carry information confidence doesn’t have, not just a second vote correlated with the first.</p><p><strong>VII. What This Means for the Humble Model</strong></p><p>The humble model now has three signals:</p><ol><li><strong>Uncertainty</strong> — from Essay #4</li></ol><p><strong>2. OOD Distance</strong> — from Essay #4</p><p><strong>3. Fragility</strong> — from Essay #5</p><p>Together, they form a more complete awareness architecture. The model can say:</p><p><em>• “I don’t know this prediction.”</em></p><p><em>• “This input is strange.”</em></p><p><em>• “Even though I seem confident, I am close to a boundary.”</em></p><p>The boat now has a depth sensor — but it’s worth being specific about which sensor. Not all three geometric methods earned that description. Local Lipschitz, as implemented here, didn’t detect fragility at all — it flagged the wrong quarter of clean images and deferred on adversarial inputs less often than doing nothing would have. Jacobian sensitivity and boundary distance both worked, and boundary distance — the most literal, most expensive of the three — worked best. “<strong><em>Geometric awareness</em></strong>” turned out to require choosing the right geometric quantity, not just any gradient-derived one. That’s a real finding, and a more honest depth sensor than claiming all three methods earned their place equally.</p><p><strong>VIII. What We Still Do Not Know</strong></p><ul><li>Whether the 300-image sample here holds up at Essay #4 scale — boundary distance’s cost (up to 30 forward/backward passes per image) makes a full 10,000-image run a real compute commitment, not a formatting change, and the exact percentages above should be treated as a first read rather than a final number until that run happens.</li><li>Whether calibrating thresholds on a held-out split (rather than the same 300 images used for evaluation, as done here) changes any of these numbers meaningfully — the current setup has a plausible mild optimistic bias baked in.</li><li>Whether Local Lipschitz can be fixed by differentiating a label-conditioned loss instead of the raw output norm, the way Methods 2 and 3 already do — or whether it’s a genuinely weaker signal even corrected.</li><li>Whether boundary distance’s advantage over Jacobian sensitivity (66.0% vs. 63.33% adversarial deferral, but a larger gap in risk — 6.86% vs. 16.36%) holds at a larger sample size, or is noise from 300 images.</li><li>Whether geometric awareness generalizes to other architectures and datasets — this essay tested one CNN on one dataset at one epsilon.</li><li>Whether this is enough to close the adversarial blind spot entirely — or whether the next layer is something else entirely.</li></ul><p><strong>IX. Invitation</strong></p><p>You have seen the silence. You have built the walls. You have crossed the bridge. You have built the first floor of awareness.</p><p>Now you have a depth sensor.</p><p>The boat is no longer just a boat. It knows when the water is deep — and when the ice is thin.</p><p>But does it reach deep enough? The next layer is not about geometry — it is about the architecture <em>itself</em>.</p><p><em>Come. Walk with me into the geometry of fragility.</em></p><p><strong>X. References</strong></p><ul><li>Hein, M., &amp; Andriushchenko, M. (2017). <em>Formal guarantees on the robustness of a classifier against adversarial manipulation. NeurIPS.</em></li><li>Szegedy, C., Zaremba, W., Sutskever, I., Bruna, J., Erhan, D., Goodfellow, I., &amp; Fergus, R. (2013). <em>Intriguing properties of neural networks. arXiv:1312.6199.</em></li><li>Goodfellow, I. J., Shlens, J., &amp; Szegedy, C. (2014). <em>Explaining and harnessing adversarial examples. arXiv:1412.6572.</em></li><li>Madry, A., Makelov, A., Schmidt, L., Tsipras, D., &amp; Vladu, A. (2017). <em>Towards deep learning models resistant to adversarial attacks. arXiv:1706.06083.</em></li><li>Tsipras, D., Santurkar, S., Engstrom, L., Turner, A., &amp; Madry, A. (2018). <em>Robustness may be at odds with accuracy. arXiv:1805.12152.</em></li><li>Zhang, H., Yu, Y., Jiao, J., Xing, E., El Ghaoui, L., &amp; Jordan, M. (2019). <em>Theoretically principled trade-off between robustness and accuracy. ICML.</em></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d1c50f402ee" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learning to Say “I Don’t Know”: The First Floor of Awareness]]></title>
            <link>https://pub.towardsai.net/learning-to-say-i-dont-know-the-first-floor-of-awareness-1a9faae389c0?source=rss-380dc4dff114------2</link>
            <guid isPermaLink="false">https://medium.com/p/1a9faae389c0</guid>
            <category><![CDATA[ai-awareness]]></category>
            <category><![CDATA[self-awareness]]></category>
            <category><![CDATA[adversarial-attack]]></category>
            <category><![CDATA[monte-carlo-dropout]]></category>
            <category><![CDATA[adversarial-defenses]]></category>
            <dc:creator><![CDATA[Maedeh Torkian]]></dc:creator>
            <pubDate>Tue, 14 Jul 2026 21:31:01 GMT</pubDate>
            <atom:updated>2026-07-14T21:31:01.017Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x1Q1plWk6ysOfc9AmgAluA.png" /><figcaption>The First Floor-Create by AI</figcaption></figure><h4>Essay #4 in the Humble Model Series</h4><p><strong>I. Introduction: The Flicker Becomes a Voice</strong></p><p>In the bridge essay, we named the pattern we had seen across three experiments:</p><p><strong>- Essay #2:</strong> A model, confident near 1.0000, could not distinguish the robust majority from the fragile minority. It was silent about its own limits.</p><p><a href="https://pub.towardsai.net/the-attack-landscape-why-silence-is-the-vulnerability-f27dabfccb9b">The Attack Landscape: Why Silence Is the Vulnerability</a></p><p><strong>- Essay #3:</strong> We built walls — FGSM training, PGD training, defensive distillation. Each raised the bar. Each eventually showed cracks. Robustness training fixed 17 of 18 images, but the one that remained wrong still received confidence 0.6187 — a flicker of hesitation that never became a warning.</p><p><a href="https://pub.towardsai.net/walls-shields-and-illusions-defenses-and-their-limits-cd67b6ec4f92">Walls, Shields, and Illusions: Defenses and Their Limits</a></p><p><strong>- The Bridge:</strong> We turned from <em>resistance</em> to <em>awareness</em>. We asked: <strong><em>What if the goal is not to be unbreakable, but to be undeluded?</em></strong> We said <em>awareness</em> needs two things — <strong><em>calibration</em></strong> and a <strong><em>gate</em></strong> — and that Essay #4 would build both.</p><p><a href="https://medium.com/@maedeh.torkian/the-bridge-from-resistance-to-awareness-58ea4156ad3f">The Bridge: From Resistance to Awareness</a></p><p>This is that essay. We build the voice.</p><p>We will move from the <em>flicker </em>(0.6187) to a calibrated uncertainty estimate — a number that actually means something, a number that can be acted upon. But it is worth being precise about what kind of essay this is. Uncertainty quantification is not the end of the series’ argument; it is the <strong>first floor of an awareness architecture</strong>. A model that can say <em>“I am not sure”</em> has not yet said <em>“this input is strange”</em> or <em>“my decision boundary is fragile here”</em> — those are separate rooms in the same building, and later essays will build them. This essay’s job is narrower and more foundational: give the model a voice at all.</p><p>We will implement three practical mechanisms that make that voice possible:</p><p><strong>1. Monte Carlo Dropout</strong> — using stochastic inference to estimate uncertainty.</p><p><strong>2. Deep Ensembles</strong> — training multiple models and measuring their disagreement.</p><p><strong>3. Out-of-Distribution Detection</strong> — recognizing when an input is unlike anything the model has seen.</p><p>These are means, not the point. The point is what we build with them: a <strong><em>decision gate</em></strong> — a simple, auditable rule that says:<em> “If uncertainty is high, do not predict. Ask for help.”</em></p><p>This is not a new wall. It is a <strong><em>voice</em></strong>, and it is the first floor of a structure this series will keep building on.</p><p><strong>II. What Is Uncertainty — and Why Softmax Is Not Enough</strong></p><p>Awareness is not binary. A model can be aware of its uncertainty about its own prediction (epistemic self-knowledge). It can be aware that the input in front of it looks nothing like its training data (distributional awareness). It can be aware that its decision boundary near this particular input is fragile, even when its own confidence doesn’t show it (geometric awareness — the flicker at 0.6187 from Essay #3 was exactly this, unreported). This essay builds the first of those three: the model’s awareness of its own uncertainty. Out-of-distribution detection, which we also implement here, begins to reach toward the second. The decision gate is what connects either signal to an action. Later essays in this series can push further into geometric and deployment-level awareness; this one lays the floor they will stand on.</p><p>Most deep learning models output a softmax vector — a probability distribution over classes. It is tempting to read this as uncertainty. But it is not.</p><p>A softmax probability is:</p><p>• <strong>Conditional</strong> on the input and the training distribution.</p><p>•<strong> Not</strong> <strong>calibrated</strong> to actual accuracy rates.</p><p>• <strong>Silent</strong> about whether the input is out-of-distribution, adversarial, or simply ambiguous.</p><p>A model that outputs 0.99 on a clean image and 0.99 on an adversarial image is not expressing <strong><em>uncertainty</em></strong>. It is expressing <strong><em>confidence</em></strong> — whether earned or not.</p><p><strong><em>Uncertainty </em></strong>quantification aims to close this gap. It gives the model a way to say:</p><p><strong><em>- “I am not sure about this prediction.”</em></strong></p><p><strong><em>- “This input is unlike anything I have seen.”</em></strong></p><p><strong><em>- “You should not trust this output.”</em></strong></p><p>There are two types of uncertainty:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*LZi6SF990c_fkEl2h5oMnA.png" /></figure><p>Aleatoric uncertainty cannot be reduced with more data. Epistemic uncertainty can — but only if the model has a way to detect when it is out of its depth.</p><p><strong>III. Method 1: Monte Carlo Dropout</strong></p><p>Dropout is a regularization technique: during training, random neurons are “dropped” (set to zero) to prevent over-reliance on specific features.</p><p>Monte Carlo (MC) Dropout uses dropout during inference. Instead of a single forward pass, we run the model multiple times with dropout enabled. The predictions vary — and the variance gives us an estimate of epistemic uncertainty.</p><p><strong>How It Works</strong></p><p>1. Train a model with dropout (standard practice).</p><p>2. At inference, enable dropout and run N forward passes (e.g., 50–100).</p><p>3. Compute:</p><p><strong>• Mean prediction</strong> — the average softmax vector.</p><p><strong>• Variance</strong> — how much the predictions vary across passes.</p><p><strong>Trade-offs</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*gwxcgXpFcduiryueQLOowg.png" /></figure><p><strong>Code Snippet (PyTorch)</strong></p><pre>def mc_dropout_predict(model, image, num_passes=50):<br>    model.train()  # Enable dropout<br>    predictions = []<br>    for _ in range(num_passes):<br>        with torch.no_grad():<br>            pred = torch.softmax(model(image), dim=1)<br>            predictions.append(pred)<br>    model.eval()  # Disable dropout for normal use<br>    predictions = torch.stack(predictions)  # [N, 1, 10]<br>    mean_pred = predictions.mean(dim=0)<br>    variance = predictions.var(dim=0)<br>    return mean_pred, variancepy</pre><p>Results :</p><p><a href="https://github.com/Maee127/Adversarial-Notebooks/blob/master/%234/Notebook_%234.ipynb">Adversarial-Notebooks/#4/Notebook_#4.ipynb at master · Maee127/Adversarial-Notebooks</a></p><p>On a clean, easily-classified MNIST test digit (the digit 7 at test index 0), MC Dropout with 50 passes returned confidence 1.0000 and variance 0.0000 — the model is not just confident, it is unanimous across every stochastic pass. That single example is a fine sanity check but not evidence on its own; the aggregate numbers over 200 images per condition are the ones worth trusting:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*AwKmBMnDF1SOf8ZYmySIuw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YlYcYZnF02Rh_BH4FWWhYA.png" /><figcaption>The notebook output</figcaption></figure><p>Variance rises about 31× from clean to OOD, and only about 6× from clean to adversarial. That six-to-thirty-one ratio is the first quantitative sign of the gap this essay is ultimately about: MC Dropout notices unfamiliarity far more than it notices adversarial perturbation, even before the decision gate does anything with the number.</p><p><strong>IV. Method 2: Deep Ensembles</strong></p><p>Deep Ensembles are a simpler — and often more effective — alternative to MC Dropout. The idea: train multiple models with different initializations, and measure their disagreement.</p><p><strong>How It Works</strong></p><p>1. Train M models (e.g., 5) on the same dataset, but with different random seeds.</p><p>2. At inference, run all M models on the input.</p><p>3. Compute:</p><p>•<strong> Mean prediction</strong> — the average of the M softmax outputs.</p><p>•<strong> Disagreement </strong>— the variance across the M predictions.</p><p><strong>Trade-offs</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*puS9RymiOfTh3M3M0aOAGw.png" /></figure><p><strong>Code Snippet (PyTorch)</strong></p><pre>def ensemble_predict(models, image):<br>    predictions = []<br>    for model in models:<br>        model.eval()<br>        with torch.no_grad():<br>            pred = torch.softmax(model(image), dim=1)<br>            predictions.append(pred)<br>    predictions = torch.stack(predictions)  # [M, 1, 10]<br>    mean_pred = predictions.mean(dim=0)<br>    variance = predictions.var(dim=0)<br>    return mean_pred, variancep</pre><p><strong>Results :</strong></p><p><a href="https://github.com/Maee127/Adversarial-Notebooks/blob/master/%234/Notebook_%234.ipynb">Adversarial-Notebooks/#4/Notebook_#4.ipynb at master · Maee127/Adversarial-Notebooks</a></p><p>On the same clean test digit, the 5-member ensemble agrees with MC Dropout’s read: confidence 1.0000, variance 0.0000. The aggregate numbers tell a slightly different story from MC Dropout’s, though:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*Fv0o6NnedNc_z5EXtmk7Nw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AMEzzjXDMnPY1gQs9Cfs3g.png" /><figcaption>The notebook output</figcaption></figure><p>The ensemble’s variance rises about 28× from clean to OOD and about 4× from clean to adversarial — the same lopsided pattern as MC Dropout, at a slightly different scale. Both methods agree on the shape of the problem even though they disagree on the exact numbers: distributional unfamiliarity moves the needle far more than adversarial perturbation does.</p><p><strong>V. Method 3: Out-of-Distribution Detection</strong></p><p>Uncertainty is not just about confidence variance. Sometimes, the input is simply strange — unlike anything the model has seen during training.</p><p>OOD detection asks: <strong><em>Is this input from the same distribution as the training data?</em></strong></p><p><strong>How It Works (Simple Approach)</strong></p><p>1. Train a model on the training set.</p><p>2. At inference, compute a <strong><em>distance metric</em></strong> between the input and the training distribution:</p><p><strong><em>• Distance in feature space</em></strong> — how far is the input from the nearest training example in the model’s latent space?</p><p><strong><em>• Reconstruction error</em></strong> — if using an autoencoder, can the input be reconstructed well?</p><p><strong><em>• Density estimation</em></strong> — how probable is the input under a density model trained on the training data?</p><p>We implement the simplest approach: <strong><em>minimum distance in feature space</em></strong>, against a cached bank of 1,000 training features.</p><p><strong>Code Snippet (PyTorch)</strong></p><pre>def extract_features(model, dataloader, max_samples=1000):<br>    features = []<br>    model.eval()<br>    with torch.no_grad():<br>        for images, _ in dataloader:<br>            _, feat = model.forward_with_features(images)<br>            features.append(feat.cpu())<br>            if len(features) * images.size(0) &gt;= max_samples:<br>                break<br>    return torch.cat(features, dim=0)[:max_samples]<br><br>def compute_ood_score(feature, training_features):<br>    # Minimum distance to any training feature<br>    return torch.cdist(feature.unsqueeze(0), training_features).min().item()</pre><p><strong>Results</strong>:</p><p><a href="https://github.com/Maee127/Adversarial-Notebooks/blob/master/%234/Notebook_%234.ipynb">Adversarial-Notebooks/#4/Notebook_#4.ipynb at master · Maee127/Adversarial-Notebooks</a></p><p>This section went through three distinct versions before landing on something trustworthy, and the path there is worth showing rather than hiding, because each wrong turn taught something the final number doesn’t convey on its own.</p><p><strong>First attempt — a single pair of examples.</strong> A clean MNIST test digit sat at distance 8.3552 from its nearest training-feature neighbor; a Fashion-MNIST image sat at 23.7167 — nearly three times farther. That looked like a clean signal. It wasn’t evidence of anything, because it was one pair of numbers.</p><p><strong>Second attempt — measured properly, and it failed</strong>. Cached as a Mahalanobis distance (normalizing by the training features’ covariance) and measured over 500 images per condition instead of one:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/410/1*kXSeB8ya1w4LBuWr6y6KIA.png" /></figure><p>Cohen’s d between the two: 0.00. No separation. The single-pair comparison above was two draws from almost entirely overlapping distributions that happened to land on opposite sides of their means. The cause: this Mahalanobis distance was fit as one global Gaussian over all ten digit classes’ features pooled together. MNIST’s classes occupy genuinely different regions of a 128-dimensional feature space — the true structure is multimodal — and a single covariance estimate averages over that structure instead of respecting it.</p><p><strong>Third attempt — class-conditional, and it worked</strong>. Fitting one Gaussian per digit class and scoring against the nearest one (Lee et al., 2018), measured again over 500 images per condition:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*IGqfecMIKgiayXNlVErZ1w.png" /></figure><p>Cohen’s d:<strong> 0.99</strong> — a large effect, and this time built from a population, not a pair. Class-conditional Mahalanobis distance genuinely separates MNIST digits from Fashion-MNIST images. The lesson from the failed global version generalizes past this one metric: a feature space shaped by ten distinct classes will defeat any detector that assumes it’s shaped like one blob, however sensible that detector looks on paper.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MnfkbGfbTE8DlPLkMIC1Ag.png" /><figcaption>The notebook output</figcaption></figure><p><strong>A second bug, found only once fusion was attempted.</strong> Validating the metric wasn’t the end of it. The first attempt to use this class-conditional score inside the decision gate — at threshold 18.29, the midpoint of the two means above — still deferred on 100% of both clean and OOD inputs. The metric was sound; the code applying it wasn’t. The gate was scoring each image’s features from an ensemble member’s forward pass, while the Mahalanobis Gaussians had been fit on a different model’s (the baseline’s) feature space. Two independently-initialized networks, even with identical architecture, don’t share an aligned feature space — there’s no reason hidden dimension 37 means the same thing in both. Distances computed that way are noise dressed up as a number. Section VI reports what happened once that mismatch was fixed and the score was computed consistently against the model it was actually fit on.</p><p><strong>VI. The Decision Gate</strong></p><p>Uncertainty becomes useful only when it <strong><em>acts</em></strong>. The decision gate is the mechanism that translates uncertainty into action.</p><p><strong>A Simple Rule</strong></p><p><em>If uncertainty &gt; threshold, do not predict. Defer to a human or a fallback system.</em></p><p>We use two thresholds:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*7_Vd2PdgUIYutlPx628TPA.png" /></figure><p><strong>Implementation</strong></p><pre>def decision_gate(models_or_model, image, method=&#39;ensemble&#39;,<br>                   threshold_variance=0.05, threshold_confidence=0.7,<br>                   num_passes=50):<br>    if method == &#39;mc_dropout&#39;:<br>        mean_pred, variance = mc_dropout_predict(models_or_model, image, num_passes)<br>    elif method == &#39;ensemble&#39;:<br>        mean_pred, variance = ensemble_predict(models_or_model, image)<br>    else:<br>        raise ValueError(&quot;method must be &#39;mc_dropout&#39; or &#39;ensemble&#39;&quot;)<br><br>    confidence = mean_pred.max().item()<br>    uncertainty = variance.max().item()<br><br>    if uncertainty &gt; threshold_variance or confidence &lt; threshold_confidence:<br>        return &#39;DEFER&#39;, None, uncertainty, confidence<br>    else:<br>        return &#39;PREDICT&#39;, mean_pred.argmax().item(), uncertainty, confidence</pre><p><strong>A First Look: Two Single Images</strong></p><p>On the clean MNIST digit: <strong>PREDICT</strong>, confidence 1.0000, uncertainty 0.0000 — the gate lets it through, correctly.</p><p>On a Fashion-MNIST image: <strong>DEFER</strong>, confidence 0.5254, uncertainty 0.1664 — the gate catches it, correctly, using variance and confidence alone, with no OOD distance signal involved at all. That the gate defers on this OOD input even without the feature-distance check is itself informative: the ensemble’s disagreement on an unfamiliar input is doing real work, independent of the separate distance metric in Section V.</p><p><strong>Evaluation Metrics</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*vcckXUGs4IlTVOqDA3GRIQ.png" /></figure><p>The goal is to balance coverage and risk: defer when uncertain, but not so often that the system becomes unusable.</p><p><strong>Full Evaluation — 10,000 Images per Set</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*s_qko3BcCuQhgQI3NGACqQ.png" /></figure><p>Read together, these two rows are the empirical heart of this essay. On clean MNIST, the gate defers only 2.52% of the time — and when it does predict, it is right 99.85% of the time, actually higher than the 99.00% baseline accuracy, because the gate is filtering out exactly the inputs the ensemble finds shakiest. On Fashion-MNIST, the gate defers 80.09% of the time. That is the awareness working as intended: four out of five OOD images never reach a prediction at all.</p><p>But the remaining 19.91% it does predict on is where the honesty has to continue. Of those, only 5.68% are “correct” against MNIST labels that do not meaningfully apply to a shirt or a shoe — the accuracy number is close to meaningless here by construction, and the risk figure of 94.32% is the number that matters: when the gate lets an OOD input through, it is wrong almost every time. Confidence-and-variance thresholds catch most distributional shift, but not all of it, and the failures that slip through are close to total failures, not partial ones. This is precisely the gap the OOD distance metric in Section V was built to close.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jc_tkFFkE36B9A3YApM0TQ.png" /><figcaption>The notebook output</figcaption></figure><p><strong>The fused gate, once the metric and the code both worked.</strong> With the class-conditional OOD score correctly wired in (threshold 18.29, scored consistently against the model it was fit on):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*S2pSvV5hbYLAQUURl4_4HA.png" /></figure><p>This is not the clean win the notebook’s early single-example numbers suggested, and it is not the total failure the two broken runs before it produced either. It’s a real, mixed result, and it deserves to be read carefully rather than rounded off in either direction. Fusion pushes coverage down substantially on both datasets — clean coverage drops from 97.48% to 87.04%, a real cost, not a rounding error. On OOD, coverage drops further still, from 19.91% to 7.62%. But look at the risk column: on OOD, risk-among-predictions barely moves, 94.32% to 95.01% — fusion is not making the gate any better at picking out which OOD inputs are safe to predict on. What it’s doing is shrinking the number of OOD inputs it’s willing to predict on at all. In absolute terms, on 10,000 Fashion-MNIST images, the unfused gate produces roughly 1,878 silent wrong predictions; the fused gate produces roughly 724 — a 61% reduction in the raw count of confidently-wrong OOD outputs. That’s a genuine improvement in the failure mode this whole essay is about. It comes paid for by clean data: the fused gate now defers on real, easy, correctly-classifiable MNIST digits about five times more often than the unfused one did, cutting the system’s usable coverage by ten percentage points to prevent OOD failures it still, on a per-prediction basis, doesn’t understand any better than before.</p><p>A third condition — adversarially perturbed MNIST, not shown in this table — turns out to matter more than either of the two above. Section VII reports it in full, but the short version: the same gate that defers on 80.09% of Fashion-MNIST images defers on only 8.80% of FGSM-perturbed ones. Distributional awareness and adversarial awareness are not the same skill, and this gate has only really demonstrated the first. It’s also worth noting that ε=0.25 is not a cherry-picked weak attack: Essay #2’s minimum-epsilon search on this same model found a median flip-epsilon of 0.24 across successfully-attacked images, so ε=0.25 sits right at the typical strength needed to fool this baseline at all — the low deferral rate is not an artifact of testing with too gentle a perturbation.</p><p><strong>VII. Putting It All Together: The Humble Model — Awareness, Not Yet Complete</strong></p><p>We now have three components:</p><p><strong>1. Uncertainty Quantification</strong> (MC Dropout or Deep Ensemble)</p><p><strong>2. OOD Detection</strong> (distance in feature space)</p><p><strong>3. Decision Gate </strong>(threshold-based deferral)</p><p>The humble model is not a single method. It is meant to be a system that integrates these components — an awareness architecture: epistemic measurement (the ensemble) telling the gate when the model itself is unsure, distributional detection (feature distance) telling it when the input itself is unfamiliar, and a policy layer (the gate) turning either signal into a decision to predict or defer, rather than treating confidence as a fixed, unquestioned output.</p><p><strong>The Flow — As Designed</strong></p><p>1. Input arrives.</p><p>2. OOD detector checks if the input is strange. If yes → defer.</p><p>3. Uncertainty estimator runs (MC Dropout or ensemble) to produce a distribution.</p><p>4. Decision gate checks uncertainty and confidence. If either exceeds threshold → defer.</p><p>5. If not deferred → predict with confidence estimate.</p><p><strong>The Flow — As Actually Implemented, and What It Took to Fuse It Correctly</strong></p><p>The notebook builds and demonstrates all three components, but the full evaluation in Part I only exercises step 3 and step 4 by default — the OOD distance score from Section V is computed separately from decision_gate unless explicitly fused in. What the unfused rows of Table VI measure is how far ensemble disagreement alone can carry an awareness system on natural distribution shift: quite far (97.48% coverage at 0.15% risk on clean data, 80.09% deferral on OOD data) but not all the way (94.32% risk on the fraction of OOD inputs that still slip through).</p><p>Getting the fused version right took three attempts, and each failure was informative in its own way. The first fusion attempt, at a threshold derived from a global Mahalanobis distance that turned out not to separate the two distributions at all (Section V), deferred on 100% of both clean and OOD inputs — not a tuning problem, but a genuinely non-separating metric being asked to draw a line that didn’t exist. The second attempt, after switching to a class-conditional Mahalanobis distance that did separate the distributions with a large effect size (Cohen’s d = 0.99), still deferred on 100% of both — this time because the gate was scoring one model’s features against Gaussians fit on a different model’s feature space, a mismatch invisible in the code until the symptom (universal deferral, again) forced a closer look. Only the third attempt, scoring consistently against the same model the metric was fit on, produced the numbers in Table VI’s fused rows.</p><p>The lesson that generalizes past this one experiment: an “any of these signals trips the alarm” gate is only as trustworthy as its least-validated input, and a signal can fail for two entirely different reasons — being genuinely uninformative, or being informative but wired in wrong — that look identical from the outside (100% deferral, both times) and require different fixes. Measuring at the population level caught the first kind of failure. It took a suspicious result and a code review to catch the second.</p><p>What the working fused gate actually buys, once both bugs were fixed, is reported in Section VI: a real reduction in absolute OOD failures, bought at a real cost to clean-data coverage, without making the gate any more discerning about which OOD inputs are safe to trust. That is a more honest resolution than either “fusion breaks everything” or “fusion solves everything,” and it’s the one the data actually supports.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*roxibtSi90rsYSvYcz41eg.png" /><figcaption>The notebook output</figcaption></figure><p><strong>Adversarial Inputs — Still the Open Wound</strong></p><p>The original plan for this notebook included evaluating the humble model on adversarial MNIST, generated the same way as in Essays #2 and #3. That run is in the notebook (Part K, FGSM at ε=0.25, unfused gate), and it remains the most important number in this essay — nothing about the OOD-fusion resolution above changes it, because fusion was never tested against the adversarial condition:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*qhq8Rx77J0D6aM51dOOEKg.png" /></figure><p>The gate defers on natural distribution shift nine times more often than it defers on adversarial perturbation of the same underlying digits. This is not a bug in the gate — it is exactly what the design predicts, once stated plainly: ensemble disagreement measures how unfamiliar an input looks to independently-trained models, and a well-constructed FGSM perturbation is deliberately small enough, and aligned enough with the model’s own gradient, to leave that sense of familiarity almost untouched. Essay #2’s own minimum-epsilon search found a median flip-epsilon of 0.24 across successful attacks, so ε=0.25 was a representative attack strength, not an artificially gentle one chosen to flatter the result. The finding that matters is the deferral gap, not the risk number: <strong>this awareness architecture, as built, is watching for the wrong kind of strangeness.</strong> It notices a shirt, eventually, after three attempts at getting the detector right. It does not reliably notice a 9 that has been nudged toward an 8, and nothing in this essay has yet tested whether the class-conditional Mahalanobis distance that rescued the OOD story would do any better against adversarial inputs than the ensemble variance already does. That is the next open question, not a settled one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w-rqh7o5upSajvoqwQywGg.png" /><figcaption>The notebook output</figcaption></figure><p><strong>VIII. What We Now Know — and What We Still Do Not</strong></p><p><strong>• Answered, and not the comfortable answer</strong>: ensemble-disagreement-based uncertainty does <em>not</em> reliably distinguish adversarial examples the way it distinguishes natural distribution shift. Deferral on FGSM-perturbed inputs (8.80%) is roughly a ninth of deferral on Fashion-MNIST (80.09%), even though both are, in a loose sense, “inputs the model wasn’t trained on.” Awareness of unfamiliarity and awareness of adversarial manipulation are different competencies, and this essay’s gate has only demonstrated the first.</p><p><strong>• Answered, finally, with a real number — and it’s neither the win nor the failure it looked like along the way:</strong> fusing OOD detection into the decision gate works, once the detector is class-conditional and scored against the right model’s features, but “works” means something specific and limited. On Fashion-MNIST, fusion cuts absolute silent failures by roughly 61% (about 1,878 wrong predictions down to about 724, out of 10,000 images) by predicting on far fewer OOD inputs overall — but it does this without getting any better at telling<em> which</em> OOD inputs are safe (risk-among-predictions moves from 94.32% to 95.01%, essentially unchanged). It buys that reduction by deferring on clean MNIST roughly five times more often too, cutting usable coverage from 97.48% to 87.04%. Two earlier attempts at this same fusion returned 100% deferral on everything — once because the underlying metric didn’t separate the distributions at all, once because the code scored the wrong model’s features against it. Both looked identical from the outside and required different fixes.</p><p><strong>• Corroborating detail:</strong> Essay #2’s own minimum-epsilon search found a median flip-epsilon of 0.24 across successful attacks (out of 500 images, only 22 flipped within ε≤0.40 at all). The ε=0.25 used for this essay’s FGSM test sits almost exactly on that median — this was a representative attack strength for this model, not an unusually weak one chosen to make the gate look better than it is.</p><p><strong>• Still open:</strong> whether the class-conditional Mahalanobis distance that finally separated clean MNIST from Fashion-MNIST also separates clean from adversarial inputs — it was never tested against the FGSM condition. If it does, fusion might close some of the adversarial deferral gap above in a way ensemble variance alone cannot; if it doesn’t, that would be a second piece of evidence that adversarial perturbations are specifically built to evade exactly this kind of feature-space detection, not just ensemble disagreement.</p><p><strong>• Still open:</strong> whether a stronger or more varied adversarial attack budget (this test used a single ε=0.25 FGSM pass against an undefended baseline) changes the 8.80% deferral figure, and whether an ensemble of <em>defensively trained </em>models (PGD training, from Essay #3) would show more disagreement on adversarial inputs than this undefended one does.</p><p>• How to set thresholds without a labeled validation set of uncertain inputs.</p><p>• Whether the decision gate works in high-stakes, low-latency environments where deferral is not possible.</p><p>. Whether the humble model is truly humble, or simply more sophisticated in its silence — on natural data, it earns that description; on adversarial data, not yet.</p><p><strong>IX. Invitation</strong></p><p>You have seen the silence. You have built the walls. You have crossed the bridge.</p><p>Now you have the first floor of a voice.</p><p>Not a wall. A boat.</p><p>Not resistance. Awareness.</p><p>Not certainty. Honesty.</p><p>The humble model is within reach — one floor of it, built and measured here; the rest, named and left standing open for what comes next.</p><p><em>The boat is built. The voice is forming. But it does not yet speak when it matters most — against adversarial inputs. That is the next shore.</em></p><p><strong><em>Come. Walk with me into deeper fog.</em></strong></p><p><strong>X. References</strong></p><p>• Goodfellow, I. J., Shlens, J., &amp; Szegedy, C. (2014). <em>Explaining and harnessing adversarial examples. arXiv:1412.6572.</em></p><p>• Lakshminarayanan, B., Pritzel, A., &amp; Blundell, C. (2017). <em>Simple and scalable predictive uncertainty estimation using deep ensembles. Advances in Neural Information Processing Systems (NeurIPS), 30.</em></p><p>• Lee, K., Lee, K., Lee, H., &amp; Shin, J. (2018). <em>A simple unified framework for detecting out-of-distribution samples and adversarial attacks. Advances in Neural Information Processing Systems (NeurIPS), 31.</em></p><p>• Gal, Y., &amp; Ghahramani, Z. (2016). <em>Dropout as a Bayesian approximation: Representing model uncertainty in deep learning. International Conference on Machine Learning (ICML), 1050–1059.</em></p><p>• Szegedy, C., Zaremba, W., Sutskever, I., Bruna, J., Erhan, D., Goodfellow, I., &amp; Fergus, R. (2013). <em>Intriguing properties of neural networks. arXiv:1312.6199.</em></p><p>• Madry, A., Makelov, A., Schmidt, L., Tsipras, D., &amp; Vladu, A. (2017). <em>Towards deep learning models resistant to adversarial attacks. arXiv:1706.06083.</em></p><p>• Papernot, N., McDaniel, P., Wu, X., Jha, S., &amp; Swami, A. (2016). <em>Distillation as a defense to adversarial perturbations against deep neural networks. IEEE Symposium on Security and Privacy (S&amp;P), 582–597.</em></p><p>• Carlini, N., &amp; Wagner, D. (2016). <em>Defensive distillation is not robust to adversarial examples. arXiv:1607.04311.</em></p><p>• Athalye, A., Carlini, N., &amp; Wagner, D. (2018). <em>Obfuscated gradients give a false sense of security. International Conference on Machine Learning (ICML), 274–283.</em></p><p>• Tsipras, D., Santurkar, S., Engstrom, L., Turner, A., &amp; Madry, A. (2018). <em>Robustness may be at odds with accuracy. arXiv:1805.12152.</em></p><p>• Zhang, H., Yu, Y., Jiao, J., Xing, E., El Ghaoui, L., &amp; Jordan, M. (2019). <em>Theoretically principled trade-off between robustness and accuracy. International Conference on Machine Learning (ICML), 7472–7482.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1a9faae389c0" width="1" height="1" alt=""><hr><p><a href="https://pub.towardsai.net/learning-to-say-i-dont-know-the-first-floor-of-awareness-1a9faae389c0">Learning to Say “I Don’t Know”: The First Floor of Awareness</a> was originally published in <a href="https://pub.towardsai.net/">Towards AI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Bridge: From Resistance to Awareness]]></title>
            <link>https://medium.com/@maedeh.torkian/the-bridge-from-resistance-to-awareness-58ea4156ad3f?source=rss-380dc4dff114------2</link>
            <guid isPermaLink="false">https://medium.com/p/58ea4156ad3f</guid>
            <category><![CDATA[defense]]></category>
            <category><![CDATA[robustness]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[awareness]]></category>
            <category><![CDATA[adversarial-attack]]></category>
            <dc:creator><![CDATA[Maedeh Torkian]]></dc:creator>
            <pubDate>Mon, 29 Jun 2026 12:45:49 GMT</pubDate>
            <atom:updated>2026-06-29T12:45:49.936Z</atom:updated>
            <content:encoded><![CDATA[<h4>Why Defenses Alone Will Never Be Enough</h4><p>The bridge essay between Essay #3 and Essay #4 — Humble Model Series</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R-ZL1_92EK9gUiZ_YUN3hQ.png" /><figcaption>AI created- By Author</figcaption></figure><p><strong>I. The Pattern We Have Seen</strong></p><p>We have built walls. We have watched them break.</p><p>In Essay #2, we saw the silence: a model confident near 1.0000 on inputs it could not distinguish — the robust majority and the fragile minority alike.</p><p>Essay #2 link:</p><p><a href="https://pub.towardsai.net/the-attack-landscape-why-silence-is-the-vulnerability-f27dabfccb9b">The Attack Landscape: Why Silence Is the Vulnerability</a></p><p>In Essay #3, we built three defenses: FGSM training, PGD training, and defensive distillation. Each raised the bar. Each eventually showed cracks — in our own numbers, and in the literature that followed each defense into production.</p><p>Essay #3 link:</p><p><a href="https://pub.towardsai.net/walls-shields-and-illusions-defenses-and-their-limits-cd67b6ec4f92">Walls, Shields, and Illusions: Defenses and Their Limits</a></p><p>And in that pattern, something became clear: the game of defense has no end — because it is the wrong game.</p><p><strong>II. The Hidden Assumption</strong></p><p>Throughout the adversarial robustness literature, there is an unspoken assumption: that the goal is to make the model <strong><em>unbreakable</em></strong>.</p><p>• <strong>Train on adversarial examples</strong> → the model becomes more resistant.</p><p>• <strong>Smooth the decision boundary</strong> → the attacker has less gradient information.</p><p>• <strong>Hide the gradients</strong> → the attacker cannot compute a perturbation.</p><p>Each defense operates under the same logic:<em> </em><strong><em>if we build a high enough wall, the attacker will give up.</em></strong></p><p>But the attacker does not give up. The attacker adapts — the wall crumbles. And the cycle repeats.</p><p>This is not a failure of individual researchers. It is the structure of an adversarial game. The defender reacts. The attacker observes. The attacker probes the new wall, finds the seam, and adapts again. There is no final move — because the game itself has no endpoint built into it. A game without an endpoint is not a game you can win. It is a game you can only play indefinitely, paying a cost each time the attacker finds a new angle and the defender scrambles to patch it.</p><p>The question is not: <strong><em>how do we win?</em></strong></p><p>The question is: <strong><em>why are we still playing?</em></strong></p><p><strong>III. A Different Question</strong></p><p>What if the goal was never to be unbreakable?</p><p>What if the goal was to be <strong><em>undeluded</em></strong>?</p><p>An undeluded model does not need to be invincible. It needs to know its limits — and to say so. When the input is out of distribution. When the confidence is fragile. When the decision sits closer to the boundary than the model’s output suggests. These are knowable things, approximately, in ways that current defenses do not attempt to surface. A PGD-trained model resists a wider range of attacks than an undefended one — but it reports its predictions with the same unqualified certainty regardless of how close to the decision boundary each input sits.</p><p>That certainty is not confidence earned. It is certainly assumed.</p><p>This is not a <em>wall</em>. It is a <em>boat</em>.</p><p>A wall is built to keep the threat out. It says nothing about what is happening on its own side. A boat knows it might sink. It does not pretend to be a <em>fortress</em>. But it has a compass. It has a warning system. It can tell you when the water is rising, when the hull is strained, and when it is time to turn back — before the water reaches the deck, not after.</p><p>The humble model is that boat.</p><p><strong>IV. The Flicker That Did Not Become a Voice</strong></p><p>In Essay #3, we tested this distinction directly. We ran the 18 images that had fooled the undefended baseline through the PGD-trained model. Robustness training did real work: 22 images originally flipped in Essay #2. When we regenerated the search to recover their indices, 18 were found; of those, 17 are now correctly classified; But one — a digit 9, predicted as an 8 — was still wrong. Its confidence was 0.6187.</p><p>Essay #2 link:</p><p><a href="https://pub.towardsai.net/the-attack-landscape-why-silence-is-the-vulnerability-f27dabfccb9b">The Attack Landscape: Why Silence Is the Vulnerability</a></p><p>Essay #3 link:</p><p><a href="https://pub.towardsai.net/walls-shields-and-illusions-defenses-and-their-limits-cd67b6ec4f92">Walls, Shields, and Illusions: Defenses and Their Limits</a></p><p>That number is lower than the model’s usual near-certainty. Compared to the 0.9769 average confidence on the 17 images it fixed, 0.6187 looks like hesitation — a <strong><em>flicker</em></strong>.</p><p>But a flicker is not a warning. A number that dropped from 0.9769 to 0.6187 is still above any threshold a practitioner would realistically set to catch errors. A system using a 0.5 cutoff would accept this prediction without question. Even a 0.7 cutoff would accept it. In practice, most systems use no cutoff at all. The model did not <strong><em>say I am uncertain</em></strong>. It said 8 — with 62% confidence, in a ten-class problem where chance is 10%. That is not uncertainty expressed. That is certainly understated.</p><p>The distinction matters. A flicker that stays inside the model — that appears in a softmax output but never triggers a flag, never passes through a gate, never reaches the human who might catch it — is not awareness. It is the last evidence of a failure that was never reported.</p><p>The bridge from resistance to awareness is the bridge from <strong><em>flicker </em></strong>to <strong><em>voice </em></strong>— from a model that hesitates silently to one that says, clearly and without shame:<em> </em><strong><em>I am not sure. I need help.</em></strong></p><p><strong>V. What Awareness Requires — and What Essay #4 Will Build</strong></p><p>The bridge is not the destination. It is the crossing. But before we cross, it is worth being precise about what we are crossing toward — because “awareness” is easy to invoke and harder to build.</p><p>Awareness, in the technical sense this series is working toward, has two parts that must both be present to matter.</p><p>The first is <strong><em>calibration</em></strong>: the model’s confidence scores must correspond to actual accuracy rates. A model that reports 0.62 confidence should be right roughly 62% of the time on similar inputs — not 99% of the time (overconfident) and not 20% of the time (erratic). Without calibration, a lower confidence score is informative only by coincidence.</p><p>The second is a <strong><em>gate</em></strong>: some mechanism that translates a calibrated uncertainty estimate into an action. A confidence score that drops to 0.62 and then disappears into a log file has not made the model humble — it has made the model slightly less wrong in a way no one will notice. The gate is what converts a number into a decision: flag this input, defer this prediction, ask for a second opinion. Without a gate, calibration is legible but inert.</p><p>In Essay #4, we will build both. We will explore Monte Carlo Dropout and Deep Ensembles as practical tools for estimating uncertainty rather than reading off a softmax score. We will look at Out-of-Distribution detection — recognizing when an input is unlike anything the model has seen, before predicting it at all. And we will implement a decision gate: a simple, auditable rule that says<em> </em><strong><em>if uncertainty is above this threshold, do not predict — ask for help.</em></strong></p><p>These are technical tools. But they serve a new purpose. Not to make the model unbreakable, but to make it <strong><em>honest </em></strong>— to the system it operates in, and to the humans who depend on it.</p><p>The <em>boat </em>is only useful if it has a working alarm system. <em>Calibration </em>is the compass; the <em>gate </em>is the alarm.</p><p><strong>VI. Invitation</strong></p><p>You have seen the walls. You have watched them break.</p><p>You have seen a model hesitate — briefly, silently — on the one input it could not fix. You have seen that hesitation go unreported.</p><p>Now consider what it would mean for it to be reported. Not as a malfunction. Not as a failure. But as the ordinary, expected behavior of a model that knows its limits and says so — before the water reaches the deck, not after.</p><p>Not resistance. Awareness. Not a fortress. A boat. Not certainty. Honesty.</p><p>The bridge is behind you. Essay #4 awaits.</p><p><em>Come. Walk with me into uncertainty.</em></p><p>Essay #1 link:</p><p><a href="https://medium.com/@maedeh.torkian/the-fog-of-certainty-on-deep-learnings-secret-vice-ed73d6ac3242">The Fog of Certainty: on Deep Learning’s Secret Vice</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=58ea4156ad3f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>