Qwen3.5-0.8B-LumenGDN
Qwen/Qwen3.5-0.8B-Base with every attention layer replaced by a Gated
DeltaNet. No attention anywhere, so no KV cache anywhere — a fixed-size
associative memory and an O(1) update at every context length.
This model has not been healed.
The surgery is done; the training that follows it is not. The 18 layers the donor already trained as DeltaNets carry their own weights, but the 6 folded attention layers are transplants that have never taken a gradient step, and they lose rotary position in the fold. Expect degraded output. This is published as a starting point for that training and as a checkable record of the transplant — not as a model to deploy.
What was done
Qwen3.5-0.8B-Base is a 3:1 hybrid. Its layer_types reads lllA six times
over, so 18 of its 24 layers are already gated DeltaNets and only 6 are
attention. Folding those 6 makes the whole model recurrent.
The 18 transplant exactly — cos 1.000000000000 on the whole decoder layer,
worst relative error 9.2e-05 in fp32 across all eighteen. Two config dials
reconcile them with no weights harmed: beta_max=1.0, because Lumen computes
beta_max * sigmoid(b_proj(x)) where Qwen computes a bare sigmoid and the
default of 2.0 would silently double every write strength, and norm_eps=1e-6.
Four conventions differ between the two libraries and three of them are silent:
a centred RMSNorm storing scale - 1, a 1/sqrt(d_k) query scale the output
norm does not absorb, and a per-head decay scale outside the softplus.
A fifth convention appears only above this size, where the donor ties each
q/k pair to several value heads. At 0.8B it does not: 16 key heads serve 16
value heads and nothing needs undoing. See
Qwen3.5-4B-LumenGDN
for the tied case and why the scan stays diagonal through it.
The 6 are folded rather than deleted. Attention's q_proj (its query half), its
gate half, k_proj/v_proj broadcast out of grouped-query attention, and
o_proj become a DeltaNet keeping attention's own head geometry — 8 heads at
256, not the donor DeltaNets' 16 at 128 — with causal-identity short
convolutions so the layer computes its transplanted projections exactly and
earns its convolution by training.
Attention has no norm before o_proj, so that projection was trained on a
particular input scale and a DeltaNet's RMS-normalised core is a different one.
The donor was run with hooks to see what its attention actually hands over —
rms 0.075 at layer 3 rising to 0.332 at layer 23 — and each folded layer is
calibrated against that. Matching it exactly is about twice too much. Because
scaling a folded layer's head_norm scales its whole residual write, and scale
0 is the hollow build, sweeping it asks directly whether the fold carries
signal before any training at all:
| write scale | val ppl | x donor |
|---|---|---|
| 0.00 (= attention deleted) | 106.97 | 4.52x |
| 0.25 | 81.26 | 3.44x |
| 0.50 | 80.12 | 3.39x |
| 1.00 (donor amplitude) | 129.22 | 5.47x |
| 1.25 | 208.46 | 8.82x |
An interior minimum is the answer: the delta rule read through attention's own
subspaces carries usable information at step zero. 0.5 is folded into
head_norm at build time, so a checkpoint means one thing.
The vision tower (100.6M) and the multi-token-prediction head (20.5M) are not
included. This is the text path only, and that amputation is logit-identical to
the donor's own text path at max |logit diff| = 0.000e+00.
| params | recurrent state (fp32) | |
|---|---|---|
Qwen/Qwen3.5-0.8B-Base, intact |
873.4M | grows with T |
| text path, amputated | 752.4M | grows with T |
| this model | 771.5M | 31.69 MiB, constant in T |
The parameter count goes up by 19.1M: attention's grouped key and value projections are broadcast from 2 heads to 8, so every state owns its own key and value rather than sharing four ways. Those duplicates are exact at initialisation.
What the fixed state is for
The donor was already carrying ~19.7 MiB of fixed state for its eighteen linear layers. The six attention layers were the only source of growth. Folding them does not add a fixed state — it removes the unbounded one.
this model: 31.69 MiB, flat in T
intact hybrid: 21.19 MiB at 64 tokens, 43.69 MiB at 1024,
growing 24.00 KiB per token — the six attention layers' KV,
extrapolated to Qwen's own 262,144 context: 6.00 GiB
crossover at ~822 tokens
Of the 31.69 MiB, 8.3M numbers are genuine associative memory.
What healing it looks like
Measured on a held-out slice of a Common Pile mixture, against the intact hybrid as reference. The last row is not in this repository — it is what 100M tokens of training bought, recorded here so the starting point has somewhere to be measured from.
| val loss | val ppl | x donor | |
|---|---|---|---|
| reference (intact hybrid) | 2.2217 | 9.22 | 1.00x |
| attention deleted, feed-forwards kept | 3.4998 | 33.11 | 3.59x |
| this model | 3.1544 | 23.44 | 2.54x |
| healed, 100M tokens | 2.2326 | 9.32 | 1.011x |
Weights are fp32 on purpose: error compounds with depth in a freshly collapsed stack, and bf16 is not safe here until roughly a thousand training steps in.
Loading it
This is not a transformers architecture; AutoModel will not load it. It
needs Lumen for the layer, and
modeling_qwen35_lumen.py in this repository for the assembly.
pip install lumeninstalls a different package. Thelumenon PyPI is a data-visualisation library by other authors. The one this needs is the architecture library below, which is not published to PyPI.
pip install torch safetensors huggingface_hub
pip install git+https://github.com/latticedynamics/lumen.git
from huggingface_hub import snapshot_download
import sys
path = snapshot_download("kennethgrace/Qwen3.5-0.8B-LumenGDN")
sys.path.insert(0, path)
from modeling_qwen35_lumen import load_creature
model, manifest = load_creature(path, device="cuda")
logits = model(input_ids) # parallel over the whole sequence
hidden, states = model.prefill(input_ids) # or stream it
logits, states = model.step(next_id, states) # O(1) per token, forever
The two paths agree: max |diff| = 1.8e-05 at the last position of a 32-token
sequence, prefilling 16 and stepping the rest.
qwen35.json carries the shape, the gate initialisation and the write-scale
calibration the build used, so the model rebuilds itself without reaching for
the donor's config. At a 248k vocabulary the readout, not the stack, is the
memory ceiling — the logits for one 4096-token window are 3.9 GiB in fp32 and
their gradient is another — so model.hidden(ids) is exposed separately for a
caller that wants to chunk the projection itself.
Credit
The weights are derivative of
Qwen/Qwen3.5-0.8B-Base by the
Qwen team, used and redistributed under Apache 2.0; the original LICENSE travels
with this repository. The gated delta rule is Yang et al. This is an independent
research artifact, not affiliated with or endorsed by Alibaba or the Qwen team.