File size: 4,955 Bytes
0a74455
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# DATA_CARD — tiny_schiller (agent-ready)

This file is a compact, copy/paste-friendly summary of the **tiny_schiller** corpus and how to load it.



## What this is



- **Corpus**: 11 public-domain dramatic works by Friedrich Schiller (German)

- **Goal**: a *drop-in* German analogue to Karpathy’s *tiny_shakespeare* for small-LM prototyping, fine-tuning, and education

- **Release artifact**: a cleaned, single UTF-8 text file + deterministic preprocessing scripts



## Quantitative summary



**Corpus file (cleaned)**

- File: `tiny_schiller.parsed.txt`
- Characters: 2,019,857
- Bytes (UTF-8): 2,067,041 (~2.07 MB)
- Encoding: UTF-8 (no BOM)
- Line endings: LF
- Unique codepoints: 88
- Guillemets `«` / `»`: 101 / 101
- Works: 11

**Precomputed token streams (90/10 train/val)**

- `schiller_char/`
  - Vocab: 88
  - Train tokens: 1,817,871
  - Val tokens: 201,986
  - chars/token: 1.00
- `schiller_bpe/` (GPT-2 BPE)
  - Vocab: 50,257
  - Train tokens: 768,768
  - Val tokens: 85,844
  - Total tokens: 854,611
  - chars/token: 2.36
- `schiller_cl100k/` (`cl100k_base`)
  - Vocab: ~100k
  - Train tokens: 578,182
  - Val tokens: 64,412
  - Total tokens: 642,593
  - chars/token: 3.14

**Fine-tuning parquet files (Hub: `data/`)**

- Whole-work split: `data/train.parquet`, `data/test.parquet`
  - Rows: 9 train works, 2 test works
  - Fields: `title`, `text`
- Instruction-formatted dialogue completion: `data/instruct.parquet`
  - Rows: 7,607
  - Fields: `prompt`, `completion`, `work`, `character`
- Per-character persona splits: `data/char_*.parquet`
  - Files: 89
  - Example row counts: `char_WALLENSTEIN.parquet` 264, `char_CARLOS.parquet` 235, `char_MOOR.parquet` 130

**Reference fine-tune (paper)**

- Model: `Qwen/Qwen2.5-0.5B-Instruct` (494M params)
- Hardware: NVIDIA RTX 3060 (12 GB VRAM), bf16
- Stage 1: 2 epochs on `instruct.parquet`, batch 4, context 512, lr 2e-4
- Stage 2: 2 epochs on `char_MOOR.parquet`, lr 1e-4, weight decay 0.05
- Wall-clock time: ~2.7 hours total (~2.6 h stage 1, <3 min stage 2)
- Reported outcome: 99.05% token accuracy, entropy 0.055 (two epochs, weight decay 0.05)
- Recipe: `examples/reference_finetune.py` (two-stage run)

## Canonical text file

- `tiny_schiller.parsed.txt`
  - UTF-8, no BOM
  - LF line endings
  - Canonical speaker turns in the form `SPEAKER:\ntext`

## Precomputed tokenization splits

These match common small-LM workflows (e.g. nanoGPT-style `train.bin`/`val.bin`).

- `schiller_char/` — character-level (88 unique characters)
- `schiller_bpe/` — GPT-2 BPE via `tiktoken`
- `schiller_cl100k/``cl100k_base` via `tiktoken`

Build locally:

```bash

python schiller_char/prepare.py

python schiller_bpe/prepare.py

python schiller_cl100k/prepare.py

```

## HuggingFace datasets (whole works)

Dataset id: `mrkschtr/tiny_schiller`

Each row is one work with at least `title` and `text` fields.

```python

from datasets import load_dataset



ds = load_dataset("mrkschtr/tiny_schiller")

print(ds["train"][0]["title"])

print(ds["train"][0]["text"][:200])

```

Split policy (paper/README): train holds out **Wilhelm Tell** and **Die Braut von Messina** as test.

## Instruction + per-character persona splits (parquet)

These ship on the Hub under `data/`.

- General dialogue-completion: `data/instruct.parquet` (7,607 rows)
- Per-character persona files: `data/char_*.parquet` (89 files)

Schema per row:

- `prompt`: instruction template + preceding context turns
- `completion`: next speaker turn in `NAME:\ntext` format
- `work`: work title
- `character`: normalized speaker id (uppercase, underscores)

Load examples:

```python

from datasets import load_dataset



# Instruction-formatted dialogue completions

ins = load_dataset(

    "mrkschtr/tiny_schiller",

    data_files="data/instruct.parquet",

    split="train",

)



# One character persona dataset

moor = load_dataset(

    "mrkschtr/tiny_schiller",

    data_files="data/char_MOOR.parquet",

    split="train",

)

```

Rebuild locally (writes to `data/` by default):

```bash

python scripts/build_instruct.py

python scripts/build_instruct.py --list-characters

python scripts/build_instruct.py --character MOOR

```

## Intended use

- Rapid prototyping of model/training/tokenization choices under tight compute
- Stylistic fine-tuning on a homogeneous German literary register
- Per-character persona fine-tuning using the prebuilt `char_*.parquet` splits
- Education and reproducibility baselines on a non-English “tiny corpus”

## Licensing (read this)

- **Text content** (`tiny_schiller.txt`, `tiny_schiller.parsed.txt`): public domain (Schiller died 1805) and redistributed from DraCor / GerDraCor under CC0
- **Code + documentation** (everything else, incl. scripts and this file): MIT

See `LICENSING.md` for details and links to the upstream CC0 claim.