bug: RAT bidirectional window shrinks below 64 tokens on CIFAR after ~4k steps #14
Labels
No labels
NaNs
area/backup
area/data
area/diffusion
area/docs
area/dsh
area/eval
area/forgejo
area/host
area/infra
area/model
area/security
area/train
needs-operator
priority/later
priority/next
priority/now
type/bug
type/docs
type/experiment
type/feature
type/task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ml-lab/wink#14
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The 10k CIFAR RAT-32 run crashed at step 4000:
Cause: tardits
Rattention._scan_chunk_size()derives the chunk from the trainedmin |gamma|. At init it is 64 (the patch count), but after ~4k steps gamma decays enough that the chunk becomes 63 while the CIFAR sequence is still 64. The bidirectional path rejects T > chunk. The 3k smoke completed because it stopped before the crossover.Options, in order of preference:
initial_state; the backward pass needs the same).gamma_minfloor (e.g. 0.5) to the trainer's gamma projection so the chunk cannot shrink below the sequence length; document it as an architecture choice and retrain.Done means a 64-token RAT CIFAR run survives 10k steps without NaN and has a stated gamma/window policy. Add a test that forces gamma to the trained regime and asserts the 64-token forward works (or fails with a clear, early config error).
Reproduced on the 10k CIFAR RAT-32 run: crash at step 4000,
bidirectional RAT supports windows up to 63 tokens; got 64. The run is marked FAILED in MLflow43d4f09497344a5ba4e69d1967e15585. The 3k smoke completed before the gamma crossover. Hyper fallback 10k produced FID 160.36 (baseline).Possible fix set remains as in the issue; priority is a chunked bidirectional scan or a documented gamma_min floor, then rerun RAT-32 CIFAR 10k + head sweep.
Implemented option 1:
ChunkedBidirectionalRattentioninsrc/wink/models/rat.py.<= _scan_chunk_size()chunks; the fast-weight state is carried between chunks (S_last) for both the forward and reversed scans, thenS = S_fwd + S_bwd - A_self.T <= chunkit delegates to stock tardits; no behavior change for MNIST.Fix validated end-to-end: the chunked bidirectional scan carried the RAT-32 CIFAR run through the ~4k gamma crossover and completed 10,000 steps.
74955807cc524e2e8bf8ada1a8ec1513docs/assets/cifar10/cifar_rat_10k_64.pngdocs/experiments/2026-11-20-cifar10-rat-chunked.mdA 10k-sample FID is being computed with the same protocol as hyper (160.36). Will close after the number lands if it is clean.
Closed by the chunked-scan fix + 10k CIFAR validation.
ChunkedBidirectionalRattentioncarries state across safe chunks; chunked-vs-full max diff ~2.3e-6.docs/assets/cifar10/cifar_rat_10k_64.png; reportdocs/experiments/2026-11-20-cifar10-rat-chunked.md; FID JSONdocs/experiments/2026-11-20-cifar10-rat-10k-fid.json. 32 tests pass.The RAT-vs-hyper CIFAR gap is only ~2.6% on one seed; the head sweep and a second seed are the next rigor step, not a blocker.