Dynamic DeltaNet: replacing attention mechanisms in Qwen3
2 min readupdated
This model is an experimental modification of Qwen/Qwen3-0.6B where all 28 standard attention layers are replaced with DeltaNet mixer variants. The project explores alternative linear attention architectures while keeping the original tokenizer and base structure. Various operation modes are available, including bank states with logarithmically growing context length. The solution targets LLM architecture researchers and developers of efficient inference systems.
Key features
- Attention replacement: All 28 standard attention layers are replaced with DeltaNet mixers featuring 16 queries and 8 shared KV heads.
- Recording modes: Supports
deltanet,latest,all, andnovelty_top1modes to manage context states. - Training methods: Includes distillation, continued pretraining, and SFT (supervised fine-tuning).
- Self-contained bundles: Each directory contains
student.safetensorsweights, configuration, and the tokenizer.
What you can do
- Architecture testing: Run inference on experimental weights using the
dynamic_deltanetpackage and the Flash Linear Attention library. - Benchmark analysis: Review evaluation results across 1,510 samples, including RULER tasks and reading comprehension tests.
- Distillation research: Use the provided training data and code to experiment with layer replacement in small LLMs.
Example
from huggingface_hub import snapshot_download
from dynamic_deltanet.student import StudentForCausalLM
path = snapshot_download("CrazyJames26/Dynamic_DeltaNet",
allow_patterns="round2_shared_kv/deltanet_lr1e-4_v0/sft_step442/*")
model = StudentForCausalLM.from_pretrained(f"{path}/round2_shared_kv/deltanet_lr1e-4_v0/sft_step442",
device="cuda", compute_precision="float32")Read more
DetailsRULER benchmarks (4K/8K/16K): native Qwen3-0.6B scores 94.50 / 91.19 / 82.75, whereas an early
sft_step442 version shows a performance drop.Requirements: requires the
dynamic_deltanet package and Flash Linear Attention.Limitations: early runs (such as
deltanet_lr1e-4_v0) will be replaced with new learning rate grid search results.









Comments