kacperwikiel commited on
Commit
28cf0b2
·
verified ·
1 Parent(s): 4012ebc

Upload Slayer GPT tokenizer model archive

Browse files
README.md CHANGED
@@ -111,6 +111,26 @@ model/ckpt.pt -> tokenizers/polish_bpe_32k.json
111
 
112
  Do not sample `model/ckpt.pt` with `tokenizers/rxlm_polish_bpe_65k.json`. That tokenizer is a separate later artifact.
113
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
114
  ## Checkpoint Summary
115
 
116
  `model/ckpt.pt`:
 
111
 
112
  Do not sample `model/ckpt.pt` with `tokenizers/rxlm_polish_bpe_65k.json`. That tokenizer is a separate later artifact.
113
 
114
+ Why this matters:
115
+
116
+ - `model/ckpt.pt` was trained with `vocab_size=32768`, so its token embedding table and output head have 32768 rows.
117
+ - `tokenizers/rxlm_polish_bpe_65k.json` has 65536 vocabulary entries and can emit token IDs that the model does not have embeddings for.
118
+ - Even if a token ID is below 32768, the two tokenizers do not guarantee that the same ID means the same text fragment.
119
+ - To use the 65k tokenizer correctly, train a separate model with a matching 65536-token vocabulary.
120
+
121
+ ## Tokenizer Construction
122
+
123
+ ![Byte-level BPE tokenizer pipeline](docs/assets/tokenizer_bpe_pipeline.png)
124
+
125
+ `tokenizers/polish_bpe_32k.json` is a pure statistical byte-level BPE tokenizer. It was not built as a morphological tokenizer:
126
+
127
+ - no Polish inflection rules,
128
+ - no lemmatizer,
129
+ - no morpheme dictionary,
130
+ - no hand-written segmentation grammar.
131
+
132
+ The tokenizer learns frequent byte/subword merges from the corpus. Polish-looking pieces emerge only because they were statistically useful in the training text.
133
+
134
  ## Checkpoint Summary
135
 
136
  `model/ckpt.pt`:
docs/assets/tokenizer_bpe_pipeline.png ADDED
docs/tokenizer_bpe_pipeline.tex ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ \documentclass[tikz,border=8pt]{standalone}
2
+ \usepackage[T1]{fontenc}
3
+ \usepackage[utf8]{inputenc}
4
+ \usepackage{tikz}
5
+ \usetikzlibrary{arrows.meta,positioning,shapes.geometric}
6
+
7
+ \definecolor{slayerRed}{RGB}{190,42,38}
8
+ \definecolor{ink}{RGB}{28,30,34}
9
+ \definecolor{muted}{RGB}{93,98,108}
10
+ \definecolor{panel}{RGB}{247,248,250}
11
+ \definecolor{line}{RGB}{190,196,205}
12
+
13
+ \tikzset{
14
+ box/.style={
15
+ draw=line,
16
+ fill=panel,
17
+ rounded corners=3pt,
18
+ very thick,
19
+ minimum width=3.2cm,
20
+ minimum height=1.18cm,
21
+ align=center,
22
+ text=ink,
23
+ font=\sffamily\small
24
+ },
25
+ note/.style={
26
+ draw=slayerRed,
27
+ fill=slayerRed!7,
28
+ rounded corners=3pt,
29
+ very thick,
30
+ minimum width=11.4cm,
31
+ minimum height=1.25cm,
32
+ align=center,
33
+ text=ink,
34
+ font=\sffamily\small
35
+ },
36
+ arrow/.style={-{Latex[length=3mm]}, very thick, draw=ink},
37
+ small/.style={font=\sffamily\footnotesize, text=muted, align=center}
38
+ }
39
+
40
+ \begin{document}
41
+ \begin{tikzpicture}[node distance=1.05cm and 0.95cm]
42
+ \node[box] (raw) {Polski korpus\\UTF-8 text};
43
+ \node[box, right=of raw] (bytes) {Byte-level\\pretokenizacja};
44
+ \node[box, right=of bytes] (pairs) {Statystyczne\\zliczanie par};
45
+ \node[box, right=of pairs] (merges) {BPE merges\\najczestsze pary};
46
+ \node[box, right=of merges] (vocab) {Vocab 32k\\token ids uint16};
47
+
48
+ \draw[arrow] (raw) -- (bytes);
49
+ \draw[arrow] (bytes) -- (pairs);
50
+ \draw[arrow] (pairs) -- (merges);
51
+ \draw[arrow] (merges) -- (vocab);
52
+
53
+ \node[note, below=1.05cm of pairs, xshift=2.05cm] (stat) {
54
+ To nie jest tokenizer morfologiczny: brak reguł fleksyjnych, lematyzacji i słownika morfemów\\
55
+ To czysty tokenizer statystyczny: segmenty wynikają z częstości par w korpusie
56
+ };
57
+
58
+ \draw[arrow, slayerRed] (pairs.south) -- ([xshift=-2.2cm]stat.north);
59
+ \draw[arrow, slayerRed] (merges.south) -- (stat.north);
60
+
61
+ \node[small, above=0.35cm of bytes] {diakrytyki sa zachowane jako bajty UTF-8};
62
+ \node[small, above=0.35cm of vocab] {model/ckpt.pt wymaga\\tokenizers/polish\_bpe\_32k.json};
63
+
64
+ \node[font=\sffamily\bfseries\large, text=ink, above=1.0cm of pairs] {
65
+ Jak powstal tokenizer Slayer GPT: byte-level BPE, nie morfologia
66
+ };
67
+ \end{tikzpicture}
68
+ \end{document}