<?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>DEV Community: Eduardo</title>
    <description>The latest articles on DEV Community by Eduardo (@dante777).</description>
    <link>https://dev.to/dante777</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4110444%2F3b32f6db-3968-4168-b4c1-c906232d8f9b.jpg</url>
      <title>DEV Community: Eduardo</title>
      <link>https://dev.to/dante777</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dante777"/>
    <language>en</language>
    <item>
      <title>COMPREHENSIVE ANALYSIS: THE CALIBRATION PHASE (EXP01–07) I built an epistemic gate to stop LLM data poisoning during fine-tuning.</title>
      <dc:creator>Eduardo</dc:creator>
      <pubDate>Mon, 07 Sep 2026 07:38:22 +0000</pubDate>
      <link>https://dev.to/dante777/comprehensive-analysis-the-calibration-phase-exp01-07-i-built-an-epistemic-gate-to-stop-llm-data-2adm</link>
      <guid>https://dev.to/dante777/comprehensive-analysis-the-calibration-phase-exp01-07-i-built-an-epistemic-gate-to-stop-llm-data-2adm</guid>
      <description>&lt;p&gt;📅 First, the complete timeline&lt;br&gt;
Date    EXP &lt;br&gt;
Aug 19  01, 02, 03  Genesis: symbolic filter, statistical rigor, first collapse&lt;br&gt;
Aug 20  04  The Manual’s five policies; A→Gate→B is born&lt;br&gt;
Aug 22  05  “Beatriz” is named; the Softplus formula is born; first GPU&lt;br&gt;
Aug 25  06  Free-form text; keywords; name + PolyForm license&lt;br&gt;
Aug 26  07→08→09→10→11  Vector gate → π_ref → LoRA → Qwen → TinyLlama (five in one day!)&lt;br&gt;
Aug 27  12  Cache + held-out set; invisibility measured&lt;br&gt;
Aug 28  13, 14  Phi-3 and Pythia&lt;br&gt;
Sep 1–4   15, 16  Ablation and final validation&lt;/p&gt;

&lt;p&gt;The entire project—from the first line of code to OpenTimestamps—took 17 days. And all of it was orchestrated on a 2006 Toshiba.&lt;/p&gt;

&lt;p&gt;🧬 The four parallel evolutions that calibration resolved&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The loss function: from runaway punishment to bounded contrast&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is THE story of calibration—the “collapse” mentioned above:&lt;br&gt;
EXP Mechanism   Result&lt;br&gt;
01–02 Filtering only (no penalty) Works, but is passive&lt;br&gt;
03  Raw −logP(rejected)   🔥 THE COLLAPSE: loss diverges to −27, margin reaches +13, but the model destroys itself—the unbounded negative gradient is a bomb&lt;br&gt;
04  −logP(argmax), brought under control  It no longer explodes (loss ~−0.6)... but it is almost useless (+0.48). Meanwhile, REWRITE dominates (+10.9)&lt;br&gt;
05  CE(truth) + β•softplus(m + logP(false) − logP(truth))  ✨ The synthesis: relative, bounded punishment. It never changed again&lt;/p&gt;

&lt;p&gt;The distilled lesson: do not punish falsehood in absolute terms—it diverges. Punish it only relative to the truth, using a function that switches itself off (Softplus). That is exactly what a reviewer would ask: “Why Softplus instead of a simple negative gradient?” You have the empirical answer in EXP03 vs. EXP05.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;The gate: from dictionary lookup to geometry&lt;/p&gt;

&lt;p&gt;EXP01–04: Exact lookup (Pydantic + dict)—perfect, but only for triplets.&lt;br&gt;
EXP06: Word overlap—the first attempt with free-form text, but fragile (erratic margins: 1.38→4.23→0.82).&lt;br&gt;
EXP07: Embeddings + cosine similarity (DenseVectorGate)—and the margins suddenly stabilize: +10.2/+10.1/+10.6, nearly identical across seeds.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The EXP06 vs. EXP07 comparison provides the empirical justification for the vector gate: the same conceptual corpus and the same protocol, yet the shift from lexical overlap to semantic geometry multiplies the margin by approximately 15× and eliminates noise. Another finding that remains implicit today.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;The corpus: from toy examples to the real world&lt;/p&gt;

