A cheap, bounded-state coding agent research program on tight compute
(2× RTX 5090): the moat is COST (O(1)/constant-memory decode) and
ADAPTIVITY, not benchmark rank. Engineering details and the resolved
current state live in AGENTS.md; framing in
NORTH_STAR_2026_06_30.md and
THESIS.md.
DECODE_COST_BENCH.md,
SCOREBOARD.mdPAPER_LATENT_EXECUTION_DRAFT.md,
program log EXEC_TRACE_LATENT_PLAN.mdIDEAS_2026_07_13.md (Tier-1
kill-tests log)STRATEGY_2026_06_28.mdIDEAS_2026_07_13.md (attach registrations)PAPER_STATE_COMPOSITION_DRAFT.md;
program logs STATE_CARTRIDGES_PLAN_2026_07_19.md,
LONGCTX_PLAN_2026_07_19.mdMETA_TTT_PLAN_2026_07_13.mdAGENTS_HISTORY.mdFull chronological arc and superseded claims:
AGENTS_HISTORY.md ·
SESSION_FINDINGS.md
gated_deltanet is broken on sm_120; plain deltanet works.)cu_seqlens
from per-position doc_ids), and a day-1 co-trained stack that trains
every mechanism above together from the first step (latest: the v17
all-features run) with per-feature usefulness tracking (see below).train_rl_grader.py)
— GRPO with a dense code_grader reward. The post-pretrain capability lever.production_lean_soup3.pt, HumanEval-solution CE
0.6614 (0.047 from the SmolLM2-360M softmax donor, at O(1) decode);
production_lean_longctx.pt is the agent-preferred variant (75% less
long-context harm, best natural-code depdist). Historical HumanEval
pass@1 on the old 287M lineage clustered ~13–15/164 with SFT ≈ RL —
greedy HumanEval-164 is a noisy dev signal at this scale; CE-based
metrics (HE-solution CE + dep-distance-stratified CE) are the standing
dev signals. See STRATEGY_2026_06_28.md, AGENTS.md.AGENTS.md.Adding a module is never enough — it has to be conditioned so the optimizer actually uses it, and probed so we can prove it contributes. The working designs:
ctx_addr_aux attention loss), paired with a copy/pointer readout that
copies the addressed source span into the logits — the additive read residual
is frozen off, so recall flows entirely through the copy head. Reads are
always-on, on the emit path at recall answer-spans (the first-occurrence
mask — recall must be supervised where recurrence fails, not at a restated
answer), not gated behind the rarely-firing think token. Co-trained into
pretrain this is load-bearing leak-free: first-occurrence const recall
0.03 → 0.98 at 1 B tokens; deployed-gate syn64 +0.76 / syn128 +0.53
(strengthening 500 M → 1 B). Reliable on identity/symbol recall (the bulk of
code recall); fully disjoint semantic recall is the next step.logp(true), train toward "think iff it helps"; latent rollouts apply
lm_head only at the think slot via skip_lm_head to stay cheap). That gate
teacher is off in the current day-1 run — it destabilizes a cold trunk —
so the gate currently learns from the LM/entropy losses while latent reasoning
carries the computation.A single sparse late-to-early FiLM connection in a DeltaNet stack gives a robust ~3–5 % PPL lift that survives a 3.3× param scale-up and an optimizer change. One late-layer output (lagged 1 token) modulates an early layer via FiLM with one learnable scalar α (+0.3 % params).
| Setup | DN baseline | + Sparse FiLM | Δ |
|---|---|---|---|
| 217 M / AdamW / 5 K | 51.00 | 49.40 (2,28) | −3.1 % |
| 360 M / Muon / 15 K | 22.79 | 21.57 (2,28) | −5.4 % |
| 708 M / Muon / 15 K | 35.38 | 34.26 (2,34) | −3.2 % |
3-seed reproducibility at 217 M: 49.40 ± 0.31 (σ < 1 %). K=3 self-feeding closes the train/inference gap → −1.5 % lift at 1× decode cost, with RNN inference state 74× smaller than a matched Transformer's KV cache.
Mechanism: the lift comes from a negative-α subtractive basin reachable iff (i) modulation is multiplicative (FiLM-form, not Q-K-V additive) and (ii) cross-source aggregation is non-softmax (sum or sigmoid; softmax dilutes by 1/K). 20+ controlled ablations; either condition failing breaks the basin.
Honest framing: cross-architecture (vs Transformer) the comparison is scale/optimizer-dependent — Transformer wins at 360 M/Muon. What's robust is the lift within the linear-RNN family. The top-down-feedback idea isn't new (GF-RNN 2015, BRIMs 2020); the contribution is the minimal-form demonstration + mechanism in a modern linear-RNN coding LM.
# Python (uv + cu132 nightly torch + local flash-linear-attention fork)
uv venv .venv && source .venv/bin/activate
uv pip install torch --index-url https://download.pytorch.org/whl/nightly/cu132
uv pip install numpy
uv pip install -e /home/knielsen/ml/flash-linear-attention # Blackwell fixes
export PYTHONPATH=$PYTHONPATH:.
# Lean library (StateDep/) — requires elan + lake
cd StateDep && source $HOME/.elan/env && lake exe cache get && lake build
# DeltaNet baseline vs Sparse-(2,28) FiLM (codeparrot, T=512, batch=8, lr=3e-4)
python experiments/train_lm.py --arch deltanet --feedback none \
--steps 5000 --d_model 576 --n_heads 9 --d_head 64 --n_layers 30
python experiments/train_lm.py --arch deltanet --feedback film \
--feedback_pairs "2,28" --steps 5000 --d_model 576 --n_heads 9 \
--d_head 64 --n_layers 30
414 commits
Python
93.9%
Shell
4.6%
Lean
1.5%
A cheap, bounded-state coding agent research program on tight compute
(2× RTX 5090): the moat is COST (O(1)/constant-memory decode) and
ADAPTIVITY, not benchmark rank. Engineering details and the resolved
current state live in AGENTS.md; framing in
NORTH_STAR_2026_06_30.md and
THESIS.md.
DECODE_COST_BENCH.md,
SCOREBOARD.mdPAPER_LATENT_EXECUTION_DRAFT.md,
program log EXEC_TRACE_LATENT_PLAN.mdIDEAS_2026_07_13.md (Tier-1
kill-tests log)STRATEGY_2026_06_28.mdIDEAS_2026_07_13.md (attach registrations)PAPER_STATE_COMPOSITION_DRAFT.md;
program logs STATE_CARTRIDGES_PLAN_2026_07_19.md,
LONGCTX_PLAN_2026_07_19.mdMETA_TTT_PLAN_2026_07_13.mdAGENTS_HISTORY.mdFull chronological arc and superseded claims:
AGENTS_HISTORY.md ·
SESSION_FINDINGS.md
gated_deltanet is broken on sm_120; plain deltanet works.)cu_seqlens
from per-position doc_ids), and a day-1 co-trained stack that trains
every mechanism above together from the first step (latest: the v17
all-features run) with per-feature usefulness tracking (see below).train_rl_grader.py)
— GRPO with a dense code_grader reward. The post-pretrain capability lever.production_lean_soup3.pt, HumanEval-solution CE
0.6614 (0.047 from the SmolLM2-360M softmax donor, at O(1) decode);
production_lean_longctx.pt is the agent-preferred variant (75% less
long-context harm, best natural-code depdist). Historical HumanEval
pass@1 on the old 287M lineage clustered ~13–15/164 with SFT ≈ RL —
greedy HumanEval-164 is a noisy dev signal at this scale; CE-based
metrics (HE-solution CE + dep-distance-stratified CE) are the standing
dev signals. See STRATEGY_2026_06_28.md, AGENTS.md.AGENTS.md.Adding a module is never enough — it has to be conditioned so the optimizer actually uses it, and probed so we can prove it contributes. The working designs:
ctx_addr_aux attention loss), paired with a copy/pointer readout that
copies the addressed source span into the logits — the additive read residual
is frozen off, so recall flows entirely through the copy head. Reads are
always-on, on the emit path at recall answer-spans (the first-occurrence
mask — recall must be supervised where recurrence fails, not at a restated
answer), not gated behind the rarely-firing think token. Co-trained into
pretrain this is load-bearing leak-free: first-occurrence const recall
0.03 → 0.98 at 1 B tokens; deployed-gate syn64 +0.76 / syn128 +0.53
(strengthening 500 M → 1 B). Reliable on identity/symbol recall (the bulk of
code recall); fully disjoint semantic recall is the next step.logp(true), train toward "think iff it helps"; latent rollouts apply
lm_head only at the think slot via skip_lm_head to stay cheap). That gate
teacher is off in the current day-1 run — it destabilizes a cold trunk —
so the gate currently learns from the LM/entropy losses while latent reasoning
carries the computation.A single sparse late-to-early FiLM connection in a DeltaNet stack gives a robust ~3–5 % PPL lift that survives a 3.3× param scale-up and an optimizer change. One late-layer output (lagged 1 token) modulates an early layer via FiLM with one learnable scalar α (+0.3 % params).
| Setup | DN baseline | + Sparse FiLM | Δ |
|---|---|---|---|
| 217 M / AdamW / 5 K | 51.00 | 49.40 (2,28) | −3.1 % |
| 360 M / Muon / 15 K | 22.79 | 21.57 (2,28) | −5.4 % |
| 708 M / Muon / 15 K | 35.38 | 34.26 (2,34) | −3.2 % |
3-seed reproducibility at 217 M: 49.40 ± 0.31 (σ < 1 %). K=3 self-feeding closes the train/inference gap → −1.5 % lift at 1× decode cost, with RNN inference state 74× smaller than a matched Transformer's KV cache.
Mechanism: the lift comes from a negative-α subtractive basin reachable iff (i) modulation is multiplicative (FiLM-form, not Q-K-V additive) and (ii) cross-source aggregation is non-softmax (sum or sigmoid; softmax dilutes by 1/K). 20+ controlled ablations; either condition failing breaks the basin.
Honest framing: cross-architecture (vs Transformer) the comparison is scale/optimizer-dependent — Transformer wins at 360 M/Muon. What's robust is the lift within the linear-RNN family. The top-down-feedback idea isn't new (GF-RNN 2015, BRIMs 2020); the contribution is the minimal-form demonstration + mechanism in a modern linear-RNN coding LM.
# Python (uv + cu132 nightly torch + local flash-linear-attention fork)
uv venv .venv && source .venv/bin/activate
uv pip install torch --index-url https://download.pytorch.org/whl/nightly/cu132
uv pip install numpy
uv pip install -e /home/knielsen/ml/flash-linear-attention # Blackwell fixes
export PYTHONPATH=$PYTHONPATH:.
# Lean library (StateDep/) — requires elan + lake
cd StateDep && source $HOME/.elan/env && lake exe cache get && lake build
# DeltaNet baseline vs Sparse-(2,28) FiLM (codeparrot, T=512, batch=8, lr=3e-4)
python experiments/train_lm.py --arch deltanet --feedback none \
--steps 5000 --d_model 576 --n_heads 9 --d_head 64 --n_layers 30
python experiments/train_lm.py --arch deltanet --feedback film \
--feedback_pairs "2,28" --steps 5000 --d_model 576 --n_heads 9 \
--d_head 64 --n_layers 30
414 commits
Python
93.9%
Shell
4.6%
Lean
1.5%