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

21038

Authors

nan

Abstract

AbstractStandard 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.

Keywords

nan

Full Content

Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 5061 - 5068 July 10-15, 2022 ©2022 Association for Computational Linguistics Models In a Spelling Bee: Language Models Implicitly Learn the Character Composition of Tokens Itay Itzhak Omer Levy The Blavatnik School of Computer Science Tel Aviv University {itay1itzhak,omerlevy}@gmail.com Abstract Standard pretrained language models operate on sequences of subword tokens without di- rect access to the characters that compose each token’s string representation. We probe the embedding layer of pretrained language mod- els and show that models learn the internal character composition of whole word and sub- word tokens to a surprising extent, without ever seeing the characters coupled with the to- kens. Our results show that the embedding lay- ers 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 fur- ther test whether enriching subword models with character information can improve lan- guage modeling, and observe that this method has a near-identical learning curve as train- ing without spelling-based enrichment. Over- all, our results suggest that language model- ing objectives incentivize the model to implic- itly learn some notion of spelling, and that ex- plicitly teaching the model how to spell does not appear to enhance its performance on such tasks.1 1 Introduction Contemporary subword tokenization algorithms such as BPE (Sennrich et al., 2016) partition a string into contiguous spans of characters. Each span represents a frequent character ngram, from individual characters (a), through prefixes (uni) and suffixes (tion), and even complete words (cats). The tokenizer then converts each such span into a discrete symbol (a token) with no internal struc- ture, effectively discarding the token’s orthographic information. Therefore, a model operating over se- quences of subword tokens should be oblivious to the spelling of each token. In this work, we show that despite having no direct access to the subwords’ 1Our code is available at: https://github.com/ itay1itzhak/SpellingBee internal character composition, pretrained language models do learn some notion of spelling. To examine what pretrained language models learn about spelling, we present the SpellingBee probe. SpellingBee is a generative language model that predicts the character composition of a token given only its (uncontextualized) vector representa- tion from the pretrained model’s embeddings ma- trix. SpellingBee is trained on part of the model’s vocabulary, and then tested by spelling unseen to- ken types. If the probe can successfully reconstruct the correct character sequence from an unseen to- ken’s embedding, then there must be significant orthographic information encoded in the vector. We find that the embedding layers of several pretrained language models contain surprising amounts of character information. SpellingBee accurately spells 31.8% of the held-out vocabu- lary for RoBERTa-Large (Liu et al., 2019), 32.9% for GPT2-Medium (Radford et al., 2019), and 40.9% for the Arabic language model AraBERT- Large (Antoun et al., 2020). A softer metric that is sensitive to partially-correct spellings (chrF) …

Content truncated to 500 words

Labeled Text

AbstractStandard 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.

Publication Details

Paper ID:
21038
Year:
2022
Publication:
TIPSTER
Publication Type:
conf
DOI:
nan