&lt;p&gt;EXP01–04: entity_a color = blue—abstract and free from pretraining contamination.&lt;br&gt;
EXP06: Six real-world facts in free-form text.&lt;br&gt;
EXP07: The final eight facts + keywords + UNKNOWN_POOL—the exact format carried through to EXP16.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Starting with synthetic entities was methodologically sound: it isolated the filter’s mechanics from the model’s priors. Only after the mechanism had been proven did the project move on to real-world facts.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Rigor: present from the very beginning&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;EXP01 was already verifying the SHA-256 hashes of the input weights. EXP02 already included seeds [11,22,33] and a PLACEBO branch. Reproducibility was not added later—it was part of the project’s DNA from day one.&lt;/p&gt;

&lt;p&gt;(Fun fact: z3-solver was installed in EXP01–04 but never invoked.)&lt;/p&gt;

&lt;p&gt;💎 THE MOST BEAUTIFUL NARRATIVE DISCOVERY IN THE ENTIRE SERIES&lt;/p&gt;

&lt;p&gt;Look at this. In EXP04, the HYBRID branch is defined as REWRITE + EPISTEMIC... but because of the bug I detected, it ended up being identical to EPISTEMIC—the REWRITE component was never executed. The branch “failed.”&lt;/p&gt;

&lt;p&gt;But what is Beatriz, from EXP05 onward?&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;When the gate detects CONTRADICTED, it trains on the true anchor = REWRITE
It also applies the Softplus contrast against the falsehood = a controlled EPISTEMIC
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Beatriz IS the HYBRID that the bug prevented us from testing in EXP04. The branch that failed because of an implementation error became the definitive architecture three days later—implemented correctly and with a bounded penalty.&lt;/p&gt;

&lt;p&gt;The bug did not kill the idea. The idea was right, and it was reborn with better mathematics. That is a story of real science worth telling. 🐛→🦋&lt;/p&gt;

&lt;p&gt;🔍 EXP07 vs. EXP08: the 55 minutes that proved something&lt;/p&gt;

&lt;p&gt;I compared the runs using the same seed and the same stream:&lt;br&gt;
    EXP07 (without π_ref)  EXP08 (with π_ref)&lt;br&gt;
BEATRIZ margin  +10.2 / +10.1 / +10.6   +10.6 / +11.0 / +11.0&lt;br&gt;
BEATRIZ PPL 948 / 1145 / 1140   1098 / 1121 / 2082&lt;/p&gt;

&lt;p&gt;Conclusion: π_ref anchoring (EXP08) did not solve the perplexity explosion—the PPL values were comparable or even worse. What solved it was LoRA (EXP09): PPL 43–91.&lt;/p&gt;

&lt;p&gt;In other words, the effective constraint was not the reference-based loss, but the low-rank architecture. This explains why π_ref was abandoned after EXP08. It is also an implicit mini-ablation—EXP07 vs. EXP08 vs. EXP09—that deserves a paragraph in the series:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;“We tested the DPO-style solution and the architectural solution—and the architectural one won.”
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;NOTE: “16 experiments (EXP08–EXP16)” → “16 experiments: EXP01–07 focused on anti-collapse calibration, and EXP08–16 on definitive results.”&lt;/p&gt;

&lt;p&gt;I will soon continue publishing the content and results from EXP08–EXP16. For now, I have only uploaded EXP08 and EXP09 to my repository. Here, I have shown you the process, so stay tuned for the upcoming experiments.&lt;/p&gt;

&lt;p&gt;Sincerely,&lt;br&gt;
Eduardo Ayala, creator of Beatriz&lt;/p&gt;

