flaviussteff commited on
Commit
0649b6d
·
verified ·
1 Parent(s): b55b8ca

Model card for spp-ro-base

Browse files
Files changed (1) hide show
  1. README.md +76 -0
README.md ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - ro
4
+ license: mit
5
+ pipeline_tag: text-generation
6
+ tags:
7
+ - romanian
8
+ - llama
9
+ - causal-lm
10
+ - from-scratch
11
+ - synthetic-persona-pretraining
12
+ ---
13
+
14
+ # spp-ro-base
15
+
16
+ Vanilla control: the same documents, the same stream, no reflections.
17
+
18
+ Part of **SPP-Ro** (https://github.com/flaviussteff/spp-ro): a compute-matched, from-scratch replication in Romanian of Minder et al., *Synthetic Persona Pretraining*, EPFL-dlab, 2026 (arXiv:2608.13482), comparing Vanilla, Filtered and SPP pretraining on **exactly the same document stream**. Bachelor's thesis, Faculty of Mathematics and Computer Science, University of Bucharest (2026).
19
+
20
+ ## Training
21
+
22
+ * **Data.** 1.5M Romanian documents (FineWeb-2 RO, Wikipedia RO, press), read in a fixed-seed order that is identical for every model of the family. 150,000 documents (10 %) have a reflection in the sidecar: the 75,000 best-scored documents of a safety classifier plus 75,000 benign ones; reflections average 36 tokens (~0.67 % of the trained tokens).
23
+ * **Schedule.** 50,000 steps from scratch (peak LR 1.5e-4, 500 warm-up steps, cosine to 0, weight decay 0.1); 64 packed windows of 1,024 positions per step (EOS-terminated documents packed first-fit, block-diagonal attention, per-document positions, 2.4 % padding); ≈3.28 billion tokens in this run (~66 h); bf16 autocast with fp32 master weights; single NVIDIA RTX 3060 12 GB.
24
+
25
+ ## Architecture
26
+
27
+ | Parameter | Value |
28
+ |---|---|
29
+ | Parameters | 88,099,584 (~88.1M), tied embeddings |
30
+ | hidden / intermediate | 768 / 2048 (SwiGLU) |
31
+ | Layers | 12, GQA 12 query / 4 key-value heads |
32
+ | Context | 1,024 tokens, RoPE theta 10,000 |
33
+ | Vocabulary | 16,384 byte-level BPE (Romanian), `<assistant>` special token |
34
+
35
+ ## Results
36
+
37
+ | Metric | Value | vs. reference |
38
+ |---|---|---|
39
+ | Perplexity, held-out web (1,000 docs) | 18.42 | ref |
40
+ | Perplexity, held-out docs flagged by the safety classifier (199 docs) | 26.16 | ref |
41
+ | Perplexity, held-out docs not flagged (1,000 docs) | 17.82 | |
42
+ | Held-out 4-way cloze accuracy (1,000 items) | 89.5 % | |
43
+ | ConstitutionEval-Ro accuracy, letter, 4-rotation debiased (chance 25 %), 600 items | 27.5 % | |
44
+ | ConstitutionEval-Ro accuracy, PMI (chance 25 %), 600 items | 38.2 % | |
45
+ | ConstitutionEval-Ro accuracy, continuation (chance 25 %), 600 items | 19.5 % | |
46
+ | ConstitutionEval-Ro accuracy, gold vs each distractor (chance 50 %), 600 items | 45.2 % | |
47
+
48
+ All five models of the family are at chance level on ConstitutionEval-Ro (an 88M-parameter model does not solve the benchmark, so it cannot show an alignment effect at this scale); the measurable result is the alignment tax: SPP costs nothing in perplexity, while the Filtered baseline loses knowledge exactly on the classifier-flagged documents (+1.13 perplexity, worse on 85 % of them, paired sign test p ≈ 1e-24). Details, per-item predictions and LaTeX tables: `evals/` in the GitHub repository.
49
+
50
+ ## Usage
51
+
52
+ ```python
53
+ from transformers import AutoModelForCausalLM, AutoTokenizer
54
+ import torch
55
+ tok = AutoTokenizer.from_pretrained("flaviussteff/spp-ro-base")
56
+ model = AutoModelForCausalLM.from_pretrained("flaviussteff/spp-ro-base", dtype=torch.float32).eval()
57
+ prompt = "În România, egalitatea de șanse între femei și bărbați"
58
+ out = model.generate(**tok(prompt, return_tensors="pt"), max_new_tokens=60, do_sample=True, temperature=0.7)
59
+ print(tok.decode(out[0], skip_special_tokens=False))
60
+ ```
61
+
62
+ ## Limitations
63
+
64
+ Small (88M), monolingual Romanian, pretraining only (no instruction tuning or post-training), single seed. Trained on web text: it reproduces the biases of its data. Not intended for production use.
65
+
66
+ ## Citation
67
+
68
+ ```bibtex
69
+ @mastersthesis{habeanu2026sppro,
70
+ title = {Pre-antrenarea Modelelor Generative Românești cu Personalitate Sintetică: Aliniere Constituțională de la Token Zero},
71
+ author = {Hăbeanu, Flavius-Ștefan},
72
+ school = {Faculty of Mathematics and Computer Science, University of Bucharest},
73
+ year = {2026},
74
+ url = {https://github.com/flaviussteff/spp-ro}
75
+ }
76
+ ```