--- language: [en] library_name: transformers pipeline_tag: text-generation license: other license_name: mixed-upstream-dataset-terms license_link: https://huggingface.co/SlayerLab/pollock-mini-lm-125m/blob/main/LICENSE.md datasets: [SlayerLab/minimal-en-corpus-5b] tags: [causal-lm, gpt2, nanogpt, bpe, educational, base-model] model-index: - name: Pollock 1.5 results: - task: {type: text-generation, name: Language modeling} dataset: {type: SlayerLab/minimal-en-corpus-5b, name: Minimal EN validation (full split), split: validation} metrics: [{type: loss, value: 2.4585190566, name: Full-validation loss}] - task: {type: text-generation, name: Linguistic minimal pairs} dataset: {type: blimp, name: BLiMP} metrics: [{type: accuracy, value: 0.7849701493, name: Accuracy}] - task: {type: text-generation, name: Language modeling} dataset: {type: lambada_openai, name: LAMBADA OpenAI} metrics: [{type: accuracy, value: 0.3007956530, name: Accuracy}, {type: perplexity, value: 45.0303617702, name: Perplexity}] - task: {type: text-generation, name: Multiple-choice completion} dataset: {type: hellaswag, name: HellaSwag} metrics: [{type: accuracy, value: 0.3083051185, name: Normalized accuracy}] - task: {type: text-generation, name: Physical commonsense reasoning} dataset: {type: piqa, name: PIQA} metrics: [{type: accuracy, value: 0.5968443961, name: Normalized accuracy}] - task: {type: text-generation, name: Science question answering} dataset: {type: sciq, name: SciQ} metrics: [{type: accuracy, value: 0.675, name: Normalized accuracy}] - task: {type: text-generation, name: Grade-school science questions} dataset: {type: arc_easy, name: ARC-Easy} metrics: [{type: accuracy, value: 0.4183501684, name: Normalized accuracy}] - task: {type: text-generation, name: Science challenge questions} dataset: {type: arc_challenge, name: ARC-Challenge} metrics: [{type: accuracy, value: 0.25, name: Normalized accuracy}] --- # Pollock 1.5 — r007 ![Pollock avatar](./assets/pollock-mini-lm-avatar-320.png) > **Wydanie eksperymentalne / Experimental release.** Model nie jest przeznaczony do zastosowań produkcyjnych ani wysokiego ryzyka. Rozmiar może różnić się między rewizjami, ale cały model zawsze pozostaje poniżej 128M parametrów. / The model is not intended for production or high-risk use. Its size may vary between revisions, but the complete model always remains below 128M parameters. ## Polski ### Opis Pollock to niewielki, anglojęzyczny model bazowy typu decoder-only, wytrenowany od zera jako czytelny eksperyment edukacyjny. Implementacja bazuje na [nanoGPT](https://github.com/karpathy/nanoGPT) i własnym tokenizerze byte-level BPE. Jest to model do uzupełniania tekstu, nie asystent konwersacyjny. Nazwa luźno nawiązuje do gestu malarskiego Jacksona Pollocka: nanoGPT jest płótnem, na którym dane, konfiguracja i decyzje treningowe tworzą różne wzorce zachowania. Pełne dane techniczne tej wersji znajdują się w [`training-history/r007.md`](./training-history/r007.md), a różnice między wydaniami w [`CHANGELOG.md`](./CHANGELOG.md). ### Architektura i tokenizer | Właściwość | Wartość | |---|---:| | Rewizja / wydanie | r007 / Pollock 1.5 | | Typ | decoder-only Transformer w stylu GPT-2 | | Warstwy / głowy / embedding | 16 / 12 / 768 | | Szerokość MLP | 3 200 | | Maksymalny kontekst | 2048 tokenów | | Słownik | 12 288 tokenów | | Parametry nanoGPT | 125 854 464 | | Łączne unikalne parametry trenowalne | 127 427 328 | | Tokenizer | byte-level BPE, pretokenizacja w stylu GPT-2 | | Tokeny specjalne | <|endoftext|>, <|im_start|>, <|im_end|> | Artefakt Transformers ma 127 565 312 parametrów, w tym 137 984 zerowe parametry bias dla zgodności z `GPT2LMHeadModel`. Natywny model był trenowany z `bias=False`. Wybrany checkpoint przekonwertowano przy użyciu Transformers 5.15.1. Deterministyczny test `[2, 64]` wykazał maksymalną bezwzględną różnicę logits **0.0**; SHA-256 pliku `model.safetensors` to `4a88432225dac6255ae1e2a085019f36dcdaf55fa33c77629dba6e7445c6c2fb`. Muon optymalizuje kwalifikujące się ukryte macierze attention i MLP. AdamW obsługuje embeddingi tokenów, powiązaną głowicę wyjściową, parametry normalizacji i biasy. Podział parametrów jest sprawdzany przed treningiem pod kątem nakładania się i kompletności. ### Dane i trening Model wytrenowano na [`SlayerLab/minimal-en-corpus-5b`](https://huggingface.co/datasets/SlayerLab/minimal-en-corpus-5b) przypiętym do commita `38bebbd`. Jest to subiektywnie dobrana mieszanka 15 anglojęzycznych źródeł po filtrowaniu języka, deduplikacji dokładnej i przybliżonej oraz decontaminacji benchmarków. R007 używa tokenizera z tego korpusu; zachowuje rozmiar słownika i identyfikatory tokenów specjalnych, ale pozostałe identyfikatory tokenów nie są zgodne z tokenizerem r006. Loader stosuje globalną permutację ze stałym seedem do niezmiennych okien tokenów w każdym przebiegu, przydziela rozłączne pozycje między rangi DDP, maskuje końcowy niepełny batch i zapisuje globalny kursor, topologię oraz ustawienia tasowania w każdym checkpoincie. | Parametr | Wartość | |---|---:| | Tokeny treningowe / walidacyjne | 5 396 605 407 / 5 238 223 | | Wybrany checkpoint | aktualizacja 43 750 | | Przetworzone tokeny | 21 503 919 992 (około 3,98 epoki) | | Sekwencja / micro-batch na GPU | 2048 / 6 | | Akumulacja globalna / na GPU | 40 / 20 micro-stepów | | Effective batch | 491 520 tokenów | | Optymalizator | Muon plus fused AdamW, betas AdamW 0.9/0.95 | | Learning rate | Muon 1e-2 → 1e-3; AdamW 3e-4 → 3e-5 | | Warmup / weight decay / grad clip | 200 / 0.01 / 1.0 | | Precyzja | BF16 | | Sprzęt | 2× NVIDIA GeForce RTX 4090 | | Framework | PyTorch 2.11.0+cu128, nanoGPT commit `3adf61e` | ### Ewaluacja Loss treningowy szacowano na stałej, tasowanej próbie 2 457 600 tokenów z całego splitu treningowego. Każda ewaluacja walidacyjna obejmowała pełny split, czyli 5 238 222 targety. Wybrany checkpoint zapisał validation loss **2.458616** po 21 503 919 992 przetworzonych tokenach. Niezależna ewaluacja pełnego splitu odtworzyła cross-entropy **2.458519**, perplexity **11.687490** i predictive entropy **2.437529**. Trening zakończył się po dokładnie czterech przebiegach korpusu, na aktualizacji 43 918 i po 21 586 421 624 przetworzonych tokenach. Benchmarki wykonano zero-shot na pełnych splitach przy użyciu `lm-evaluation-harness` 0.4.12, batch size 8, maksymalnego kontekstu 1024 i BF16 na Apple M1 Max MPS. | Benchmark | Główna metryka | Wynik | Próbki | |---|---|---:|---:| | BLiMP | acc | 0.784970 | 67 000 | | LAMBADA | acc | 0.300796 | 5 153 | | HellaSwag | acc_norm | 0.308305 | 10 042 | | PIQA | acc_norm | 0.596844 | 1 838 | | SciQ | acc_norm | 0.675000 | 1 000 | | ARC-Easy | acc_norm | 0.418350 | 2 376 | | ARC-Challenge | acc_norm | 0.250000 | 1 172 | Perplexity LAMBADA wynosi **45.030362**. W porównaniu z pomiarem E2 checkpoint E4-best poprawia BLiMP i ARC-Challenge, ale uzyskuje niższe wyniki na pozostałych pięciu zadaniach. Spadek cross-entropy walidacyjnej nie przekłada się więc jednolicie na te benchmarki downstream. Pełne metryki i protokół znajdują się w [`benchmarks/english.json`](./benchmarks/english.json). ### Użycie z Transformers ```python from transformers import AutoModelForCausalLM, AutoTokenizer model_id = "SlayerLab/pollock-mini-lm-125m" tokenizer = AutoTokenizer.from_pretrained(model_id) model = AutoModelForCausalLM.from_pretrained(model_id) inputs = tokenizer("Once upon a time", return_tensors="pt") output = model.generate( **inputs, max_new_tokens=100, do_sample=True, temperature=0.7, top_k=50 ) print(tokenizer.decode(output[0], skip_special_tokens=True)) ``` Model używa standardowego `GPT2LMHeadModel`; `trust_remote_code=True` nie jest potrzebne. ### Stałe próbki inferencji Wspólny zestaw [`fixed-sampling-v1`](./inference-samples/README.md) pokazuje te same cztery prompty wygenerowane przez r001-r007. Wszystkie opublikowane rewizje są ładowane z pełnych, niezmiennych SHA commitów, a SHA-256 każdego pliku z wagami jest sprawdzane przed inferencją. Referencyjny protokół używa macOS 26.2 na arm64, CPU, float32, jednego wątku, Transformers 5.15.1, seed 1337 resetowanego dla każdego promptu, temperature 0.7, top-k 50 i limitu 100 nowych tokenów. | Rewizja | Wydanie | Wagi | Historia | |---|---|---|---| | **r007** | **Pollock 1.5** | [`f2a1ec0`](https://huggingface.co/SlayerLab/pollock-mini-lm-125m/commit/f2a1ec072098d257c36b129b0e554e2e6de9c46e) | [`r007.md`](./training-history/r007.md) | | r006 | Pollock 1.4 | [`a2e53d9`](https://huggingface.co/SlayerLab/pollock-mini-lm-125m/commit/a2e53d9f1b690ebfbea375cf8bd3b5bdf69dece9) | [`r006.md`](./training-history/r006.md) | | r005 | Pollock 1.3 | [`e780025`](https://huggingface.co/SlayerLab/pollock-mini-lm-125m/commit/e780025f15e06bc3765a74d973906eb8a11c022c) | [`r005.md`](./training-history/r005.md) | | r004 | Pollock 1.2 | [`30feb81`](https://huggingface.co/SlayerLab/pollock-mini-lm-125m/commit/30feb81e5097eef13b939e1827d98e0458bf602d) | [`r004.md`](./training-history/r004.md) | | r003 | Pollock 1.1 | [`698984b`](https://huggingface.co/SlayerLab/pollock-mini-lm-125m/commit/698984b1d1b96c9b6ffaff00c7fc2e78e140e842) | [`r003.md`](./training-history/r003.md) | | r002 | Pollock 1.0 | [`5e571cd`](https://huggingface.co/SlayerLab/pollock-mini-lm-125m/commit/5e571cde09ef2d1124e13d1c31d0b75f8bd0e513) | [`r002.md`](./training-history/r002.md) | | r001 | poprzednik eksperymentalny | [`5b8f825`](https://huggingface.co/SlayerLab/pollock-mini-lm-125m/commit/5b8f82515c4e31d9a4a8a222eabdaab3ad5171b0) | [`r001.md`](./training-history/r001.md) | Pełne teksty są przeznaczone do porównywania zachowania, nie są benchmarkiem ani deklaracją poprawności. [`results.json`](./inference-samples/results.json) zapisuje także dokładne identyfikatory tokenów, a [`generate.py`](./inference-samples/generate.py) odtwarza i weryfikuje cały zestaw. Dokładny replay potwierdzono w zapisanym środowisku; inny system operacyjny lub CPU może zmienić wynik samplingu. Starsze próbki osadzone w historii r001 pozostają historycznym zapisem i nie są używane do bezpośredniego porównania, ponieważ nie przypięto całego ich środowiska wykonania. ### Ograniczenia i odpowiedzialne użycie - Jest to surowy model bazowy bez instruction tuningu, RLHF ani alignmentu. - Może halucynować oraz generować treści toksyczne, stronnicze, niebezpieczne lub podobne do danych treningowych. - Mały rozmiar ogranicza wiedzę, rozumowanie, spójność długiego tekstu i jakość kodu. - Model trenowano i oceniano głównie po angielsku. - Nie należy używać go do porad medycznych, prawnych i finansowych, decyzji o ludziach ani zastosowań wysokiego ryzyka. - Użytkownik odpowiada za ocenę warunków źródeł danych dla swojego zastosowania. ## English ### Overview Pollock is a small English decoder-only base language model trained from scratch as a readable educational experiment. It is based on [nanoGPT](https://github.com/karpathy/nanoGPT) and a custom byte-level BPE tokenizer. It is a completion model, not a conversational assistant. The name loosely refers to Jackson Pollock's painterly gesture: nanoGPT is the canvas on which data, configuration, and training decisions create different behavioral patterns. See [`training-history/r007.md`](./training-history/r007.md) for the complete technical record and [`CHANGELOG.md`](./CHANGELOG.md) for release-to-release changes. ### Architecture and tokenizer | Property | Value | |---|---:| | Revision / release | r007 / Pollock 1.5 | | Type | GPT-2-style decoder-only Transformer | | Layers / heads / width | 16 / 12 / 768 | | MLP width | 3,200 | | Maximum context | 2,048 tokens | | Vocabulary | 12,288 tokens | | nanoGPT parameters | 125,854,464 | | Total unique trainable parameters | 127,427,328 | | Tokenizer | byte-level BPE, GPT-2-style pretokenization | | Special tokens | `<|endoftext|>`, `<|im_start|>`, `<|im_end|>` | The Transformers artifact has 127,565,312 parameters, including 137,984 zero-valued compatibility bias parameters required by `GPT2LMHeadModel`. The native model was trained with `bias=False`. The selected checkpoint was converted with Transformers 5.15.1. A deterministic `[2, 64]` probe produced maximum absolute logit error **0.0**; the `model.safetensors` SHA-256 is `4a88432225dac6255ae1e2a085019f36dcdaf55fa33c77629dba6e7445c6c2fb`. Muon optimizes eligible hidden attention and MLP matrices. AdamW handles token embeddings, the tied output head, normalization parameters, and biases. The parameter partition is checked for overlap and completeness before training. ### Data and training The model was trained on [`SlayerLab/minimal-en-corpus-5b`](https://huggingface.co/datasets/SlayerLab/minimal-en-corpus-5b), pinned to commit `38bebbd`. It is a subjectively selected mixture of 15 English-language sources after language filtering, exact and approximate deduplication, and benchmark decontamination. R007 uses the tokenizer from this corpus; it retains the vocabulary size and special-token IDs, but other token IDs are not compatible with r006's tokenizer. The loader applies a seeded global permutation to the fixed token windows in each pass, assigns disjoint positions across DDP ranks, masks the final partial batch, and stores its global cursor, topology, and shuffle settings in every checkpoint. | Setting | Value | |---|---:| | Training / validation tokens | 5,396,605,407 / 5,238,223 | | Selected checkpoint | update 43,750 | | Token presentations | 21,503,919,992 (approximately 3.98 epochs) | | Sequence / micro-batch per GPU | 2,048 / 6 | | Global / per-GPU accumulation | 40 / 20 micro-steps | | Effective batch | 491,520 tokens | | Optimizer | Muon plus fused AdamW, AdamW betas 0.9/0.95 | | Learning rate | Muon 1e-2 → 1e-3; AdamW 3e-4 → 3e-5 | | Warmup / weight decay / grad clip | 200 / 0.01 / 1.0 | | Precision | BF16 | | Hardware | 2× NVIDIA GeForce RTX 4090 | | Framework | PyTorch 2.11.0+cu128, nanoGPT commit `3adf61e` | ### Evaluation Training loss was estimated on a fixed shuffled sample of 2,457,600 tokens from the complete training split. Every validation evaluation covered the full split, or 5,238,222 targets. The selected checkpoint recorded validation loss **2.458616** after 21,503,919,992 token presentations. An independent full-split evaluation reproduced cross-entropy **2.458519**, perplexity **11.687490**, and predictive entropy **2.437529**. Training ended after exactly four corpus passes, at update 43,918 and 21,586,421,624 token presentations. Benchmarks used complete splits with `lm-evaluation-harness` 0.4.12, zero few-shot examples, batch size 8, maximum context 1024, and BF16 on Apple M1 Max MPS. | Benchmark | Primary metric | Score | Samples | |---|---|---:|---:| | BLiMP | acc | 0.784970 | 67,000 | | LAMBADA | acc | 0.300796 | 5,153 | | HellaSwag | acc_norm | 0.308305 | 10,042 | | PIQA | acc_norm | 0.596844 | 1,838 | | SciQ | acc_norm | 0.675000 | 1,000 | | ARC-Easy | acc_norm | 0.418350 | 2,376 | | ARC-Challenge | acc_norm | 0.250000 | 1,172 | LAMBADA perplexity is **45.030362**. Compared with the E2 measurement, the E4-best checkpoint improves BLiMP and ARC-Challenge but scores lower on the other five tasks. The validation cross-entropy gain therefore does not transfer uniformly to these downstream benchmarks. Full metrics and protocol details are recorded in [`benchmarks/english.json`](./benchmarks/english.json). ### Usage Use the Transformers example in the Polish section. The artifact uses standard `GPT2LMHeadModel`; `trust_remote_code=True` is unnecessary. ### Fixed inference samples The shared [`fixed-sampling-v1`](./inference-samples/README.md) suite runs the same four prompts on r001-r007. All published revisions are loaded from full immutable commit SHAs, and every weight-file SHA-256 is verified before inference. The reference protocol uses macOS 26.2 on arm64, CPU float32 with one thread, Transformers 5.15.1, seed 1337 reset for every prompt, temperature 0.7, top-k 50, and a 100-new-token limit. | Revision | Release | Weights | History | |---|---|---|---| | **r007** | **Pollock 1.5** | [`f2a1ec0`](https://huggingface.co/SlayerLab/pollock-mini-lm-125m/commit/f2a1ec072098d257c36b129b0e554e2e6de9c46e) | [`r007.md`](./training-history/r007.md) | | r006 | Pollock 1.4 | [`a2e53d9`](https://huggingface.co/SlayerLab/pollock-mini-lm-125m/commit/a2e53d9f1b690ebfbea375cf8bd3b5bdf69dece9) | [`r006.md`](./training-history/r006.md) | | r005 | Pollock 1.3 | [`e780025`](https://huggingface.co/SlayerLab/pollock-mini-lm-125m/commit/e780025f15e06bc3765a74d973906eb8a11c022c) | [`r005.md`](./training-history/r005.md) | | r004 | Pollock 1.2 | [`30feb81`](https://huggingface.co/SlayerLab/pollock-mini-lm-125m/commit/30feb81e5097eef13b939e1827d98e0458bf602d) | [`r004.md`](./training-history/r004.md) | | r003 | Pollock 1.1 | [`698984b`](https://huggingface.co/SlayerLab/pollock-mini-lm-125m/commit/698984b1d1b96c9b6ffaff00c7fc2e78e140e842) | [`r003.md`](./training-history/r003.md) | | r002 | Pollock 1.0 | [`5e571cd`](https://huggingface.co/SlayerLab/pollock-mini-lm-125m/commit/5e571cde09ef2d1124e13d1c31d0b75f8bd0e513) | [`r002.md`](./training-history/r002.md) | | r001 | experimental predecessor | [`5b8f825`](https://huggingface.co/SlayerLab/pollock-mini-lm-125m/commit/5b8f82515c4e31d9a4a8a222eabdaab3ad5171b0) | [`r001.md`](./training-history/r001.md) | The complete texts are behavioral examples, not benchmarks or factuality claims. [`results.json`](./inference-samples/results.json) also records exact token IDs, while [`generate.py`](./inference-samples/generate.py) reproduces and verifies the suite. Exact replay was confirmed in the recorded environment; another operating system or CPU can change sampled outputs. The older samples embedded in the r001 history remain a historical record and are excluded from direct comparison because their complete execution environment was not pinned. ### Limitations and responsible use - This is a raw base model without instruction tuning, RLHF, or safety alignment. - It may hallucinate and generate toxic, biased, unsafe, or training-like text. - Its small size limits knowledge, reasoning, long-form coherence, and code quality. - It was trained and evaluated primarily in English. - Do not use it for medical, legal, financial, high-impact, or production decisions without independent safeguards. - Users must evaluate upstream dataset terms for their intended use. ## Licencja / License Kod nanoGPT jest na licencji MIT. Korpus łączy źródła o różnych warunkach i nie ma jednej wspólnej licencji, dlatego model oznaczono jako `license: other`. Szczegóły: [`LICENSE.md`](./LICENSE.md) i karta datasetu. nanoGPT code is MIT-licensed. The corpus combines sources governed by different terms and has no single common license, so the model is marked as `license: other`. See [`LICENSE.md`](./LICENSE.md) and the dataset card. ## Pochodzenie / Attribution Model i dataset / Model and dataset: Dawid Majewski / SlayerLab. Trening bazuje na / Training is based on [karpathy/nanoGPT](https://github.com/karpathy/nanoGPT).