File size: 7,949 Bytes
c646e07
 
 
 
3ded1d9
 
c646e07
 
 
 
 
3ded1d9
 
 
 
 
 
 
a319aed
3ded1d9
a319aed
 
3ded1d9
a319aed
3ded1d9
a319aed
 
3ded1d9
a319aed
3ded1d9
a319aed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c646e07
3ded1d9
c646e07
 
3ded1d9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a319aed
3ded1d9
 
 
 
 
a319aed
3ded1d9
a319aed
3ded1d9
a319aed
 
 
 
 
3ded1d9
a319aed
3ded1d9
a319aed
 
 
 
 
 
 
 
 
3ded1d9
a319aed
3ded1d9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a319aed
3ded1d9
 
 
 
c646e07
3ded1d9
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
---
language:
- pl
license: cc-by-sa-4.0
library_name: transformers
pipeline_tag: text-generation
tags:
- gpt2
- gollem
- polish
- sft
- from-scratch
- amd-rocm
base_model: SlayerLab/goLLeM-110M-PL
model-index:
- name: goLLeM-110M-PL-SFT-merged
  results:
  - task: {type: text-classification, name: Polish topic classification}
    dataset: {type: sdadas/8tags, name: 8Tags (Polish), split: test}
    metrics:
    - {type: accuracy, value: 0.110247, name: Accuracy (PL)}
    - {type: f1, value: 0.034779, name: Macro-F1 (PL)}
  - task: {type: text-classification, name: Polish sentiment (in-domain)}
    dataset: {type: allegro/klej-polemo2-in, name: PolEmo2-IN (Polish), split: test}
    metrics:
    - {type: accuracy, value: 0.423823, name: Accuracy (PL)}
    - {type: f1, value: 0.242625, name: Macro-F1 (PL)}
  - task: {type: text-classification, name: Polish sentiment (out-of-domain)}
    dataset: {type: allegro/klej-polemo2-out, name: PolEmo2-OUT (Polish), split: test}
    metrics:
    - {type: accuracy, value: 0.356275, name: Accuracy (PL)}
    - {type: f1, value: 0.169887, name: Macro-F1 (PL)}
  - task: {type: text-generation, name: English zero-shot (cross-lingual transfer)}
    dataset: {type: blimp, name: BLiMP (English), split: train}
    metrics: [{type: acc, value: 0.5404, name: acc (EN)}]
  - task: {type: text-generation, name: English zero-shot (cross-lingual transfer)}
    dataset: {type: EleutherAI/lambada_openai, name: LAMBADA OpenAI (English), split: test}
    metrics: [{type: acc, value: 0.0223, name: acc (EN)}, {type: perplexity, value: 55056.11, name: perplexity (EN)}]
  - task: {type: text-generation, name: English zero-shot (cross-lingual transfer)}
    dataset: {type: hellaswag, name: HellaSwag (English), split: validation}
    metrics: [{type: acc_norm, value: 0.2817, name: acc_norm (EN)}]
  - task: {type: text-generation, name: English zero-shot (cross-lingual transfer)}
    dataset: {type: piqa, name: PIQA (English), split: validation}
    metrics: [{type: acc_norm, value: 0.5065, name: acc_norm (EN)}]
  - task: {type: text-generation, name: English zero-shot (cross-lingual transfer)}
    dataset: {type: sciq, name: SciQ (English), split: test}
    metrics: [{type: acc_norm, value: 0.6000, name: acc_norm (EN)}]
  - task: {type: text-generation, name: English zero-shot (cross-lingual transfer)}
    dataset: {type: allenai/ai2_arc, config: ARC-Easy, name: ARC-Easy (English), split: test}
    metrics: [{type: acc_norm, value: 0.2597, name: acc_norm (EN)}]
  - task: {type: text-generation, name: English zero-shot (cross-lingual transfer)}
    dataset: {type: allenai/ai2_arc, config: ARC-Challenge, name: ARC-Challenge (English), split: test}
    metrics: [{type: acc_norm, value: 0.2270, name: acc_norm (EN)}]
---

# GoLLeM-110M-PL-SFT-merged

> **Wydanie eksperymentalne / Experimental release.** Model nie jest przeznaczony do zastosowań produkcyjnych ani wysokiego ryzyka.

Instruction-tuned (SFT) wersja **GoLLeM-110M-PL** — małego, polskojęzycznego modelu bazowego typu decoder-only, wytrenowanego **od zera** na konsumenckiej karcie **AMD Radeon RX 7900 XTX** (ROCm/WSL2, Windows), bez NVIDII i bez chmury. Implementacja GPT-2 (nanoGPT-style) + własny polski tokenizer BPE. Wersja `merged` = wagi SFT scalone do formatu `GPT2LMHeadModel` (ładowalne standardowym `transformers`).

## Architektura i tokenizer

| Właściwość | Wartość |
|---|---:|
| Typ | GPT-2-style decoder-only Transformer |
| Warstwy / głowy / d_model | 12 / 12 / 768 |
| Maksymalny kontekst | 512 tokenów |
| Słownik | 32 000 (polski byte-level BPE, dynaword-32k) |
| Parametry | ~110M (weight-tied embeddings) |
| Token specjalny | `<|endoftext|>` = 0 |
| Format | `GPT2LMHeadModel`, safetensors |

## Baza, dane i trening

