Rill-51M-A25M-Base

Rill-51M-A25M-Base β€” a small hybrid Gated DeltaNet-2 / GQA Mixture-of-Experts language model pretrained from scratch.

  • 51,524,854 parameters (24,982,774 active per token)
  • BF16 SafeTensors weights, plus a mixed-precision NVFP4/FP8/BF16 variant
  • Pretrained on 2,000,000,000 tokens (70/30 FineWeb-Edu/FineWeb) with quantization-aware training
  • Runs locally on CUDA, Apple Silicon (MPS) or CPU

Model Details

Architecture Hybrid decoder-only: Gated DeltaNet-2 + GQA, Mixture-of-Experts FFN
Parameters 51,524,854 total / 24,982,774 active
Hidden size 384
Layers 12 (GDN2 Γ—3 β†’ GQA repeated 3 times; 9 GDN2 + 3 GQA)
Gated DeltaNet-2 6 heads, head dimension 64, short convolution 4
Attention GQA β€” 6 query heads, 2 KV heads, head dimension 64, RoPE ΞΈ=10000
MoE FFN 8 routed SwiGLU experts (intermediate 320), top-2, + 1 shared expert (intermediate 128)
Normalization RMSNorm (pre-norm), gated RMSNorm on GDN2 outputs
Embedding Factorized tied embedding, rank 128
Vocabulary 32,768
Context length 4,096 tokens
Canonical dtype BF16
Mixed-precision variant Routed experts NVFP4, GDN2/GQA Q/K/V/O FP8 E4M3, rest BF16 (45.8 MB vs 103.1 MB)

Training

Pretraining

The Base model was initialized from scratch and pretrained for exactly 2,000,000,000 tokens (30,518 steps of 65,536 tokens, sequence length 4,096, documents packed with per-document state and attention resets).

Data FineWeb-Edu 1.4B tokens (int_score β‰₯ 3) + FineWeb 0.6B tokens, sample-10BT, English, deduplicated
Data license ODC-By 1.0
Optimizer AdamW (Ξ² = 0.9/0.95, weight decay 0.1), peak LR 4e-4, 40M-token warmup, cosine to 4e-5
Quantization-aware training BF16 β†’ routed experts NVFP4 (from 100M tokens) β†’ + FP8 attention projections / KV (from 200M tokens)
Final validation CE 3.426 (BF16), 3.439 (with quantization simulation)
Hardware 1Γ— NVIDIA RTX 5090, about 5.4 hours

Benchmark Results

Zero-shot evaluation with lm-evaluation-harness 0.4.13 task definitions (full test/validation sets), no chat template, BF16 weights on CUDA. MMLU is the harness group score (57 subjects weighted by question count).

Task Metric Shots Base
HellaSwag acc_norm 0 27.88%
PIQA acc_norm 0 59.85%
ARC-Easy acc_norm 0 37.96%
ARC-Challenge acc_norm 0 23.29%
LAMBADA OpenAI acc 0 20.20%
WinoGrande acc 0 50.28%
BoolQ acc 0 51.53%
MMLU (57 subjects, size-weighted) acc 0 22.95%
Eight-task mean β€” 0 36.74%

Tokenizer

  • Rill-Tokenizer-32768
  • Byte-level BPE with NFKC normalization
  • Vocabulary size: 32,768

Special Tokens

Token ID Role
<|endoftext|> 0 end of document / end of turn
<|pad|> 1 padding
<|instruction|> 2 user turn
<|context|> 3 optional context
<|response|> 4 assistant turn

Usage

The bundle includes a self-contained inference.py; it does not import the Rill-LM training code. The config.json, generation_config.json and tokenizer_config.json describe the custom architecture and the generation/tokenizer defaults; standard transformers.AutoModel loading is not supported. Install the three runtime dependencies:

python -m pip install torch safetensors tokenizers

The Base model is a plain text-completion model:

python inference.py --prompt "The history of the printing press" --max-new-tokens 128

