Text Generation
Transformers
ONNX
Safetensors
Transformers.js
English
gpt2
public-domain
open-data
data-provenance
text-generation-inference
Instructions to use ikarth/openpd-gpt2-v0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ikarth/openpd-gpt2-v0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ikarth/openpd-gpt2-v0")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ikarth/openpd-gpt2-v0") model = AutoModelForCausalLM.from_pretrained("ikarth/openpd-gpt2-v0", device_map="auto") - Transformers.js
How to use ikarth/openpd-gpt2-v0 with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-generation', 'ikarth/openpd-gpt2-v0'); - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ikarth/openpd-gpt2-v0 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ikarth/openpd-gpt2-v0" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ikarth/openpd-gpt2-v0", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ikarth/openpd-gpt2-v0
- SGLang
How to use ikarth/openpd-gpt2-v0 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 "ikarth/openpd-gpt2-v0" \ --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": "ikarth/openpd-gpt2-v0", "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 "ikarth/openpd-gpt2-v0" \ --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": "ikarth/openpd-gpt2-v0", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ikarth/openpd-gpt2-v0 with Docker Model Runner:
docker model run hf.co/ikarth/openpd-gpt2-v0
Upload folder using huggingface_hub
Browse files- .gitattributes +1 -0
- README.md +259 -0
- config.json +34 -0
- export_info.json +8 -0
- generation_config.json +10 -0
- model.safetensors +3 -0
- onnx/model_quantized.onnx +3 -0
- provenance_step_004499.json +165 -0
- summary.md +13 -0
- tokenizer.json +0 -0
- tokenizer_config.json +13 -0
- training_curves.png +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
training_curves.png filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,259 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc0-1.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
library_name: transformers
|
| 6 |
+
pipeline_tag: text-generation
|
| 7 |
+
tags:
|
| 8 |
+
- gpt2
|
| 9 |
+
- public-domain
|
| 10 |
+
- open-data
|
| 11 |
+
- data-provenance
|
| 12 |
+
- onnx
|
| 13 |
+
- transformers.js
|
| 14 |
+
datasets:
|
| 15 |
+
- common-pile/project_gutenberg_filtered
|
| 16 |
+
- common-pile/pre_1929_books_filtered
|
| 17 |
+
- storytracer/LoC-PD-Books
|
| 18 |
+
- common-pile/biodiversity_heritage_library_filtered
|
| 19 |
+
- common-pile/ubuntu_irc_filtered
|
| 20 |
+
- common-pile/caselaw_access_project_filtered
|
| 21 |
+
- common-pile/usgpo_filtered
|
| 22 |
+
- common-pile/regulations_filtered
|
| 23 |
+
- common-pile/arxiv_abstracts_filtered
|
| 24 |
+
- common-pile/arxiv_papers_filtered
|
| 25 |
+
- common-pile/peS2o_filtered
|
| 26 |
+
- common-pile/pubmed_filtered
|
| 27 |
+
- common-pile/python_enhancement_proposals_filtered
|
| 28 |
+
---
|
| 29 |
+
|
| 30 |
+
# openpd-gpt2 v0
|
| 31 |
+
|
| 32 |
+
I trained a language model from scratch! It's called GPT-2.
|
| 33 |
+
|
| 34 |
+
The code is based on the well-known nanoGPT tutorials, with the twist that the training data is entirely public domain and CC0 text (and therefore, so is the model). The nature of the particular public-domain data means that books from 1929 and before make up a large part of the dataset, so it's not as versed in modern topics as the original internet-poisoned GPT-2 is. On the other hand no Reddit posts were consulted in training this model.
|
| 35 |
+
|
| 36 |
+
It's trained on about 2.5B tokens, with a relatively strict definition of public domain text; I have plans for the full 10B-token dataset (with an even stricter limit) at a later date, but the point of this model is that it was trained entirely on my personal 3090. (A solid workhorse, but send better GPUs for faster results.)
|
| 37 |
+
|
| 38 |
+
Note that the data cleaning was relatively minimal, and I didn't alter the original architecture much. It's a base model with no safety tuning, guardrails, or instruction tuning, use at your own risk. It also doesn't have a lot of code in its training data, so there's a limit to what it can do other than say bad words at you.
|
| 39 |
+
|
| 40 |
+
Better data and architecture can produce a better model; this one is mostly proof-of-concept.
|
| 41 |
+
|
| 42 |
+
## Try it
|
| 43 |
+
|
| 44 |
+
**In your browser:** [openpd-gpt2 demo](https://huggingface.co/spaces/ikarth/openpd-gpt2) (runs locally
|
| 45 |
+
via transformers.js and the 8-bit ONNX weights in `onnx/`; about 170 MB download).
|
| 46 |
+
|
| 47 |
+
**With transformers:**
|
| 48 |
+
|
| 49 |
+
```python
|
| 50 |
+
from transformers import pipeline
|
| 51 |
+
|
| 52 |
+
generator = pipeline("text-generation", model="ikarth/openpd-gpt2-v0")
|
| 53 |
+
print(generator("The old captain looked out across the harbor and")[0]["generated_text"])
|
| 54 |
+
```
|
| 55 |
+
|
| 56 |
+
Sampling defaults (`generation_config.json`): temperature 0.9, top-k 50, 120 new tokens.
|
| 57 |
+
|
| 58 |
+
## Model
|
| 59 |
+
|
| 60 |
+
| | |
|
| 61 |
+
|---|---|
|
| 62 |
+
| Architecture | GPT-2 small: 12 layers, 12 heads, 768 dims, 1,024-token context, tied embeddings (vocab padded to 50,304 for training; exported with 50,257) |
|
| 63 |
+
| Tokenizer | GPT-2 BPE (`tiktoken` `gpt2`). **Not trained on open data** (see Known issues) |
|
| 64 |
+
| Parameters | ~124M |
|
| 65 |
+
| Code | personally hand-coded core model (build-nanogpt lineage, so copied from there). Run segments: `eb0b3af` (start, uncommitted changes present), `fe60116` (resume, uncommitted changes present), `2928c74` (final segment, clean) |
|
| 66 |
+
|
| 67 |
+
## Training data
|
| 68 |
+
|
| 69 |
+
As near as I can tell the whole thing is public domain (or CC0).
|
| 70 |
+
|
| 71 |
+
Tiers `pd` + `pd-policy`: every document is public domain (by law, mostly US) or CC0, checked per
|
| 72 |
+
document where the source records licenses (`metadata.license` / `oa_license`), per source
|
| 73 |
+
otherwise, except Ubuntu IRC (`pd-policy`), whose public-domain status rests on Ubuntu's IRC
|
| 74 |
+
policy rather than law or per-author dedication. Dataset `openpd-v1`
|
| 75 |
+
(tokenized with GPT-2 BPE), fingerprint `fbca048694dc8f04…` (sha256 of the token stream).
|
| 76 |
+
|
| 77 |
+
| Source | License basis | Dataset train tokens | Share | Cleaning |
|
| 78 |
+
|---|---|---|---|---|
|
| 79 |
+
| Project Gutenberg (Common Pile) | PD (US) | 2.176 B | 22.3% | prose unwrapped, verse kept |
|
| 80 |
+
| Pre-1929 books, Internet Archive (Common Pile) | PD (US) | 2.113 B | 21.6% | de-hyphenated |
|
| 81 |
+
| Library of Congress Selected Digitized Books (storytracer) | CC0 / PD (US) | 1.156 B | 11.8% | de-hyphenated, prose unwrapped |
|
| 82 |
+
| Ubuntu IRC (Common Pile) | **pd-policy**: PD by Ubuntu IRC policy + join notice | 0.943 B | 9.7% | timestamps removed, **nicknames pseudonymized**, emails/IPs replaced |
|
| 83 |
+
| Caselaw Access Project (Common Pile) | PD (US) | 0.724 B | 7.4% | — |
|
| 84 |
+
| arXiv abstracts (Common Pile) | CC0 | 0.550 B | 5.6% | — |
|
| 85 |
+
| US Government Publishing Office (Common Pile) | PD (US gov works) | 0.469 B | 4.8% | de-hyphenated |
|
| 86 |
+
| Biodiversity Heritage Library (Common Pile) | PD | 0.435 B | 4.5% | de-hyphenated |
|
| 87 |
+
| PubMed Central, CC0 subset (Common Pile) | CC0 | 0.410 B | 4.2% | — |
|
| 88 |
+
| peS2o, CC0/PD subset (Common Pile) | CC0 / PD | 0.301 B | 3.1% | — |
|
| 89 |
+
| arXiv papers, PD/CC0 subset (Common Pile) | PD / CC0 | 0.284 B | 2.9% | de-hyphenated |
|
| 90 |
+
| Regulations.gov (Common Pile) | PD (US gov works) | 0.202 B | 2.1% | de-hyphenated |
|
| 91 |
+
| Python Enhancement Proposals (Common Pile) | PD | 0.003 B | 0.0% | — |
|
| 92 |
+
| **Total** | | **9.77 B** | | |
|
| 93 |
+
|
| 94 |
+
**What this model actually trained on** (from `src.run_provenance` on the released checkpoint,
|
| 95 |
+
step 4,499): **2.36 B tokens, 0.24 epochs** of the dataset. Gutenberg 0.526 B, pre-1929 books
|
| 96 |
+
0.511 B, LoC 0.279 B, Ubuntu IRC 0.228 B, case law 0.175 B, arXiv abstracts 0.133 B, USGPO 0.113 B,
|
| 97 |
+
BHL 0.105 B, PubMed CC0 0.099 B, peS2o 0.073 B, arXiv papers 0.069 B, regulations 0.049 B, PEPs
|
| 98 |
+
0.001 B. Attribution for `openpd-v1` is proportional: the dataset interleaves sources evenly, so
|
| 99 |
+
each source's share of the trained tokens matches its dataset share to about a percent.
|
| 100 |
+
|
| 101 |
+
Provenance records (per source: upstream revision, per-file sha256, license review, cleaning,
|
| 102 |
+
model involvement) live in the dataset registry; the tokenized dataset's manifest lists every
|
| 103 |
+
input file with its hash.
|
| 104 |
+
|
| 105 |
+
### Model involvement in the data
|
| 106 |
+
No synthetic text. Upstream processing involved models only for text extraction and filtering:
|
| 107 |
+
OCR for the book, BHL, and case-law sources; Grobid PDF parsing for peS2o; and Common Pile's
|
| 108 |
+
filtering pipeline (classifiers not yet verified against the Common Pile paper).
|
| 109 |
+
|
| 110 |
+
### Ubuntu IRC licensing (`pd-policy`)
|
| 111 |
+
Ubuntu's IRC Guidelines stated that the contents of all Ubuntu channels are "considered to be in
|
| 112 |
+
the public domain", its IRC Terms of Service stated that participants in logged channels agree to
|
| 113 |
+
public logging and processing, and logged channels showed an entry notice pointing to those terms
|
| 114 |
+
(also documented by Uthus & Aha 2013). I think it's fine but I'm not a lawyer and in the interest of having 100% rigidly public domain training data I'm planning on a future training run that drops it from the mix.
|
| 115 |
+
|
| 116 |
+
### Personal information
|
| 117 |
+
Ubuntu IRC is the only source with chat participants. Nicknames are replaced with stable
|
| 118 |
+
pseudonyms (salted xxh64 seeding an Elite (1984)-style syllable generator; consistent within and across
|
| 119 |
+
logs, not reversible without the private salt). Emails and IPv4 addresses are replaced with
|
| 120 |
+
`user@example.com` / `192.0.2.1`. Limits: only nicknames that speak in a given day's channel log
|
| 121 |
+
are recognized; a nickname that is an ordinary English word is not rewritten inside sentences;
|
| 122 |
+
pseudonyms keep the original nickname's trailing digits. A bug, found after training, left
|
| 123 |
+
`/me` action lines unmatched: about 5% of action lines (0.03% of IRC lines) kept the real nickname
|
| 124 |
+
of someone who only used `/me` that day. Fixed for future datasets.
|
| 125 |
+
|
| 126 |
+
**Pre-release leak check.** From 2,048 IRC-style samples (256 new tokens each), every nickname
|
| 127 |
+
the model wrote was compared with the 836k real nicknames in the raw logs and their pseudonyms.
|
| 128 |
+
In speaker/action position, 0.4% matched a distinctive real nickname that is never a pseudonym,
|
| 129 |
+
and on inspection these were ordinary names, words, or prompt echoes, except one. Of the 1,000
|
| 130 |
+
most active distinctive nicknames, three appeared at all, six times in total: the handles of
|
| 131 |
+
long-time Ubuntu developers, learned from mentions on days they didn't speak. No real email addresses, no IP addresses from the logs, and no phone numbers appeared.
|
| 132 |
+
So the model has picked up a few prominent community members' public handles, rarely; it does
|
| 133 |
+
not reproduce the chat participants at large.
|
| 134 |
+
|
| 135 |
+
## Training
|
| 136 |
+
|
| 137 |
+
| | |
|
| 138 |
+
|---|---|
|
| 139 |
+
| Steps | 4,500 × 524,288 tokens = 2.36 B tokens |
|
| 140 |
+
| Schedule | WSD: 170 warmup steps, constant 6e-4 to step 3,599, linear decay to 6e-5 over the last 20% |
|
| 141 |
+
| Optimizer | AdamW (β 0.9/0.95, weight decay 0.1 on matrices), grad clip 1.0 |
|
| 142 |
+
| Precision | bf16 autocast, TF32 matmuls, `torch.compile` |
|
| 143 |
+
| Hardware | 1× RTX 3090, power-limited to 300 W |
|
| 144 |
+
| Throughput | ~56–60k tokens/s |
|
| 145 |
+
| Training time | 11.6 h of active training (paused overnight at step 3,599; restarted from the step-4,000 checkpoint after a stall) |
|
| 146 |
+
| Energy (GPU) | 3.69 kWh (driver energy counter; excludes the rest of the machine) |
|
| 147 |
+
|
| 148 |
+
## Evaluation
|
| 149 |
+
|
| 150 |
+

