Views
No views yet
| Metric | Original | Trimmed | Reduction |
|---|---|---|---|
| Vocabulary size | 128,256 tokens | 32,768 tokens | 74.45% |
| Model size | 3,075,098,624 params | 2,879,539,200 params | 6.36% |

1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_name = "alphaedge-ai/SmolLM3-3B-arb-32768"
4device = "cuda" # for GPU usage or "cpu" for CPU usage
5
6# load the tokenizer and the model
7tokenizer = AutoTokenizer.from_pretrained(model_name)
8model = AutoModelForCausalLM.from_pretrained(
9 model_name,
10).to(device)
11
12# prepare the model input
13prompt = "Your prompt in Arabic."
14messages = [
15 {"role": "user", "content": prompt}
16]
17text = tokenizer.apply_chat_template(
18 messages,
19 tokenize=False,
20 add_generation_prompt=True,
21)
22model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
23
24# Generate the output
25generated_ids = model.generate(**model_inputs, max_new_tokens=32768)
26
27# Get and decode the output
28output_ids = generated_ids[0][len(model_inputs.input_ids[0]):]
29print(tokenizer.decode(output_ids, skip_special_tokens=True))1messages = [
2 {"role": "system", "content": "/no_think"},
3 {"role": "user", "content": prompt}
4]@misc{bakouch2025smollm3,
title={SmolLM3: smol, multilingual, long-context reasoner},
author={akouch, Elie and Ben Allal, Loubna and Lozhkov, Anton and Tazi, Nouamane
and Tunstall, Lewis and Patiño, Carlos Miguel and Beeching, Edward
and Roucher, Aymeric and others},
year={2025},
howpublished={https://huggingface.co/blog/smollm3}
}@misc{hf_blogpost_trimming,
title={Introduction to Trimming},
author={Loïck BOURDOIS and Tom AARSEN and Bram VANROY and Christopher AKIKI and Woojun JUNG and Manuel ROMERO and Prithiv SAKTHI},
year={2026},
url={https://huggingface.co/blog/lbourdois/introduction-to-trimming},
}