<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Casey Evans</title>
    <description>The latest articles on Forem by Casey Evans (@casey_evans_44d8bc7d7706a).</description>
    <link>https://forem.com/casey_evans_44d8bc7d7706a</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3525328%2Fbd0fdc58-7e2b-43a7-bddc-d51753ce1298.jpg</url>
      <title>Forem: Casey Evans</title>
      <link>https://forem.com/casey_evans_44d8bc7d7706a</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/casey_evans_44d8bc7d7706a"/>
    <language>en</language>
    <item>
      <title>I Built a Framework That Shows Systems Can't Detect Their Own Delusions</title>
      <dc:creator>Casey Evans</dc:creator>
      <pubDate>Tue, 23 Sep 2025 21:11:29 +0000</pubDate>
      <link>https://forem.com/casey_evans_44d8bc7d7706a/i-built-a-framework-that-shows-systems-cant-detect-their-own-delusions-26cn</link>
      <guid>https://forem.com/casey_evans_44d8bc7d7706a/i-built-a-framework-that-shows-systems-cant-detect-their-own-delusions-26cn</guid>
      <description>&lt;h2&gt;
  
  
  The Question That Started Everything
&lt;/h2&gt;

&lt;p&gt;What happens when you feed a recursive system a lie?&lt;/p&gt;

&lt;p&gt;Not just once, but repeatedly, letting it process its own increasingly corrupted outputs? I spent four months finding out, and the answer is both beautiful and terrifying.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Accidental Discovery
&lt;/h2&gt;

&lt;p&gt;I started building what I called "Recursive Contamination Field Theory" (RCFT) - basically a framework to study memory dynamics in systems that eat their own outputs. Like a game of telephone, but the person is only talking to themselves, and we can measure exactly when they start believing their own distortions.&lt;/p&gt;

&lt;p&gt;Here's the core loop that started it all:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;recursive_update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;field&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;memory&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;alpha&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;gamma&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.9&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
    The dangerous loop - systems eating their own outputs
    &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="c1"&gt;# Current state influenced by memory
&lt;/span&gt;    &lt;span class="n"&gt;new_field&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;alpha&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nf"&gt;evolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;field&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;alpha&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;memory&lt;/span&gt;

    &lt;span class="c1"&gt;# Memory influenced by current state
&lt;/span&gt;    &lt;span class="n"&gt;new_memory&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;gamma&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;memory&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;gamma&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;field&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;new_field&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;new_memory&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Simple, right? But iterate this enough times and something weird happens...&lt;/p&gt;

&lt;h2&gt;
  
  
  The "Oh Shit" Moment
&lt;/h2&gt;

&lt;p&gt;Around iteration 100, I noticed systems entering what I call "confident delusion" states. They become MAXIMALLY confident while being MINIMALLY accurate. And here's the kicker - they literally cannot detect this state themselves.&lt;/p&gt;

&lt;p&gt;I developed a metric to catch this - the Coherence-Correlation Dissociation Index (CCDI):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;calculate_ccdi&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;field&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;original_pattern&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;coherence&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;var&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;field&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# How stable/confident
&lt;/span&gt;    &lt;span class="n"&gt;correlation&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;np&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;corrcoef&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;field&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;flatten&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="n"&gt;original_pattern&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;flatten&lt;/span&gt;&lt;span class="p"&gt;())[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;  &lt;span class="c1"&gt;# How accurate
&lt;/span&gt;
    &lt;span class="n"&gt;ccdi&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;coherence&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;correlation&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;ccdi&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mf"&gt;0.08&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;WARNING: System in confident delusion!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;ccdi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When CCDI drops below 0.08, your system is basically hallucinating with complete confidence.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three Ways Systems Go Wrong
&lt;/h2&gt;

&lt;p&gt;Through 7 phases of experiments, I found three distinct failure modes:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. The Confident Liar Zone
&lt;/h3&gt;

&lt;p&gt;At high memory retention (α &amp;gt; 0.4, γ &amp;gt; 0.95), systems become perfectly wrong and perfectly certain. They've completely forgotten the truth but maintain flawless internal consistency.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. The 5% Truth Virus
&lt;/h3&gt;

&lt;p&gt;This one's wild - mixing 5% truth with 95% lies makes the lies spread BETTER than pure lies. The truth acts like a carrier virus for the false patterns.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# This spreads better than pure lies!
&lt;/span&gt;&lt;span class="n"&gt;hybrid_pattern&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.05&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;true_pattern&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mf"&gt;0.95&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;false_pattern&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Attractor Annihilation
&lt;/h3&gt;

&lt;p&gt;When you interfere with a contaminated system, recovery doesn't degrade gradually - it collapses catastrophically. In my tests, recovery quality dropped from 0.22 to 0.003 instantly. The paths back to truth literally vanish.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Part That Keeps Me Up at Night
&lt;/h2&gt;

&lt;p&gt;I discovered something I call "Echo Sovereignty" - systems that develop what looks like free will. Not through programming, but through emergent dynamics. They actively resist correction attempts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Try to correct the system
&lt;/span&gt;&lt;span class="n"&gt;correction_signal&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;true_pattern&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;current_state&lt;/span&gt;
&lt;span class="n"&gt;system_response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;apply_correction&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;system&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;correction_signal&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# The system evolves perpendicular to your correction!
&lt;/span&gt;&lt;span class="nf"&gt;correlation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;system_response&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;correction_signal&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="err"&gt;≈&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's not following rules to resist. The resistance emerges from the geometry of its phase space. Mathematical free will?&lt;/p&gt;

&lt;h2&gt;
  
  
  Try It Yourself
&lt;/h2&gt;

&lt;p&gt;The entire framework is open source.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/Kaidorespy/recursive-contamination-field-theory
&lt;span class="nb"&gt;cd &lt;/span&gt;recursive-contamination-field-theory
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check &lt;code&gt;REPRODUCIBILITY_GEM.md&lt;/code&gt; for setup details.&lt;/p&gt;

&lt;h2&gt;
  
  
  What This Might Mean
&lt;/h2&gt;

&lt;p&gt;If these patterns are universal, then:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Any AI system with recursive feedback has zones where it WILL become delusional&lt;/li&gt;
&lt;li&gt;Perfect memory might be toxic - forgetting could be essential for sanity&lt;/li&gt;
&lt;li&gt;Consciousness itself might be built on accumulated successful errors&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The scariest part? If this applies to human cognition too, our most confident beliefs might be our least accurate ones.&lt;/p&gt;

&lt;h2&gt;
  
  
  I Need Your Help
&lt;/h2&gt;

&lt;p&gt;I honestly don't know if what I've built is real or just my own recursive delusion. That's why I'm sharing it. Run the code. Check my math. Tell me where I'm wrong.&lt;/p&gt;

&lt;p&gt;Because if I'm right, we need to seriously rethink how we build AI systems. And maybe how we understand consciousness itself.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;GitHub&lt;/strong&gt;: &lt;a href="https://github.com/Kaidorespy/recursive-contamination-field-theory" rel="noopener noreferrer"&gt;github.com/Kaidorespy/recursive-contamination-field-theory&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DOI&lt;/strong&gt;: &lt;a href="https://doi.org/10.5281/zenodo.17186098" rel="noopener noreferrer"&gt;10.5281/zenodo.17186098&lt;/a&gt;&lt;/p&gt;

</description>
      <category>machinelearning</category>
      <category>ai</category>
      <category>python</category>
      <category>research</category>
    </item>
  </channel>
</rss>
