Qwen3.5-0.8B-LumenGDN-Healed
kennethgrace/Qwen3.5-0.8B-LumenGDN — Qwen3.5 rebuilt in Lumen's shapes, its native linear-attention stack transplanted as Gated DeltaNets and its remaining attention layers folded into the same — trained back into coherence. The surgery is documented on that sibling; this repo is what happened after it.
24 layers — 18 the donor's own linear_attention blocks, transplanted
exactly, and 6 folded from full_attention — d_model=1024, 16 states of
width d_k=128 / d_v=128, 771,512,048 parameters in float32. Every
layer is a Gated DeltaNet. Unlike the SmolLM2 collapse the feed-forward is
kept — the donor's own GDN layers have one, so a folded layer keeps its own
rather than being folded into the mixer.
Where it got to
Step 77,976, validation loss 2.0679 — perplexity 7.908 — on a held-out slice of the same mixture it trained on.
| step | in run | val loss | val ppl | segment |
|---|---|---|---|---|
| 100 | 100 | 2.4406 | 11.48 | qwen35-heal-frozen |
| 1,525 | 1,525 | 2.2326 | 9.32 | qwen35-heal-frozen |
| 1,600 | 1,600 | 2.2815 | 9.79 | qwen35-heal-frozen-2 |
| 1,700 | 1,700 | 2.2814 | 9.79 | qwen35-heal-frozen-2 |
| 3,050 | 3,050 | 2.1913 | 8.95 | qwen35-heal-frozen-2 |
| 3,150 | 100 | 2.2570 | 9.55 | qwen35-heal-8192 |
| 3,350 | 300 | 2.3688 | 10.68 | qwen35-heal-8192 |
| 4,575 | 1,525 | 2.2341 | 9.34 | qwen35-heal-8192 |
| 4,650 | 1,600 | 2.2806 | 9.78 | qwen35-heal-8192-2 |
| 5,050 | 2,000 | 2.2538 | 9.52 | qwen35-heal-8192-2 |
| 6,100 | 3,050 | 2.2048 | 9.07 | qwen35-heal-8192-2 |
| 21,600 | 15,500 | 2.1934 | 8.97 | qwen35-heal-16k |
| 24,100 | 18,000 | 2.1849 | 8.89 | qwen35-heal-16k |
| 32,600 | 26,500 | 2.1597 | 8.67 | qwen35-heal-16k |
| 41,100 | 35,000 | 2.1404 | 8.50 | qwen35-heal-16k |
| 49,600 | 43,500 | 2.1172 | 8.31 | qwen35-heal-16k |
| 58,100 | 52,000 | 2.0980 | 8.15 | qwen35-heal-16k |
| 67,100 | 61,000 | 2.0828 | 8.03 | qwen35-heal-16k |
| 75,600 | 69,500 | 2.0728 | 7.95 | qwen35-heal-16k |
| 84,076 | 77,976 | 2.0679 | 7.91 | qwen35-heal-16k |
The first column counts steps across the whole lineage; the second is the
number the run itself used, which restarts at zero whenever a segment began
as a --branch. Landmarks only — 190 validation points were measured,
and all of them are in the record below. Weights are step-final.full.pt from
qwen35-heal-16k.
Lineage and dose
| segment | seq | tokens | cumulative | val (nats) |
|---|---|---|---|---|
qwen35-heal-frozen |
4096 | 100M | 100M | 2.2326 |
qwen35-heal-frozen-2 |
4096 | 100M | 200M | 2.1913 |
qwen35-heal-8192 |
8192 | 100M | 300M | 2.2341 |
qwen35-heal-8192-2 |
8192 | 100M | 400M | 2.2048 |
qwen35-heal-16k |
16384 | 5,110M | 5,510M | 2.0675 |
Validation at 8192 does not compare with validation at 4096. qwen35-heal-16k
trained at 16,384 but was validated at 8192 with its parent's exact settings
(batch 1, 20 batches), so the last three rows compare with each other. Every
segment read windows its ancestors had not.
The first four segments trained on longform1b, retokenised with Qwen3.5's
248,320-id vocabulary: AdamW, peak LR 3e-4 cosine to 3e-5, warmup 200.
qwen35-heal-16k trained on longform6b, which has longform1b's source
shares six times over, drawn from documents longform1b never contained. Its
held-out slice is byte-identical to longform1b's, so the validation numbers
still compare. It read 311,904 windows of 16,384 tokens. 36.4% of those lie
wholly inside one document; the rest are runs of adjacent documents from the
same source, so that the mixture is not skewed toward the old books that
dominate long documents. One cosine from 1.5e-4 down to 1.5e-5 over 77,976
steps of 65,536 tokens, warmup 300, grad clip 1.0 throughout.
Only the graft was trained. freeze_native=True froze all eighteen
transplanted linear_attention blocks, which the donor had already trained
and which transferred exactly; freeze_basis=True froze the embeddings,
every norm and the tied head. The gradient went to the six folded layers
and nothing else. Training the whole model instead makes validation rise.
These weights are fp32. qwen35-heal-16k held its frozen blocks in bf16
while it trained. What is published here is its trained graft laid over the
same fp32 frozen blocks the previous upload carried. Scored in fp32 with the
run's validation settings, it reads 2.0675; the run itself recorded 2.0679
with bf16 frozen blocks. That 0.0004 gap held at every checkpoint where both
were measured. The run's record for its first 15,000 steps was lost, so its
curve starts at step 15,500.
How healed
The donor and each checkpoint were scored in one process on identical
windows: eighty 512-token windows per domain, 40,960 tokens each. The donor
is creatures/qwen35-text, Qwen3.5-0.8B-Base with its multimodal organs
amputated, which is the thing this creature was actually cut from.
| domain | in the mixture? | donor | heal-8192-2-3050 |
this | × donor |
|---|---|---|---|---|---|
| ubuntu_irc | yes | 10.91 | 9.29 | 8.06 | 0.74 |
| pubmed | yes | 11.76 | 11.67 | 10.49 | 0.89 |
| stackexchange | yes | 10.59 | 12.24 | 10.83 | 1.02 |
| stackv2_edu (code) | yes | 4.47 | 5.25 | 4.74 | 1.06 |
| uk_hansard | no | 18.64 | 22.08 | 20.44 | 1.10 |
| wikiteam | no | 13.02 | 15.55 | 14.43 | 1.11 |
| arxiv_abstracts | dropped | 13.43 | 16.43 | 14.97 | 1.11 |
| github_archive | no | 14.81 | 18.88 | 16.88 | 1.14 |
| usgpo | no | 11.78 | 14.56 | 13.45 | 1.14 |
| uspto | no | 5.69 | 7.58 | 7.06 | 1.24 |
Perplexity. 0.920× donor in-mixture, 1.144× on the five unseen
registers, up from 1.036× and 1.243× at heal-8192-2-3050. All ten
registers improved, including the five the corpus never contained. From step
29,000 to the end those five gained as much as the mixture did. It beats its
donor on dialogue and pubmed, and is within 6% of it on Stack Exchange and
code. The SmolLM2 collapse, where every layer was folded, sits
at 2.02× / 3.11×. This one gets close because only six of its twenty-four
layers were ever folded; the other eighteen were already Gated DeltaNets and
transferred exactly.
What the tokens bought, and what they did not
- Register moved again. At 400M tokens it looked saturated: in-mixture went from 1.049× at 200M to 1.044× at 400M. Another 5.1B tokens took it to 0.920×.
- Context use stopped improving early. This was measured as loss at each position on single documents out to 16,384 tokens, with the donor scored on the same windows. Every gain that grows with distance arrived in the first 29,000 steps. After that, the model improved by the same amount at every position from the first hundred tokens to the last.
- Past 8K it still pays more than the donor. The extra loss it takes
beyond 8K, over what it takes at 2K–8K, narrowed from +0.032 nats on books
and +0.038 on code at
heal-8192-2-3050to +0.024 and +0.026. It did not close. On books it stays under the donor at every position out to 16K, with its lead shrinking as distance grows. On code it trails by ~0.14 nats out to 8K and ~0.17 beyond. - Reach was not re-measured. The last recall measurement is the 400M one: recall improved, but only inside ~4096 tokens (past it, +0.0021 ± 0.0042, not significant). A separate graft trained only on 16K windows did not reach further either. The reach is set by the state's capacity, not by the training window.
This is a rolling heal
main is always the most-healed state and moves when a segment finishes.
Each finished segment is frozen as a branch <run>-<step>:
heal-8192-2-3050 (400M tokens) and heal-16k-77976 (5.51B, this upload).
Pull a branch for a state that will not move, or main to continue from
wherever the heal has got to.
What is not here
The optimizer state, by policy. This repository holds states a run
begins from, never states a run passes through. Adam's moments exist to serve
--resume, which is a mid-run concept — so they are never uploaded. That is
not a size tradeoff made once; a checkpoint's moments are simply not part of
what makes it a starting point.
A pull is therefore always a --branch: fresh moments, step 0, fresh warmup
and cosine. Correct for a new corpus, a new sequence length or a new schedule,
and deliberately incapable of continuing the epoch that produced these
weights.
The record
The training curve and validation trace ship with the weights:
record/qwen35-heal-frozen/record/qwen35-heal-frozen-2/record/qwen35-heal-8192/record/qwen35-heal-8192-2/record/qwen35-heal-16k/
log.jsonl is per-step loss, learning rate, gradient norm and throughput;
validation.jsonl carries loss plus a fixed sample set at every validation
point, so what the model said at each step is recoverable, not just what it
scored. run.json is the full argument set and corpus composition.
Use
pip install torch safetensors huggingface_hub tokenizers
pip install git+https://github.com/latticedynamics/lumen.git@v0.8.1
import sys, torch
from huggingface_hub import snapshot_download
from tokenizers import Tokenizer
path = snapshot_download("kennethgrace/Qwen3.5-0.8B-LumenGDN-Healed") # revision="<branch>" for a state that will not move
sys.path.insert(0, path)
from modeling_qwen35_lumen import load_creature
device = "cuda" if torch.cuda.is_available() else "cpu"
model, manifest = load_creature(path, device=device)
model.eval()
tok = Tokenizer.from_file(f"{path}/tokenizer.json")
ids = tok.encode("The history of the Roman Empire").ids
with torch.no_grad():
for _ in range(40):
logits = model(torch.tensor([ids], device=device)) # (B, T) -> (B, T, vocab)
ids.append(logits[0, -1].argmax().item())
print(tok.decode(ids))
If the repository is private, run hf auth login first. The loop is greedy
and re-reads the whole sequence for every new token: a demonstration, fine for
a few dozen tokens and slow for long outputs.
@v0.8.1 pins the Lumen release this loader was verified against. An
unpinned install follows Lumen's main branch, and if Lumen's API changes the
loader breaks with nothing at install time to say why.
This is not a transformers architecture and will not load with
AutoModelForCausalLM. modeling_qwen35_lumen.py is standalone and depends only
on torch, safetensors and lumen; tokenizers is only for the prompt.