Soft Spec Decoding AE Gate
compressing Qwen3-8B hidden states
2 min read
The model is a set of autoencoders (VAE) that compress 8 consecutive hidden state positions of Qwen3-8B (in nf4 4-bit quantization) into a single latent vector and decode them back. The solution is designed as part of a draft model for lossless speculative decoding (a method for speeding up language model text generation). Latent spaces and layers are aggregated to optimize language model performance without reducing prediction accuracy of the frozen LLM head.
Key features
- Compression of every 8 hidden state positions of Qwen3-8B into a single latent vector
- Use of various latent dimension configurations (512, 1024, 2048)
- Support for different input grid series (final normalized state or a combination of layers 18, 24, 30, and the final one)
- Maintenance of compatibility with the original frozen Qwen3-8B language head
What you can do
- Integrate checkpoints into a speculative decoding project to speed up Qwen3-8B inference
- Analyze training results, curves, and noise tests from the included results folder
- Experiment with different latent space dimensions (z512, z1024, z2048) to balance speed and accuracy
Example
Model and configuration loading is done using the ae_gate.py script from the project repository, and input data preparation is performed via cache_states.py.
Read more
DetailsBase model: Qwen/Qwen3-8B
Math and coding consistency: up to 94.5% (z2048_full)
Chat consistency: up to 78.2%
Limitations: the gate is fixed before training on dev sets










Comments