Downloads · 30 days
12
15% of all-time downloads
sahilchachra/Qwen3.5-9B-English-trimmed
Qwen3.5-9B-English-trimmed is a text generation model from sahilchachra. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
A vocabulary-trimmed derivative of Qwen/Qwen3.5-9B, built for deployments that only need English + code, not all 201 languages the base tokenizer supports.
Downloads · 30 days
12
15% of all-time downloads
All-time downloads
80
Public
Parameters
8B
16 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors16 GB · 100%
How the weights are stored.
BF168B · 100%
From the Hugging Face model README
A vocabulary-trimmed derivative of Qwen/Qwen3.5-9B, built for deployments that only need English + code, not all 201 languages the base tokenizer supports.
This model changes only the token embedding (embed_tokens) and output (lm_head) matrices — unlike the 0.8B version of this project, Qwen3.5-9B does not tie these two matrices (tie_word_embeddings: false), so both were sliced independently. Every other weight — all 32 transformer layers, the Gated DeltaNet / attention blocks — is copied byte-for-byte unmodified from the base model. No fine-tuning was performed.
Modified from the original. This is a derivative of Qwen/Qwen3.5-9B (Apache 2.0). See Attribution below.
| Original | This model | ||
|---|---|---|---|
| Vocabulary size | 248,320 | 48,704 | 5.10x smaller |
| Total parameters | ~9.65B | ~8.02B | -16.9% |
embed_tokens params | 1.017B | 0.200B | 5.10x smaller |
lm_head params | 1.017B | 0.200B | 5.10x smaller |
| Combined embed+lm_head as % of model | 21.1% | 5.0% | |
| Checkpoint size (bf16) | 19.31 GB | 16.04 GB | -16.9% |
The vocabulary keep-set is identical to sahilchachra/Qwen3.5-0.8B-English-trimmed — Qwen3.5-9B uses the exact same 248,320-token tokenizer as the 0.8B model, so the token-frequency mining, coverage analysis, and safety-net keyword pinning done for that release apply here unchanged. See that model's card and the accompanying methodology notes for the full mining process.
At 0.8B scale, the tied embedding/lm_head matrix was ~34% of total parameters. At 9B scale, the two (now separate, untied) matrices are a much smaller slice of a much bigger backbone — about 21% combined before trimming, 5% after. The absolute parameter savings from trimming the vocabulary are identical in relative terms (same 5.10x vocab reduction, same token math), but the backbone dominates total size far more at this scale, so the overall model shrinks by "only" 16.9% instead of 27%. The same logic applies to decode-time compute: the lm_head projection is a smaller fraction of total per-token cost on a 32-layer, 4096-hidden model than on a 24-layer, 1024-hidden one, so the relative decode speedup from trimming is expected to be smaller here too (see Limitations — this wasn't directly measured for this size).
Identical pipeline to the 0.8B release:
embed_tokens.weight and lm_head.weight sliced to the kept token ids (independently, since untied). Tokenizer's BPE vocab and merges rebuilt to match.Engineering note: this model's ~19.3GB checkpoint was too large to safely load in full on the machine used to build it (24GB unified memory). Instead of loading the whole model, only the single safetensors shard containing embed_tokens/lm_head was opened (via safetensors.safe_open, memory-mapped) and rewritten with the sliced tensors; the other 3 shards (32 transformer layers, untouched) were copied through as-is. This avoided ever materializing the full 9.65B-parameter model in memory.
Because of the memory constraint above, the following checks that were done for the 0.8B release were not repeated here:
If you use this model, it's worth running your own quick generation/perplexity check on your target domain before relying on it in production — the trim mechanism is proven at 0.8B scale, but end-to-end behavior at 9B scale hasn't been independently verified.
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "sahilchachra/Qwen3.5-9B-English-trimmed"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, dtype=torch.bfloat16)
messages = [{"role": "user", "content": "Explain what a hash map is, with a short Python example."}]
inputs = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt")
out = model.generate(inputs, max_new_tokens=200)
print(tok.decode(out[0], skip_special_tokens=True))
This model is a derivative of Qwen/Qwen3.5-9B, licensed under Apache License 2.0. In accordance with the license:
embed_tokens/lm_head matrices and tokenizer vocabulary were changed; all other weights are unmodified copies of the original.See the Apache 2.0 license text for full terms.
See also: sahilchachra/Qwen3.5-0.8B-English-trimmed — the sibling release this vocabulary was originally mined and validated on.