A from-scratch 1.12B decoder-only LLM, pretrained on ~20B tokens and aligned with DPO.
Full code, architecture writeup, and training diary: github.com/DW-dev-UE/LLM-from-scratch β see BENCHMARK v2 for the full benchmark writeup this card summarizes.
This checkpoint is the DPO-aligned release (pretrain β SFT β DPO).
| Architecture | Decoder-only Transformer, GQA (16Q/4KV) + RoPE (ΞΈ=500K) + SwiGLU + RMSNorm + QK-Norm, weight tying |
| Parameters | 1,119.5M (measured) |
| Layers Β· d_model | 24 Β· 2048 |
| Context length | 4096 (trained at 2048) |
| Vocab | 32,000 (byte-level BPE, English-only) |
| Weights | stored as float32 (~4.48GB); load with dtype=torch.bfloat16 to halve memory |
| Pretrain | 51K steps Β· ~20B tokens Β· v3-en corpus (English web + code + math) |
| Post-training | SFT (8.4K steps) β RLVR attempted and abandoned (no learning signal at this scale β see BENCHMARK-v2.md Β§6) β DPO (60K preference pairs) |
| HF conversion | Weights map 1:1 onto Qwen3ForCausalLM (GQA+RoPE+SwiGLU+RMSNorm+QK-norm matches the Qwen3 block exactly). Verified by teacher-forced next-token argmax agreement against this model's own recorded benchmark generations, plus an A/B check confirming QK-norm is applied before RoPE (the Qwen3 convention) |
This checkpoint expects the chat template below (system prompt + optional <THINKING> block) β see chat_template.jinja / ARCHITECTURE.md Β§7.1 in the repo for the exact format.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("YOON1v/Apex-1-DPO", dtype=torch.bfloat16).cuda()
tokenizer = AutoTokenizer.from_pretrained("YOON1v/Apex-1-DPO")
messages = [{"role": "user", "content": "Write a Python function that checks if a number is prime."}]
prompt = tokenizer.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True, enable_thinking=False)
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
out = model.generate(**inputs, max_new_tokens=256, do_sample=True, temperature=0.7, top_p=0.9)
print(tokenizer.decode(out[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
Set enable_thinking=True to have the model reason inside <THINKING>...</THINKING> before answering. Per this model's own benchmark (see below), no-thinking mode currently scores higher β thinking mode tends to run long and cut into the answer budget.
Standard suite (lm-evaluation-harness 0.4.12, bf16), compared against models trained on a similar token budget:
| Apex-1 SFT | Apex-1 DPO | TinyLlama-1.1B (3T tok) | Pythia-1.0B (300B tok) | |
|---|---|---|---|---|
| Commonsense avg, 7 tasks (0-shot) | 49.54 | 49.65 | 52.99 | 48.30 |
| MMLU (5-shot) | 24.83 | 24.90 | 25.34 | 25.70 |
| GSM8K (5-shot, strict) | 1.44 | 1.90 | β | β |
| HumanEval (pass@1) | 8.54 | 8.54 | 9.15 | 1.83 |
| MBPP (pass@1) | 4.80 | 5.20 | β | β |
DPO β₯ SFT on every metric above β no alignment tax. BoolQ 62.20 ranks 1st among TinyLlama-1.1B / Pythia-1.0B / OPT-1.3B. Apex-1 matches the 15Γ-more-trained Pythia-1.0B on commonsense average and beats it on ARC β the most token-efficient entry among same-budget peers, and its HumanEval score is 4.7Γ Pythia's despite the token gap.
Against the wider 2024β2025 small-model landscape (Llama-3.2-1B/9T, Qwen2.5-1.5B/18T, SmolLM2-1.7B/11T, OLMo-1B/2T), Apex-1 trails β expected given 450β900Γ less training data, not an architecture gap. Full comparison table, benchmark provenance, and citations: see BENCHMARK-v2.md Β§5.4 in the repo.
[!NOTE] GSM8K/MBPP train splits partially overlap this model's SFT data (evaluation used the held-out test split); HumanEval is fully uncontaminated. See the repo's
ckpt/lm_eval_Apex-1_COMPARISON.mdfor the raw numbers this card summarizes.
Apache 2.0.
A from-scratch 1.12B decoder-only LLM, pretrained on ~20B tokens and aligned with DPO.
Full code, architecture writeup, and training diary: github.com/DW-dev-UE/LLM-from-scratch β see BENCHMARK v2 for the full benchmark writeup this card summarizes.
This checkpoint is the DPO-aligned release (pretrain β SFT β DPO).
| Architecture | Decoder-only Transformer, GQA (16Q/4KV) + RoPE (ΞΈ=500K) + SwiGLU + RMSNorm + QK-Norm, weight tying |
| Parameters | 1,119.5M (measured) |
| Layers Β· d_model | 24 Β· 2048 |
| Context length | 4096 (trained at 2048) |
| Vocab | 32,000 (byte-level BPE, English-only) |
| Weights | stored as float32 (~4.48GB); load with dtype=torch.bfloat16 to halve memory |
| Pretrain | 51K steps Β· ~20B tokens Β· v3-en corpus (English web + code + math) |
| Post-training | SFT (8.4K steps) β RLVR attempted and abandoned (no learning signal at this scale β see BENCHMARK-v2.md Β§6) β DPO (60K preference pairs) |
| HF conversion | Weights map 1:1 onto Qwen3ForCausalLM (GQA+RoPE+SwiGLU+RMSNorm+QK-norm matches the Qwen3 block exactly). Verified by teacher-forced next-token argmax agreement against this model's own recorded benchmark generations, plus an A/B check confirming QK-norm is applied before RoPE (the Qwen3 convention) |
This checkpoint expects the chat template below (system prompt + optional <THINKING> block) β see chat_template.jinja / ARCHITECTURE.md Β§7.1 in the repo for the exact format.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("YOON1v/Apex-1-DPO", dtype=torch.bfloat16).cuda()
tokenizer = AutoTokenizer.from_pretrained("YOON1v/Apex-1-DPO")
messages = [{"role": "user", "content": "Write a Python function that checks if a number is prime."}]
prompt = tokenizer.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True, enable_thinking=False)
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
out = model.generate(**inputs, max_new_tokens=256, do_sample=True, temperature=0.7, top_p=0.9)
print(tokenizer.decode(out[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
Set enable_thinking=True to have the model reason inside <THINKING>...</THINKING> before answering. Per this model's own benchmark (see below), no-thinking mode currently scores higher β thinking mode tends to run long and cut into the answer budget.
Standard suite (lm-evaluation-harness 0.4.12, bf16), compared against models trained on a similar token budget:
| Apex-1 SFT | Apex-1 DPO | TinyLlama-1.1B (3T tok) | Pythia-1.0B (300B tok) | |
|---|---|---|---|---|
| Commonsense avg, 7 tasks (0-shot) | 49.54 | 49.65 | 52.99 | 48.30 |
| MMLU (5-shot) | 24.83 | 24.90 | 25.34 | 25.70 |
| GSM8K (5-shot, strict) | 1.44 | 1.90 | β | β |
| HumanEval (pass@1) | 8.54 | 8.54 | 9.15 | 1.83 |
| MBPP (pass@1) | 4.80 | 5.20 | β | β |
DPO β₯ SFT on every metric above β no alignment tax. BoolQ 62.20 ranks 1st among TinyLlama-1.1B / Pythia-1.0B / OPT-1.3B. Apex-1 matches the 15Γ-more-trained Pythia-1.0B on commonsense average and beats it on ARC β the most token-efficient entry among same-budget peers, and its HumanEval score is 4.7Γ Pythia's despite the token gap.
Against the wider 2024β2025 small-model landscape (Llama-3.2-1B/9T, Qwen2.5-1.5B/18T, SmolLM2-1.7B/11T, OLMo-1B/2T), Apex-1 trails β expected given 450β900Γ less training data, not an architecture gap. Full comparison table, benchmark provenance, and citations: see BENCHMARK-v2.md Β§5.4 in the repo.
[!NOTE] GSM8K/MBPP train splits partially overlap this model's SFT data (evaluation used the held-out test split); HumanEval is fully uncontaminated. See the repo's
ckpt/lm_eval_Apex-1_COMPARISON.mdfor the raw numbers this card summarizes.
Apache 2.0.