|
| 151 |
+
|
| 152 |
+
Evaluated every 500 steps (and through the decay phase, shaded). Perplexity on the held-out 1930
|
| 153 |
+
novels passed GPT-2's between steps 3,750 and 4,000. HellaSwag's ActivityNet contexts climbed
|
| 154 |
+
steadily from chance to 0.30, while its WikiHow contexts stayed at or below chance throughout.
|
| 155 |
+
BLiMP was still rising when training stopped: this model is undertrained, and the next run
|
| 156 |
+
(8.8B tokens, about 4× longer) should show how far these curves go.
|
| 157 |
+
|
| 158 |
+
Every number below comes from the same eval code, run the same way on this model and on OpenAI's
|
| 159 |
+
GPT-2 small (124M parameters, trained on WebText: 2019 web pages linked from Reddit). Both use the
|
| 160 |
+
same tokenizer, so perplexities are directly comparable. "Before decay" is the step-3,599
|
| 161 |
+
checkpoint, the end of the constant-learning-rate phase. `summary.md` in this repo has the table;
|
| 162 |
+
per-paradigm and per-book results are in the project repo.
|
| 163 |
+
|
| 164 |
+
| | openpd-gpt2 v0 | v0 before decay (step 3,599) | GPT-2 small |
|
| 165 |
+
|---|---|---|---|
|
| 166 |
+
| Val loss (openpd-v1 val split) | **3.418** | 3.675 (step 3,500) | n/a (different data) |
|
| 167 |
+
| **HellaSwag** acc_norm (10,042; chance 0.25) | 0.255 | 0.248 | 0.298 |
|
| 168 |
+
| ActivityNet contexts | 0.302 | 0.295 | 0.353 |
|
| 169 |
+
| WikiHow contexts | 0.233 | 0.225 | 0.272 |
|
| 170 |
+
| **BLiMP**, mean of 67 paradigms (chance 0.5) | 0.736 | 0.711 | 0.823 |
|
| 171 |
+
| morphology | 0.880 | 0.847 | 0.930 |
|
| 172 |
+
| syntax | 0.673 | 0.639 | 0.791 |
|
| 173 |
+
| semantics | 0.681 | 0.692 | 0.745 |
|
| 174 |
+
| syntax/semantics | 0.686 | 0.669 | 0.785 |
|
| 175 |
+
| **Perplexity**, 1930 novels (held out, 977k tokens) | **26.1** | 31.7 | 28.8 |
|
| 176 |
+
| **Perplexity**, WikiText-103 test (modern, 273k tokens) | 81.1 | 104.3 | **22.8** |
|
| 177 |
+
| CBT common nouns (*contaminated*, see below) | 0.791 | 0.739 | 0.863 |
|
| 178 |
+
|
| 179 |
+
**Period text: better than GPT-2.** The 1930 set is eight novels first published in 1930, which
|
| 180 |
+
entered the US public domain on 1 January 2026 and were added to Project Gutenberg after the
|
| 181 |
+
training data was collected: *The Maltese Falcon* (Hammett), *The Murder at the Vicarage*
|
| 182 |
+
(Christie), *Strong Poison* (Sayers), *The Secret of the Old Clock* (Keene), *Vile Bodies* (Waugh),
|
| 183 |
+
*Cakes and Ale* (Maugham), *Angel Pavement* (Priestley), and *Mr. Fortune's Maggot* (Townsend
|
| 184 |
+
Warner). A 13-gram overlap scan against the training data finds 2.2% of their 13-token spans on
|
| 185 |
+
average (stock phrases), so they are effectively unseen. This model has lower perplexity than
|
| 186 |
+
GPT-2 on all eight books (26.1 vs 28.8 overall).
|
| 187 |
+
|
| 188 |
+
**Modern text: much worse.** On WikiText-103 (Wikipedia articles), perplexity is 3.5× GPT-2's.
|
| 189 |
+
Most of the training data predates 1930, and its modern sources are specialized (case law,
|
| 190 |
+
government documents, science papers, IRC chat) rather than general encyclopedic or web prose.
|
| 191 |
+
(Our WikiText numbers use whole-article sliding windows on detokenized text, not the GPT-2
|
| 192 |
+
paper's setup; compare them only within this table.)
|
| 193 |
+
|
| 194 |
+
**HellaSwag is near chance (0.25).** HellaSwag asks for the most plausible ending to a
|
| 195 |
+
description of an everyday activity. Its ActivityNet contexts (video captions) score 0.30; its
|
| 196 |
+
WikiHow contexts, about modern products, technology, and activities that public-domain text never
|
| 197 |
+
describes, score 0.23, slightly *below* chance. This reflects the training data at least as much
|
| 198 |
+
as the model size.
|
| 199 |
+
|
| 200 |
+
**BLiMP: grammar is mostly learned.** BLiMP gives the model pairs of sentences that differ in one
|
| 201 |
+
grammatical detail and checks that it prefers the grammatical one. The gap to GPT-2 is smallest in
|
| 202 |
+
morphology (agreement, irregular forms: 0.88 vs 0.93) and largest in syntax (0.67 vs 0.79).
|
| 203 |
+
|
| 204 |
+
**CBT is contaminated, so its score doesn't measure generalization.** The Children's Book Test
|
| 205 |
+
(fill in a missing common noun from 10 candidates) is built from Project Gutenberg children's
|
| 206 |
+
books, and Project Gutenberg is in the training data: 66% of the test passages' 13-token spans
|
| 207 |
+
appear in it. The score is listed for completeness only. The named-entity subset is omitted.
|
| 208 |
+
|
| 209 |
+
**The learning-rate decay helped across the board.** The last 20% of training (learning rate
|
| 210 |
+
decayed linearly to 1/10) cut val loss from 3.675 to 3.418 and improved every metric above except
|
| 211 |
+
BLiMP semantics (0.692 → 0.681).
|
| 212 |
+
|
| 213 |
+
**Samples** (`configs/prompts/openpd-v1.toml`, 3 samples per prompt, temperature 0.9, top-k 50; v0
|
| 214 |
+
vs v0-before-decay vs GPT-2): v0 writes in a consistent 19th-century register (quoted dialogue,
|
| 215 |
+
epistolary and naturalist prose), produces convincing IRC support chat with pseudonymous nicks,
|
| 216 |
+
and is grammatical over short spans but drifts over longer ones. Given modern prompts ("My
|
| 217 |
+
favorite video game is"), it switches into IRC chat, its only modern register. Example:
|
| 218 |
+
|
| 219 |
+
> *The old captain looked out across the harbor and* called in the old man, and a man in the cabin
|
| 220 |
+
> called out to him. The young man was his only answer when he heard the old captain's answer.
|
| 221 |
+
> "Well, sir, for a moment or two you are so anxious to get away in a storm…"
|
| 222 |
+
|
| 223 |
+
|
| 224 |
+
## Known issues
|
| 225 |
+
|
| 226 |
+
From `src/data_report.py` over the training data (`openpd-v1_report.json`):
|
| 227 |
+
|
| 228 |
+
- **Data tables in government sources.** Some USGPO / Regulations.gov documents are large numeric
|
| 229 |
+
data dumps (tariff codes, emissions tables, columns of `0.00`). ~0.3% of tokens are in
|
| 230 |
+
documents where ≥30% of tokens contain digits (256 documents).
|
| 231 |
+
- **Layout-heavy government text.** 3.8% of tokens (31,011 documents) are in documents where ≥60%
|
| 232 |
+
of tokens contain no letters: indentation runs, dot leaders, rule lines, column layouts. Much of
|
| 233 |
+
it wraps real text; it was not normalized.
|
| 234 |
+
- **Very long documents.** 739 documents (6.8% of tokens) are longer than one 524k-token training
|
| 235 |
+
batch, up to 7.2M tokens; each fills several consecutive batches by itself. In training this
|
| 236 |
+
showed up as occasional very-low-loss steps and gradient-norm spikes (handled by clipping).
|
| 237 |
+
- **OCR noise.** Book, LoC, BHL, and case-law text is OCR; BHL in particular is noisy
|
| 238 |
+
("thoiit^ht jfood policy"). Greek and other non-Latin passages in older books are often garbled.
|
| 239 |
+
- **No cross-source deduplication.** The same work can appear in Project Gutenberg, the
|
| 240 |
+
pre-1929 books, and LoC. [3 copies is acceptable](https://arxiv.org/abs/2305.16264v5) but deduplication might improve things.
|
| 241 |
+
- **Period bias.** Most text predates 1930; the model knows little about the modern world, and
|
| 242 |
+
its language and attitudes reflect its sources, including their prejudices.
|
| 243 |
+
- **US-centric public-domain basis.** "Public domain" here means public domain in the United
|
| 244 |
+
States; some works may still be under copyright elsewhere.
|
| 245 |
+
- **Tokenizer.** The GPT-2 tokenizer was trained by OpenAI on WebText, which is not open data.
|
| 246 |
+
The model's weights are trained only on open data, but its vocabulary is not.
|
| 247 |
+
- **Ubuntu IRC is `pd-policy`, not `pd`.** See "Ubuntu IRC licensing" above.
|
| 248 |
+
- **Unverified upstream details.** Common Pile's compilation license and the exact classifiers in
|
| 249 |
+
its filtering pipeline are not yet verified against its paper.
|
| 250 |
+
|
| 251 |
+
## Intended use
|
| 252 |
+
|
| 253 |
+
Experiments, comparisons with the original GPT-2, demonstrations of open-data training, winning petty arguments, and fun. Not for factual questions, advice, or any use that needs reliable or current information.
|
| 254 |
+
|
| 255 |
+
## Attribution
|
| 256 |
+
|
| 257 |
+
Training data from the Common Pile v0.1 (Kandpal et al. 2025, *The Common Pile v0.1: An 8TB
|
| 258 |
+
Dataset of Public Domain and Openly Licensed Text*) and the Library of Congress Selected Digitized
|
| 259 |
+
Books collection (compiled by Sebastian Majstorovic / storytracer).
|
config.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"activation_function": "gelu_new",
|
| 3 |
+
"add_cross_attention": false,
|
| 4 |
+
"architectures": [
|
| 5 |
+
"GPT2LMHeadModel"
|
| 6 |
+
],
|
| 7 |
+
"attn_pdrop": 0.0,
|
| 8 |
+
"bos_token_id": 50256,
|
| 9 |
+
"dtype": "float32",
|
| 10 |
+
"embd_pdrop": 0.0,
|
| 11 |
+
"eos_token_id": 50256,
|
| 12 |
+
"initializer_range": 0.02,
|
| 13 |
+
"layer_norm_epsilon": 1e-05,
|
| 14 |
+
"model_type": "gpt2",
|
| 15 |
+
"n_embd": 768,
|
| 16 |
+
"n_head": 12,
|
| 17 |
+
"n_inner": null,
|
| 18 |
+
"n_layer": 12,
|
| 19 |
+
"n_positions": 1024,
|
| 20 |
+
"pad_token_id": null,
|
| 21 |
+
"reorder_and_upcast_attn": false,
|
| 22 |
+
"resid_pdrop": 0.0,
|
| 23 |
+
"scale_attn_by_inverse_layer_idx": false,
|
| 24 |
+
"scale_attn_weights": true,
|
| 25 |
+
"summary_activation": null,
|
| 26 |
+
"summary_first_dropout": 0.1,
|
| 27 |
+
"summary_proj_to_labels": true,
|
| 28 |
+
"summary_type": "cls_index",
|
| 29 |
+
"summary_use_proj": true,
|
| 30 |
+
"tie_word_embeddings": true,
|
| 31 |
+
"transformers_version": "5.20.2",
|
| 32 |
+
"use_cache": true,
|
| 33 |
+
"vocab_size": 50257
|
| 34 |
+
}
|
export_info.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"source_checkpoint": "runs/20261031-144653_openpd-v0/archive/step_004499.pt",
|
| 3 |
+
"step": 4499,
|
| 4 |
+
"dataset": "data/openpd-v1",
|
| 5 |
+
"dataset_tokens_sha256": "fbca048694dc8f04546b77bd6a6845c2eb4e1e8ac24540ad122717e6f66ee00d",
|
| 6 |
+
"round_trip_max_logit_diff": 9.5367431640625e-06,
|
| 7 |
+
"greedy_identical": true
|
| 8 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token_id": 50256,
|
| 3 |
+
"do_sample": true,
|
| 4 |
+
"eos_token_id": 50256,
|
| 5 |
+
"max_new_tokens": 120,
|
| 6 |
+
"pad_token_id": 50256,
|
| 7 |
+
"temperature": 0.9,
|
| 8 |
+
"top_k": 50,
|
| 9 |
+
"transformers_version": "5.20.2"
|
| 10 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:705ee7f265d8b6fa3af8438c7faa2f8893440095f0c5ba510fb93fc523e57dfe
|
| 3 |
+
size 497774208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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"checkpoint": "runs/20261031-144653_openpd-v0/checkpoints/step_004499.pt",
|
| 3 |
+
"step": 4499,
|
| 4 |
+
"steps_trained": 4500,
|
| 5 |
+
"tokens_trained": 2359296000,
|
| 6 |
+
"epochs": 0.2416,
|
| 7 |
+
"run_dir": "runs/20261031-144653_openpd-v0",
|
| 8 |
+
"run_status": "completed",
|
| 9 |
+
"run_git": "eb0b3afcf17a3dbaafe9a74dea6112e2e391fb8a-dirty",
|
| 10 |
+
"dataset": "openpd-v1",
|
| 11 |
+
"dataset_manifest": "data/openpd-v1/openpd-v1_meta.json",
|
| 12 |
+
"dataset_tokens_sha256": "fbca048694dc8f04546b77bd6a6845c2eb4e1e8ac24540ad122717e6f66ee00d",
|
| 13 |
+
"attribution": "proportional (dataset-level shares per shard)",
|
| 14 |
+
"sources": [
|
| 15 |
+
{
|
| 16 |
+
"name": "project_gutenberg",
|
| 17 |
+
"tokens_trained": 525575177,
|
| 18 |
+
"share": 0.222768,
|
| 19 |
+
"registry_record": "common-pile/project_gutenberg_filtered",
|
| 20 |
+
"clean": [
|
| 21 |
+
"unwrap_prose"
|
| 22 |
+
],
|
| 23 |
+
"license_filter": [
|
| 24 |
+
"Public Domain"
|
| 25 |
+
]
|
| 26 |
+
},
|
| 27 |
+
{
|
| 28 |
+
"name": "pre_1929_books",
|
| 29 |
+
"tokens_trained": 510543269,
|
| 30 |
+
"share": 0.216396,
|
| 31 |
+
"registry_record": "common-pile/pre_1929_books_filtered",
|
| 32 |
+
"clean": [
|
| 33 |
+
"dehyphenate"
|
| 34 |
+
],
|
| 35 |
+
"license_filter": [
|
| 36 |
+
"Public Domain"
|
| 37 |
+
]
|
| 38 |
+
},
|
| 39 |
+
{
|
| 40 |
+
"name": "loc_pd_books",
|
| 41 |
+
"tokens_trained": 279252641,
|
| 42 |
+
"share": 0.118363,
|
| 43 |
+
"registry_record": "storytracer/LoC-PD-Books",
|
| 44 |
+
"clean": [
|
| 45 |
+
"dehyphenate",
|
| 46 |
+
"unwrap_prose"
|
| 47 |
+
],
|
| 48 |
+
"license_filter": null
|
| 49 |
+
},
|
| 50 |
+
{
|
| 51 |
+
"name": "ubuntu_irc",
|
| 52 |
+
"tokens_trained": 227833781,
|
| 53 |
+
"share": 0.096569,
|
| 54 |
+
"registry_record": "common-pile/ubuntu_irc_filtered",
|
| 55 |
+
"clean": [
|
| 56 |
+
"irc_timestamps",
|
| 57 |
+
"irc_pseudonymize",
|
| 58 |
+
"scrub_contacts"
|
| 59 |
+
],
|
| 60 |
+
"license_filter": [
|
| 61 |
+
"Public Domain"
|
| 62 |
+
]
|
| 63 |
+
},
|
| 64 |
+
{
|
| 65 |
+
"name": "caselaw_access_project",
|
| 66 |
+
"tokens_trained": 174956726,
|
| 67 |
+
"share": 0.074156,
|
| 68 |
+
"registry_record": "common-pile/caselaw_access_project_filtered",
|
| 69 |
+
"clean": [],
|
| 70 |
+
"license_filter": [
|
| 71 |
+
"Public Domain"
|
| 72 |
+
]
|
| 73 |
+
},
|
| 74 |
+
{
|
| 75 |
+
"name": "arxiv_abstracts",
|
| 76 |
+
"tokens_trained": 132824148,
|
| 77 |
+
"share": 0.056298,
|
| 78 |
+
"registry_record": "common-pile/arxiv_abstracts_filtered",
|
| 79 |
+
"clean": [],
|
| 80 |
+
"license_filter": [
|
| 81 |
+
"Public Domain"
|
| 82 |
+
]
|
| 83 |
+
},
|
| 84 |
+
{
|
| 85 |
+
"name": "usgpo",
|
| 86 |
+
"tokens_trained": 113376329,
|
| 87 |
+
"share": 0.048055,
|
| 88 |
+
"registry_record": "common-pile/usgpo_filtered",
|
| 89 |
+
"clean": [
|
| 90 |
+
"dehyphenate"
|
| 91 |
+
],
|
| 92 |
+
"license_filter": [
|
| 93 |
+
"Public Domain"
|
| 94 |
+
]
|
| 95 |
+
},
|
| 96 |
+
{
|
| 97 |
+
"name": "biodiversity_heritage_library",
|
| 98 |
+
"tokens_trained": 105056241,
|
| 99 |
+
"share": 0.044529,
|
| 100 |
+
"registry_record": "common-pile/biodiversity_heritage_library_filtered",
|
| 101 |
+
"clean": [
|
| 102 |
+
"dehyphenate"
|
| 103 |
+
],
|
| 104 |
+
"license_filter": [
|
| 105 |
+
"Public Domain"
|
| 106 |
+
]
|
| 107 |
+
},
|
| 108 |
+
{
|
| 109 |
+
"name": "pubmed_cc0",
|
| 110 |
+
"tokens_trained": 99020065,
|
| 111 |
+
"share": 0.04197,
|
| 112 |
+
"registry_record": "common-pile/pubmed_filtered",
|
| 113 |
+
"clean": [],
|
| 114 |
+
"license_filter": [
|
| 115 |
+
"Public Domain"
|
| 116 |
+
]
|
| 117 |
+
},
|
| 118 |
+
{
|
| 119 |
+
"name": "peS2o_pd",
|
| 120 |
+
"tokens_trained": 72651775,
|
| 121 |
+
"share": 0.030794,
|
| 122 |
+
"registry_record": "common-pile/peS2o_filtered",
|
| 123 |
+
"clean": [],
|
| 124 |
+
"license_filter": [
|
| 125 |
+
"CC0",
|
| 126 |
+
"pd"
|
| 127 |
+
]
|
| 128 |
+
},
|
| 129 |
+
{
|
| 130 |
+
"name": "arxiv_papers_pd",
|
| 131 |
+
"tokens_trained": 68541823,
|
| 132 |
+
"share": 0.029052,
|
| 133 |
+
"registry_record": "common-pile/arxiv_papers_filtered",
|
| 134 |
+
"clean": [
|
| 135 |
+
"dehyphenate"
|
| 136 |
+
],
|
| 137 |
+
"license_filter": [
|
| 138 |
+
"Public Domain"
|
| 139 |
+
]
|
| 140 |
+
},
|
| 141 |
+
{
|
| 142 |
+
"name": "regulations",
|
| 143 |
+
"tokens_trained": 48892045,
|
| 144 |
+
"share": 0.020723,
|
| 145 |
+
"registry_record": "common-pile/regulations_filtered",
|
| 146 |
+
"clean": [
|
| 147 |
+
"dehyphenate"
|
| 148 |
+
],
|
| 149 |
+
"license_filter": [
|
| 150 |
+
"Public Domain"
|
| 151 |
+
]
|
| 152 |
+
},
|
| 153 |
+
{
|
| 154 |
+
"name": "python_enhancement_proposals",
|
| 155 |
+
"tokens_trained": 771979,
|
| 156 |
+
"share": 0.000327,
|
| 157 |
+
"registry_record": "common-pile/python_enhancement_proposals_filtered",
|
| 158 |
+
"clean": [],
|
| 159 |
+
"license_filter": [
|
| 160 |
+
"Public Domain"
|
| 161 |
+
]
|
| 162 |
+
}
|
| 163 |
+
],
|
| 164 |
+
"computed": "2026-11-01"
|
| 165 |
+
}
|
summary.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
| Metric | 20261031-144653_openpd-v0@step4499 | 20261031-144653_openpd-v0@step3599 | hf:gpt2 |
|
| 2 |
+
|---|---|---|---|
|
| 3 |
+
| HellaSwag acc_norm (all) | 0.2554 | 0.2478 | 0.2979 |
|
| 4 |
+
| ActivityNet contexts | 0.3016 | 0.2948 | 0.3525 |
|
| 5 |
+
| WikiHow contexts | 0.2334 | 0.2253 | 0.2720 |
|
| 6 |
+
| BLiMP (mean of 67 paradigms) | 0.7355 | 0.7105 | 0.8233 |
|
| 7 |
+
| morphology | 0.8797 | 0.8469 | 0.9296 |
|
| 8 |
+
| syntax | 0.6725 | 0.6389 | 0.7907 |
|
| 9 |
+
| semantics | 0.6811 | 0.6916 | 0.7451 |
|
| 10 |
+
| syntax/semantics | 0.6864 | 0.6689 | 0.7852 |
|
| 11 |
+
| CBT common nouns (contaminated: 66% 13-gram overlap with training data) | 0.7912 | 0.7388 | 0.8632 |
|
| 12 |
+
| Perplexity: 1930 period prose (held out) | 26.14 | 31.67 | 28.78 |
|
| 13 |
+
| Perplexity: WikiText-103 test (modern) | 81.12 | 104.30 | 22.82 |
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": "<|endoftext|>",
|
| 5 |
+
"eos_token": "<|endoftext|>",
|
| 6 |
+
"errors": "replace",
|
| 7 |
+
"is_local": false,
|
| 8 |
+
"local_files_only": false,
|
| 9 |
+
"model_max_length": 1024,
|
| 10 |
+
"pad_token": null,
|
| 11 |
+
"tokenizer_class": "GPT2Tokenizer",
|
| 12 |
+
"unk_token": "<|endoftext|>"
|
| 13 |
+
}
|
training_curves.png
ADDED
|
Git LFS Details
|