This repository contains a tiny Qwen3NextForCausalLM Mixture-of-Experts
language model trained from scratch on TinyStories.
The model has 2,945,914 parameters. It combines Gated DeltaNet linear
attention, gated full attention, sparse top-2 MoE routing, and a shared expert
in a checkpoint small enough for implementation testing and experimentation.
This is a synthetic tiny checkpoint. It is not an official Qwen model, does
not contain weights from an original Qwen checkpoint, and should not be
expected to match the quality or capabilities of production Qwen models.
Repository contents
hf/: the final Hugging Face checkpoint and tokenizer
example_generate.py: a minimal generation example
eval_text_generation.json: generations from the final training evaluation
artifact_metadata.json: training arguments, metrics, router usage, and the
expanded configuration
qwen3_next_config_dump.json: a standalone configuration dump
Optimizer checkpoints and the full training log are intentionally omitted
from the distribution package.
The model follows the Qwen3-Next hybrid layer pattern: three Gated DeltaNet
linear-attention layers followed by one gated full-attention layer. Every
layer contains a sparse MoE block.
Relationship to Qwen3-Next 80B
The architecture is a deliberately scaled-down member of the same
Transformers architecture family as Qwen/Qwen3-Next-80B-A3B-Instruct:
text
13 x (Gated DeltaNet -> MoE)
21 x (Gated full attention -> MoE)
The original model repeats this four-layer pattern multiple times and uses
hundreds of experts. Tiny Qwen3-Next 3M keeps one four-layer cycle and eight
experts so that the important execution paths remain present at a much
smaller scale.
This checkpoint is pretrained only. It has not been instruction-tuned and
does not reproduce Qwen3-Next 80B behavior.
Router auxiliary loss was active during training. All experts received
traffic. Final aggregate expert fractions ranged from approximately 0.060 to
0.208 depending on layer and expert; no expert was unused.
Training data
The model was trained on the full TinyStories training corpus using an
independent 1% validation split:
The tokenizer uses <s> as both BOS and padding, and </s> as EOS. The model
configuration reserves 1,024 embedding rows while the tokenizer exposes
1,003 tokens.
Training setup
The checkpoint was trained from scratch in float32 on an NVIDIA GeForce GTX
1650:
Validation loss was computed over 16 batches, or 65,536 tokens, from the
independent packed validation split. These numbers are compact checkpoint
diagnostics, not general language-model benchmark results.
Example generation
With prompt Once upon, sampling seed 0 produced the following representative
TinyStories-style opening:
text
1Once upon a time, there was a little girl named Lily. She loved to play with
2her toys and go on adventures. One day, she went outside and saw a rainbow in
3the sky. It was so pretty that it made her feel even happier than before.
Sampling is stochastic. Other seeds may produce a boy, an adult, an animal,
or another kind of TinyStories character. The model usually produces
recognizable English, but semantic contradictions, unfinished sentences,
invented words, and repetition remain possible at this size.
Usage
Install the requirements:
pip install -r requirements.txt
Run the included local example from the repository root:
python example_generate.py
To load the package from Hugging Face Hub, resolve the hf directory to a
local path first. This also avoids a Transformers 5.14.1 local-subfolder issue
in which generation configuration lookup may incorrectly fall back to the
repository root:
The optional flash-linear-attention and causal-conv1d packages are not
required. Without them, Transformers uses its PyTorch Gated DeltaNet fallback,
which is the path used to train and validate this checkpoint.
The examples explicitly select experts_implementation="batched_mm". The
model's routed experts have an intermediate width of 54, while the default
PyTorch grouped_mm CUDA path in some recent Torch/Transformers combinations
requires expert matrix strides to be multiples of 16 bytes. Without the
explicit compatible implementation, loading succeeds but the first forward
pass can fail with:
RuntimeError: strides should be multiple of 16 bytes
batched_mm evaluates the same expert weights without that grouped-kernel
layout restriction. experts_implementation="eager" is also a compatible,
slower fallback.
Intended uses
This model is intended for:
testing Qwen3NextConfig and Qwen3NextForCausalLM
testing Gated DeltaNet fallback implementations
testing the hybrid linear/full-attention layer pattern
testing sparse top-2 MoE routing and shared experts
checking router load-balancing loss
exercising custom tokenizer loading
testing generate(), save_pretrained(), and from_pretrained()
compact inference-engine and architecture experiments
It is not intended for:
instruction following or chat
factual question answering
high-quality long-form generation
production deployment
safety-critical use
benchmark comparison with production Qwen models
Limitations
Known limitations include:
only 2.95 million parameters
small 1,003-token tokenizer
English TinyStories-only pretraining
weak factual knowledge and reasoning
no instruction tuning or chat template
occasional grammatical and semantic errors
invented words and truncated sentences
repetition and template-like stories
no quality-equivalence claim with official Qwen models
no current llama.cpp or GGUF inference support assumed for Qwen3-Next
Notes on GGUF
The checkpoint is distributed as a normal float32 Hugging Face Safetensors
model. A useful GGUF build requires converter and runtime support for the full
Qwen3-Next graph, including Gated DeltaNet, hybrid attention, routed experts,
and the shared expert. Merely placing tensors in a GGUF container is not
sufficient for compatible inference.
Citation
This is a synthetic tiny Qwen3-Next-compatible MoE checkpoint trained from
scratch on TinyStories. It is intended for implementation validation,
debugging, education, and small-scale architecture experiments.