Low-Rank Softmax Can Have Unargmaxable Classes in Theory but Rarely in Practice
38926Authors
nan
Abstract
AbstractClassifiers in natural language processing (NLP) often have a large number of output classes. For example, neural language models (LMs) and machine translation (MT) models both predict tokens from a vocabulary of thousands. The Softmax output layer of these models typically receives as input a dense feature representation, which has much lower dimensionality than the output. In theory, the result is some words may be impossible to be predicted via argmax, irrespective of input features, and empirically, there is evidence this happens in small language models (Demeter et al., 2020). In this paper we ask whether it can happen in practical large language models and translation models. To do so, we develop algorithms to detect such unargmaxable tokens in public models. We find that 13 out of 150 models do indeed have such tokens; however, they are very infrequent and unlikely to impact model quality. We release our algorithms and code to the public.
Keywords
Full Content
Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics Volume 1: Long Papers, pages 6738 - 6758 May 22-27, 2022 c⃝2022 Association for Computational Linguistics Low-Rank Softmax Can Have Unargmaxable Classes in Theory but Rarely in Practice Andreas Grivas and Nikolay Bogoychev and Adam Lopez Institute for Language, Cognition, and Computation School of Informatics University of Edinburgh {agrivas, n.bogoych, alopez}@ed.ac.uk Abstract Classifiers in natural language processing (NLP) often have a large number of output classes. For example, neural language mod- els (LMs) and machine translation (MT) mod- els both predict tokens from a vocabulary of thousands. The Softmax output layer of these models typically receives as input a dense fea- ture representation, which has much lower di- mensionality than the output. In theory, the result is some words may be impossible to be predicted via argmax, irrespective of input fea- tures, and empirically, there is evidence this happens in small language models (Demeter et al., 2020). In this paper we ask whether it can happen in practical large language models and translation models. To do so, we develop algorithms to detect such unargmaxable tokens in public models. We find that 13 out of 150 models do indeed have such tokens; however, they are very infrequent and unlikely to impact model quality. We release our algorithms and code so that others can test their models.1 1 Introduction Probabilistic multiclass classifiers with a large number of output classes are commonplace in NLP (Chen et al., 2016). For example, the vo- cabulary size of contemporary LMs and MT mod- els varies from tens to hundreds of thousands (Liu et al., 2020). Recent advances in modelling such large vocabularies have mostly been made by im- proving neural network feature encoders (Devlin et al., 2019; Conneau et al., 2020). But irrespective of a feature encoder’s expressivity (Yun et al., 2020; Raghu et al., 2017), a classifier that linearly maps lower dimensional features to higher dimensional outputs has reduced expressivity (Yang et al., 2018), with consequences that are not well understood. In this work we elaborate on the consequences of using argmax prediction with low-rank classifiers, 1https://github.com/andreasgrv/unargmaxable Figure 1: Illustration of an unargmaxable class. Class c4 can never be predicted using argmax for this Softmax classifier with |C| = 4 classes and d = 2 input features. On the left, each feature vector x is colored according to the class assigned the largest probability; note that while c1, c2 and c3 surface as regions, c4 does not. On the right, we show that there is no direction in feature space for which c4 has the largest probability. classifiers that have more output classes |C| than features d. For example, MT models often have subword vocabularies of size |C| ≈ 30000, but have d ≈ 1024. The expressivity penalty for such low-rank classifiers is that some output distribu- tions cannot be represented. Demeter et al. (2020) identified this weakness in Softmax LMs, showing that, in theory, some tokens can never be assigned the highest …
Content truncated to 500 words
Labeled Text
AbstractClassifiers in natural language processing (NLP) often have a large number of output classes. For example, neural language models (LMs) and machine translation (MT) models both predict tokens from a vocabulary of thousands. The Softmax output layer of these models typically receives as input a dense feature representation, which has much lower dimensionality than the output. In theory, the result is some words may be impossible to be predicted via argmax, irrespective of input features, and empirically, there is evidence this happens in small language models (Demeter et al., 2020). In this paper we ask whether it can happen in practical large language models and translation models. To do so, we develop algorithms to detect such unargmaxable tokens in public models. We find that 13 out of 150 models do indeed have such tokens; however, they are very infrequent and unlikely to impact model quality. We release our algorithms and code to the public.
Publication Details
- Paper ID:
- 38926
- Year:
- 2022
- Publication:
- TIPSTER
- Publication Type:
- conf
- DOI:
- nan