Qwen3.5-9B-ART
adaptive transformer for fast inference
2 min read
This adapter (LoRA (a small add-on over the base model)) for the powerful base language model Qwen/Qwen3.5-9B implements the Adaptive Recurrent Transformer (ART) architecture. The main goal of the model is to reduce VRAM load and accelerate text generation through dynamic early exits (LayerSkip) and self-speculative decoding. The architecture allows on-the-fly switching between different layer depths (from 4 to 32 layers) without additional VRAM costs. This solution is useful for developers and engineers looking to optimize the speed of large models locally or on a server.
Key features
- Self-speculative decoding: acceleration of generation by 1.8–2.4x without quality loss due to fast early exits and accurate verification.
- VRAM savings: reduction of KV-cache memory consumption by 50–65% due to truncation of extra projection matrices.
- Dynamic depth: support for five execution modes ranging from lightweight fast layers (4L, 8L) to full base accuracy (32L).
- Lightweight: the adapter uses only 43.2 million trainable parameters (0.48% of the base) with a rank size of r = 16.
What you can do
- Accelerate generation: implement early exits for tasks where high response speed (tokens per second) is important.
- Run in limited memory: use lightweight configurations (for example, 16L or 24L) to work with the model on standard consumer GPUs.
- Test hybrid schemes: apply the self-speculative verification mode for accurate logical reasoning.
Example
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model_id = "Qwen/Qwen3.5-9B"
adapter_id = "KrishnTundia/Qwen3.5-9B-ART-architecture"
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
base_model = AutoModelForCausalLM.from_pretrained(
base_model_id,
torch_dtype=torch.float16,
device_map="auto"
)
model = PeftModel.from_pretrained(base_model, adapter_id)
model.merge_adapter()Read more
DetailsBase model: Qwen/Qwen3.5-9B (32-layer foundation)
Adapter parameters: r = 16, alpha = 32, 43.2M parameters
Performance: 4L output accelerates generation by 3.9x (39.63 tok/s), while 32L delivers 10.15 tok/s
License: Apache License 2.0










Comments