Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,129 @@
|
|
| 1 |
---
|
|
|
|
| 2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
language: en
|
| 3 |
license: apache-2.0
|
| 4 |
+
tags:
|
| 5 |
+
- text-generation
|
| 6 |
+
- small-language-model
|
| 7 |
+
- slm
|
| 8 |
+
pipeline_tag: text-generation
|
| 9 |
+
inference: true
|
| 10 |
+
widget:
|
| 11 |
+
- text: "What is the capital of France?"
|
| 12 |
+
example_title: "Geography"
|
| 13 |
+
- text: "7 * 8 ="
|
| 14 |
+
example_title: "Arithmetic"
|
| 15 |
---
|
| 16 |
+
|
| 17 |
+
# Haiku H2
|
| 18 |
+
|
| 19 |
+
Haiku H2 is the canonical successor to Haiku Mini β a 217M-parameter small language model from **Rootcomputer**. It features a modernized architecture, a complete SFT + DPO post-training pipeline, and a published benchmark profile that wins its weight class.
|
| 20 |
+
|
| 21 |
+
H2 is available for public testing in open beta via [chathaiku.com](https://chathaiku.com/). It is an experimental research model, designed to make small-model behavior studyable end-to-end, validate training pipelines, and publish reproducible benchmarks against comparable open small models.
|
| 22 |
+
|
| 23 |
+
---
|
| 24 |
+
|
| 25 |
+
## Model Specifications
|
| 26 |
+
|
| 27 |
+
H2 is a decoder-only transformer architecture optimized to keep parameter counts low without sacrificing capacity.
|
| 28 |
+
|
| 29 |
+
| Specification | Value |
|
| 30 |
+
| :--- | :--- |
|
| 31 |
+
| **Parameters** | 217M |
|
| 32 |
+
| **Transformer Layers** | 16 |
|
| 33 |
+
| **Embedding Dimension** | 1,024 |
|
| 34 |
+
| **Attention Mechanism** | Grouped-Query Attention (GQA) with 4 KV heads |
|
| 35 |
+
| **Positional Base** | 50k RoPE (Rotary Positional Embeddings) |
|
| 36 |
+
| **Activation Function** | SwiGLU |
|
| 37 |
+
| **Embeddings** | Tied Input/Output Embeddings |
|
| 38 |
+
| **Precision & Scaling** | bf16 (Flash Attention 2 supported) |
|
| 39 |
+
|
| 40 |
+
---
|
| 41 |
+
|
| 42 |
+
## Training Pipeline
|
| 43 |
+
|
| 44 |
+
H2 is trained across three distinct stages. Each stage is validated independently against a stable upstream checkpoint to allow cheap, rapid iteration on commodity hardware.
|
| 45 |
+
|
| 46 |
+
1. **Pretrain:** Base language modeling executed on the Rootcomputer multi-source corpus, comprising web text, books, news, scientific papers, and biomedical sources.
|
| 47 |
+
2. **SFT (Supervised Fine-Tuning):** Conversational tuning that teaches the model the shape of instructions, responses, refusals, and proper output formatting.
|
| 48 |
+
3. **DPO (Direct Preference Optimization):** Preference alignment on accumulated chosen/rejected pairs to sharpen identity consistency, formatting adherence, false-premise handling, and response quality. *Note: DPO is always retrained from the SFT base, never stacked.*
|
| 49 |
+
|
| 50 |
+
---
|
| 51 |
+
|
| 52 |
+
## Evaluation: Featherweight v1 Benchmark
|
| 53 |
+
|
| 54 |
+
H2 is evaluated on **Featherweight v1**, a 100-question multiple-choice benchmark designed for the sub-1B parameter class. The benchmark spans 10 categories (10 questions each) with balanced multiple-choice keys (25% each for A/B/C/D) to eliminate position bias.
|
| 55 |
+
|
| 56 |
+
Testing uses deterministic greedy decoding (`temperature=0`, `top_k=1`, `max_new_tokens=20`) across two formats:
|
| 57 |
+
* **Plain Prompt:** Matches deployed evaluators, ending with *"Answer with just the letter of the correct choice."*
|
| 58 |
+
* **Completion Prompt:** An MMLU-style format ending with a bare *"Answer:"* (fairer to non-instruction-tuned base models).
|
| 59 |
+
|
| 60 |
+
### Key Takeaways
|
| 61 |
+
* **38β39% Accuracy:** Solid performance across both prompt formats (random chance is 25%).
|
| 62 |
+
* **1st in Weight Class:** Beats every tested model $\le$ 217M parameters by 7β8 points.
|
| 63 |
+
* **Highly Robust:** Only a 1 percentage point swing between plain and completion prompts, making it the most prompt-robust model tested.
|
| 64 |
+
|
| 65 |
+
### Comparison Leaderboard
|
| 66 |
+
|
| 67 |
+
| Model | Params | Plain | Completion | $\Delta$ |
|
| 68 |
+
| :--- | :---: | :---: | :---: | :---: |
|
| 69 |
+
| distilgpt2 | 82M | 27% | 24% | β3 |
|
| 70 |
+
| gpt2 | 124M | 23% | 26% | +3 |
|
| 71 |
+
| opt-125m | 125M | 28% | 23% | β5 |
|
| 72 |
+
| smollm-135m | 135M | 26% | 19% | β7 |
|
| 73 |
+
| smollm-135m-instruct | 135M | 30% | 32% | +2 |
|
| 74 |
+
| pythia-160m | 162M | 25% | 28% | +3 |
|
| 75 |
+
| **Haiku H2** | **217M** | **38%** | **39%** | **+1** |
|
| 76 |
+
| gpt2-medium | 355M | 24% | 23% | β1 |
|
| 77 |
+
| smollm-360m | 362M | 20% | 29% | +9 |
|
| 78 |
+
| pythia-410m | 405M | 25% | 32% | +7 |
|
| 79 |
+
| qwen2.5-0.5b | 494M | 40% | 70% | +30 |
|
| 80 |
+
| tinyllama-1.1b-chat | 1.1B | 45% | 60% | +15 |
|
| 81 |
+
|
| 82 |
+
*$\Delta$ = completion β plain. With n = 100, the 95% confidence interval on individual scores is roughly $\pm$9 percentage points.*
|
| 83 |
+
|
| 84 |
+
---
|
| 85 |
+
|
| 86 |
+
## Capability Profile
|
| 87 |
+
|
| 88 |
+
On the completion prompt, H2's category-specific breakdown shows an uneven but stable profile that remains strictly above the 25% random chance floor everywhere:
|
| 89 |
+
|
| 90 |
+
* **Strongest Categories:** Geography (60%) and Arithmetic (50%).
|
| 91 |
+
* **Weakest Categories:** Categorization (20%) and Logic (30%).
|
| 92 |
+
|
| 93 |
+
### Size and Recency Gap
|
| 94 |
+
When plotted against larger systems like **Qwen 2.5 (494M)** and **TinyLlama 1.1B Chat**, H2's performance curve sits nested uniformly inside theirs. Larger, more recent 2024-vintage systems outperform H2 on knowledge-heavy fields (e.g., Qwen reaches 100% on categorization). H2's primary claim is that it represents the strongest option within its explicit weight class and against older architectures up through ~410M parameters.
|
| 95 |
+
|
| 96 |
+
---
|
| 97 |
+
|
| 98 |
+
## Key Model Claims
|
| 99 |
+
|
| 100 |
+
* **Wins its weight class:** Outperforms all tested models $\le$ 217M parameters on both prompt settings.
|
| 101 |
+
* **Beats larger base models:** Comfortably clears larger pre-pretrained models like `gpt2-medium` (355M) and `pythia-410m` (405M) by 7β18 points, demonstrating that SFT+DPO alignment optimizes small weights far better than raw scale alone.
|
| 102 |
+
* **Unmatched prompt robustness:** Shifts by only 1% between testing formats, while competitors swing by up to 15% (TinyLlama) or 30% (Qwen 2.5).
|
| 103 |
+
|
| 104 |
+
---
|
| 105 |
+
|
| 106 |
+
## Intended Use & Limitations
|
| 107 |
+
|
| 108 |
+
### Best For
|
| 109 |
+
* **Research baseline:** A fully-documented, reproducible small architecture to compare against, fork, or iterate on.
|
| 110 |
+
* **Small-model behavior studies:** Investigating how SFT and DPO alignment mechanisms behave at the 200M parameter scale.
|
| 111 |
+
* **Pipeline validation:** Testing architecture changes and data mixtures quickly and cheaply before scaling to larger models.
|
| 112 |
+
|
| 113 |
+
### Out of Scope & Limitations
|
| 114 |
+
* **Multi-step reasoning:** Logical reasoning is near chance (20β30%). Avoid chains of inference or syllogisms.
|
| 115 |
+
* **Unreliable arithmetic:** Arithmetic beyond single-digit operations is unstable and prone to hallucinations (e.g., outputs like `7 Γ 8 = 57`).
|
| 116 |
+
* **Corpus bounds:** Factual knowledge is strictly limited to the training corpus. Factual outputs should always be independently verified.
|
| 117 |
+
* **Safety critical zones:** Not evaluated or certified for medical, legal, financial, or safety-critical deployment.
|
| 118 |
+
|
| 119 |
+
---
|
| 120 |
+
|
| 121 |
+
## Reproducibility
|
| 122 |
+
|
| 123 |
+
The validation framework is entirely open. Anyone using a standard CUDA GPU environment with `pip install transformers torch` can verify these benchmarks.
|
| 124 |
+
|
| 125 |
+
* `featherweight.jsonl`: Contains the 100 benchmark questions balanced evenly across choice keys.
|
| 126 |
+
* `run_featherweight.py`: Standalone evaluation script supporting local Hugging Face pipelines, HTTP requests, and OpenAI-compatible backends using deterministic greedy decoding.
|
| 127 |
+
|
| 128 |
+
---
|
| 129 |
+
*Model card generated based on Featherweight v1 evaluation metadata, 2026-06-13.*
|