Do RNN States Encode Abstract Phonological Alternations? (2021)

Abstract: Sequence-to-sequence models have delivered impressive results in word formation tasks such as morphological inflection, often learning to model subtle morphophonological details with limited training data. Despite the performance, the opacity of neural models makes it difficult to determine whether complex generalizations are learned, or whether a kind of separate rote memorization of each morphophonological process takes place. To investigate whether complex alternations are simply memorized or whether there is some level of generalization across related sound changes in a sequence-to-sequence model, we perform several experiments on Finnish consonant gradation—a complex set of sound changes triggered in some words by certain suffixes. We find that our models often—though not always—encode 17 different consonant gradation processes in a handful of dimensions in the RNN. We also show that by scaling the activations in these dimensions we can control whether consonant gradation occurs and the direction of the gradation.

## introduction recent work on computational morphology demonstrates that neural networks can very effectively learn to inflect words, given adequate amounts of training data @xcite . however, in computational morphology and in nlp at large, the interpretability of neural models remains a serious concern @xcite -it is unclear how networks trained to inflect words actually accomplish their task. it is also unclear to which extent networks are able to learn linguistic generalizations from their input data instead of simply memorizing training examples and exhibiting a kind of nearest-neighbor behavior. in this paper, we shed light on what kind of linguistic generalizations neural networks are capable of learning from data. we report on an investigation into how consonant gradation, a particular morphophonological alternation which is common in finnish and other uralic languages, is encoded in the hidden states of an lstm encoderdecoder model trained to perform word inflection. specifically, we train character-based sequence-tosequence models for inflection of finnish nouns into the genitive case, an inflection type which commonly triggers consonant gradation. consonant gradation is a morphophonological alternation where voiceless stops p, t and k are lenited in certain positions (see section 3 for further details). we first demonstrate that inflection networks tend to learn an abstract representation for consonant gradation, where the alternation is triggered by the same dimensions in encoder hidden states regardless of which stop p, t or k undergoes gradation. this echoes the treatment of gradation in linguistic literature @xcite ) nevertheless, we also find evidence that this behavior is not universal and that networks can sometimes fail to generalize gradation and instead learn to represent gradation using distinct dimensions for each stop p, t and k. our second contribution is to show that networks can learn a general representation encompassing both so-called quantitative gradation and qualitative gradation (these are further described in section 3). this presents further evidence that the phonological representations learned by encoderdecoder models can learn to group linguistic generalizations that target different sounds. as our third contribution, we show evidence of a remarkable property whereby directionality of gradation is encoded as positive or negative hidden state activations: consonant gradation is called direct when the base form of a noun displays the strong grade (such as kk) and the genitive form displays the weak grade of a stop (such as k). in inverse (or 'strengthening') gradation, the opposite alternation occurs. we find hidden state dimensions which encode for the direction of gradation by a positive or negative activation. this behavior is demonstrated in figure 1 where a negative activation of dimension 487 in the encoder hidden state marks inverse gradation of a stop, and positive activation instead marks direct gradation (see section 6 for further discussion of this phenomenon). ## related work interpretation of neural representations in recurrent neural models has been an active area of research over a long period of time starting with @xcite . however, representations in models of phonology have received less attention than many other subfields of nlp. @xcite investigates learning of turkish vowel harmony by a character-based rnn language model trained on word forms. the paper investigates hidden state activations of rnn models while varying the hidden state dimensionality between 1 and 4. it presents evidence that rnn hidden states can capture turkish vowel harmony patterns when a sufficient number of hidden dimensions are available. in a similar vein, silfverberg et al. (2018) investigate phoneme representations for finnish, spanish and turkish finding correlations between embedding representations and phonological distinctive features. @xcite present an investigation of phone embeddings learned using word2vec @xcite for simulated data showing that phone embeddings capture phonemic and allophonic relationships. they also show that phone embeddings capture co-occurrence restrictions for vowels well, while largely failing to do this for consonants. our encoder representations, in contrast, are able to capture these co-occurrence restrictions. @xcite investigates representations learned by a generative adversarial network or gan @xcite trained on audio recordings of speech, showing that some of the latent variables of the gan correspond to phonological features of the speech signal: specifically the presence or absence of the fricative [s] in the output of the network and the amplitude of frication. they show that manipulation of the variables changes these features in a predictable manner. similarly to our work, beguš (2020b) also scales state activations and observes the effect on the output of the network. in a related investigation of reduplication, beguš (2020a) train gan models on speech and identify variables which trigger reduplication in the speech signal. extensive work exists on linguistic probing experiments for neural representations @xcite . a recent probing paper by torroba hennigen et al. (2020) is more directly related to our work. they present a decomposable probe for finding small sets of hidden states which encode for linguistically relevant information, particularly morphosyntactic information. our work shares the aim of not only identifying if information is present in a neural system, but also examining how it is represented. however, we additionally perform experiments on manipulating network activations and examine how such manipulations influence the outputs of the network. our approach was inspired by the now-classic paper on visualization and interpretation of recurrent networks by @xcite in that we also seek individual interpretable dimensions. the work by @xcite on analyzing individual neurons in networks trained for linguistic tasks (pos tagging as well as semantic and morphological tagging) is more closely related to the present work. they present a general methodology for uncovering neurons which encode linguistic information by training a classifier to predict linguistic features of the input based on the representations generated by the network. they also show that it is possible to manipulate specific neurons to force the nominative genitive gloss pappi papin 'priest' kenttä kentän 'field' quantitative kiukku kiukun 'anger' ripe rippeen 'remain(s)' laite laitteen 'device' liike liikkeen 'motion' sopu sovun 'agreement' johto johdon 'lead' aika ajan 'time' kyky kyvyn 'skill' olento olennon 'creature' qualitative kenkä kengän 'shoe' silta sillan 'bridge' rumpu rummun 'drum' ranne ranteen 'wrist' salko salon 'pole' ## consonant gradation consonant gradation (cg), common in many uralic languages, is a set of assimilation and lenition processes, usually targeting the final syllable in a word stem. historically the trigger for the alternation has been purely phonological, but in finnish, the alternation is no longer entirely predictable from the phonological structure @xcite . 1 the trigger for gradation is usually an affix that closes the final syllable, such as the genitive -n, e.g. katto ∼ katon ('roof' sg. nom. ∼ sg. foot_1 gen.). the overall process is divided into quantitative gradation where, for example, geminate pp, tt, kk alternate with their non-geminate counterparts, p, t, k, and qualitative gradation where a large variety of lenition and assimilation processes are found. for example, strong grade k can alternate with the weakened j, v, g, etc. see the advantages of studying finnish consonant gradation in this context is that the set of sound changes is very diverse, but that the trigger for all of them is the same. also, the finnish writing system is very phonemic and surface-oriented and therefore no conversion to an ipa representation is necessary to reveal the sound changes that occur as a result of gradation. of particular interest to us is that there are many similar-looking alternations in finnish that are not a result of consonant gradation, but paradigmatic variation. for example, varis ('crow' sg. nom.) is inflected variksen in the sg. gen. form. note the similarity of this alternation to the actual cg case of liike ('motion' sg. nom.) ∼ liikkeen (sg. gen.) which also involves a ∅ ∼ k alternation. it is therefore of some interest to observe whether neural inflection models encode the two cases differently in some respect. in total we count 17 different types of lenition or fortition falling under the rubric of consonant gradation in our data set; an example of each type is shown in ## methods this section presents our @xmath0. ## data our dataset was produced by taking the most frequent 5,000 lexemes tagged as singular nominative nouns from the turku dependency treebank @xcite and generating the singular genitive forms using the omorfi finitestate morphological transducer @xcite . we excluded compound nouns (e.g. ammattikorkeakoulututkinnoista 'from the professional high-school examinations') and words marked as nouns which contained punctuation or numerals (e.g. g8-neuvottelut 'g8 negotiations', 2000luvulla 'in the 2000s', °c:ssa 'in °c' etc.). loan words were included, both unadapted such as workshop and bungalow and partially or fully adapted such as brosyyri 'brochure' and samppanja 'champagne'. this gave a total of 4,797 nominative-genitive pairs. we randomly ordered them and then split these into disjoint sets: 90% for training (4,317 pairs) and 10% for validation. we then took the validation set (479 pairs) and annotated them for: gradation (yes, no), type of gradation (qualitative, quantitative), consonant (p, t, k) and direction (direct, inverse). this gave a total of 84 examples of nouns exhibiting consonant gradation. this set was heavily skewed towards t gradation (54 out of 84 examples). 3 so we randomly sampled another 84 words from the frequency list, which were not found in the training data or in the existing validation set and which contained p and k, and annotated them and added them to the validation set. statistics on the composition of the hand-annotated dataset can be found in ## experiments and results we investigate representation of consonant gradation in encoder hidden states in the following way: as explained in section 4.2, we identify individual dimensions in encoder hidden states which activate strongly during gradation regardless of the identity of the consonant undergoing gradation. we then investigate the association of these states using two experiments: we (1) perform significance tests on a held-out dataset to determine if the states activate significantly more strongly when gradation occurs, and (2) scale the state activations and observe the effect on the output of the network. ## discussion and conclusions figure 2 shows the activation for a hidden state dimension which is strongly associated with grada- figure 1 shows a scatter plot of two encoder hidden state dimensions (487 and 484 in model 3) which activate strongly during gradation. each point in the plot corresponds to one example in our development dataset. clearly, examples which do not undergo gradation cluster around (0, 0). 7 in contrast, gradation for k and p lead to a positive activation for state 484, whereas t-gradation gives a negative activation. moreover, direct gradation results in a positive activation for state 487 and inverse gradation gives a negative activation. examples which do not undergo gradation can also have high values for 484 (> 0.4). many of these examples end in -jv, -vv or -mv which could actually be examples where inverse gradation occurs but it happens not to be the case for these particular ones. examples where the activation for 484 is low (< -0.5) span a small number of forms ending -tv, -bv, and -gv. there is also a substantial number of non-gradating forms where the activation for 484 @xmath1.5. most of these fall into the linnoitus 'fortress' / linnoituksen 'fortress sg. gen.' patterns where a k is inserted in the penultimate syllable. this alternation bears great resemblance to gradation as mentioned in section 3. there are also a few examples of the type tase 'balance sheet' / taseen 'balance sheet sg. gen.' where the stemfinal vowel is doubled displaying large activation for 484. this is perhaps somewhat harder to explain. however, note that this vowel doubling frestate 487, our model still correctly inflects basilika into basilikan instead of applying gradation, which would give a form like *basilijan or *basilian. 7 the single t at (0, 0) represents the pair olut ∼ oluen, where @xmath2. this is an extremely infrequent gradation type. quently co-occurs with gradation as in tarvike 'accessory', tarvikkeen 'accessory sg. gen.'. in our experiments we found that the system would sometimes output a gradated form even when the exact type of gradation was not present in the training data, for example bambu ∼ bammun ('bamboo' sg. nom. ∼ sg. gen.). since finnish natively lacks b and g, examples of gradation with these consonants are rare. however, it is indeed the case that loanwords that include such voiced stops do undergo gradation, e.g. dubata ∼ dubbaan ('to dub' inf. ∼ 1p sg. pres. sg.) @xcite . since native finnish speakers seem to extend gradation from voiceless stops to their voiced counterparts in loanwords, the question whether neural models can exhibit such generalizing behavior as well is an interesting one. our initial investigations into whether the similarity of the learned embeddings for p and b could trigger such generalizations across similar sounds failed to identify a clear reason for the behavior, and we leave a detailed study of this to future work. we have presented an investigation of encoder representations of phonological alternations, specifically consonant gradation in finnish. we found evidence of a generalized representation of gradation covering all stops which undergo gradation and different types of gradation. we also found that scaling hidden states can "switch off" gradation, prompting the model to generate alternate forms which do not display gradation. moreover, the direction of gradation can be encoded as positive vs. negative hidden dimension activation.