Downloads · 30 days
16
17% of all-time downloads
enCoder/qwen3-5-4b-mlp7808-distilled
qwen3-5-4b-mlp7808-distilled is a text generation model from enCoder. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as other.
A structurally MLP-pruned and knowledge-distilled derivative of Qwen/Qwen3.5-4B, saved as 16 safetensors shards (~ 7.9 GB, bf16). The SwiGLU MLP intermediate dimension is reduced 9216 → 7808 (~15.3% MLP pruning, a 128…
Downloads · 30 days
16
17% of all-time downloads
All-time downloads
96
Public
Repo size
8.4 GB
Likes
0
Public
Click a slice to open those files.
.safetensors8.4 GB · 100%
From the Hugging Face model README
A structurally MLP-pruned and knowledge-distilled derivative of
Qwen/Qwen3.5-4B, saved as 16 safetensors shards (~ 7.9 GB, bf16). The SwiGLU MLP
intermediate dimension is reduced 9216 → 7808 (~15.3% MLP pruning, a 128-multiple
for kernel alignment) via Wanda importance scoring, then recovered with logit-level
knowledge distillation from the original bf16 model (and a LoRA recovery pass).
⚠️ Research artifact. Pruning measurably reduced instruction-following ability (IFEval ~0.87 → ~0.71; see Limitations). Best used as a smaller, faster base for further fine-tuning — not as a faithful drop-in replacement for the parent on instruction- or format-strict tasks.
This checkpoint takes the hybrid (linear-attention + full-attention) Qwen3.5-4B,
narrows every SwiGLU MLP block's intermediate width from 9216 to 7808 by keeping the
top-scoring channels under the Wanda criterion (|W| · ‖X‖₂), and re-trains the slimmed
model to track the original via knowledge distillation. Attention layers, the embedding,
and the tied LM head are left unpruned.
Qwen/Qwen3.5-4BGeneral-purpose text generation and research on structured pruning + distillation of small hybrid LLMs.
A lighter base for task-specific fine-tuning. A short instruction-following SFT/DPO pass is recommended before assistant-style use to recover the pruning regression.
Not a faithful substitute for Qwen3.5-4B on strict instruction-following, exact-format output, or safety-critical applications, given the measured IFEval regression.
inst_level_strict_acc), the original Qwen3.5-4B scores ≈0.87 while this
pruned+distilled checkpoint scores ≈0.71. MLP pruning removed capacity that
instruction-following relies on, and generic-corpus distillation did not recover it.Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. Run an instruction-following SFT (or DPO) pass before assistant-style deployment, and evaluate on your own target tasks rather than relying on the parent's reported numbers.
Use the code below to get started with the model.
from transformers import AutoTokenizer, Qwen3_5ForConditionalGeneration
import torch
model_id = "your-username/your-repo" # or local path to this folder
tok = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = Qwen3_5ForConditionalGeneration.from_pretrained(
model_id, torch_dtype=torch.bfloat16, trust_remote_code=True
).eval().cuda()
msgs = [{"role": "user", "content": "Explain Wanda pruning in two sentences."}]
inputs = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt").cuda()
out = model.generate(inputs, max_new_tokens=128, do_sample=False)
print(tok.decode(out[0, inputs.shape[1]:], skip_special_tokens=True))
yahma/alpaca-cleaned (open instruction corpus) served as both the Wanda calibration
source and the distillation corpus. No proprietary or private data was used.
Calibration activations were collected over the corpus to compute per-channel Wanda
scores (|W| · ‖X‖₂) for each MLP intermediate channel; sequences truncated to the
training sequence length.
safetensors shards (~7.9 GB total)IFEval prompt set; the distillation corpus for argmax-agreement checks.
Generic next-token fidelity vs instruction-following capability.
inst_level_strict_acc (instruction-following)| Metric | Original Qwen3.5-4B | This model |
|---|---|---|
| Teacher argmax agreement | 100% (def.) | ~98% |
| IFEval (inst_level_strict_acc) | ~0.87 | ~0.71 |
High generic-text fidelity to the parent, with a clear instruction-following regression introduced by MLP pruning. Treat as a research checkpoint / fine-tuning base.
Pruning was concentrated in the SwiGLU MLP intermediate dimension; attention (linear + full), embeddings, and the tied LM head were preserved.
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
Hybrid Qwen3.5-4B backbone (Qwen3_5ForConditionalGeneration): 32 decoder layers (mix
of linear-attention and full-attention), hidden size 2560, MLP intermediate 7808
(pruned from 9216), grouped-query attention (16 query / 4 KV heads, head_dim 256),
vocabulary 248,320, tied input/output embeddings. Objective: knowledge distillation
toward the bf16 parent.
NVIDIA H100 (80GB), multi-GPU data-parallel.
PyTorch, Hugging Face Transformers, PEFT, Accelerate.
BibTeX:
@misc{qwen3_5,
title = {Qwen3.5},
author = {Qwen Team},
year = {2025}
}
APA:
Qwen Team. (2025). Qwen3.5. (Base model for this pruned + distilled derivative.)
|W| · ‖X‖₂).Pruning targeted only the MLP intermediate width; for stronger instruction-following, fine-tune downstream.
[More Information Needed]
[More Information Needed]