Qwen3.5-0.8B
Read the 24-layer hybrid and calculate the cache retained by its six full-attention layers.
Jump to a section
Six layers that remember every token
Qwen3.5-0.8B is a small vision-language model whose text stack keeps two kinds of history. Of its 24 layers, 18 are Gated DeltaNet layers that carry a fixed-size recurrent state. The other 6 are gated full-attention layers that keep a key and a value for every token. At 4,096 tokens those six layers hold 48 MiB of cache, while the recurrent state stays the same size however long the prefix gets.
The feed-forward layers are dense. Some Qwen models use mixture-of-experts, but that family-level description does not apply to this checkpoint.
The repeating four-layer pattern
The official configuration lists the text layers in a fixed order: three Gated DeltaNet layers, then one gated full-attention layer, repeated six times. Every fourth layer is full attention.
The figure follows that order from the checkpoint configuration. It is a layout, not a picture of measured activations.
A recurrent layer folds each token into a state of fixed size, so whatever it remembers about the past has to fit in that state. A full-attention layer keeps every token's key and value, so a later query can address any earlier position directly. The hybrid places one such layer after every three recurrent ones. Linear attention covers the recurrent side and KV caching the growing side.
Twelve kibibytes per token
The full-attention layers have two KV heads of dimension 256. At batch 1 with two-byte cache elements, the six layers store
where the factors are the key and value, the six layers, tokens, two KV heads, the head dimension and the bytes per element.
That is 12 KiB per token, 48 MiB at 4,096 tokens and 384 MiB at 32,768. Had all 24 layers been full attention with the same shape, every figure would be four times larger.
This is a tensor-size calculation, not a measured serving footprint. It leaves out recurrent states, convolution buffers, vision features, model weights, padding and allocator overhead.
layer_types = ['linear', 'linear', 'linear', 'full'] * 6
assert len(layer_types) == 24
assert layer_types.count('linear') == 18
assert layer_types.count('full') == 6
cache_bytes = 2 * layer_types.count('full') * 4096 * 2 * 256 * 2
assert cache_bytes == 12_288 * 4096
assert cache_bytes / 2**20 == 48
print(cache_bytes / 2**20, 'MiB for full-attention K/V only')These counts belong to this checkpoint. Another family member may differ in depth, head count, head dimension or feed-forward design, so read its configuration instead of deriving the shape from the name.
What a three-to-one ratio does not tell you
Memory. Three quarters of the layers being recurrent does not mean three quarters less inference memory. Parameters, recurrent state, the full-attention cache and runtime allocations have different sizes and grow differently, so a ratio of layer counts is not a ratio of bytes or of latency.
Growth. Double the prefix with the model, batch and cache dtype fixed, and the full-attention cache doubles. The recurrent layers do not acquire a new matrix per token; their fixed-size state stays as it is.
Kernels. Exact attention kernels still matter. The six full-attention layers can use an optimised exact kernel such as FlashAttention, while the recurrent layers need kernels for their own recurrence or chunkwise computation.
Sources and further reading
- Official Qwen3.5-0.8B model card, reviewed October 2026.
- Qwen3.5-0.8B checkpoint configuration: layer order, head counts and dimensions. No inference or benchmark reproduction is claimed.
- Yang et al., Gated Delta Networks (2024): the recurrent layer type in 18 of the 24 layers.