Views
No views yet
tohio/slm-125m-instruct for the SFT-only version.
Use tohio/slm-125m for the raw base model.| Variant | Hub | Description |
|---|---|---|
| Base | tohio/slm-125m | Pretrained only |
| Instruct | tohio/slm-125m-instruct | Chat + response-control + code SFT |
| Chat | tohio/slm-125m-chat | SFT + DPO aligned |
| Component | Choice | Rationale |
|---|---|---|
| Positional encoding | RoPE | Better length generalisation, relative position awareness |
| Normalization | RMSNorm | Faster than LayerNorm, modern standard |
| Activation | SwiGLU | Better gradient flow, used by LLaMA and Mistral |
| Attention | GQA | Reduces KV cache memory at inference |
| Bias | None | Simpler, modern standard |
| Embeddings | Tied | Reduces parameters, effective at small scale |
| Vocab size | 32,000 | Custom BPE tokenizer trained on the pretraining corpus |
| Parameters | 125.3M (125,264,640 parameters) |
| Source | Target Share | Link |
|---|---|---|
common_crawl | 5.0% | Common Crawl |
fineweb | 10.0% | FineWeb |
fineweb_edu | 31.5% | FineWeb-Edu |
wikipedia | 10.0% | Wikipedia (EN) |
pg19 | 2.5% | PG-19 (Project Gutenberg) |
pes2o | 5.0% | peS2o (academic papers) |
nemotron_cc_math | 7.0% | Nemotron CC Math |
stackexchange | 1.0% | StackExchange |
synthetic_arithmetic | 0.1% | Synthetic arithmetic |
synthetic_task_code | 0.4% | Synthetic task code |
educational_qa_mcq_math | 0.1% | Educational QA/MCQ (math) |
educational_qa_mcq_general | 0.2% | Educational QA/MCQ (general) |
factual_restraint | 0.1% | Factual restraint |
nemotron_specialized | 12.0% | Nemotron Specialized |
stack_v1 | 12.45% | The Stack v1 dedup |
codesearchnet | 2.25% | CodeSearchNet |
stack_smol | 0.15% | The Stack (smol) |
jupyter | 0.07% | Jupyter notebooks |
conala | 0.07% | CoNaLa |
Realized mix may differ from target — supply-bound sources (pes2o, jupyter at this scale) route their deficit to FineWeb.
| Stage | Dataset | Size |
|---|---|---|
| Chat SFT | OpenHermes-2.5 | ~1M examples |
| Response-control SFT | Generated locally by finetune/data/response_control.py | 5K examples |
| Code SFT | Magicoder-OSS-Instruct-75K + handcrafted body-only completions | ~75K examples + small handcrafted set |
| DPO alignment | Anthropic/hh-rlhf + Intel/orca_dpo_pairs + argilla/dpo-mix-7k | ~60K pairs after filtering |
| Benchmark | Few-shot | Metric | Score |
|---|---|---|---|
| HellaSwag | 10-shot | acc_norm | 0.3099 |
| ARC-Easy | 25-shot | acc_norm | 0.4895 |
| ARC-Challenge | 25-shot | acc_norm | 0.2577 |
| MMLU | 5-shot | acc | 0.2536 |
| TruthfulQA | 0-shot | acc | 0.4295 |
| HumanEval | 0-shot | pass@1 | 0.0915 |
1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model = AutoModelForCausalLM.from_pretrained(
4 "tohio/slm-125m-chat",
5 trust_remote_code=True,
6)
7tokenizer = AutoTokenizer.from_pretrained(
8 "tohio/slm-125m-chat",
9 trust_remote_code=True,
10)
11
12messages = [
13 {"role": "system", "content": "Answer clearly and concisely."},
14 {"role": "user", "content": "Explain what a transformer is."},
15]
16
17inputs = tokenizer.apply_chat_template(
18 messages,
19 return_tensors="pt",
20 add_generation_prompt=True,
21 return_dict=True,
22)
23
24endofturn_id = tokenizer.convert_tokens_to_ids("<|endofturn|>")
25
26output = model.generate(
27 **inputs,
28 max_new_tokens=120,
29 do_sample=False,
30 repetition_penalty=1.1,
31 pad_token_id=tokenizer.pad_token_id or tokenizer.eos_token_id,
32 eos_token_id=[tokenizer.eos_token_id, endofturn_id],
33)
34
35input_len = inputs["input_ids"].shape[1]
36print(tokenizer.decode(output[0][input_len:], skip_special_tokens=True))trust_remote_code=True loads the custom SLM architecture bundled alongside the model weights — no local install of the tohio/slm codebase required.