{"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/models-in-a-spelling-bee-language-models","title":"Models In a Spelling Bee: Language Models Implicitly Learn the Character Composition of Tokens","arxiv_id":"2108.11193","date":"2021-08-25","proceeding":"NAACL 2022 7","authors":["Itay Itzhak","Omer Levy"],"abstract":"Standard pretrained language models operate on sequences of subword tokens without direct access to the characters that compose each token's string representation. We probe the embedding layer of pretrained language models and show that models learn the internal character composition of whole word and subword tokens to a surprising extent, without ever seeing the characters coupled with the tokens. Our results show that the embedding layer of RoBERTa holds enough information to accurately spell up to a third of the vocabulary and reach high average character ngram overlap on all token types. We further test whether enriching subword models with additional character information can improve language modeling, and observe that this method has a near-identical learning curve as training without spelling-based enrichment. Overall, our results suggest that language modeling objectives incentivize the model to implicitly learn some notion of spelling, and that explicitly teaching the model how to spell does not appear to enhance its performance on such tasks.","url_abs":"https://arxiv.org/abs/2108.11193v2","url_pdf":"https://arxiv.org/pdf/2108.11193v2.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":"models-in-a-spelling-bee-language-models","repo_url":"https://github.com/itay1itzhak/spellingbee","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"}],"methods":[{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-dropout","method_name":"Attention Dropout"},{"method_slug":"bert","method_name":"BERT"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"linear-warmup-with-linear-decay","method_name":"Linear Warmup With Linear Decay"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"roberta","method_name":"RoBERTa"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"weight-decay","method_name":"Weight Decay"},{"method_slug":"wordpiece","method_name":"WordPiece"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2108.11193","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2108.11193"}},"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/itay1itzhak/spellingbee","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":1,"unverified":10},"by_repo_kind":{"official":{"samples":11,"ran":1,"repositories":1}},"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":11,"samples":[{"code_sha256_prefix":"82bdf940665aeeb4","entry":"safe_readline","repo":"itay1itzhak/spellingbee","repo_kind":"official","path":"fairseq/binarizer.py","file_url":"https://github.com/itay1itzhak/spellingbee/blob/HEAD/fairseq/binarizer.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":false,"mcp_get_code":{"code_sha256":"82bdf940665aeeb4"}},{"code_sha256_prefix":"f86bf547d6717795","entry":"get_char_f1","repo":"itay1itzhak/spellingbee","repo_kind":"official","path":"SpellingBee/results_analysis.py","file_url":"https://github.com/itay1itzhak/spellingbee/blob/HEAD/SpellingBee/results_analysis.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":false,"mcp_get_code":{"code_sha256":"f86bf547d6717795"}},{"code_sha256_prefix":"c945a23e9719cfd7","entry":"get_configuration","repo":"itay1itzhak/spellingbee","repo_kind":"official","path":"fairseq/create_Slurm_files.py","file_url":"https://github.com/itay1itzhak/spellingbee/blob/HEAD/fairseq/create_Slurm_files.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":false,"mcp_get_code":{"code_sha256":"c945a23e9719cfd7"}},{"code_sha256_prefix":"6e15294c0af45e6c","entry":"get_edit_distance","repo":"itay1itzhak/spellingbee","repo_kind":"official","path":"SpellingBee/results_analysis.py","file_url":"https://github.com/itay1itzhak/spellingbee/blob/HEAD/SpellingBee/results_analysis.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":false,"mcp_get_code":{"code_sha256":"6e15294c0af45e6c"}},{"code_sha256_prefix":"233b727ac91d7a08","entry":"get_emb_matrix","repo":"itay1itzhak/spellingbee","repo_kind":"official","path":"SpellingBee/create_spelling_data.py","file_url":"https://github.com/itay1itzhak/spellingbee/blob/HEAD/SpellingBee/create_spelling_data.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":false,"mcp_get_code":{"code_sha256":"233b727ac91d7a08"}},{"code_sha256_prefix":"77696c06494e7976","entry":"get_run_file_text","repo":"itay1itzhak/spellingbee","repo_kind":"official","path":"fairseq/create_Slurm_files.py","file_url":"https://github.com/itay1itzhak/spellingbee/blob/HEAD/fairseq/create_Slurm_files.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":false,"mcp_get_code":{"code_sha256":"77696c06494e7976"}},{"code_sha256_prefix":"3e50c2ec5c870f73","entry":"levenshtein_ratio_and_distance","repo":"itay1itzhak/spellingbee","repo_kind":"official","path":"SpellingBee/results_analysis.py","file_url":"https://github.com/itay1itzhak/spellingbee/blob/HEAD/SpellingBee/results_analysis.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":false,"mcp_get_code":{"code_sha256":"3e50c2ec5c870f73"}},{"code_sha256_prefix":"886fa2c9e77b1749","entry":"normalize","repo":"itay1itzhak/spellingbee","repo_kind":"official","path":"SpellingBee/create_spelling_data.py","file_url":"https://github.com/itay1itzhak/spellingbee/blob/HEAD/SpellingBee/create_spelling_data.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":false,"mcp_get_code":{"code_sha256":"886fa2c9e77b1749"}},{"code_sha256_prefix":"f1bc5fa91d03b094","entry":"preprocess_dic","repo":"itay1itzhak/spellingbee","repo_kind":"official","path":"SpellingBee/create_spelling_data.py","file_url":"https://github.com/itay1itzhak/spellingbee/blob/HEAD/SpellingBee/create_spelling_data.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":false,"mcp_get_code":{"code_sha256":"f1bc5fa91d03b094"}},{"code_sha256_prefix":"b6531410b2e0eb83","entry":"sort_dict_by_value","repo":"itay1itzhak/spellingbee","repo_kind":"official","path":"SpellingBee/download_pretrained_embeddings.py","file_url":"https://github.com/itay1itzhak/spellingbee/blob/HEAD/SpellingBee/download_pretrained_embeddings.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":false,"mcp_get_code":{"code_sha256":"b6531410b2e0eb83"}},{"code_sha256_prefix":"dcefa8b170aa8d70","entry":"translation_get_script_file_text","repo":"itay1itzhak/spellingbee","repo_kind":"official","path":"fairseq/create_Slurm_files.py","file_url":"https://github.com/itay1itzhak/spellingbee/blob/HEAD/fairseq/create_Slurm_files.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":false,"mcp_get_code":{"code_sha256":"dcefa8b170aa8d70"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}