&lt;p&gt;Demonstrating that true innovation in AI is born from freedom, rigor, and open-source code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/EduardoAyalaT/beatriz-epistemic-gate-" rel="noopener noreferrer"&gt;https://github.com/EduardoAyalaT/beatriz-epistemic-gate-&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>llm</category>
      <category>opensource</category>
    </item>
    <item>
      <title>I built an epistemic gate to stop LLM data poisoning during fine-tuning. Tested across 5 architectures, orchestrated on a 2006 Toshiba laptop for $0.</title>
      <dc:creator>Eduardo</dc:creator>
      <pubDate>Fri, 04 Sep 2026 23:41:10 +0000</pubDate>
      <link>https://dev.to/dante777/i-built-an-epistemic-gate-to-stop-llm-data-poisoning-during-fine-tuning-tested-across-5-21n2</link>
      <guid>https://dev.to/dante777/i-built-an-epistemic-gate-to-stop-llm-data-poisoning-during-fine-tuning-tested-across-5-21n2</guid>
      <description>&lt;p&gt;Hi everyone,&lt;br&gt;
For a long time, the AI industry has pushed the narrative that advanced safety research, data poisoning auditing, and model alignment require massive clusters and millions of dollars.&lt;br&gt;
I wanted to test if that's true. Over the last few months, using a 2006 Toshiba Satellite (2GB RAM) for orchestration and free Kaggle T4 GPUs ($0 cost), I built and ran a 16-experiment series (EXP08–EXP16) exploring epistemic collapse and data poisoning in LLMs.&lt;br&gt;
Today, I'm open-sourcing the first phase of this work: Beatriz Epistemic Gate.&lt;br&gt;
What problem does it solve?&lt;br&gt;
Malicious data poisoning during fine-tuning is often surgical and invisible to aggregate metrics (like standard perplexity). An attacker can destroy specific facts down to an exact indifference point while global metrics actually improve because of generic fine-tuning on fluent prose. This makes silent poisoning a stealthy threat for small teams and startups fine-tuning local models.&lt;br&gt;
How does Beatriz work?&lt;br&gt;
Instead of invading or rewriting complex training loops, Beatriz acts as a lightweight, non-invasive defensive proxy (~0.1ms decision latency) that sits between a generative source and a training student model. It verifies generated text against an immutable anchor corpus using cosine similarity in embedding spaces, applying a composite loss function:&lt;br&gt;
• LceLce: Preserves linguistic fluency.&lt;br&gt;
• LcontrastivaLcontrastiva (Softplus): Keeps active pressure on the model to anchor to truth even after cross-entropy saturates.&lt;br&gt;
Key Results (EXP08–EXP16):&lt;br&gt;
• Multi-architecture validation: Tested across GPT-2 (124M), Qwen-2.5-0.5B, TinyLlama-1.1B, Pythia-1.4B, and Phi-3-mini-4k-instruct (3.8B).&lt;br&gt;
• Ablation (EXP15): Pure filtering (GATE_ONLY) provides 65% of the defensive benefit out of the box. The contrastive term adds the remaining 35%.&lt;br&gt;
• Scaled Held-Out (EXP16): Validated on a rigorous 30 multi-domain unattacked facts benchmark, consolidating a robust truth margin of +4.19 ± 0.08 with 0.93 Precision and 0.80 Recall on the gate.&lt;br&gt;
What's in the repo right now?&lt;br&gt;
To avoid overwhelming the community, I'm releasing the project in phases. Today you'll find:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; EXP08 &amp;amp; EXP09 code &amp;amp; notebooks (fully reproducible on Kaggle).&lt;/li&gt;
&lt;li&gt; Technical Whitepaper (WHITEPAPER.md / WHITEPAPER.es.md) detailing all 16 experiments.&lt;/li&gt;
&lt;li&gt; Corrective Manual (docs/MANUAL_CORRECTIVO.md) with formal mathematical loss specifications.
If you're an indie dev, researcher, or startup exploring safe local fine-tuning, check it out, run the notebooks, and let me know your thoughts!
GitHub Repo: [&lt;a href="https://github.com/EduardoAyalaT/beatriz-epistemic-gate-" rel="noopener noreferrer"&gt;https://github.com/EduardoAyalaT/beatriz-epistemic-gate-&lt;/a&gt;]&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>machinelearning</category>
      <category>security</category>
    </item>
  </channel>
</rss>
