BookCorpus

On this page 7

BookCorpus is an English text dataset of about 11,000 free, self-published books, collected in 2015 and later used as core training data for early pretrained language models, most notably the original GPT and BERT. In artificial intelligence, it is remembered as the corpus that showed how long, coherent narrative text helps models learn dependencies that span many sentences.

The dataset is also a standard case study in dataset documentation and provenance. Retrospective audits found duplicate books, a strong genre skew and unresolved licensing questions, so BookCorpus now appears in discussions of responsible data curation as often as in discussions of model training.

Origin and composition of BookCorpus

BookCorpus was assembled by researchers working on aligning books with their film adaptations, a task that needed large amounts of narrative prose. The team collected novels offered free of charge on a self-publishing platform, keeping only books with at least about 20,000 words so that each item carried sustained storytelling rather than short fragments.

The resulting corpus contains roughly 74 million sentences and close to one billion words, although later model papers often cite a figure of about 800 million words after their own preprocessing. The text is plain, lowercase or mixed case depending on the copy, and it carries no labels or annotations: it is raw unlabeled data intended for self-supervised learning.

The table below summarizes the commonly reported properties of the original release.

PropertyReported valueNote
Number of booksAbout 11,000Fewer unique titles after deduplication
SentencesAbout 74 millionVaries with sentence splitter
WordsAbout 800 million to 1 billionDepends on tokenization
Minimum book lengthAbout 20,000 wordsFilter applied at collection
LanguageEnglishNo multilingual content
AnnotationNoneRaw text for self-supervised use
Reported properties of the original BookCorpus

Why BookCorpus mattered for language model pretraining

BookCorpus mattered because it supplied long contiguous documents at a time when most open text collections consisted of short news items or shuffled sentences. A model trained to predict the next token across thousands of consecutive words must track characters, events and pronoun references, which encourages it to learn long-range context.

The original Generative Pre-trained Transformer was pretrained on BookCorpus alone, and its authors emphasized the value of contiguous text for unsupervised pretraining. BERT then combined BookCorpus with English Wikipedia and used the pair for its masked language modeling and next sentence prediction objectives. Many follow-up encoders kept the same pairing as a baseline, which made BookCorpus a de facto reference corpus for several years.

The following table compares how several well-known models used the dataset.

ModelRole of BookCorpusOther sources
GPT (2018)Sole pretraining corpusNone
BERTAbout one quarter of the textEnglish Wikipedia
RoBERTaSmall share of a larger mixNews, web text and stories
XLNetPart of the base dataWikipedia and web crawls
ALBERTShared baseline with BERTEnglish Wikipedia
Use of BookCorpus in early pretrained models

How BookCorpus compares with other text corpora

BookCorpus is small and narrow by current standards, but it differs from web corpora in document length and editorial style. Web-derived sets such as Common Crawl, C4 or FineWeb offer billions or trillions of tokens with heavy filtering, while BookCorpus offers fewer tokens of consistent narrative fiction. Curated mixtures such as The Pile later included book collections as one component among many.

CorpusTypical sizeMain contentKey difference
BookCorpusAbout 1 billion wordsSelf-published fictionLong narrative documents
English WikipediaAbout 2.5 billion wordsEncyclopedic articlesFactual, edited prose
OpenWebTextAbout 8 billion tokensWeb pages linked from forumsDiverse informal text
C4About 150 billion tokensFiltered web crawlHeuristic quality filters
The PileAbout 300 billion tokensMixture of 22 sourcesExplicit domain mixing
BookCorpus compared with related pretraining corpora

In a modern pretraining corpus, books typically form a minor but valuable slice that improves coherence over long passages. Researchers now treat book data as one domain weight in a mixture rather than as a standalone corpus.

Documented problems: duplication, skew and licensing

A retrospective datasheet analysis of BookCorpus found that the collection contains thousands of duplicated titles, so the number of unique books is substantially lower than the headline figure. Duplicates inflate the apparent size and increase the risk of memorization of repeated passages, which is why training data deduplication is now a standard step.

The same analysis reported a strong genre imbalance, with romance heavily overrepresented relative to other genres, and noted that some books carried terms that prohibited redistribution or copying. The original authors were not asked for consent, and the original files were never distributed with a clear license. These findings raised copyright and consent concerns that continue to shape training data licensing debates.

The table below links each documented problem to its practical consequence for model builders.

IssueEffect on modelsTypical mitigation
Duplicate booksOverweighting and memorizationExact and near-duplicate removal
Genre skewStylistic and topical biasDomain reweighting
Unclear licensingLegal and reputational riskLicensed or public-domain sources
Missing documentationHard to reproduce resultsDatasheets and data cards
Fixed snapshotDated language and topicsSupplement with newer corpora
Known issues and their consequences

Replications and the status of the dataset today

The original BookCorpus is no longer officially distributed, so most later work relies on community replications that re-scrape the same platform. These copies differ in book count, cleaning and deduplication, which means that two papers citing BookCorpus may have trained on materially different text.

  • Replicated versions such as BookCorpusOpen contain a different and larger set of books, collected years after the original.
  • Exact reproduction of early benchmark results is therefore difficult, and small score differences should not be overinterpreted.
  • Responsible use today means checking the license of each source, recording the version used and documenting any filtering.

For new projects, practitioners usually prefer public-domain book collections or explicitly licensed text, and they cite BookCorpus mainly as a historical baseline or for controlled comparisons with earlier models.

In plain words

BookCorpus is a big pile of novels that computers read to learn language. Each book tells a long story. That helps a model learn how ideas connect over many pages. Early models such as GPT and BERT learned from it.

Later, people checked the pile closely. They found many repeated books and far more romance than other genres. The writers had also not agreed to this use. So BookCorpus is now a lesson in careful data collection as much as a tool.

A real-world example

A university research group wants to test whether a new pretraining objective beats the original BERT recipe. To keep the comparison fair, the team trains a small encoder on the same mix of book text and Wikipedia that BERT used, about 3.3 billion words in total, and then fine-tunes it on standard sentence classification benchmarks.

During setup, the group discovers that its downloaded book replica differs from the original. A deduplication pass removes several thousand repeated titles, and a genre count shows that romance dominates. The team documents the exact version, the filters applied and the final token count in a data card.

The outcome is a cleaner experiment: the new objective shows a modest but consistent gain, and reviewers can see precisely which text produced it. The group also flags the licensing limits of the replica and recommends public-domain books for any release.