Downloads · 30 days
5
9% of all-time downloads
a-scarlett/Qwen3-8B-no-layer21
Qwen3-8B-no-layer21 is a machine learning model from a-scarlett. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
Ablated version of Qwen/Qwen3-8B with layer 21 removed.
Downloads · 30 days
5
9% of all-time downloads
All-time downloads
55
Public
Parameters
8B
16 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors16 GB · 100%
From the Hugging Face model README
Ablated version of Qwen/Qwen3-8B with layer 21 removed.
Removing layer 21 improves performance on MATH500 by 75%!
| Model | MATH500 Accuracy |
|---|---|
| Original Qwen3-8B (36 layers) | 0.0667 |
| Without layer 21 (35 layers) | 0.1167 (+75% improvement) |
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"a-scarlett/Qwen3-8B-no-layer21",
torch_dtype="auto",
device_map="auto",
trust_remote_code=True
)
tokenizer = AutoTokenizer.from_pretrained("a-scarlett/Qwen3-8B-no-layer21", trust_remote_code=True)
prompt = "Solve: What is 15 * 23?"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
This model demonstrates that not all layers in a transformer are equally important. Layer 21 in Qwen3-8B appears to introduce noise or interfere with mathematical reasoning, and removing it actually improves performance.
Tested on MATH500 dataset (500 competition-level math problems):
Apache 2.0 (same as base model)
@misc{qwen3-8b-ablated,
title={Qwen3-8B with Layer 21 Removed},
author={a-scarlett},
year={2025},
howpublished={\url{https://huggingface.co/a-scarlett/Qwen3-8B-no-layer21}}
}