CoolFace
Modelpublic

OliverSundaram/Sai-Slice1-60M-base

sourceHugging Faceapache-2.0updated 8d agoView on Hugging Face
1likes449downloads
Model Card

Sai-Slice1-60M-base

![Github](https://github.com/OliverSundaram/Sai) ![License: Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)


Sai-Slice1-60M-base is a small Mixture-of-Experts (MoE) decoder-only language model, pretrained from scratch on ~1.2B tokens of English web text. It is the first release (slice 1) of the Sai series.

This is a base model: it continues text and has not been instruction-tuned. A chat fine-tune (Sai-Slice1-60M-Chatter) is coming soon.

Total parameters~60.6M
Active parameters per token~19.3M
Training tokens~1.19B (1 epoch)
Context length1,024
Training compute24.9 h on a single RTX 4060 (8 GB)
Test cross-entropy2.101 (perplexity ≈ 8.2)

Model details

ComponentSetting
ArchitectureDecoder-only transformer, pre-norm
Layers15 (1 dense + 14 MoE)
Hidden size256
AttentionMulti-head attention, 8 heads (head dim 32)
Position embeddingRoPE (base 10,000)
NormalizationRMSNorm
Feed-forwardSwiGLU
FFN hidden dim1,024 (dense layer) / 192 (each expert)
Experts per MoE layer24 routed + 1 shared
Router top-k4
Vocabulary16,384 (byte-level BPE)
EmbeddingsTied input/output
KV cacheYes
Weights dtypefloat32

Each token is routed to 4 of the 24 routed experts, and always passes through the shared expert. The first layer uses a dense FFN; the other 14 use MoE. Routing is trained with a load-balancing auxiliary loss.

Parameter breakdown: token embeddings 4.19M (tied with the output head), attention 3.93M, dense FFN 0.79M, MoE layers 51.7M (14 × 25 experts × 147K + routers). Active per token counts 5 of the 25 experts in each MoE layer.

Usage

The model uses custom code, so trust_remote_code=True is required. It was built and tested with transformers==5.16.1 and torch==2.11.0.

python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

repo = "OliverSundaram/Sai-Slice1-60M-base"

model = AutoModelForCausalLM.from_pretrained(repo, trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained(repo)

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")

text, tokens_per_sec, time_to_first_token = model.run(
    "The history of the printing press",
    tokenizer,
    device,
    max_new_tokens=100,
    top_k=20,
    temp=0.9,
    use_cached=True,
    format_prompt=False,  # plain text continuation for the base model
)
print(text)

model.run returns the prompt plus its continuation, the generation speed in tokens/sec, and the time to first token in seconds. Generation stops at <|end|>, at max_new_tokens, or at the 1,024-token context limit.

Notes:

  • —Keep format_prompt=False with this base model. format_prompt=True wraps the prompt in the chat template (<|system|>…<|end|><|user|>…<|end|><|assistant|>), which is intended for the upcoming fine-tuned model.
  • —Use model.run for generation. The Hugging Face generate() method is not supported, because the model manages its own KV cache instead of returning past_key_values.
  • —A standard forward pass (model(input_ids, attention_mask=...)) returns logits and works with tools such as lm-evaluation-harness.

Training data

Sourceopenbmb/Ultra-FineWeb-L3, subset Ultra-FineWeb-L3-en-Multi-Style-Synthetic
Tokens~1.2B, streamed and shuffled (seed 42)
Split99.5% train / 0.25% validation / 0.25% test
Document separator`<\end\>`

Tokenizer: byte-level BPE trained on the first 1M documents of the same subset. Vocabulary size is 16,384, maximum token length is 16, and there are five special tokens: <|end|> (EOS), <|pad|>, <|user|>, <|assistant|> and <|system|>.

Training procedure

HyperparameterValue
Epochs1
Optimizer steps18,219
Sequence length1,024
Batch size8 × 8 gradient accumulation = 64 sequences (65,536 tokens) per step
OptimizerAdamW (β₁ 0.9, β₂ 0.95, ε 1e-8)
Weight decay0.1 (on weight matrices only)
Peak learning rate3e-4
LR scheduleWarmup-stable-decay: 3% linear warmup, then constant, then 1 − √ decay to 0 over the final 20%
Gradient clipping1.0
Aux (load-balancing) losscoefficient 0.01
Precisionbf16 autocast
Dropout0.0
Seed42
Hardware1× NVIDIA RTX 4060 (8 GB)
Training time24.9 hours

Final results: test cross-entropy 2.101 (perplexity ≈ 8.2), test auxiliary loss 1.033.

[image]

Evaluation

Evaluated with lm-evaluation-harness v0.4.13 on the full test sets.

TaskMetricShotsSai-Slice1-60M-baseChance
SciQacc062.3 ± 1.525.0
COPAacc058.0 ± 5.050.0
PIQAacc_norm056.5 ± 1.250.0
WinoGrandeacc552.2 ± 1.450.0
TruthfulQA (MC2)acc047.6 ± 1.6—
BoolQacc047.5 ± 0.950.0
Social IQaacc034.4 ± 1.133.3
HellaSwagacc_norm528.2 ± 0.425.0
OpenBookQAacc_norm026.2 ± 2.025.0
ARC-Challengeacc_norm1524.4 ± 1.325.0
RACEacc023.3 ± 1.325.0
MMLUacc023.2 ± 0.425.0
CommonsenseQAacc020.0 ± 1.120.0
LAMBADA (OpenAI)acc09.4 ± 0.4—
LAMBADA (standard)acc08.3 ± 0.4—
TaskMetricValue
WikiTextword perplexity148.35
WikiTextbyte perplexity2.547
LAMBADA (OpenAI)perplexity1,081

MMLU by category: humanities 24.3, STEM 21.9, social sciences 21.7, other 24.2.

[image]

<details> <summary>MMLU by subject</summary>

[image]

</details>

Inference speed

Measured with model.run on 100 prompts from gharezlak/autocomplete, generating up to 100 new tokens (top-k 20, temperature 0.9, KV cache on), in float32 on an RTX 4060 (8 GB).

MetricMeanMedian
Tokens / sec10.710.7
Time to first token0.18 s0.16 s

The first prompt includes CUDA warmup (1.85 s time to first token). Throughput is currently limited by the MoE layer, which loops over experts in Python, rather than by model size.

[image]

Limitations

  • —Base model only. It continues text and does not follow instructions or hold a conversation.
  • —Small. With ~60M parameters and ~1.2B training tokens, it has very limited world knowledge and reasoning, and it often produces fluent but incorrect or incoherent text. Do not rely on its outputs for facts.
  • —English only, with a 1,024-token context window.
  • —Data bias. It was trained on filtered and synthetically rewritten web text and may reproduce the biases and errors in that data.
  • —It is intended for research, education and experimentation, not for production use.

Files

FileDescription
model.safetensorsModel weights (float32)
config.jsonModel configuration
modules.pyModel code (SaiConfig, Sai), loaded via trust_remote_code
tokenizer.json, tokenizer_config.jsonTokenizer
trainer_state.ptOptimizer and scheduler state plus loss history, for resuming training or re-plotting
assets/Charts used in this card

Citation

bibtex
@misc{sundaram2026sai,
  title        = {Sai-Slice1-60M-base: A Small Mixture-of-Experts Language Model},
  author       = {Sundaram, Oliver},
  year         = {2026},
  howpublished = {\url{https://huggingface.co/OliverSundaram/Sai-Slice1-60M-base}}
}

License

Released under the Apache 2.0 License.