CoolFace
Modelpublic

SlayerLab/pollock-mini-lm-125m

sourceHugging Faceotherupdated 5d agoView on Hugging Face
3likes2.1kdownloads
README.md298 linesDownload Raw Back to root
1---2language: [en]3library_name: transformers4pipeline_tag: text-generation5license: other6license_name: mixed-upstream-dataset-terms7license_link: https://huggingface.co/SlayerLab/pollock-mini-lm-125m/blob/main/LICENSE.md8datasets: [SlayerLab/minimal-en-corpus-5b]9tags: [causal-lm, gpt2, nanogpt, swiglu, bpe, educational, base-model]10model-index:11  - name: Pollock 1.612    results:13      - task: {type: text-generation, name: Language modeling}14        dataset: {type: SlayerLab/minimal-en-corpus-5b, name: Minimal EN validation (full split), split: validation}15        metrics: [{type: loss, value: 2.4507743919, name: Full-validation loss}]16      - task: {type: text-generation, name: Linguistic minimal pairs}17        dataset: {type: blimp, name: BLiMP}18        metrics: [{type: accuracy, value: 0.7803582090, name: Accuracy}]19      - task: {type: text-generation, name: Language modeling}20        dataset: {type: lambada_openai, name: LAMBADA OpenAI}21        metrics: [{type: accuracy, value: 0.3132156026, name: Accuracy}, {type: perplexity, value: 42.0737928480, name: Perplexity}]22      - task: {type: text-generation, name: Multiple-choice completion}23        dataset: {type: hellaswag, name: HellaSwag}24        metrics: [{type: accuracy, value: 0.3043218482, name: Normalized accuracy}]25      - task: {type: text-generation, name: Physical commonsense reasoning}26        dataset: {type: piqa, name: PIQA}27        metrics: [{type: accuracy, value: 0.6169749728, name: Normalized accuracy}]28      - task: {type: text-generation, name: Science question answering}29        dataset: {type: sciq, name: SciQ}30        metrics: [{type: accuracy, value: 0.643, name: Normalized accuracy}]31      - task: {type: text-generation, name: Grade-school science questions}32        dataset: {type: arc_easy, name: ARC-Easy}33        metrics: [{type: accuracy, value: 0.4255050505, name: Normalized accuracy}]34      - task: {type: text-generation, name: Science challenge questions}35        dataset: {type: arc_challenge, name: ARC-Challenge}36        metrics: [{type: accuracy, value: 0.2474402730, name: Normalized accuracy}]37---38 39# Pollock 1.6 - r00840 41![Pollock avatar](https://huggingface.co/SlayerLab/pollock-mini-lm-125m/resolve/f2a1ec072098d257c36b129b0e554e2e6de9c46e/assets/pollock-mini-lm-avatar-320.png)42 43> **Wydanie eksperymentalne / Experimental release.** Model nie jest44> przeznaczony do zastosowań produkcyjnych ani wysokiego ryzyka. Cały model45> pozostaje poniżej 128M parametrów. / The model is not intended for production46> or high-risk use. The complete model remains below 128M parameters.47 48## Polski49 50### Opis51 52Pollock to niewielki, anglojęzyczny model bazowy typu decoder-only, wytrenowany53od zera jako czytelny eksperyment edukacyjny. Implementacja bazuje na54[nanoGPT](https://github.com/karpathy/nanoGPT) i własnym tokenizerze byte-level55BPE. Jest to model do uzupełniania tekstu, nie asystent konwersacyjny.56 57R008 zastępuje klasyczny blok GELU MLP blokiem SwiGLU dopasowanym do tego samego58budżetu poniżej 128M parametrów. Tokenizer, korpus, kontekst, liczba warstw,59szerokość modelu, attention i effective batch pozostają zgodne z R007. Pełna60historia techniczna znajduje się w [`training-history/r008.md`](./training-history/r008.md),61a różnice między wydaniami w [`CHANGELOG.md`](./CHANGELOG.md).62 63### Architektura i tokenizer64 65| Właściwość | Wartość |66|---|---:|67| Rewizja / wydanie | r008 / Pollock 1.6 |68| Typ | decoder-only Transformer w stylu GPT-2 z SwiGLU |69| Warstwy / głowy / embedding | 16 / 12 / 768 |70| Szerokość SwiGLU | 2 144 |71| Maksymalny kontekst | 2 048 tokenów |72| Słownik | 12 288 tokenów |73| Łączne unikalne parametry trenowalne | 127 820 544 |74| Tokenizer | byte-level BPE, pretokenizacja w stylu GPT-2 |75| Tokeny specjalne | <code>&lt;&#124;endoftext&#124;&gt;</code>, <code>&lt;&#124;im_start&#124;&gt;</code>, <code>&lt;&#124;im_end&#124;&gt;</code> |76 77Model używa własnej klasy Transformers `PollockForCausalLM`, ponieważ standardowy78`GPT2LMHeadModel` nie implementuje tego wariantu SwiGLU. Wybrany checkpoint z79aktualizacji 32 000 ma SHA-25680`25b8cac7d5142c75e1be0b42fa24d980896e6f911e912c883566747a3baa56f0`.81Konwersja w Transformers 5.15.1 wykazała maksymalną bezwzględną różnicę logits82**0.0** na deterministycznej próbie `[2, 64]`. SHA-256 pliku83`model.safetensors` to84`1c1002909119b4913841ee29efd44bd86d62d81f2ae27de01602b64d4af0dbec`.85Artefakt Transformers ma 127 975 936 parametrów, w tym zerowe tensory bias86wymagane przez implementację pakietową; model natywny ma 127 820 544 parametrów.87 88Muon optymalizuje kwalifikujące się ukryte macierze attention i MLP. AdamW89obsługuje embeddingi tokenów, powiązaną głowicę wyjściową, parametry normalizacji90i biasy. Podział parametrów jest sprawdzany przed treningiem pod kątem nakładania91się i kompletności.92 93### Dane i trening94 95Model jest trenowany na96[`SlayerLab/minimal-en-corpus-5b`](https://huggingface.co/datasets/SlayerLab/minimal-en-corpus-5b)97przypiętym do commita `38bebbd`. Jest to subiektywnie dobrana mieszanka 1598anglojęzycznych źródeł po filtrowaniu języka, deduplikacji dokładnej i99przybliżonej oraz decontaminacji benchmarków. R008 zachowuje tokenizer R007.100 101Loader stosuje globalną permutację ze stałym seedem do niezmiennych okien102tokenów w każdym przebiegu, przydziela rozłączne pozycje między rangi DDP,103maskuje końcowy niepełny batch i zapisuje globalny kursor, topologię oraz104ustawienia tasowania w każdym checkpoincie.105 106| Parametr | Wartość |107|---|---:|108| Tokeny treningowe / walidacyjne | 5 396 605 407 / 5 238 223 |109| Planowane maksimum / wybrana ekspozycja | 4 przebiegi / 15 728 561 562 targety |110| Wybrany checkpoint | aktualizacja 32 000, validation loss 2.4507743919 |111| Sekwencja / micro-batch na GPU | 2 048 / 6 |112| Akumulacja globalna / na GPU | 40 / 10 micro-stepów |113| Effective batch | 491 520 tokenów |114| Optymalizator | Muon plus fused AdamW, betas AdamW 0.9/0.95 |115| LR pierwszych dwóch przebiegów | Muon 1e-2 -> 1e-3; AdamW 3e-4 -> 3e-5 |116| LR finalnej kontynuacji | Muon 1e-4; AdamW 3e-6, stałe |117| Warmup / weight decay / grad clip | 200 / 0.01 / 1.0 |118| Precyzja / sprzęt | BF16 / 4x NVIDIA H100 80GB HBM3 |119 120Pierwsze dwa przebiegi zakończyły się na aktualizacji 21 959. Pierwotna121kontynuacja odziedziczyła z R007 zbyt wysokie dla tej architektury dolne LR122`1e-3` i `3e-5`: pogorszyły się jednocześnie train-eval i pełny validation loss,123a norma parametrów spadła o około 6,5%. Kontynuację zatrzymano na aktualizacji12434 520. Finalny trening R008 rozpoczęto ponownie z niezmienionego, zweryfikowanego125checkpointu E2, obniżając oba LR dziesięciokrotnie i pozostawiając weight decay126bez zmian. Validation loss osiągnął minimum 2.4507743919 przy aktualizacji12732 000, a następnie przeszedł w plateau i wzrósł do 2.4516 przy ostatnim128zapisanym checkpoincie 38 000. Trening zatrzymano celowo przy aktualizacji12938 140; checkpoint 32 000 wybrano przed benchmarkami downstream.130 131### Ewaluacja132 133Loss treningowy jest szacowany na stałej, tasowanej próbie 2 457 600 tokenów z134całego splitu treningowego. Każda ewaluacja walidacyjna obejmuje pełny split,135czyli 5 238 222 targety. Wybrany checkpoint ma train-eval loss 2.4182 oraz136pełny validation loss 2.4507743919.137 138| Benchmark | Główna metryka | Wynik | Próbki |139|---|---|---:|---:|140| BLiMP | acc | 78.0358% | 67 000 |141| LAMBADA | acc / perplexity | 31.3216% / 42.0738 | 5 153 |142| HellaSwag | acc_norm | 30.4322% | 10 042 |143| PIQA | acc_norm | 61.6975% | 1 838 |144| SciQ | acc_norm | 64.3000% | 1 000 |145| ARC-Easy | acc_norm | 42.5505% | 2 376 |146| ARC-Challenge | acc_norm | 24.7440% | 1 172 |147 148Wyniki pochodzą z pełnych splitów, zero-shot, w `lm-eval` 0.4.12,149Transformers 5.15.1 i PyTorch 2.8.0+cu128 na RTX A4500. Tabela model-card używa150BF16, batch 8 i maksymalnego kontekstu 1 024. Tiny-ML WikiText-2 osiąga byte151perplexity 1.9423491827, 0.9578025823 bits/byte i word perplexity 34.8189798815.152Kanoniczny Open SLM FP32 Intelligence Index wynosi 13.4419562655; pełne wyniki,153próbki i protokół są powiązane z tym samym hashem modelu.154 155Stałe, nieprzebierane próbki generacji z seedem 1337 są zachowane razem z156artefaktami ewaluacji. Pokazują również typowe ograniczenia małego modelu157bazowego, w tym powtórzenia i błędy faktograficzne.158 159Pełne publiczne podsumowanie znajduje się w [`benchmarks/english.json`](./benchmarks/english.json),160a próbki i skrypt odtwarzający w [`inference-samples/r008/`](./inference-samples/r008/).161 162### Użycie z Transformers163 164```python165from transformers import AutoModelForCausalLM, AutoTokenizer166 167model_id = "SlayerLab/pollock-mini-lm-125m"168tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)169model = AutoModelForCausalLM.from_pretrained(170    model_id,171    trust_remote_code=True,172)173 174inputs = tokenizer("Once upon a time", return_tensors="pt")175output = model.generate(176    **inputs,177    max_new_tokens=100,178    do_sample=True,179    temperature=0.7,180    top_k=50,181)182print(tokenizer.decode(output[0], skip_special_tokens=True))183```184 185`trust_remote_code=True` jest wymagane, ponieważ repozytorium zawiera małą,186audytowalną implementację własnego bloku SwiGLU. Przed użyciem należy przejrzeć187`modeling_pollock.py` w przypiętej rewizji modelu.188 189### Ograniczenia i odpowiedzialne użycie190 191- Jest to surowy model bazowy bez instruction tuningu, RLHF ani alignmentu.192- Może halucynować oraz generować treści toksyczne, stronnicze, niebezpieczne193  lub podobne do danych treningowych.194- Mały rozmiar ogranicza wiedzę, rozumowanie, spójność długiego tekstu i jakość195  kodu.196- Model trenowano i oceniano głównie po angielsku.197- Nie należy używać go do porad medycznych, prawnych i finansowych, decyzji o198  ludziach ani zastosowań wysokiego ryzyka.199- Użytkownik odpowiada za ocenę warunków źródeł danych dla swojego zastosowania.200 201## English202 203### Overview204 205Pollock is a small English decoder-only base language model trained from scratch206as a readable educational experiment. It is based on207[nanoGPT](https://github.com/karpathy/nanoGPT) and a custom byte-level BPE208tokenizer. It is a completion model, not a conversational assistant.209 210R008 replaces the GELU MLP with a parameter-matched SwiGLU block while retaining211R007's tokenizer, corpus, learned absolute positions, context, layer count,212model width, attention configuration, and effective batch. See213[`training-history/r008.md`](./training-history/r008.md) for the technical record214and [`CHANGELOG.md`](./CHANGELOG.md) for release-to-release changes.215 216### Architecture and tokenizer217 218| Property | Value |219|---|---:|220| Revision / release | r008 / Pollock 1.6 |221| Type | GPT-2-style decoder-only Transformer with SwiGLU |222| Layers / heads / width | 16 / 12 / 768 |223| SwiGLU width | 2,144 |224| Maximum context | 2,048 tokens |225| Vocabulary | 12,288 tokens |226| Total unique trainable parameters | 127,820,544 |227| Tokenizer | byte-level BPE, GPT-2-style pretokenization |228| Special tokens | `<|endoftext|>`, `<|im_start|>`, `<|im_end|>` |229 230The artifact uses the custom `PollockForCausalLM` Transformers class because231standard `GPT2LMHeadModel` does not implement this SwiGLU variant. The selected232step-32,000 checkpoint was converted with a maximum absolute native/Transformers233logit difference of **0.0**. Its SHA-256 is234`25b8cac7d5142c75e1be0b42fa24d980896e6f911e912c883566747a3baa56f0`;235the resulting `model.safetensors` SHA-256 is236`1c1002909119b4913841ee29efd44bd86d62d81f2ae27de01602b64d4af0dbec`.237 238### Data and training239 240The model is trained on241[`SlayerLab/minimal-en-corpus-5b`](https://huggingface.co/datasets/SlayerLab/minimal-en-corpus-5b),242pinned to commit `38bebbd`. The deterministic loader, four-pass target,243491,520-target effective batch, and validation protocol match the Polish section.244 245The first two passes ended at update 21,959. The initial continuation inherited246R007-derived floor learning rates that proved too high for this architecture:247fixed train-eval and full-validation loss both degraded while parameter norm248fell by about 6.5%. It was stopped at update 34,520. Final R008 training restarted249from the unchanged, checksum-verified E2 checkpoint with fixed Muon and AdamW250learning rates reduced by 10x to `1e-4` and `3e-6`; weight decay remained251`1e-2`. Full-validation loss reached its minimum of 2.4507743919 at step 32,000252after 15,728,561,562 target presentations. Training was intentionally stopped253at step 38,140 after the metric plateaued; the preselected best-validation254checkpoint was then used for all release benchmarks.255 256### Evaluation257 258The model-index and Polish table report the complete zero-shot standard suite.259Evaluation used full splits with `lm-eval` 0.4.12, Transformers 5.15.1,260PyTorch 2.8.0+cu128, and the exact converted model identified above. Tiny-ML261WikiText-2 word perplexity is 34.8189798815. The canonical FP32 Open SLM scores262are HellaSwag 30.4521%, ARC-Easy 42.3401%, ARC-Challenge 24.5734%, PIQA26361.0990%, ArithMark-3 34.6000%, and Intelligence Index 13.4419562655.264The machine-readable summary is available at265[`benchmarks/english.json`](./benchmarks/english.json), and the fixed samples266plus replay script at [`inference-samples/r008/`](./inference-samples/r008/).267 268### Usage269 270Use the Transformers example in the Polish section. Loading requires271`trust_remote_code=True`; review `modeling_pollock.py` at the pinned model272revision before use.273 274### Limitations and responsible use275 276- This is a raw base model without instruction tuning, RLHF, or safety alignment.277- It may hallucinate and generate toxic, biased, unsafe, or training-like text.278- Its small size limits knowledge, reasoning, long-form coherence, and code quality.279- It was trained and evaluated primarily in English.280- Do not use it for medical, legal, financial, high-impact, or production281  decisions without independent safeguards.282- Users must evaluate upstream dataset terms for their intended use.283 284## Licencja / License285 286Kod nanoGPT jest na licencji MIT. Korpus łączy źródła o różnych warunkach i nie287ma jednej wspólnej licencji, dlatego model oznaczono jako `license: other`.288Szczegóły: [`LICENSE.md`](./LICENSE.md) i karta datasetu.289 290nanoGPT code is MIT-licensed. The corpus combines sources governed by different291terms and has no single common license, so the model is marked as292`license: other`. See [`LICENSE.md`](./LICENSE.md) and the dataset card.293 294## Pochodzenie / Attribution295 296Model i dataset / Model and dataset: Dawid Majewski / SlayerLab. Trening bazuje297na / Training is based on [karpathy/nanoGPT](https://github.com/karpathy/nanoGPT).298