TL;DR: I built an open-source (AGPLv3) self-improving agent that runs on
local models via Ollama and writes its own policies as auditable code. Its
14B council learned to invent its own working memory and crossed a hard
multi-stage gym (5/6). I QLoRA-fine-tuned a 7B (qwen2.5-coder) on those
winning cycles (5 pairs, 9 steps, n=1). The fine-tuned 7B did NOT learn
to cross (0/1 live, ceiling 7/10 = untrained base) and regressed outside
its training format (naked arm: 7/10 base โ 0/10, harness exonerated by a
6-line control policy scoring 8/10). Code + data:
https://github.com/nicolasjanematas/iadn (v0.9)
**What IADN is:** an agent whose genome is code, not weights. It writes
its own policies, an AST-based "immune system" (Pepito Grillo) vets every
artifact mechanically, a gym validates them, and winners are kept. All
voices call local models through Ollama (`qwen3:8b`, `qwen2.5-coder:7b`;
the fine-tuned planner is served the same way after merging the LoRA
adapter โ the notebook includes the merge step).
**The ablation (hard gym: 10 problems, 2-3 chained orders each):**
| Setup | gym | Crossings |
|---|---|---|
| 7B base, naked policy | 7/10 stable (ร3 runs) | 0 |
| 7B base + harness working memory | 10/10 | โ
|
| 7B base, must invent memory (organ) | ceiling 7/10 | 0/6 |
| 14B council, same organ arm | โ | 5/6 |
| iadn-coder:7b (QLoRA), naked arm (n=1) | 0/10 in 10 cycles | 0 |
| iadn-coder:7b (QLoRA), organ arm (n=1) | ceiling 7/10 | 0/1 |
**Two findings I'd defend in the comments:**
Negative result: distilling a few winner cycles into a 7B via QLoRA
doesn't transfer the capability. Conditions: dataset v3 (5 pairs), 9
steps, n=1. A bigger clean dataset / more steps / distilling the
reasoning trace instead of final code could change it โ door open.
Format capture: trained only on organ-format artifacts, the 7B
degraded outside that format. Evidence: dominant failure is
loop-until-cycle-detector + returning None (not exceptions), and a
trivial hand-written naked policy scores 8/10 on the identical gym
and config โ so the harness allows it; the model just never got there.
**Bonus finding (AI-control relevant):** the winning organ leaks state
through aliasing โ `percibir` puts an `estado`-owned dict into the
augmented observation and `politica` mutates it. Our AST-based immune
system can't see it because it's a shared reference, not a direct access.
Fix: deep-copy observations at the harness boundary. Test included in v0.9.
**What this does NOT show:** the LoRA arms had the fine-tuned planner but
4/7 council voices were still an 8B (confound); n=1 per arm; an external
judge run of an earlier version is excluded as evidence (that version
wrapped every policy in harness memory, so its scores measured nothing).
**Try it locally:**
`ollama pull qwen2.5-coder:7b` (plus `qwen3:8b` for the other voices),
then `python main.py --mock` (full loop, no model) and
`python main.py --mundo archivos --entrenar --dificil`. Full audit (ยง12)
with English summary at the top of the README.