Model details
Table | |
|---|
| 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) |
Usage
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.
Benchmarks
Standard suite (lm-evaluation-harness 0.4.12, bf16), compared against models trained on a similar token budget:
Table with columns: Apex-1 SFT, Apex-1 DPO, TinyLlama-1.1B (3T tok), Pythia-1.0B (300B tok) | 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 | — | — |
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.md for the raw numbers this card summarizes.
Known limitations
- English-only (no multilingual pretraining data)
- GSM8K / multi-step arithmetic reasoning is very weak (~2%) — this is why the project moved to DPO instead of RLVR for alignment (RLVR needs a non-trivial number of correct samples per group to produce a gradient; this model has too few)
- MMLU sits at random-guess level (~25%), consistent with other 1B-scale models
- Not instruction-tuned for multi-turn conversation beyond what the SFT/DPO mix covers
Training data
- Pretrain: v3-en corpus (fineweb_edu, dclm, finemath4, cosmopedia2, code [python/js/java/c/cpp/sql/shell], finepdfs, wikipedia_en) — 80.8GB, ~20.3B tokens
- SFT: HuggingFaceTB/smoltalk2 English subset, 538K examples (think:no-think ≈ 1:2)
- DPO: 60K preference pairs
License
Apache 2.0.