---
language:
- en
license: apache-2.0
library_name: transformers
tags:
- text-generation
- llama
- small-language-model
- efficient
- edge-deployment
- speculative-decoding
- tiny-model
- 12m-parameters
- kaggle-trained
- educational
- research
- low-resource
- cpu-inference
- mobile-deployment
- stentor2
- tokenmonster
pipeline_tag: text-generation
datasets:
- epfml/FineWeb-HQ
- StentorLabs/StenCore
thumbnail: https://huggingface.co/StentorLabs/Stentor2-12M/resolve/main/thumbnail.png
widget:
- text: Once upon a time
example_title: Story Generation
- text: Explain neural networks in simple terms.
example_title: Toy Explanation (Often Wrong)
- text: 'def fibonacci(n):'
example_title: Code Continuation
- text: The laws of thermodynamics describe
example_title: Science Continuation
model_card_authors:
- StentorLabs
model-index:
- name: Stentor2-12M
results:
- task:
type: text-generation
dataset:
name: FineWeb-HQ (validation split)
type: epfml/FineWeb-HQ
metrics:
- name: Best Validation Loss
type: loss
value: 3.2814
- name: Best Perplexity (at best checkpoint)
type: perplexity
value: 26.61
- name: Final Epoch Validation Loss
type: loss
value: 3.2565
- name: Final Epoch Perplexity
type: perplexity
value: 25.96
- name: BLiMP Overall Accuracy
type: accuracy
value: 68.95
---
# Stentor2-12M







