Text Generation
Transformers
Safetensors
Polish
gpt2
polish
nanogpt
tokenizer-ablation
research
Eval Results (legacy)
text-generation-inference
Run this model with HF Jobs
Run SlayerLab/GoLLeM-45M-PL on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/SlayerLab/GoLLeM-45M-PL. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/SlayerLab/GoLLeM-45M-PL on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/SlayerLab/GoLLeM-45M-PL. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/SlayerLab/GoLLeM-45M-PL. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use SlayerLab/GoLLeM-45M-PL with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SlayerLab/GoLLeM-45M-PL with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SlayerLab/GoLLeM-45M-PL")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("SlayerLab/GoLLeM-45M-PL") model = AutoModelForCausalLM.from_pretrained("SlayerLab/GoLLeM-45M-PL", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use SlayerLab/GoLLeM-45M-PL with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SlayerLab/GoLLeM-45M-PL" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SlayerLab/GoLLeM-45M-PL", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/SlayerLab/GoLLeM-45M-PL
- SGLang
How to use SlayerLab/GoLLeM-45M-PL with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "SlayerLab/GoLLeM-45M-PL" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SlayerLab/GoLLeM-45M-PL", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "SlayerLab/GoLLeM-45M-PL" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SlayerLab/GoLLeM-45M-PL", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use SlayerLab/GoLLeM-45M-PL with Docker Model Runner:
docker model run hf.co/SlayerLab/GoLLeM-45M-PL
Upload folder using huggingface_hub
Browse filesFiles changed (6)
- README.md+138
- config.jsonAdded+35
- generation_config.jsonAdded+614
- model.safetensorsAdded+3
- tokenizer.jsonAdded
- tokenizer_config.jsonAdded+9
123---license: mit---123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141---language:- pllicense: mitlibrary_name: transformerspipeline_tag: text-generationtags:- polish- gpt2- nanogpt- tokenizer-ablation- research---> **Kopia lustrzana.** Repozytorium źródłowe modelu:> [KateMajzel/GoLLeM-45M-PL](https://huggingface.co/KateMajzel/GoLLeM-45M-PL).> Wagi i tokenizer są identyczne. Aktualizacje karty modelu wprowadzane są najpierw> w repozytorium źródłowym.# GoLLeM-45M-PLModel GPT-2 (42,5 mln parametrów) wytrenowany od zera na 2,96 GB polskiego tekstu,z dedykowanym polskim tokenizerem BPE (32 768 pozycji).Model jest **artefaktem eksperymentu badawczego**, nie narzędziem użytkowym.Pytanie: *czy dedykowany tokenizer polski daje lepszy model niż tokenizer GPT-2 przytym samym budżecie treningowym?* Odpowiedź: **nie daje lepszego — daje porównywalny2,5× taniej.**Kod, dane i pełna metodologia: https://github.com/KateMajzel/gollem-pl## Użycie```pythonfrom transformers import pipelinepipe = pipeline("text-generation", model="KateMajzel/GoLLeM-45M-PL")print(pipe("W lesie mieszkał mały", max_new_tokens=50)[0]["generated_text"])```Domyślne parametry generacji: `do_sample=True`, `temperature=0.8`, `top_p=0.9`,`repetition_penalty=1.15`. Dekodowanie zachłanne wpada w pętle powtórzeń — typowe dlamodeli tej wielkości. 199 nieużywanych tokenów wypełniających (32 569–32 767)zablokowano przez `bad_words_ids`.## WynikiBPB na prywatnym held-oucie (1 999 dokumentów, identyczne 2 767 440 bajtów dlakażdego modelu; średnie z 3 ziaren dla R1 i R2a):| przebieg | tokenizer | budżet | BPB ↓ | sd | parametry | czas ||---|---|---|---|---|---|---|| **R1** (ten model) | polski, 32 768 | 2,96 GB | 1,2114 | 0,0100 | 42,5 M | **49,7 min** || R2a | GPT-2, 50 257 | 2,96 GB — te same bajty | 1,1946 | 0,0035 | 51,5 M | 122,4 min || R2b | GPT-2, 50 257 | 2 970 kroków — te same tokeny | 1,2756 | (n=1) | 51,5 M | 62,4 min || R3 | GPT-2 zero-shot | — | 2,9555 | (n=1) | 124 M | — |Benchmarki zero-shot (log-likelihood z normalizacją PMI domenową):| zadanie | R1 | R2a | GPT-2 | klasa większościowa | losowo ||---|---|---|---|---|---|| PolEmo2-IN | 47,2% | 43,8% | 20,8% | 40,0% | 25,0% || 8Tags | 31,5% | 29,8% | 17,8% | 16,5% | 12,5% |### InterpretacjaCztery niezależne pomiary (BPB, PolEmo2, 8Tags, prywatny held-out) nie wykazująistotnej przewagi żadnego tokenizera przy równym budżecie tekstu, a ich kierunki sąniespójne. Rozstrzygająca obserwacja: **różnica BPB między dwoma ziarnami tego samegomodelu (0,0186) przewyższa różnicę między modelami o odmiennych tokenizerach (0,0124).**Przewaga leży w koszcie. Przy wyrównanym budżecie obliczeniowym (R1 vs R2b) tokenizerpolski wygrywa o 5,30% BPB — 6,4 odchylenia. Ten sam wniosek uzyskał niezależnie zespółBielika v3 PL na skali 11B (arXiv 2604.10799).### Uwaga o perplexityPPL/token wynosi 30,7 dla R1 i 5,8 dla R2a, co sugerowałoby pięciokrotną przewagęGPT-2. To artefakt: modele o różnych tokenizerach przewidują jednostki różnej trudności.**Perplexity jest między nimi nieporównywalna.** Jedyną poprawną metryką jestbits-per-byte.## TokenizerByte-level BPE, 32 568 pozycji + 200 specjalnych. 27,9% pozycji z polskimidiakrytykami, round-trip bezstratny, zero tokenów nieosiągalnych przez merge.| | ten tokenizer | GPT-2 ||---|---|---|| bajty/token (korpus) | 4,050 | 2,066 || bajty/token (held-out) | 4,103 | 2,134 || gęstość | **1,96×** | 1,00× |## Dane treningowe2,96 GB, 803 177 dokumentów, [SpeakLeash](https://speakleash.org/): 37% encyklopediai literatura, 22% fora, 27% web, 11% publicystyka i nauka, 3% teksty urzędowe.Celowo wykluczone: tłumaczenia i napisy (translationese), tekst syntetyczny, tekstypiosenek (prawa autorskie), surowy Common Crawl. Licencje zbiorów po stronie SpeakLeash.## Architektura8 warstw × 8 głowic × 512 wymiarów, kontekst 1 024 tokeny, 42,5 M parametrów(25,7 M niezanurzeniowych), 731 mln tokenów treningowych (17,2 na parametr),AdamW lr 1e-3 → 1e-4, bfloat16, 1 epoka, 1× RTX 5080.## Ograniczenia- **Skala.** Model produkuje poprawną polszczyznę na poziomie zdania, ale halucynujefakty i traci spójność po kilku zdaniach. Przykład z generacji: *„wieś znalazła sięw powiecie częstochowskim, gminie Łęczna"* — obie nazwy istnieją, zestawienie jestfałszywe.- **Model bazowy.** Wyłącznie kontynuacja tekstu; bez dostrajania instrukcyjnegoi bez filtrowania bezpieczeństwa.- **Dane z forów internetowych.** Model może odtwarzać obecne tam uprzedzenia i język.Nie nadaje się do zastosowań z udziałem użytkownika końcowego — w szczególnościdzieci — bez nadzoru człowieka.- **Jedna skala i jedna konfiguracja.** Wyniki dotyczą 42 M parametrów i 3 GB danych.- **Rejestr zależny od miksu danych.** Przy prompcie z bajki dla dzieci modelodpowiada językiem forów lub haseł encyklopedycznych.- Korpus zawiera windowsowe końce linii (`\r\n`), które model odtwarza.## OdtwarzalnośćKod, konfiguracje, skrypty ewaluacyjne i opis pięciu pułapek metodologicznych:https://github.com/KateMajzel/gollem-plBazuje na [nanoGPT](https://github.com/karpathy/nanoGPT) (MIT, Andrej Karpathy).## Cytowanie```bibtex@misc{gollem45mpl,title = {GoLLeM-45M-PL: ablacja tokenizera dla polskiego modelu językowego},author = {Majzel-Pośpiech, Katarzyna},year = {2026},url = {https://huggingface.co/KateMajzel/GoLLeM-45M-PL}}```
1234567891011121314151617181920212223242526272829303132333435{ "activation_function": "gelu_new", "add_cross_attention": false, "architectures": [ "GPT2LMHeadModel" ], "attn_pdrop": 0.1, "bos_token_id": 32568, "dtype": "float32", "embd_pdrop": 0.1, "eos_token_id": 32568, "initializer_range": 0.02, "layer_norm_epsilon": 1e-05, "model_type": "gpt2", "n_ctx": 1024, "n_embd": 512, "n_head": 8, "n_inner": null, "n_layer": 8, "n_positions": 1024, "pad_token_id": 32580, "reorder_and_upcast_attn": false, "resid_pdrop": 0.1, "scale_attn_by_inverse_layer_idx": false, "scale_attn_weights": true, "summary_activation": null, "summary_first_dropout": 0.1, "summary_proj_to_labels": true, "summary_type": "cls_index", "summary_use_proj": true, "tie_word_embeddings": true, "transformers_version": "5.15.0", "use_cache": true, "vocab_size": 32768}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614{ "_from_model_config": true, "output_attentions": false, "output_hidden_states": false, "transformers_version": "5.15.0", "use_cache": true, "max_new_tokens": 100, "do_sample": true, "temperature": 0.8, "top_p": 0.9, "repetition_penalty": 1.15, "bad_words_ids": [ [ 32569 ], [ 32570 ], [ 32571 ], [ 32572 ], [ 32573 ], [ 32574 ], [ 32575 ], [ 32576 ], [ 32577 ], [ 32578 ], [ 32579 ], [ 32580 ], [ 32581 ], [ 32582 ], [ 32583 ], [ 32584 ], [ 32585 ], [ 32586 ], [ 32587 ], [ 32588 ], [ 32589 ], [ 32590 ], [ 32591 ], [ 32592 ], [ 32593 ], [ 32594 ], [ 32595 ], [ 32596 ], [ 32597 ], [ 32598 ], [ 32599 ], [ 32600 ], [ 32601 ], [ 32602 ], [ 32603 ], [ 32604 ], [ 32605 ], [ 32606 ], [ 32607 ], [ 32608 ], [ 32609 ], [ 32610 ], [ 32611 ], [ 32612 ], [ 32613 ], [ 32614 ], [ 32615 ], [ 32616 ], [ 32617 ], [ 32618 ], [ 32619 ], [ 32620 ], [ 32621 ], [ 32622 ], [ 32623 ], [ 32624 ], [ 32625 ], [ 32626 ], [ 32627 ], [ 32628 ], [ 32629 ], [ 32630 ], [ 32631 ], [ 32632 ], [ 32633 ], [ 32634 ], [ 32635 ], [ 32636 ], [ 32637 ], [ 32638 ], [ 32639 ], [ 32640 ], [ 32641 ], [ 32642 ], [ 32643 ], [ 32644 ], [ 32645 ], [ 32646 ], [ 32647 ], [ 32648 ], [ 32649 ], [ 32650 ], [ 32651 ], [ 32652 ], [ 32653 ], [ 32654 ], [ 32655 ], [ 32656 ], [ 32657 ], [ 32658 ], [ 32659 ], [ 32660 ], [ 32661 ], [ 32662 ], [ 32663 ], [ 32664 ], [ 32665 ], [ 32666 ], [ 32667 ], [ 32668 ], [ 32669 ], [ 32670 ], [ 32671 ], [ 32672 ], [ 32673 ], [ 32674 ], [ 32675 ], [ 32676 ], [ 32677 ], [ 32678 ], [ 32679 ], [ 32680 ], [ 32681 ], [ 32682 ], [ 32683 ], [ 32684 ], [ 32685 ], [ 32686 ], [ 32687 ], [ 32688 ], [ 32689 ], [ 32690 ], [ 32691 ], [ 32692 ], [ 32693 ], [ 32694 ], [ 32695 ], [ 32696 ], [ 32697 ], [ 32698 ], [ 32699 ], [ 32700 ], [ 32701 ], [ 32702 ], [ 32703 ], [ 32704 ], [ 32705 ], [ 32706 ], [ 32707 ], [ 32708 ], [ 32709 ], [ 32710 ], [ 32711 ], [ 32712 ], [ 32713 ], [ 32714 ], [ 32715 ], [ 32716 ], [ 32717 ], [ 32718 ], [ 32719 ], [ 32720 ], [ 32721 ], [ 32722 ], [ 32723 ], [ 32724 ], [ 32725 ], [ 32726 ], [ 32727 ], [ 32728 ], [ 32729 ], [ 32730 ], [ 32731 ], [ 32732 ], [ 32733 ], [ 32734 ], [ 32735 ], [ 32736 ], [ 32737 ], [ 32738 ], [ 32739 ], [ 32740 ], [ 32741 ], [ 32742 ], [ 32743 ], [ 32744 ], [ 32745 ], [ 32746 ], [ 32747 ], [ 32748 ], [ 32749 ], [ 32750 ], [ 32751 ], [ 32752 ], [ 32753 ], [ 32754 ], [ 32755 ], [ 32756 ], [ 32757 ], [ 32758 ], [ 32759 ], [ 32760 ], [ 32761 ], [ 32762 ], [ 32763 ], [ 32764 ], [ 32765 ], [ 32766 ], [ 32767 ] ], "eos_token_id": 32568, "pad_token_id": 32568, "bos_token_id": 32568}123version https://git-lfs.github.com/spec/v1oid sha256:325198eecaed245557c794d500037f7612a44287d009c7b6471891c45377d4b3size 170096368123456789{ "tokenizer_class": "PreTrainedTokenizerFast", "model_max_length": 1024, "bos_token": "<|endoftext|>", "eos_token": "<|endoftext|>", "pad_token": "<|pad|>", "unk_token": null, "clean_up_tokenization_spaces": false}README.md+138
config.jsonAdded+35
generation_config.jsonAdded+614
model.safetensorsAdded+3
tokenizer.jsonAdded
tokenizer_config.jsonAdded+9