- **Model bazowy:** [SlayerLab/goLLeM-110M-PL](https://huggingface.co/SlayerLab/goLLeM-110M-PL) (ckpt_00060733), pretrenowany od zera na korpusie **dynaword-expansion** (HPLT v3.0 `pol_Latn`, ~1,35 mld tokenów, 1 epoka), PII-scrubbed. **Język treningu: 100% polski.**
- **SFT:** grounded-QA, **26 194 par** (4 autorów, CC-BY-SA-inherit); 3 epoki, lr 2e-5, weight decay 0.1, batch 16 × accum 4 (efektywny 64), ~3 min 40 s na RX 7900 XTX (ROCm).
- **Gate treningowy:** PII 0, regurgitacja 0 (model składa ze wzorców, nie recytuje danych); forma odpowiedzi 15/15 (0 kontynuacji, 0 boilerplate).

## Ewaluacja

Zero-shot, pełne splity. Ewaluacja pokrywa **dwa języki**: **polski (3 benchmarki)** — realna kompetencja modelu — oraz **angielski (7 benchmarków)** — transfer międzyjęzykowy (model jest jednojęzyczny polski, więc EN mierzy transfer, nie zdolność). **Bateria EN:** `lm-evaluation-harness` 0.4.12 (te same taski i wersja co karta [Pollock](https://huggingface.co/SlayerLab/pollock-mini-lm-125m)). **Bateria PL:** port protokołu dmpod (`eval_pl_bench`, mean-loglikelihood-per-token, length-normalized, accuracy + macro-F1). Pomiar: SlayerLab (Latarnik/Hart), 2026-08-27, RX 7900 XTX.

### 🇵🇱 Bateria POLSKA — kompetencja (random: 8Tags .125, PolEmo2 .25)

| Benchmark | Język | Accuracy | Macro-F1 | Próbki |
|---|:---:|---:|---:|---:|
| 8Tags | 🇵🇱 PL | 0.1102 | 0.0348 | 4 372 |
| PolEmo2-IN | 🇵🇱 PL | 0.4238 | 0.2426 | 722 |
| PolEmo2-OUT | 🇵🇱 PL | 0.3563 | 0.1699 | 494 |

### 🇬🇧 Bateria ANGIELSKA — transfer międzyjęzykowy (random: BLiMP/PIQA .5, reszta ~.25)

| Benchmark | Język | Metryka | Wynik |
|---|:---:|---|---:|
| BLiMP | 🇬🇧 EN | acc | 0.5404 |
| LAMBADA OpenAI | 🇬🇧 EN | acc | 0.0223 (ppl 55056) |
| HellaSwag | 🇬🇧 EN | acc_norm | 0.2817 |
| PIQA | 🇬🇧 EN | acc_norm | 0.5065 |
| SciQ | 🇬🇧 EN | acc_norm | 0.6000 |
| ARC-Easy | 🇬🇧 EN | acc_norm | 0.2597 |
| ARC-Challenge | 🇬🇧 EN | acc_norm | 0.2270 |

**Interpretacja (uczciwie):** to model **polski** (trenowany 100% PL). Bateria 🇵🇱 mierzy realną kompetencję, bateria 🇬🇧 — transfer międzyjęzykowy. Na EN wypada ~losowo (LAMBADA ppl 55056 = nie przewiduje angielskiego następnego słowa) — to oczekiwane dla modelu monolingwalnego, nie wada. Sygnał jest tam, gdzie powinien: PolEmo2-IN 0.424 (nad losowym 0.25). Uwaga porównawcza: względem bazy GoLLeM-110M-PL SFT nie podniósł zdolności zero-shot klasyfikacji (8Tags pozostaje ~losowo; wzrost accuracy PolEmo2 idzie w parze ze spadkiem macro-F1 = przesunięcie ku klasie większościowej). Model najlepiej traktować jako **completion/instruction-following bazowej skali**, nie jako klasyfikator. Confound porównań z modelami innej klasy: różny słownik i długość kontekstu.

## Użycie

```python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "SlayerLab/goLLeM-110M-PL-SFT-merged"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id).eval()

ids = tok("Polska to kraj położony w", return_tensors="pt").input_ids
out = model.generate(ids, max_new_tokens=80, do_sample=True, temperature=0.8,
                     top_k=40, repetition_penalty=1.3, pad_token_id=0)
print(tok.decode(out[0], skip_special_tokens=True))
```

## Ograniczenia i odpowiedzialne użycie

- Mały model (110M) — generuje **pewnie brzmiące nieprawdy** i potrafi dryfować z tematu; wiedza faktograficzna jest ograniczona skalą.
- Trenowany i oceniany głównie po polsku; po angielsku ~losowo (transfer).
- Kontekst 512 tokenów, brak filtrów bezpieczeństwa na wyjściu.
- **PII:** może generować prawdopodobnie brzmiące imiona/adresy = **konfabulacje**, nie dane realnych osób; kontaktowe PII (telefon/e-mail/PESEL) było scrubowane w korpusie (model zwraca tagi `[Telefon]`/`[PII]`). Weryfikacja wyjścia po stronie użytkownika.

## Licencja i pochodzenie

- Licencja: **CC-BY-SA-4.0** (dziedziczona po danych SFT grounded-QA, CC-BY-SA-inherit).
- Model i trening: **Arkadiusz Słota / SlayerLab**. Architektura oparta na GPT-2 / nanoGPT.