Run this model with HF Jobs
Run Lazyshu/PyraLM-10M on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/Lazyshu/PyraLM-10M. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Lazyshu/PyraLM-10M on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/Lazyshu/PyraLM-10M. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/Lazyshu/PyraLM-10M. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use Lazyshu/PyraLM-10M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Lazyshu/PyraLM-10M with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Lazyshu/PyraLM-10M", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Lazyshu/PyraLM-10M", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Lazyshu/PyraLM-10M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Lazyshu/PyraLM-10M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Lazyshu/PyraLM-10M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Lazyshu/PyraLM-10M
- SGLang
How to use Lazyshu/PyraLM-10M with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Lazyshu/PyraLM-10M" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Lazyshu/PyraLM-10M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Lazyshu/PyraLM-10M" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Lazyshu/PyraLM-10M", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Lazyshu/PyraLM-10M with Docker Model Runner:
docker model run hf.co/Lazyshu/PyraLM-10M
PyraLM-10M
BETU leaderboard update (2026-12-04): PyraLM-10M ranks #1 in the
<10Mcategory of the BETU SLM Leaderboard, with Overall Index 22.64 and Quality 20.28 (accepted submission). BETU combines six benchmarks; its Overall Index is a separate metric from the Open SLM Intelligence Index below.
PyraLM-10M is a 9,987,600-parameter (<10M) English decoder-only language model trained from scratch with a pyramid-tapered 18-layer FFN architecture and a compact 5,120-vocab BPE tokenizer.
This release is a genuine single-trajectory training checkpoint (no model merging, no model soups, no SWA/EMA), achieving an Intelligence Index of 16.30 in local FP32 zero-shot evaluation following the Open SLM Leaderboard protocol (pending official leaderboard verification; 3-seed Stage 2 mean from the same 20B pretrained base: 16.23 ยฑ 0.07).
Model Overview
| Property | Value |
|---|---|
| Parameters | 9,987,600 (tied input/output embeddings) |
| Architecture | 18-layer pyramid-tapered decoder-only Transformer (PyraLMForCausalLM) |
Hidden Size (d_model) |
256 |
| Attention | GQA (8 query heads, 2 KV heads, head_dim = 32), RoPE (theta = 10000), per-head QK-Norm, headwise output gate, local window (16) on layer 0 |
| Pyramid Tapered SwiGLU FFN | [624ร5, 408ร5, 312ร4, 232ร4] |
| Local Mixing & Norm | Peri-LN (RMSNorm), causal depthwise Canon-A/C convolutions (kernel = 4, document-masked) |
| Context Length | 512 tokens |
| Tokenizer | Custom 5,120-vocab BPE (bos_token = null, pad = 0, eos = 1) |
| Checkpoint Type | Single unaveraged training checkpoint (no merging / soup / SWA / EMA) |
| Weights SHA-256 | 457f89e1606e066b70e9e0f4724a4a588c17a041acc3839da0334f2eed923fa2 |
| License | MIT |
Architecture Attribution: The custom attention/Peri-LN/Canon modeling code is adapted from Ethoric-10M (MIT License). On top of that foundation, PyraLM-10M introduces an 18-layer pyramid-tapered FFN allocation (12L uniform 721 โ 18L tapered [624..232]), a custom 5,120-vocab BPE tokenizer, and an independent 20B pretraining + non-benchmark post-training pipeline trained completely from scratch.
Evaluation Results
Note: All scores below are local zero-shot evaluations run under the official Open SLM Leaderboard FP32 protocol (
add_bos_token=False,max_length / max_context = 512), pending independent verification by the Open SLM Leaderboard team.
Evaluated twice independently locally across all 16,428 items with bitwise-identical predictions (max_abs_diff = 0.0):
| Model | Params | Intelligence Index | HellaSwag (acc_norm) |
ARC-Easy (acc_norm) |
ARC-Challenge (acc_norm) |
PIQA (acc_norm) |
ArithMark-3 (acc_norm) |
|---|---|---|---|---|---|---|---|
| PyraLM-10M (this release, seed 31) | 9.99M | 16.30 | 28.44 | 40.36 | 24.15 | 58.32 | 58.00 |
| PyraLM-10M (3-seed Stage 2 mean ยฑ SD, s19/s23/s31) | 9.99M | 16.23 ยฑ 0.07 | 28.46 | 40.43 | 24.03 | 58.63 | 56.97 |
| Ethoric-10M (upstream reference, local FP32 eval) | 9.97M | 12.94 | 28.75 | 37.58 | 24.66 | 59.85 | 41.60 |
Reproducibility note: Across three independent Stage 2 random seeds (19, 23, 31) starting from the same 20B pretrained base checkpoint, all three runs exceeded 16.18 (16.19 / 16.19 / 16.30, sample SD 0.07).
Training Summary & Contamination Control
- Stage 1 โ Pretraining from Scratch (
20.0Btokens):- Trained from random initialization (
15.4Bmain stage +4.6Bannealing stage) on open English web, encyclopedia, textbook, and math corpora (FineWeb-Edu,Cosmopedia-v2,TxT360-v2,DCLM-Baseline,FineMath-4plus,FineWiki,Tiny-Strange-Textbooks,OpenMathInstruct-2,FinePhrase,Orca-Math,QA-Commonsense). - All pretraining documents were filtered with a frozen Aho-Corasick lexical filter to remove matches against the train, validation, and test splits of all five official leaderboard benchmarks (
HellaSwag,ARC-Easy,ARC-Challenge,PIQA,ArithMark-3.0).
- Trained from random initialization (
- Stage 2 โ Post-Training on Non-Benchmark QA & Math (
112,644examples,2,081steps):- Single-trajectory post-training starting from the final
20.0Bcheckpoint (lr = 5e-5, global batch128, no EMA/SWA/weight merging). - Composed strictly of non-leaderboard public QA/math training sets (
SocialIQA,CommonsenseQA,SciQ,QASC,GSM8K,Orca-Math,ASDiv,SVAMP) plus24,000programmatically verified abstract symbolic & quantitative arithmetic exercises (no ArithMark names, objects, or story templates). - None of the train, validation, or test splits of HellaSwag, ARC-Easy, ARC-Challenge, PIQA, or ArithMark-3.0 were used (
0hits under the frozen lexical guard).
- Single-trajectory post-training starting from the final
- Note on Public Web Data:
- Automated lexical filtering was applied across both stages to exclude all splits of the five official benchmarks. As with any model trained on large public web corpora, text-level filtering cannot completely rule out occasional paraphrased or near-duplicate web passages.
Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo_id = "Lazyshu/PyraLM-10M"
tokenizer = AutoTokenizer.from_pretrained(repo_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
repo_id,
trust_remote_code=True,
dtype=torch.float32,
).eval()
inputs = tokenizer("78 + 27 =", return_tensors="pt")
with torch.inference_mode():
out = model.generate(**inputs, max_new_tokens=16)
print(tokenizer.decode(out[0], skip_special_tokens=True))
# 78 + 27 = 105
generate()readseos_token_id(1) andpad_token_id(0) automatically fromgeneration_config.json/config.json, supports greedy andtop_ksampling, and supports batched generation withtokenizer.padding_side = "left".forward(..., labels=...)follows standard Hugging Face causal LM next-token shift semantics (logits[:, :-1]vslabels[:, 1:],ignore_index=-100).
Official Evaluation Reproduction
Evaluate in FP32 with add_bos_token=False and context length 512:
# HellaSwag, ARC-Easy, ARC-Challenge, PIQA via lm-evaluation-harness
lm_eval --model hf \
--model_args pretrained=Lazyshu/PyraLM-10M,trust_remote_code=True,dtype=float32,add_bos_token=False,max_length=512 \
--tasks hellaswag,arc_easy,arc_challenge,piqa \
--num_fewshot 0 --batch_size auto
# ArithMark-3.0 via the official script from AxiomicLabs/Arithmark-3.0
# (verified against commit 6f6e59dd9b7e2c63455f7af7f838f9ecc3d0a746; remote code is trusted by default)
python bencharithmark-3.py \
--model Lazyshu/PyraLM-10M \
--dtype float32 --max-context 512 --save-predictions
Verified local environment: Python 3.12.12, torch 2.12.0.dev20260220+cu126, transformers 4.57.1, safetensors 0.6.2, tokenizers 0.22.1, lm-eval 0.4.13, AxiomicLabs/Arithmark-3.0 (6f6e59dd9b7e2c63455f7af7f838f9ecc3d0a746).
Limitations
- Ultra-small capacity (
9.99Mparameters): Intended as a research small language model for studying architecture efficiency, tokenization, and small-scale reasoning; not a general-purpose assistant. - Short context (
512tokens): RoPE and training context are fixed at512tokens. - English only & unaligned: Trained on English data without safety/chat alignment.
- Custom
generate()subset: Supports greedy decoding anddo_sample/temperature/top_kwith unpadded or left-padded inputs; unsupported generation kwargs raiseValueErrorexplicitly.
License & Acknowledgments
Released under the MIT License.
- Special thanks to the PyTRIO team for providing the compute resources for training.
- We gratefully acknowledge the Ethoric-10M authors (Tech.us Team) for releasing their clean MIT-licensed attention/Peri-LN/Canon implementation.
- Thanks to AxiomicLabs for maintaining the Open SLM Leaderboard and ArithMark-3.0.
- Downloads last month
- 636
Evaluation results
- acc_norm (0-shot, local eval) on HellaSwagvalidation set self-reported28.440
- acc_norm (0-shot, local eval) on ARC-Easytest set self-reported40.360
- acc_norm (0-shot, local eval) on ARC-Challengetest set self-reported24.150
- acc_norm (0-shot, local eval) on PIQAvalidation set self-reported58.320
- acc_norm (0-shot, local eval) on ArithMark-3.0test set self-reported58.000