CoolFace
Datasetpublic

ysngkil/whole-books

Whole Books Five book-length corpora for long-context language-model pretraining, packaged so that one row is one whole book. Together: 202,343 books, about 20.9 B tokens in a 32K-vocabulary Llama-style tokenizer, with the large majority of tokens inside books of 64K tokens or more. Built 2026-09-06 from pinned snapshots of the sources below; nothing was filtered, deduplicated or cleaned beyond what the sources had already done, and the reassembly steps are documented per… See the full description on the dataset page: https://huggingface.co/datasets/ysngkil/whole-books.

sourceHugging Faceotherupdated 20d agoView on Hugging Face
0likes65downloads
Dataset Card

Whole Books

Five book-length corpora for long-context language-model pretraining, packaged so that one row is one whole book. Together: 202,343 books, about 20.9 B tokens in a 32K-vocabulary Llama-style tokenizer, with the large majority of tokens inside books of 64K tokens or more. Built 2026-09-06 from pinned snapshots of the sources below; nothing was filtered, deduplicated or cleaned beyond what the sources had already done, and the reassembly steps are documented per config.

python
from datasets import load_dataset
ds = load_dataset("ysngkil/whole-books", "gutenberg", split="train")   # gutenberg | pre1929 | doab | textbooks | pressbooks

Configs

configbookstokens (est.)tokens per book p50 / p90 / maxtokens in books >= 64Kfilessize
gutenberg55,4545.49 B75,382 / 207,150 / 7,816,04587%156.83 GiB
pre1929124,89811.65 B57,502 / 210,297 / 5,553,60286%2615.04 GiB
doab18,9483.32 B146,996 / 317,572 / 1,518,37498%13.0 GiB
textbooks1,1490.27 B117,278 / 515,344 / 5,959,59296%10.27 GiB
pressbooks1,8940.14 B31,867 / 202,291 / 1,415,77481%10.17 GiB

Token counts are estimates: characters times a chars-per-token ratio calibrated on random samples with fla-hub/transformer-1.3B-100B (32,000 tokens, Llama-style). Llama-3-style 128K vocabularies give ~15-20% fewer tokens.

Provenance and licences

configwhatsource snapshotlicence
gutenbergProject Gutenberg books`common-pile/project_gutenberg_filtered` @ 3cdf6879Public Domain
pre1929Pre-1929 public-domain books (Internet Archive / HathiTrust scans)`common-pile/pre_1929_books_filtered` @ 23f9d96dPublic Domain
doabDOAB / OAPEN open-access academic books, reassembled from sections`common-pile/doab_filtered` @ defb24caCC BY 4.0 / 3.0, CC BY-SA 4.0 / 3.0 (per row)
textbooksLibreTexts textbooks, reassembled from chapters`princeton-nlp/TextbookChapters` @ 542b0c60LibreTexts terms (mostly CC BY / CC BY-NC-SA); see source
pressbooksPressbooks open textbooks, reassembled from chapter pages`common-pile/pressbooks_filtered` @ 1a1d3b50CC BY 4.0, CC BY-SA 4.0, CC0, Public Domain (per row)

gutenberg, pre1929, doab, pressbooks are the _filtered subsets released with Common Pile v0.1 (Kandpal et al. 2025), i.e. already language-filtered, quality-filtered and deduplicated by them. textbooks is the chapter dataset that ProLong (Gao et al. 2024) used for its textbooks domain.

How each config was built

  • —gutenberg and pre1929: the Common Pile records converted 1:1 to parquet (one record = one book). The dolma metadata fields are flattened into columns (title, url, language, license, and for pre1929 also author, year, place, htid, hathi_url, ia_url, ...); text is untouched. Note that the PG-19 benchmark (Rae et al. 2019) is ~96% contained in gutenberg by Gutenberg id; exclude PG-19's test ids before evaluating on it.
  • —doab: Common Pile stores each DOAB book as several section records (section_idx). Sections of a book are contiguous and ordered in the snapshot; they were concatenated in section_idx order with a blank line between them. 403,992 sections -> 18,948 books; 9,851 books have gaps in the section numbering (sections removed by Common Pile's filter) and are concatenated as-is; 1,050 books share title and author with an earlier book_id and are flagged in dup_of. Columns: book_id, title, author, publisher, isbn, license, url, created, n_sections, section_idx, n_sections_missing, n_chars, dup_of, crawl_order, text.
  • —textbooks: TextbookChapters rows are single chapters keyed by a path textbooks/<field>/<shelf>/<Book>/<chapter>; chapters were grouped by book and joined in natural path order. 77,932 chapters -> 1,149 textbooks. Columns: book, shelf, field, n_chapters, n_chars, first_chapter, text. ProLong trained on a stream of these textbooks cut into 512K-token pieces; this config is the uncut superset.
  • —pressbooks: Common Pile stores one record per chapter page carrying only the book title; pages were grouped by the URL prefix before /chapter/<slug>/, kept in crawl order, and a # <slug humanised> heading was inserted before each chapter whose slug is not purely numeric. 54,455 pages -> 1,894 books. Crawl order matched the chapter numbering in the slugs in 318 of the 394 books where that could be checked; the live Pressbooks TOC API was not reachable from the build machine, so the order is not verified against it. Columns: book_url, landing_url, title, author, institution, subject, license, n_chapters, n_chars, chapter_slugs, dup_of, crawl_order, text.

Each config directory also holds a _summary.json with the build parameters where a reassembly was done.

Citation of the sources

  • —Common Pile v0.1: Kandpal et al., The Common Pile v0.1: An 8TB Dataset of Public Domain and Openly Licensed Text, 2025.
  • —TextbookChapters / ProLong: Gao et al., How to Train Long-Context Language Models (Effectively), 2024.
  • —PG-19 (for the overlap note): Rae et al., Compressive Transformers for Long-Range Sequence Modelling, 2019.