Model grafting turns Qwen3.5-4B into a causal encoder-decoder, 3.7x faster long prompts

asankhs · reddit · 2026-09-22

Reddit user asankhs demonstrates "model grafting": inspired by DeepSeek-V4.1-Flash's causal encoder-decoder architecture (trained from scratch), the technique retrofits an existing pretrained model—cutting at some depth, letting lower layers read the prompt, using upper layers as prefix KV for the encoder via identity-init adapters, then healing with self-distillation from the unmodified parent. Decoding stays unchanged.

Applied to Qwen3.5-4B, two variants are released on Hugging Face (LocalLLaMA/Qwen3.5-4B-graft8 and graft16):

A blog post details the method, offering an open-source path to faster long-context inference without training from scratch.

Related event: Model Grafting Converts Qwen3.5-4B into Causal Encoder-Decoder, 3.7x Faster(2 posts)→

Original post →

More from Models

Models channel →