[](https://huggingface.co/StentorLabs)
> ๐ฌ **Research Artifact โ Not a Production Model.** This model has no safety tuning and is not suitable for deployment in any user-facing application. See [Intended Uses](#use-cases--intended-uses) for details.
---
## Table of Contents
1. [What Is This?](#what-is-this)
2. [The Core Design Insight: Vocabulary Efficiency](#the-core-design-insight-vocabulary-efficiency)
3. [Head-to-Head: Stentor v1 vs Stentor2](#head-to-head-stentor-v1-vs-stentor2)
4. [Quick Start](#quick-start)
5. [Important Limitations](#important-limitations)
6. [Honest Notices](#-honest-notices)
7. [PDF Tokens & The Replacement Character](#pdf-tokens--the-replacement-character)
8. [Model Architecture โ Full Specification](#model-architecture--full-specification)
9. [The Tokenizer: TokenMonster](#the-tokenizer-tokenmonster)
10. [Training Infrastructure](#training-infrastructure)
11. [Training Hyperparameters โ Complete Reference](#training-hyperparameters--complete-reference)
12. [The T4 Mixed-Precision Recipe โ Deep Dive](#the-t4-mixed-precision-recipe--deep-dive)
13. [Data Pipeline](#data-pipeline)
14. [Weight Initialization](#weight-initialization)
15. [Evaluation & Results](#evaluation--results)
16. [Training Dynamics](#training-dynamics)
17. [Use Cases & Intended Uses](#use-cases--intended-uses)
18. [Out-of-Scope Uses](#out-of-scope-uses)
19. [Ethical Considerations & Societal Impact](#ethical-considerations--societal-impact)
20. [Inference Guide](#inference-guide)
21. [Free Inference โ Try It Now](#-free-inference--try-it-now)
22. [Real Model Responses](#real-model-responses)
23. [Quantization](#quantization)
24. [Format Conversion](#format-conversion)
25. [Speculative Decoding](#speculative-decoding)
26. [Bias, Risks & Limitations](#bias-risks--limitations)
27. [Related Work](#related-work)
28. [Environmental Impact](#environmental-impact)
29. [Citation](#citation)
---
## What Is This?
Stentor2-12M is the first production release from the **Stentor2** model family โ a ground-up redesign of the original Stentor v1 line. At ~12.3M parameters, it is a compact base language model built entirely from scratch on free-tier Kaggle compute using two NVIDIA Tesla T4 GPUs.
Like all Stentor models, this is a **base next-token predictor**, not a chat assistant. It will not reliably follow instructions, has no safety tuning, and is best used for research, prototyping, speculative decoding, and edge-deployment experimentation. The value of this model is not its conversational capability โ it's what it represents architecturally: a dramatic efficiency gain over v1 at the same scale, achieved by fixing the root cause of v1's underperformance.
---
## The Core Design Insight: Vocabulary Efficiency
The most consequential change in Stentor2 is the replacement of the standard Llama/Mistral 32,768-token vocabulary with a purpose-built **8,000-token English vocabulary** from the TokenMonster project (`english-8000-strict-nocapcode-v1`, padded to 8,064 for hardware alignment).
This is not a minor tweak โ it is the entire architectural story of Stentor2.
### Why Vocabulary Size Matters So Much at This Scale
In a transformer language model, the embedding table has shape `[vocab_size ร hidden_size]`. When you tie word embeddings (share the embedding and output projection weights, which Stentor does), this table appears once in the parameter count. At 12M total parameters, the fraction consumed by this table dictates how much "brain" is left over for the actual transformer layers.
**Stentor-12M (v1)** used a 32,768-token vocabulary. At a hidden size of 192:
```
embedding_params = 32,768 ร 192 = 6,291,456
total_params = 12,047,040
embedding_share = 52.2%
```
Over half of the model was a lookup table. The transformer stack โ the part that actually *learns language patterns* โ had fewer than 6 million parameters to work with.
**Stentor2-12M** uses an 8,064-token vocabulary. At a hidden size of 256:
```
embedding_params = 8,064 ร 256 = 2,064,384
total_params = 12,294,400
embedding_share = 16.8%
```
By shrinking the vocabulary, the embedding table was cut from 6.3M to 2.1M parameters โ freeing up ~4.2M parameters redistributed into transformer depth (12 layers vs 9) and width (hidden size 256 vs 192), where they contribute directly to language modeling quality.
The result is a **~70.1% reduction in perplexity** (89.01 โ ~26.6) compared to Stentor-12M v1.
---
## Head-to-Head: Stentor v1 vs Stentor2
| Property | Stentor-12M (v1) | Stentor2-12M |
|---|---|---|
| **Vocabulary** | 32,768 (Mistral BPE) | 8,064 (TokenMonster English) |
| **Hidden Size** | 192 | 256 |
| **Intermediate Size** | 576 | 768 |
| **Num Layers** | 9 | 12 |
| **Attention Heads** | 3 | 4 |
| **Head Dimension** | 64 | 64 |
| **Context Length** | 512 tokens | 1,024 tokens |
| **Total Parameters** | 12,047,040 | 12,294,400 |
| **Embedding Share** | 52.2% | 16.8% |
| **Non-Embedding Params** | ~5.76M | ~10.23M |
| **Source Token Budget** | 200M | 240M |
| **Total Token Budget** | ~200M | 480M |
| **Training Time** | ~1.3h | ~2.1h |
| **Training Processes** | 1 | 2 |
| **Best Perplexity** | 89.01 | **26.61** |
| **Perplexity Reduction** | โ | **~70.1%** |
| **BLiMP Accuracy** | โ | **68.95%** |
| **Tokenizer** | Mistral BPE | TokenMonster |
| **Architecture** | LlamaForCausalLM | LlamaForCausalLM |
| **Training Precision** | fp16 | fp16 + FP32 norms/critical layers |
---
## ๐ Quick Start
### 1. Install Dependencies
```bash
pip install transformers torch safetensors huggingface_hub tokenmonster
```
### 2. Load the Model
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model = AutoModelForCausalLM.from_pretrained(
"StentorLabs/Stentor2-12M",
torch_dtype=torch.float16,
)
tokenizer = AutoTokenizer.from_pretrained(
"StentorLabs/Stentor2-12M",
trust_remote_code=True,
)
```
### 3. Generate Text
```python
input_ids = torch.tensor([tokenizer.encode("The history of computing")], dtype=torch.long).to(next(model.parameters()).device)
attention_mask = torch.ones_like(input_ids)
with torch.inference_mode():
output = model.generate(
input_ids,
attention_mask=attention_mask,
max_new_tokens=80,
do_sample=True,
temperature=1.1,
top_p=0.55,
repetition_penalty=1.15,
pad_token_id=tokenizer.pad_token_id,
)
print(tokenizer.decode(output[0].tolist()))
```
> **Why `attention_mask`?** The model's pad token and EOS token are the same ID. Without an explicit attention mask, HuggingFace throws a warning because it can't tell which tokens are real vs padding. Passing `torch.ones_like(input_ids)` tells the model that every token in the input is real.
### 4. Recommended Generation Settings
| Parameter | Recommended Range | Personal Favorite | Notes |
|---|---|---|---|
| `temperature` | 0.6 โ 0.9 | **0.8** | Below 0.6 causes heavy `<22>` (PDF token) output; above 0.9 gets chaotic |
| `top_p` | 0.6 โ 0.8 | **0.7** | Below 0.6 also increases `<22>` tokens significantly |
| `repetition_penalty` | 1.1 โ 1.4 | **1.2** | Without this the model will loop; 1.2โ1.3 hits the sweet spot |
| `max_new_tokens` | 10 โ 500 | โ | Model stays mostly on topic but may drift at longer lengths |
> โ ๏ธ **Always use `repetition_penalty โฅ 1.1`.** Without it, this model will fall into repetitive loops. With it on, output quality is mostly stable.
> โ ๏ธ **Keep temperature and top_p above 0.6.** Going below this threshold causes the model to lean heavily on PDF-derived tokens that render as `<22>` (the Unicode replacement character). See [PDF Tokens](#pdf-tokens--the-replacement-character) for details.
---
## โ ๏ธ Important Limitations
- **Not Instruction-Tuned:** This is a base model. It will often ignore prompts, continue in unexpected directions, or respond off-topic.
- **No Safety Tuning:** No RLHF, no constitutional AI, no content filtering.
- **Limited World Knowledge:** ~12M parameters cannot store meaningful world knowledge.
- **Context Window:** Hard limit of 1,024 tokens.
- **English Only:** The TokenMonster vocabulary is English-specific.
- **TokenMonster Required:** Uses a TokenMonster adapter. Make sure `tokenmonster` is installed (`pip install tokenmonster`). You do not need a custom model loader โ standard `AutoModelForCausalLM` works โ but the tokenmonster package is still required for the tokenizer.
- **PDF Tokens (`<22>`):** The model was trained on data containing PDF-extracted text, and will sometimes generate tokens that render as `<22>` (the Unicode replacement character). See the [PDF Tokens](#pdf-tokens--the-replacement-character) section below.
- **Repetition Without Penalty:** Without `repetition_penalty`, the model will fall into loops. Always use `repetition_penalty โฅ 1.1`.
- **Shared Tensor Warning:** When saving or loading, you may see: `Removed shared tensor {'lm_head.weight'} while saving`. This is expected from tied word embeddings and is safe to ignore.
---
## ๐ Honest Notices
These are candid, first-hand observations about how this model actually behaves.
1. **Significantly more coherent than its predecessors.** Output quality is a clear step up from Stentor2-12M-Preview and Stentor-12M v1. It is competitive with โ and in some runs slightly better than โ Stentor-30M, despite being less than half the parameter count.
2. **Generates PDF tokens (`<22>`).** The model will sometimes output tokens that display as `<22>` โ the Unicode replacement character. These are valid tokens from PDF-extracted training data that most systems cannot natively render, and that most language models never produce. They are not a decoding error. See [PDF Tokens](#pdf-tokens--the-replacement-character) for details.
3. **Prone to repetition without `repetition_penalty`.** Left unchecked, the model loops. With `repetition_penalty` set to 1.1โ1.4, this is mostly resolved and output quality is stable.
4. **No custom model loader required. ๐** Unlike Stentor2-12M-Preview, this model loads with standard `AutoModelForCausalLM.from_pretrained()`. No special loading code needed.
5. **You still need to install `tokenmonster`.** The tokenizer wraps TokenMonster and requires `pip install tokenmonster`. It's a one-line install and nothing like the complexity of a fully custom tokenizer, but it is a required dependency.
6. **The model talks about education and academics โ a lot.** Trained on FineWeb-HQ (a high-quality filtered web corpus with significant PDF and educational content) and StenCore (100% PDFs), the model has a strong prior toward academic language, school systems, curriculum, research, and formal writing. Prompts unrelated to education will frequently be redirected toward educational framing anyway.
7. **This model will usually stop on its own.** Unlike other Stentor models that tend to run until they hit `max_new_tokens`, Stentor2-12M will typically emit an EOS token and halt by itself โ it can happen anywhere, it might be at the 20 token mark or it might be the 500 token mark. The exact stopping point can highly vary. You don't need a tight token cap to prevent runaway generation. That said, it's still recommended to set a generous ceiling (e.g. `max_new_tokens=1000`) rather than leaving it uncapped, just as a safety net in case the model doesn't stop on a given run.
---
## PDF Tokens & The Replacement Character
Stentor2-12M was trained on FineWeb-HQ and StenCore, which includes a substantial amount of text extracted from PDF documents. PDFs often contain binary sequences or encoding artifacts that survive text extraction as raw bytes outside the standard UTF-8 range. These get tokenized and trained on as valid tokens.
As a result, the model has learned to generate these tokens โ and will do so, especially at lower temperatures or lower top-p values. When decoded, they render as **`<22>`** (U+FFFD, the Unicode replacement character), because most systems substitute this symbol for unrepresentable byte sequences.
**What this looks like:**
```
Academics โ <22><22><22><22><22><22><22><22><22><22><22><22><22><22>...
```
**How to reduce it:** Keep `temperature โฅ 0.6` and `top_p โฅ 0.6`. Below these thresholds, PDF token probability rises sharply. At well-tuned settings (temp 0.8, top_p 0.7), `<22>` tokens appear occasionally but do not dominate output.
**This is not a bug.** Most language models are trained on clean text and never encounter these sequences. Stentor2-12M is unusual in that it can generate them โ a side effect of training on real-world PDF-extracted data.
---
## Model Architecture โ Full Specification
Stentor2-12M is a `LlamaForCausalLM` model.
### Core Configuration
| Component | Value | Derivation |
|---|---|---|
| **Architecture** | `LlamaForCausalLM` | Hard-coded in training script |
| **Hidden Size** | 256 | embedding_params (2,064,384) รท vocab_size (8,064) = 256 โ |
| **Intermediate Size (FFN)** | 768 | Hidden ร 3 (verified via total param count) |
| **Num Hidden Layers** | 12 | Verified via total param count formula |
| **Num Attention Heads** | 4 | Hidden รท head_dim = 256 รท 64 = 4 |
| **Num Key/Value Heads** | 4 | Full MHA (no GQA at this scale) |
| **Head Dimension** | 64 | Enforced by training script |
| **Vocab Size** | 8,064 | TokenMonster 8K base + 62 padding tokens (multiple of 128) |
| **Max Position Embeddings** | 1,024 | `block_size` default in training script |
| **Hidden Activation** | SiLU | LlamaForCausalLM default |
| **Positional Encoding** | RoPE | `rope_theta = 10,000.0` |
| **RMS Norm Epsilon** | 1e-5 | Default in training script |
| **Tie Word Embeddings** | True | Shared embedding / LM head weights |
| **Attention Implementation** | SDPA | PyTorch Scaled Dot Product Attention |
### Parameter Count Breakdown
```python
def estimate_llama_params(vocab_size, hidden_size, intermediate_size,
num_hidden_layers, num_attention_heads, num_key_value_heads):
kv_dim = int(hidden_size * num_key_value_heads / num_attention_heads)
attn = 2 * hidden_size * hidden_size + 2 * hidden_size * kv_dim
mlp = 3 * hidden_size * intermediate_size
norm = 2 * hidden_size
total = vocab_size * hidden_size + num_hidden_layers * (attn + mlp + norm) + hidden_size
return total
```
Plugging in Stentor2 values:
```
kv_dim = 256 * 4 / 4 = 256
attn = 2ร256ร256 + 2ร256ร256 = 262,144
mlp = 3ร256ร768 = 589,824
norm = 2ร256 = 512
per_layer = 852,480
embedding = 8,064 ร 256 = 2,064,384
layers = 12 ร 852,480 = 10,229,760
final_norm = 256
total = 2,064,384 + 10,229,760 + 256 = 12,294,400 โ
```
| Component | Parameters | % of Total |
|---|---|---|
| Embedding Table (tied with LM Head) | 2,064,384 | 16.8% |
| Transformer Layers ร 12 | 10,229,760 | 83.2% |
| โ Attention (per layer ร 12) | 3,145,728 | 25.6% |
| โ FFN/MLP (per layer ร 12) | 7,077,888 | 57.5% |
| โ Layer Norms (per layer ร 12) | 6,144 | 0.05% |
| Final RMS Norm | 256 | 0.002% |
| **Total** | **12,294,400** | **100%** |
---
## The Tokenizer: TokenMonster
Stentor2 uses a custom tokenizer adapter wrapping the **TokenMonster** `english-8000-strict-nocapcode-v1` vocabulary.
### What Is TokenMonster?
TokenMonster ([alasdairforsythe/tokenmonster](https://huggingface.co/alasdairforsythe/tokenmonster)) is an alternative tokenization approach optimized for compact English vocabulary sizes.
### Tokenizer Efficiency vs. v1
This tokenizer produces **more tokens per word** compared to Stentor v1. This is expected โ smaller vocabulary means more tokens per word on average. The ~70.1% perplexity improvement shows the tradeoff was worth it.
### Vocabulary Construction
1. Base vocabulary loaded from `alasdairforsythe/tokenmonster` โ `vocabs/english-8000-strict-nocapcode-v1.vocab`
2. Special tokens added: `` (EOS), `` (BOS), `",
"bos_token": "",
"pad_token": "",
"vocab_size": 8064
}
```
### Chat Template
```jinja
{% for message in messages %}
<|{{ message['role'] }}|>
{{ message['content'] }}
{% endfor %}
{% if add_generation_prompt %}<|assistant|>
{% endif %}
```
---
## Training Infrastructure
### Hardware
| Component | Specification |
|---|---|
| GPU Count | 2ร NVIDIA Tesla T4 |
| VRAM per GPU | 15.64 GB |
| Total VRAM | ~31.3 GB |
| Active Training Processes | **2** (dual-process via HuggingFace Accelerate) |
| Platform | Kaggle Notebooks (free tier) |
| Accelerator Library | HuggingFace Accelerate |
### Software Stack
| Package | Role |
|---|---|
| PyTorch | Core tensor operations and autograd |
| HuggingFace Transformers | Model architecture (LlamaForCausalLM) |
| HuggingFace Accelerate | Training loop and device management |
| HuggingFace Datasets | Data loading |
| bitsandbytes | Dual-GPU optimization |
| tokenmonster | Custom vocabulary |
| safetensors | Model serialization |
---
## Training Hyperparameters โ Complete Reference
### Core Training Parameters
| Hyperparameter | Value | Notes |
|---|---|---|
| `learning_rate` | 8e-4 | AdamW LR (script default) |
| `weight_decay` | 0.01 | Applied to non-embedding, non-norm, non-bias params |
| `max_grad_norm` | 1.0 | Gradient clipping threshold |
| `optimizer` | AdamW | With `betas=(0.9, 0.95)`, `eps=1e-8` |
| `scheduler` | Cosine | Cosine decay with linear warmup |
| `warmup_ratio` | 0.05 | โ **477 warmup steps** |
| `stable_ratio` | 0.80 | โ **7,641 stable steps** |
| `source_token_budget` | 240,000,000 | Source data token cap |
| `token_budget` | 480,000,000 | Total training tokens; **hit at ~3,662 steps** |
| `max_train_steps` | 9,552 | Configured limit; token budget hit first |
| `seed` | 42 | Reproducibility seed |
| `mixed_precision` | fp16 | All activations/gradients in FP16 |
### Batch & Sequence Parameters
| Hyperparameter | Value | Notes |
|---|---|---|
| `per_device_train_batch_size` | **32** | Per GPU per gradient accumulation step |
| `per_device_eval_batch_size` | 16 | Evaluation batch size |
| `gradient_accumulation_steps` | **2** | Effective optimizer steps every 2 forward passes |
| `total_batch_size` | **128** | `per_device ร processes ร grad_accum = 32ร2ร2` |
| `block_size` | 1,024 | Sequence length; training packed to this size |
| `tokens_per_optimizer_step` | **131,072** | `total_batch_size ร block_size = 128ร1024` |
| `num_train_epochs` | 2 | Both epochs completed before token budget |
### Evaluation & Checkpointing
| Hyperparameter | Value |
|---|---|
| `eval_steps` | **900** |
| `best_eval_steps` | 900 |
| `best_eval_start_step` | 1,500 |
| `save_every_minutes` | 30 |
| `save_total_limit` | 2 |
| `logging_steps` | **300** |
| `max_eval_samples` | 5,000 |
### AdamW Optimizer โ Detailed
- **Decay group:** All `nn.Linear` weight matrices โ `weight_decay = 0.01`
- **No-decay group:** Bias terms, normalization parameters, embedding parameters โ `weight_decay = 0.0`
- **Betas:** `(0.9, 0.95)`
- **Epsilon:** `1e-8`
- **Fused kernel:** Enabled when CUDA is available
### Learning Rate Schedule
```
Phase 1 โ Warmup (steps 0โ477):
LR ramps linearly from 0 โ 8e-4
Phase 2 โ Cosine Decay (steps 477โ9,552):
LR follows cosine curve from 8e-4 โ 0
(Training ended early at ~3,662 steps due to token budget)
```
---
## The T4 Mixed-Precision Recipe โ Deep Dive
The training pipeline uses a custom **T4 Mixed-Precision Recipe** designed for stable fp16 training on NVIDIA Tesla T4 GPUs.
### 1. FP32 Normalization Layers (25 modules)
All RMSNorm modules are monkey-patched to run in FP32 regardless of input dtype:
```python
def _fp32_norm_forward(hidden_states, *args, **kwargs):
input_dtype = hidden_states.dtype
output = original_forward(hidden_states.float().contiguous(), *args, **kwargs)
return output.clone().to(input_dtype)
```
The `.clone()` call prevents returning graph-managed buffers that can be overwritten. The `.contiguous()` prevents strided-tensor issues in FP32 norm ops.
**Count:** 12 layers ร 2 norms each (input + post-attention) + 1 final norm = **25 modules total**.
### 2. FP32 Critical Layers (2 layers)
The **first 2 transformer layers** are designated as critical and run entirely in FP32:
- Weights cast to `.float()` at setup time
- `forward()` monkey-patched to cast all inputs to FP32 and outputs back to original dtype
- `torch.amp.autocast("cuda", enabled=False)` prevents re-downcasting inside the layer
**Rationale:** The first layers handle embedding projection and initial feature extraction. Instability here corrupts the entire forward pass. Running these in FP32 provides a stability floor at minimal compute cost.
### 3. FP32 Attention Softmax โ Skipped
The FP32 softmax wrapper was **not applied** (0 modules). As logged during training:
```
Stability tricks: skipping FP32 softmax wrapper because
SDPA/FlashAttention kernels require fp16/bf16 inputs for fast paths.
```
PyTorch's SDPA implementation handles numerical stability internally and requires fp16/bf16 inputs for its optimized code paths. Wrapping softmax in FP32 would bypass these fast kernels.
### T4 Recipe Summary
| Technique | Count | Scope |
|---|---|---|
| FP32 norm modules | **25** | All RMSNorm layers |
| FP32 critical layers | **2** | First 2 transformer layers |
| FP32 softmax modules | **0** | Skipped โ SDPA incompatible |
---
## Data Pipeline
### Dataset
The model was trained on **FineWeb-HQ and StenCore** ([epfml/FineWeb-HQ](https://huggingface.co/datasets/epfml/FineWeb-HQ)) and ([StentorLabs/StenCore](https://huggingface.co/datasets/StentorLabs/StenCore))โ high-quality filtered web and PDF corpuses.
**Total tokens processed:** 480,116,736 (~480M, budget-limited run)
**Source tokens (raw data):** 240,000,000 (240M source token budget)
### Text Preprocessing
```python
def clean_text(text: str) -> str:
text = unicodedata.normalize("NFKC", text)
lines = [line.strip() for line in text.splitlines() if line.strip()]
text = " ".join(lines)
text = " ".join(text.split())
return text
```
- **NFKC normalization** maps visually equivalent Unicode characters to canonical form
- **Whitespace collapse** ensures consistent tokenization
### Sequence Packing
After tokenization, samples are packed into fixed 1,024-token blocks. Labels for packed sequences are identical to `input_ids` (causal LM). No special boundary masking between packed samples.
---
## Weight Initialization
```python
def initialize_weights(model, std=0.02):
for module in model.modules():
if isinstance(module, (nn.Linear, nn.Embedding)):
module.weight.data.normal_(mean=0.0, std=std)
if module.bias is not None:
module.bias.data.zero_()
elif "rmsnorm" in type(module).__name__.lower():
if module.weight is not None:
module.weight.data.fill_(1.0)
if module.bias is not None:
module.bias.data.zero_()
```
- Linear/Embedding layers: normal(0, 0.02)
- RMSNorm scale weights: 1.0 (identity at start)
- Biases: zero
---
## Evaluation & Results
### Training Curves

> Raw data available in [`training_curves.csv`](./training_curves.csv) โ columns: `step`, `epoch`, `train_loss`, `eval_loss`, `eval_ppl`, `note`.
---
### Results Summary
| Checkpoint | Step | Eval Loss | Perplexity |
|---|---|---|---|
| Early | 900 | โ | โ |
| First best | 1,500 | 3.5410 | 34.50 |
| Second best | 2,400 | 3.3743 | 29.20 |
| Epoch 0 end | ~2,350 | 3.3776 | 29.30 |
| **Best Checkpoint** | **3,300** | **3.2814** | **26.61** |
| Epoch 1 end (final) | ~3,662 | 3.2565 | 25.96 |
### Comparison to Stentor v1
| Model | Best Eval Loss | Best Perplexity | Improvement |
|---|---|---|---|
| Stentor-12M (v1) | 4.4887 | 89.01 | โ |
| **Stentor2-12M** | **3.2814** | **26.61** | **โ70.1% perplexity** |
> **Note:** The comparison is close but not perfectly controlled โ v1 trained on a mix of FineWeb-Edu and Cosmopedia v2, while Stentor2 trained on FineWeb-HQ and StenCore. Both use educational-quality text at the same parameter count.
---
### BLiMP Evaluation Results
[BLiMP](https://github.com/alexwarstadt/blimp) (Benchmark of Linguistic Minimal Pairs) measures grammatical sensitivity by presenting 67 targeted minimal-pair contrasts โ one grammatical sentence vs. one ungrammatical sentence โ across a broad range of English syntactic phenomena. A score of 50% is chance; 100% is perfect.
| Metric | Value |
|---|---|
| Overall BLiMP Accuracy | 68.95% |
| โ Strong (โฅ 85%) | 20 tasks |
| ๐ก Moderate (56โ84%) | 29 tasks |
| โ Weak (โค 55%) | 18 tasks |
Made with โค๏ธ by StentorLabs
Democratizing AI through accessible, efficient models