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.

PyraLM-10M

English | ็ฎ€ไฝ“ไธญๆ–‡

BETU leaderboard update (2026-12-04): PyraLM-10M ranks #1 in the <10M category 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

  1. Stage 1 โ€” Pretraining from Scratch (20.0B tokens):
    • Trained from random initialization (15.4B main stage + 4.6B annealing 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).
  2. Stage 2 โ€” Post-Training on Non-Benchmark QA & Math (112,644 examples, 2,081 steps):
    • Single-trajectory post-training starting from the final 20.0B checkpoint (lr = 5e-5, global batch 128, no EMA/SWA/weight merging).
    • Composed strictly of non-leaderboard public QA/math training sets (SocialIQA, CommonsenseQA, SciQ, QASC, GSM8K, Orca-Math, ASDiv, SVAMP) plus 24,000 programmatically 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 (0 hits under the frozen lexical guard).
  3. 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() reads eos_token_id (1) and pad_token_id (0) automatically from generation_config.json / config.json, supports greedy and top_k sampling, and supports batched generation with tokenizer.padding_side = "left".
  • forward(..., labels=...) follows standard Hugging Face causal LM next-token shift semantics (logits[:, :-1] vs labels[:, 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.99M parameters): Intended as a research small language model for studying architecture efficiency, tokenization, and small-scale reasoning; not a general-purpose assistant.
  • Short context (512 tokens): RoPE and training context are fixed at 512 tokens.
  • English only & unaligned: Trained on English data without safety/chat alignment.
  • Custom generate() subset: Supports greedy decoding and do_sample / temperature / top_k with unpadded or left-padded inputs; unsupported generation kwargs raise ValueError explicitly.

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
Safetensors
Model size
9.99M params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Evaluation results