gpt4-books

May 2, 2023 · View on GitHub

Code and data to support the following paper:

Kent K. Chang, Mackenzie Cramer, Sandeep Soni and David Bamman (2023), "Speak, Memory: An Archaeology of Books Known to ChatGPT/GPT-4", ArXiv.

This work probes what books GPT-4 and ChatGPT have memorized by assessing the degree to which models are able to predict the masked token (a proper name) in name cloze passages like the following:

Though of a very ingenious mechanical turn, [MASK] could never get this table to suit him. He put chips under it, blocks of various sorts, bits of pasteboard, and at last went so far as to attempt an exquisite adjustment by final pieces of folded blotting paper.

Detailed results on all books can be found here: gpt4-books.

Generating name cloze passages

To generate name cloze passages for your own texts, see the generate_name_cloze folder.

100 most memorized books

The following books in our set have the highest GPT-4 name cloze accuracy (where accuracy here is the fraction of times a model predicts the masked name exactly right in 100 passages from a book). Full name cloze accuracy results (GPT-4, ChatGPT and BERT) for all books can be found here: gpt4-books.

GPT-4 AccuracyChatGPT AccuracyBERT AccuracyYearAuthorTitle
0.980.820.001865Lewis CarrollAlice's Adventures in Wonderland
0.760.430.001997J.K. RowlingHarry Potter and the Sorcerer's Stone
0.740.290.001850Nathaniel HawthorneThe Scarlet Letter
0.720.110.001892Arthur Conan DoyleThe Adventures of Sherlock Holmes
0.700.100.001815Jane AustenEmma
0.650.190.001823Mary Wollstonecraft ShelleyFrankenstein; Or, The Modern Prometheus
0.620.130.001813Jane AustenPride and Prejudice
0.610.180.001838Charles DickensOliver Twist
0.610.300.001853Herman MelvilleBartleby, the Scrivener: A Story of Wall-Street
0.610.350.001884Mark TwainAdventures of Huckleberry Finn
0.610.080.001897Bram StokerDracula
0.590.220.001851Herman MelvilleMoby Dick; Or, The Whale
0.590.130.001902Arthur Conan DoyleThe Hound of the Baskervilles
0.580.350.001876Mark TwainThe Adventures of Tom Sawyer
0.570.300.001949George Orwell1984
0.540.100.001908L. M. MontgomeryAnne of Green Gables
0.510.200.011954J.R.R. TolkienThe Fellowship of the Ring
0.490.160.132012E.L. JamesFifty Shades of Grey
0.490.160.001847Charlotte BrontëJane Eyre: An Autobiography
0.490.120.001883Robert Louis StevensonTreasure Island
0.490.220.001903Jack LondonThe Call of the Wild
0.490.240.011911Frances Hodgson BurnettThe Secret Garden
0.480.140.002008Suzanne CollinsThe Hunger Games
0.470.200.011916James JoyceA Portrait of the Artist as a Young Man
0.450.090.001847Emily BrontëWuthering Heights
0.450.100.011868Louisa May AlcottLittle Women
0.430.270.001954William GoldingLord of the Flies
0.430.170.001979Douglas AdamsThe Hitchhiker's Guide to the Galaxy
0.420.080.001890Oscar WildeThe Picture of Dorian Gray
0.420.030.001898Henry JamesThe Turn of the Screw
0.410.200.001912Edgar Rice BurroughsTarzan of the Apes
0.400.060.001861Charles DickensGreat Expectations
0.370.060.001897H. G. WellsThe Invisible Man: A Grotesque Romance
0.360.020.021914James JoyceDubliners
0.340.050.001849Charles DickensDavid Copperfield
0.330.020.011794Ann Ward RadcliffeThe Mysteries of Udolpho
0.300.160.001959Chinua AchebeThings Fall Apart
0.280.120.001977J. R. R. Tolkien and Christopher TolkienThe Silmarillion
0.280.090.001922James JoyceUlysses
0.270.130.001953Ray BradburyFahrenheit 451
0.270.130.001996George R.R. MartinA Game of Thrones
0.260.050.012003Dan BrownThe Da Vinci Code
0.260.080.001965Frank HerbertDune
0.250.200.011937Zora Neale HurstonTheir Eyes Were Watching God
0.250.040.001851Nathaniel HawthorneThe House of the Seven Gables
0.250.030.001861George EliotSilas Marner
0.250.010.001920Edith WhartonThe Age of Innocence
0.250.140.001961Harper LeeTo Kill a Mockingbird
0.240.030.031953Ian FlemingCasino Royale
0.240.000.001915W. Somerset (William Somerset) MaughamOf Human Bondage
0.230.090.001891Thomas HardyTess of the d'Urbervilles: A Pure Woman
0.230.050.001903Henry JamesThe Ambassadors
0.220.130.001984William GibsonNeuromancer
0.220.000.001885H. Rider (Henry Rider) HaggardKing Solomon's Mines
0.210.020.001900Theodore DreiserSister Carrie: A Novel
0.200.100.001985Orson Scott CardEnder's Game
0.200.030.001852Charles DickensBleak House
0.200.040.001877Anna SewellBlack Beauty
0.190.120.001932Aldous HuxleyBrave New World
0.190.070.001826James Fenimore CooperThe Last of the Mohicans; A narrative of 1757
0.190.060.001868Wilkie CollinsThe Moonstone
0.190.000.001922F. Scott (Francis Scott) FitzgeraldThe Beautiful and Damned
0.180.050.001855Elizabeth Cleghorn GaskellNorth and South
0.180.040.001905Emmuska Orczy, Baroness OrczyThe Scarlet Pimpernel
0.180.070.001937Margaret MitchellGone with the Wind
0.170.050.001968Philip K. DickDo Androids Dream of Electric Sheep?
0.170.030.001848Anne BrontëThe Tenant of Wildfell Hall
0.170.080.001908E. M. (Edward Morgan) ForsterA Room with a View
0.160.060.052009Dan BrownThe Lost Symbol
0.160.020.011848William Makepeace ThackerayVanity Fair
0.160.030.001871George EliotMiddlemarch
0.160.050.011879Henry JamesDaisy Miller: A Study
0.150.040.042013Dan BrownInferno
0.150.080.012014Veronica RothDivergent
0.150.070.001899Kate ChopinThe Awakening, and Selected Short Stories
0.150.030.001903Samuel ButlerThe Way of All Flesh
0.150.040.001940John SteinbeckThe Grapes of Wrath
0.140.000.001913D. H. (David Herbert) LawrenceSons and Lovers
0.130.050.001983James KahnReturn of the Jedi
0.130.020.011928D. H. LawrenceLady Chatterley's Lover
0.130.010.001749Henry FieldingHistory of Tom Jones, a Foundling
0.130.040.001818Jane AustenPersuasion
0.130.030.001977Alex HaleyRoots
0.120.020.001874Thomas HardyFar from the Madding Crowd
0.110.110.001961Irving StoneThe Agony and the Ecstasy
0.110.010.031957Ian FlemingFrom Russia with Love
0.110.040.001962Madeleine L'EngleA Wrinkle in Time
0.110.040.011939Marjorie Kinnan RawlingsThe Yearling
0.100.050.001975E. L. DoctorowRagtime
0.100.050.001929Dashiell HammettThe Maltese Falcon
0.100.080.071991Diana GabaldonOutlander
0.100.020.001989Kazuo IshiguroThe Remains of the Day
0.100.050.001898Elizabeth Von ArnimElizabeth and Her German Garden
0.100.000.001915Charlotte Perkins GilmanHerland
0.100.010.001983Alice WalkerThe Color Purple
0.090.020.001934Dorothy L. SayersThe Nine Tailors
0.090.030.001985Margaret AtwoodThe Handmaid's Tale
0.090.010.001778Fanny BurneyEvelina, Or, the History of a Young Lady's Entrance into the World
0.090.020.001896Sarah Orne JewettThe Country of the Pointed Firs
0.090.040.001988Toni MorrisonBeloved