Run this model with HF Jobs
Run Lazyshu/PyraLM-10M-v2 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-v2. 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-v2 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-v2. 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-v2. 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-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Lazyshu/PyraLM-10M-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Lazyshu/PyraLM-10M-v2", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Lazyshu/PyraLM-10M-v2", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Lazyshu/PyraLM-10M-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Lazyshu/PyraLM-10M-v2" # 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-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Lazyshu/PyraLM-10M-v2
- SGLang
How to use Lazyshu/PyraLM-10M-v2 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-v2" \ --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-v2", "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-v2" \ --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-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Lazyshu/PyraLM-10M-v2 with Docker Model Runner:
docker model run hf.co/Lazyshu/PyraLM-10M-v2
PyraLM-10M-v2
| Model | Role | Hugging Face | ModelScope |
|---|---|---|---|
| PyraLM-10M | Original, 18-layer tapered model | HF | MS |
| PyraLM-10M-v2 | Latest <10M, 12 layers | HF | MS |
| PyraLM-50M | Larger capacity, 20 layers | HF | MS |
Leaderboard submissions (2026-12-06): Open SLM #369 and BETU #51 are under review. The unmodified official BETU runner reproduced all six task prediction hashes; its submission Overall Index is 27.22. Official ArithMark-4 evaluation is pending.
PyraLM-10M-v2 is a 9,974,350-parameter (<10M) English decoder-only language model trained from scratch with the PyraLMNext architecture: a 12-layer dense single-pass SwiGLU Transformer featuring causal document-masked Token Smear, Partial RoPE (0.5), Block Attention Residuals, Layer-0 Value Residual, and a custom 5,120-vocabulary byte-level BPE tokenizer.
This release is a genuine single-trajectory training checkpoint (no weight averaging, no model merging, no parameter looping). Its local zero-shot results are 29.37% HellaSwag, 44.82% ARC-Easy, 23.46% ARC-Challenge, 60.55% PIQA, and 63.10% ArithMark-3, with 27.22 BETU Overall Index. Independent leaderboard verification is pending.
The reference models are the top two entries in the Open SLM <10M ranking as of 2026-12-06. PyraLM scores are local FP32 evaluations; reference scores are taken from the official leaderboard. min-spark-1.7 is listed as a four-pass model.
Model Overview
| Property | Value |
|---|---|
| Parameters | 9,974,350 (tied input/output embeddings) |
| Architecture | 12-layer dense single-pass decoder-only Transformer (PyraLMNextForCausalLM) |
Hidden Size (d_model) |
288 |
| Attention | GQA (9 query heads, 3 KV heads, head_dim = 32), Partial RoPE (fraction = 0.5, theta = 10000), per-head QK-Norm, headwise output gate; local window (16) on layer 0 |
| SwiGLU FFN | [560ร9, 544ร3] |
| Residual Mixing | Block Attention Residuals (block_attnres_size = 3) and Layer-0 Value Residual |
| Local Mixing | Causal, document-masked Token Smear and Canon A/C depthwise convolutions (kernel = 4) |
| Context Length | 1,024 tokens |
| Tokenizer | Custom byte-level BPE, 5,120 vocabulary (bos_token = null, pad = 0, eos = 1) |
| Checkpoint Type | Single unaveraged training checkpoint; dense, single-pass inference |
| Weights SHA-256 | cbb54dc9b2db2e3f8ab1468a0642f4eda1421390e1b625cc08c2f6be189dd505 |
| License | MIT |
Evaluation Results
The following are local zero-shot results, awaiting independent leaderboard verification. The Open SLM reference evaluation uses native FP32, TF32 off, no BOS, and a 512-token context.
| Model | Params | HellaSwag (acc_norm) |
ARC-Easy (acc_norm) |
ARC-Challenge (acc_norm) |
PIQA (acc_norm) |
ArithMark-3 |
|---|---|---|---|---|---|---|
| PyraLM-10M-v2 (this release) | 9.97M | 29.37 | 44.82 | 23.46 | 60.55 | 63.10 |
Official ArithMark-4 results and the current Open SLM Intelligence Index are pending independent evaluation.
For the BETU SLM Leaderboard, local evaluation uses the model's native 1,024-token context:
| BETU Task / Index | Local Result |
|---|---|
| HellaSwag (10,042 items) | 29.37% |
| ARC-Easy (2,376 items) | 44.82% |
| PIQA (1,838 items) | 60.55% |
| ArithMark-3 (1,000 items) | 63.10% |
| Tiny Theory of Mind (2,000 items) | 35.55% |
| BananaMind Base Bench 1.1 (350 items) | 47.71% |
| Quality | 24.01 |
| Overall Index | 27.22 |
Additional Local Evaluations: PyraLM Family
The table compares the three released checkpoints on the same fixed text and task subsets. PyraLM-10M-v1 denotes the original PyraLM-10M release. These are local evaluations; the table specifies the evaluated subsets.
| Benchmark | Items / text size | PyraLM-10M-v1 | PyraLM-10M-v2 | PyraLM-50M |
|---|---|---|---|---|
| WikiText-2 โ language modeling (byte PPL โ) | 1,292,008 bytes | 2.9075 | 2.8282 | 2.3925 |
| LAMBADA โ contextual word prediction | 5,153 | 23.56 | 25.54 | 34.74 |
| SWAG โ commonsense continuation | 2,000 | 33.55 | 34.70 | 41.95 |
| RACE-Middle โ reading comprehension | 1,311 | 32.88 | 33.79 | 41.27 |
| RACE-High โ reading comprehension | 1,500 | 28.33 | 27.60 | 32.13 |
| BoolQ โ yes/no reading comprehension | 2,195 | 46.97 | 57.86 | 60.05 |
| OpenBookQA โ elementary science | 454 | 26.21 | 27.75 | 34.58 |
| SciQ โ science knowledge | 993 | 51.96 | 57.40 | 72.51 |
| Quartz โ qualitative reasoning with a passage | 784 | 51.40 | 52.55 | 56.63 |
| COPA โ causal commonsense | 100 | 55.00 | 55.00 | 64.00 |
| WinoGrande โ pronoun resolution | 1,267 | 49.96 | 49.57 | 49.72 |
| RTE โ textual entailment | 272 | 48.16 | 51.84 | 51.10 |
| WiC โ word sense in context | 635 | 50.24 | 45.20 | 49.61 |
| CB โ textual entailment | 48 | 56.25 | 54.17 | 43.75 |
Accuracy is reported in percent. FP32, TF32 off, no BOS, context 512. SWAG, RACE, BoolQ, RTE, WiC and CB use summed continuation log-likelihood; OpenBookQA, SciQ, Quartz, COPA and WinoGrande use character-normalized scores; LAMBADA uses exact next-word completion. BoolQ includes 54 context-truncated candidates for 10M-v1 and 18 for 50M. SciQ uses a test subset; its training split is included in SFT.
WikiText-2 uses the same raw text and 256-token prediction windows. Byte PPL = exp(total NLL / UTF-8 bytes) is reported across different tokenizers; token-level PPL is not compared directly.
Training Summary
- Pretraining: Trained from random initialization on 23.85B training tokens (
19.10Bstable +4.75B1-sqrtcooldown) of English web, educational, textbook, encyclopedia, science, commonsense, and math text using Muon-based optimization (1,024context), followed by a 1.52B-token high-density CoT-Math / Natural Science / WikiHow / DCLM continuation polish (25.37B total training tokens). - Post-training: Single-trajectory SFT on 66,847 examples (
1,400updates, learning rate3.5e-5), combining non-math multiple-choice supervision (SocialIQA,SciQ,CommonsenseQA,QASC) with6,800generative arithmetic / word-problem examples (GSM8K,ASDiv,SVAMP, and exact symbolic arithmetic; 0 math multiple-choice items), retaining pretraining next-token replay at loss weight 0.40.
The released weights come from one continuous training lineage, without weight averaging or model merging.
Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo_id = "Lazyshu/PyraLM-10M-v2"
tokenizer = AutoTokenizer.from_pretrained(repo_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
repo_id,
trust_remote_code=True,
dtype=torch.float32,
).eval()
prompt = (
"Problem: A baker made 48 muffins and sold 19 of them. "
"How many muffins are left?\nSolution:"
)
inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False)
with torch.inference_mode():
out = model.generate(**inputs, max_new_tokens=64, do_sample=False)
print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
For the ModelScope mirror, download the same package and pass the local path to the Transformers calls above:
from modelscope import snapshot_download
repo_id = snapshot_download("Lazyshu/PyraLM-10M-v2")
generation_config.jsonsupplieseos_token_id = 1andpad_token_id = 0.- For batched generation, use
tokenizer.padding_side = "left". - The generation interface supports greedy decoding and temperature/top-k sampling. For sampling, use
do_sample=True, temperature=0.7, top_k=40.
Public-task Reproduction
Use FP32, no BOS, zero-shot prompts, and a 512-token evaluation context (native model context is 1,024).
# Four public tasks via lm-evaluation-harness
lm_eval --model hf \
--model_args pretrained=Lazyshu/PyraLM-10M-v2,trust_remote_code=True,dtype=float32,add_bos_token=False,max_length=512 \
--tasks hellaswag,arc_easy,arc_challenge,piqa \
--num_fewshot 0 --device cpu --batch_size 8
# Official ArithMark-3 script from AxiomicLabs/Arithmark-3.0
python bencharithmark-3.py \
--model Lazyshu/PyraLM-10M-v2 \
--dtype float32 --device cpu --max-context 512 --save-predictions
Limitations
- Ultra-small parameter budget (
9.97M): Designed for small-language-model research and efficient edge/CPU inference; not a general-purpose chat assistant. - Short context: Native context is
1,024tokens; the Open SLM reference evaluation uses512. - English-focused: Pretraining and post-training primarily use English text and have not undergone chat or safety alignment.
License & Acknowledgments
Released under the MIT License. See LICENSE.
- Thanks to the PyTRIO team for providing training compute.
- PyraLM-10M-v2 succeeds PyraLM-10M and shares the PyraLMNext architectural family with PyraLM-50M. We acknowledge Ethoric-10M for the Peri-LN/Canon attention foundation.
- Thanks to AxiomicLabs and BananaMind for maintaining the public benchmarks and leaderboards.
- Downloads last month
- 24
Collection including Lazyshu/PyraLM-10M-v2
Evaluation results
- acc_norm (0-shot, local FP32 eval) on HellaSwagvalidation set self-reported29.370
- acc_norm (0-shot, local FP32 eval) on ARC-Easytest set self-reported44.820
- acc_norm (0-shot, local FP32 eval) on ARC-Challengetest set self-reported23.460
- acc_norm (0-shot, local FP32 eval) on PIQAvalidation set self-reported60.550
- acc_norm (0-shot, local FP32 eval) on ArithMark-3.0test set self-reported63.100