{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/tinystories-how-small-can-language-models-be","title":"TinyStories: How Small Can Language Models Be and Still Speak Coherent English?","arxiv_id":"2305.07759","date":"2023-05-12","proceeding":null,"authors":["Ronen Eldan","Yuanzhi Li"],"abstract":"Language models (LMs) are powerful tools for natural language processing, but they often struggle to produce coherent and fluent text when they are small. Models with around 125M parameters such as GPT-Neo (small) or GPT-2 (small) can rarely generate coherent and consistent English text beyond a few words even after extensive training. This raises the question of whether the emergence of the ability to produce coherent English text only occurs at larger scales (with hundreds of millions of parameters or more) and complex architectures (with many layers of global attention). In this work, we introduce TinyStories, a synthetic dataset of short stories that only contain words that a typical 3 to 4-year-olds usually understand, generated by GPT-3.5 and GPT-4. We show that TinyStories can be used to train and evaluate LMs that are much smaller than the state-of-the-art models (below 10 million total parameters), or have much simpler architectures (with only one transformer block), yet still produce fluent and consistent stories with several paragraphs that are diverse and have almost perfect grammar, and demonstrate reasoning capabilities. We also introduce a new paradigm for the evaluation of language models: We suggest a framework which uses GPT-4 to grade the content generated by these models as if those were stories written by students and graded by a (human) teacher. This new paradigm overcomes the flaws of standard benchmarks which often requires the model's output to be very structures, and moreover provides a multidimensional score for the model, providing scores for different capabilities such as grammar, creativity and consistency. We hope that TinyStories can facilitate the development, analysis and research of LMs, especially for low-resource or specialized domains, and shed light on the emergence of language capabilities in LMs.","url_abs":"https://arxiv.org/abs/2305.07759v2","url_pdf":"https://arxiv.org/pdf/2305.07759v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"tinystories-how-small-can-language-models-be","repo_url":"https://github.com/cg80499/kan-gpt-2","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"jax","reach":null},{"paper_slug":"tinystories-how-small-can-language-models-be","repo_url":"https://github.com/danbraunai/simple_stories_train","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"jax","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"tinystories-how-small-can-language-models-be","repo_url":"https://github.com/lennart-finke/simple_stories_generate","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok"}},{"paper_slug":"tinystories-how-small-can-language-models-be","repo_url":"https://github.com/noanabeshima/tinymodel","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"tinystories-how-small-can-language-models-be","repo_url":"https://github.com/phixion/phixion","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"tinystories-how-small-can-language-models-be","repo_url":"https://github.com/vizuaraai/tiny-stories-regional","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"tinystories-how-small-can-language-models-be","repo_url":"https://github.com/zhaoolee/garss","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"tinystories-how-small-can-language-models-be","repo_url":"https://github.com/sri9s/tinystories-language-models","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-dropout","method_name":"Attention Dropout"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"cosine-annealing","method_name":"Cosine Annealing"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"discriminative-fine-tuning","method_name":"Discriminative Fine-Tuning"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"gpt-2","method_name":"GPT-2"},{"method_slug":"gpt-3","method_name":"GPT-3"},{"method_slug":"gpt-4","method_name":"GPT-4"},{"method_slug":"gpt-neo","method_name":"GPT-Neo"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"linear-warmup-with-cosine-annealing","method_name":"Linear Warmup With Cosine Annealing"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"},{"method_slug":"weight-decay","method_name":"Weight Decay"}],"datasets_introduced":[{"slug":"tinystories","name":"TinyStories","full_name":""}],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2305.07759","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2305.07759"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/phixion/phixion","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/danbraunai/simple_stories_train","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/cg80499/kan-gpt-2","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/lennart-finke/simple_stories_generate","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/sri9s/tinystories-language-models","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/noanabeshima/tinymodel","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/vizuaraai/tiny-stories-regional","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/zhaoolee/garss","reach":{"status":"ok"}}],"summary":{"ran_fixture":1,"ran_draft_wrong":1,"ran":1,"unverified":15},"by_repo_kind":{"listed":{"samples":18,"ran":3,"repositories":3}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"cc82794b6ec72130","entry":"pad_vocab","repo":"danbraunai/simple_stories_train","repo_kind":"listed","path":"simple_stories_train/train_gpt2.py","file_url":"https://github.com/danbraunai/simple_stories_train/blob/HEAD/simple_stories_train/train_gpt2.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"cc82794b6ec72130"}},{"code_sha256_prefix":"7f351de9044b032b","entry":"parse_mlp_tag","repo":"noanabeshima/tinymodel","repo_kind":"listed","path":"tinymodel/lm.py","file_url":"https://github.com/noanabeshima/tinymodel/blob/HEAD/tinymodel/lm.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"7f351de9044b032b"}},{"code_sha256_prefix":"d8a05e02085eeb90","entry":"setup_logger","repo":"danbraunai/simple_stories_train","repo_kind":"listed","path":"simple_stories_train/log.py","file_url":"https://github.com/danbraunai/simple_stories_train/blob/HEAD/simple_stories_train/log.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d8a05e02085eeb90"}},{"code_sha256_prefix":"69981ccab3e11aa0","entry":"clean_dataset","repo":"danbraunai/simple_stories_train","repo_kind":"listed","path":"simple_stories_train/tokenizer.py","file_url":"https://github.com/danbraunai/simple_stories_train/blob/HEAD/simple_stories_train/tokenizer.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"69981ccab3e11aa0"}},{"code_sha256_prefix":"9ca1ae242b588ec1","entry":"compare_metrics","repo":"vizuaraai/tiny-stories-regional","repo_kind":"listed","path":"results/compare_models_statistics.py","file_url":"https://github.com/vizuaraai/tiny-stories-regional/blob/HEAD/results/compare_models_statistics.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9ca1ae242b588ec1"}},{"code_sha256_prefix":"b73c48f33832ec9c","entry":"convert_dotted_args_to_nested_dict","repo":"danbraunai/simple_stories_train","repo_kind":"listed","path":"simple_stories_train/utils.py","file_url":"https://github.com/danbraunai/simple_stories_train/blob/HEAD/simple_stories_train/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b73c48f33832ec9c"}},{"code_sha256_prefix":"2425cc683fe447c3","entry":"create_data_loader","repo":"danbraunai/simple_stories_train","repo_kind":"listed","path":"simple_stories_train/dataloaders.py","file_url":"https://github.com/danbraunai/simple_stories_train/blob/HEAD/simple_stories_train/dataloaders.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2425cc683fe447c3"}},{"code_sha256_prefix":"ea33e0525958ca7b","entry":"create_tokenizer","repo":"danbraunai/simple_stories_train","repo_kind":"listed","path":"simple_stories_train/tokenizer.py","file_url":"https://github.com/danbraunai/simple_stories_train/blob/HEAD/simple_stories_train/tokenizer.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ea33e0525958ca7b"}},{"code_sha256_prefix":"f50e36ff8515bb12","entry":"evaluate_story","repo":"vizuaraai/tiny-stories-regional","repo_kind":"listed","path":"prompting/requests_helper.py","file_url":"https://github.com/vizuaraai/tiny-stories-regional/blob/HEAD/prompting/requests_helper.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f50e36ff8515bb12"}},{"code_sha256_prefix":"e88f4b6f04069085","entry":"extract_metrics","repo":"vizuaraai/tiny-stories-regional","repo_kind":"listed","path":"results/compare_models_statistics.py","file_url":"https://github.com/vizuaraai/tiny-stories-regional/blob/HEAD/results/compare_models_statistics.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e88f4b6f04069085"}},{"code_sha256_prefix":"65f2a574a10b1e7b","entry":"generate_story","repo":"vizuaraai/tiny-stories-regional","repo_kind":"listed","path":"prompting/requests_helper.py","file_url":"https://github.com/vizuaraai/tiny-stories-regional/blob/HEAD/prompting/requests_helper.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"65f2a574a10b1e7b"}},{"code_sha256_prefix":"654be48c7a17f9d2","entry":"get_model_and_tokenizer","repo":"vizuaraai/tiny-stories-regional","repo_kind":"listed","path":"translation/get_model_token.py","file_url":"https://github.com/vizuaraai/tiny-stories-regional/blob/HEAD/translation/get_model_token.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"654be48c7a17f9d2"}},{"code_sha256_prefix":"fa261019edd7ff74","entry":"is_checkpoint_step","repo":"danbraunai/simple_stories_train","repo_kind":"listed","path":"simple_stories_train/utils.py","file_url":"https://github.com/danbraunai/simple_stories_train/blob/HEAD/simple_stories_train/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"fa261019edd7ff74"}},{"code_sha256_prefix":"c430eca0b62e5574","entry":"load_tokenizer","repo":"danbraunai/simple_stories_train","repo_kind":"listed","path":"simple_stories_train/tokenizer.py","file_url":"https://github.com/danbraunai/simple_stories_train/blob/HEAD/simple_stories_train/tokenizer.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c430eca0b62e5574"}},{"code_sha256_prefix":"31f124b85a98aa6e","entry":"normalize_text","repo":"vizuaraai/tiny-stories-regional","repo_kind":"listed","path":"analysis/BERT_BLEU_eval.py","file_url":"https://github.com/vizuaraai/tiny-stories-regional/blob/HEAD/analysis/BERT_BLEU_eval.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"31f124b85a98aa6e"}},{"code_sha256_prefix":"b062d9bb343787c7","entry":"process_chunk","repo":"vizuaraai/tiny-stories-regional","repo_kind":"listed","path":"prompting/requests_helper.py","file_url":"https://github.com/vizuaraai/tiny-stories-regional/blob/HEAD/prompting/requests_helper.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b062d9bb343787c7"}},{"code_sha256_prefix":"a3875bb0a0255e77","entry":"replace_pydantic_model","repo":"danbraunai/simple_stories_train","repo_kind":"listed","path":"simple_stories_train/utils.py","file_url":"https://github.com/danbraunai/simple_stories_train/blob/HEAD/simple_stories_train/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a3875bb0a0255e77"}},{"code_sha256_prefix":"2a0bbd4146b3cf66","entry":"tokenize_and_concatenate","repo":"danbraunai/simple_stories_train","repo_kind":"listed","path":"simple_stories_train/dataloaders.py","file_url":"https://github.com/danbraunai/simple_stories_train/blob/HEAD/simple_stories_train/dataloaders.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2a0bbd4146b3cf66"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}