Without --prompt the CLI reads prompts interactively (/exit quits).

To use the mixed-precision weights, add --weights mixed; --act-quant additionally quantizes activations and the KV cache the same way as during quantization-aware training (CPU/CUDA only):

python inference.py --weights mixed --act-quant

The device is chosen automatically (CUDA β†’ Apple MPS β†’ CPU; override with --device). Weights are read from the BF16 checkpoint with strict name/shape/dtype checks; computation runs in BF16 on CUDA and FP32 on MPS/CPU, while the router, the Gated DeltaNet-2 recurrent state, normalization statistics and logits are always FP32. Generation is incremental: each Gated DeltaNet-2 layer keeps a fixed-size recurrent state and each GQA layer keeps a KV cache. Sampling defaults: temperature 0.8, top-k 50, top-p 0.95, repetition penalty 1.1 (--temperature 0 for greedy).

Mixed-precision weights

model-mixed.safetensors stores the same checkpoint in the precisions used by quantization-aware training (quantization_config.json lists the format of every tensor):

Tensors Format
Routed experts (experts_gate/up/down) NVFP4: E2M1 values packed two per byte, E4M3 scale per 16 input elements, FP32 scale per expert
GDN2/GQA Q/K/V/O projections FP8 E4M3 with an FP32 scale per output channel
Everything else BF16 (A_log, dt_bias FP32)

The weights are converted from the FP32 master weights with the same functions as the training-time quantization simulation, so the dequantized values match it bit for bit. inference.py dequantizes them at load time, so the mixed weights reduce the file size but do not make inference faster; fast NVFP4/FP8 execution needs dedicated kernels (e.g. on NVIDIA Blackwell GPUs).

Zero-shot results with the mixed-precision weights (same protocol as above; "weights + activations/KV" quantizes activations and the KV cache with per-sequence scales, matching --act-quant on a one-sequence prefill):

Task Metric Shots BF16 Mixed (weights) Mixed (weights + activations/KV)
HellaSwag acc_norm 0 27.88% 27.86% 27.90%
PIQA acc_norm 0 59.85% 59.85% 59.36%
ARC-Easy acc_norm 0 37.96% 38.38% 38.01%
ARC-Challenge acc_norm 0 23.29% 22.44% 21.93%
LAMBADA OpenAI acc 0 20.20% 20.53% 20.30%
WinoGrande acc 0 50.28% 50.75% 50.43%
BoolQ acc 0 51.53% 51.93% 52.08%
MMLU (57 subjects, size-weighted) acc 0 22.95% 22.94% 22.96%
Eight-task mean β€” 0 36.74% 36.84% 36.62%

Limitations

This model is very small and is intended for research and local experimentation rather than reliable general-purpose assistance. It produces factual errors, repetitions and incoherent text, and it scores near chance on WinoGrande, ARC-Challenge and MMLU. It was trained on English web text only and has not been safety-tuned.

License

MIT License for the weights and code in this repository. The training data keep their own licenses (FineWeb/FineWeb-Edu: ODC-By 1.0).

Files

  • README.md β€” model card and usage documentation
  • inference.py β€” standalone strict loader and interactive/single-prompt inference CLI
  • model.safetensors β€” BF16 model weights
  • model-mixed.safetensors β€” mixed-precision weights (NVFP4 / FP8 / BF16)
  • quantization_config.json β€” per-tensor format of the mixed-precision weights
  • tokenizer.json β€” standalone tokenizer
  • config.json β€” custom architecture configuration
  • generation_config.json β€” sampling defaults
  • tokenizer_config.json β€” tokenizer defaults and special-token mapping

No training data, optimizer state, or other training outputs are included.

Downloads last month
82
Safetensors
Model size
51.5M params
Tensor type
BF16
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for brulee-1/Rill-51M-A25M-Base

Finetunes
1 model

Datasets used to train brulee-1/Rill-51M-A25M-Base

Collection including brulee-1/Rill-51M-A25M-Base