Models In a Spelling Bee: Language Models Implicitly Learn the Character Composition of Tokens

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 layers of RoBERTa and GPT2 each hold enough information to accurately spell up to a third of the vocabulary and reach high character ngram overlap across all token types. We further test whether enriching subword models with 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.
Anthology ID:
2022.naacl-main.373
Volume:
Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies
Month:
July
Year:
2022
Address:
Seattle, United States
Editors:
Marine Carpuat, Marie-Catherine de Marneffe, Ivan Vladimir Meza Ruiz
Venue:
NAACL
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
5061–5068
Language:
URL:
https://aclanthology.org/2022.naacl-main.373
DOI:
10.18653/v1/2022.naacl-main.373
Bibkey:
Cite (ACL):
Itay Itzhak and Omer Levy. 2022. Models In a Spelling Bee: Language Models Implicitly Learn the Character Composition of Tokens. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 5061–5068, Seattle, United States. Association for Computational Linguistics.
Cite (Informal):
Models In a Spelling Bee: Language Models Implicitly Learn the Character Composition of Tokens (Itzhak & Levy, NAACL 2022)
Copy Citation:
PDF:
https://aclanthology.org/2022.naacl-main.373.pdf
Video:
 https://aclanthology.org/2022.naacl-main.373.mp4
Code
 itay1itzhak/spellingbee