Grounded Compositional Outputs for Adaptive Language Modeling
Authors
Abstract
Language models have emerged as a central component across NLP, and a great deal of progress depends on the ability to cheaply adapt them (e.g., through finetuning) to new domains and tasks. A language model's vocabulary$-$typically selected before training and permanently fixed later$-$affects its size and is part of what makes it resistant to such adaptation. Prior work has used compositional input embeddings based on surface forms to ameliorate this issue. In this work, we go one step beyond and propose a fully compositional output embedding layer for language models, which is further grounded in information from a structured lexicon (WordNet), namely semantically related words and free-text definitions. To our knowledge, the result is the first word-level language model with a size that does not depend on the training vocabulary. We evaluate the model on conventional language modeling as well as challenging cross-domain settings with an open vocabulary, finding that it matches or outperforms previous state-of-the-art output embedding methods and adaptation approaches. Our analysis attributes the improvements to sample efficiency: our model is more accurate for low-frequency words.
1 Introduction
Language models (LMs) are at the heart of natural language processing, especially following their recent success in the pretraining paradigm (Dai and Le, 2015; Peters et al., 2018; Devlin et al., 2019; Radford et al., 2019, inter alia) . Continued advances in NLP rely on the adaptability of LMs to domains beyond their training data and to new domains and tasks, e.g., through domain adaptive pretraining followed by finetuning (Gururangan et al., 2020) . Here, we focus on an important component of LMs, namely the output vocabularyover which a LM's probability distribution over the "next word" (given the history) ranges-and investigate the impact of the type of its representation on the adaptability of neural LMs.
Today, LMs are typically trained with a closed output vocabulary derived from the training data; the vocabulary is not modified when the language model is adapted or deployed. This makes large pretrained language models struggle with rare words, despite being able to produce contextualized representations for them (Schick and Schütze, 2020) . More importantly, this means a generative LM can never give nonzero probability to a specific word it did not see in training. This is a longstanding challenge of language modeling (Jelinek, 1997) , but it becomes especially important when we adapt to new domains and tasks.
One way to "open up" the vocabulary is to model sequences of bytes, characters, or "wordpieces" rather than the conventional word tokens (Sennrich et al., 2016; Radford et al., 2018; Ponti et al., 2019) . While effective, this approach requires the LM to memorize subsequences if it is to treat them as words. These models appear to require greater network depth and show slower convergence than word-based alternatives (Cherry et al., 2018; Al-Rfou et al., 2019) ; the extra work comes at a cost. This is one of the reasons why the area of word-level language modeling is still very active (Baevski and Auli, 2019; Sukhbaatar et al., 2019; Khandelwal et al., 2020; Press et al., 2020) .
Interpolations between word-and character-or morphology-based LMs represent another class of solutions (Mielke and Eisner, 2018; Gerz et al., 2018; Ataman et al., 2020) . These "hybrid" approaches combine benefits from both model types. However, they introduce complexity which makes them potentially more difficult to train, maintain, and analyze. Notable for enabling adaptability are interpolated LMs based on copy mechanisms (Merity et al., 2017) , dynamic evaluation (Krause et al., 2018) , and neural caches (Grave et al., 2017c,a) ; the last provides state-of-the-art adaptation performance and, unlike the rest, it does not require additional training.
We propose a new word-level Grounded Compositional output LM (GroC) that applies a compositional representation to the output vocabulary (Section 3). Each word's output embedding is built from its surface character sequence and (if available) those of semantically related words and a free-text definition of from WordNet (Fellbaum, 1998) . This parameterization offers two chief advantages. First, GroC can assign probability to words not seen during training. This means that a vocabulary different from the training vocabularye.g., one associated with a different text domain, crucial in adaptive settings-can be considered at inference time. Second, because there are no word type-specific parameters, the number of model parameters in GroC does not depend on the training vocabulary or its size.
We evaluate GroC on language modeling with both fixed and open vocabularies in English. On standard language modeling (Section 4) we observe that our model has superior perplexity and is more sample efficient than a variety of existing output embedding approaches, including the recent adaptive embedding of Baevski and Auli (2019) . The open-vocabulary settings include a cross-domain setting and finetuning (Section 5). We find that GroC also outperforms strong interpolated baselines, including the unbounded neural cache model of Grave et al. (2017a) on "near" domains and performs competitively on "far" domains.
Our analysis shows that our approach has improved sharing across words in the output vocabulary. We show experimentally that the perplexity gains are strongest for low-frequency words, implying improved sample efficiency relative to baselines: compositional output representations allow us to predict words from fewer training examples.
2 Preliminaries On Language Modeling
Language models assign probability to sequences of tokens; the task is usually framed as learning the conditional probability distributions over individual tokens given their histories of tokens to the left (Bahl et al., 1983) . Training requires a sequence of T tokens x = x 1 , . . . , x T , each x t a member of a preselected vocabulary V. We let x t ∈ {0, 1} |V| denote the one-hot encoding of x t . The probability of the sequence x is factored using the chain rule of probability:
p(x) = T t=1 p(x t | x 1 , . . . , x t−1 ).
(1)
To approximate this joint distribution, researchers have fit parametric families based on relative frequencies (Bahl et al., 1983; Kneser and Ney, 1995; Goodman, 2001 ) and neural networks (Bengio et al., 2003; Mikolov et al., 2010) . Here, we focus on the latter due to their established effectiveness (Merity et al., 2018; Baevski and Auli, 2019) . Tokens in this work correspond to words but they can also correspond to individual characters (Al-Rfou et al., 2019) or byte pairs (Radford et al., 2019) .
2.1 Neural Language Models
To make clear this paper's contributions, we describe neural language models by decomposing them into several abstract parts.
In most neural language models, the first layer of computation obtains an input embedding of each history word x j using a lookup function. In our notation, this corresponds to selecting the word type's row in a fixed input embedding matrix, E in : x j E in , which we denote e in x j . Importantly, however, input embeddings need not be lookups; for example, they can be built compositionally from the characters in the surface form of the word (Ling et al., 2015) , an idea central to this work. Next, the history or "prefix" words x
Finally, the distribution over the next word (random variable X t ) is given by
EQUATION (3): Not extracted; please refer to original document.
where E out ∈ R |V|×d is the output embedding matrix and b ∈ R |V| is the bias vector (corresponding roughly to unigram log-frequencies of words in the vocabulary).
The parameters of the model-including all parameters of the prefix function f , E in , E out , and b-are all chosen by maximizing the likelihood of the training sequence x under the model (Eq. 1). Note that, though we focus on an autoregressive (left-to-right) language model objective, our analysis below is applicable to other language model pretraining objectives such as masked language modeling (Devlin et al., 2019) and replaced token detection (Clark et al., 2020) .
2.2 Choice Of Output Representations
Above we assumed an output embedding matrix E out that independently parameterizes each word in the vocabulary with a separate d-dimensional vector. This approach requires d × |V| parameters, leading to concerns about cost and overparameterization. Prior work addressed this issue by tying parameters between the input and output embedding matrices (i.e., E out = E in ; Inan et al., 2017; Press and Wolf, 2017) . However, the parameters for each word are still independent from each other, as displayed in Figure 1(a) .
An alternative, also considered here, is to share output parameters across words as well as with the input embeddings. Specifically, this involves making the output embedding a function of the input embedding using a shared parameterization across words, E out = g(E in ), as displayed in Figure 1 (b). For example, Gulordava et al. (2018) used a linear transformation, while Baevski and Auli (2019) used a linear transformation for each frequency bin to dedicate parameters to words proportional to their frequencies. Pappas and Henderson (2019) used a deep residual transformation as g, demonstrating that shared parameterizations perform better than independent ones. The two latter studies also provided evidence that models with shared parameterization are more sample efficient than independent parameterizations since they perform better on low-frequency words.
Limitations We argue that dependence of a model's parameterization on the size of the vocabulary leads to several limitations shared by current word-level language models. First, the output embedding methods above have terms that scale with the vocabulary size, such as the lookup table for the input embedding or the bias vector, which is a concern for the parameterization of infrequent words. Second, handling of words unseen in the training data leads us to the convention of uninformative "out-of-vocabulary" word types or linguistically naïve, data-driven vocabulary transformations that + x
e k 6 Y = < / l a t e x i t > f < l a t e x i t s h a 1 _ b a s e 6 4 = " a j 1
V r W g q S r q k g q J / b L g t s T m R K / w = " > A A A B 6 H i c b V B N S 8 N A E J 3 U r 1 q / q h 6 9 L B b B U 0 m q o M e i F 4 8 t 2 F p o Q 9 l s J + 3 a z S b s b o Q S + g u 8 e F D E q z / J m / / G b Z u D t j 4 Y e L w 3 w 8 y 8 I B F c G 9 f 9 d g p r 6 x u b W 8 X t 0 s 7 u 3 v 5 B + f C o r e N U M W y x W M S q E 1 C N g k t s G W 4 E d h K F N A o E P g T j 2 5 n / 8 I R K 8 1 j e m 0 m C f k S H k o e c U W O l Z t g v V 9 y q O w d Z J V 5 O K p C j 0 S 9 / 9 Q Y x S y O U h g m q d d d z E + N n V B n O B E 5 L v V R j Q t m Y D r F r q a Q R a j + b H z o l Z 1 Y Z k D B W t q Q h c / X 3 R E Y j r S d R Y D s j a k Z 6 2 Z u J / 3 n d 1 I T X f s Z l k h q U b L E o T A U x M Z l 9 T Q Z c I T N i Y g l l i t t b C R t R R Z m x 2 Z R s C N 7 y y 6 u k X a t 6 F 9 V a 8 7 J S v 8 n j K M I J n M I 5 e H A F d b i D B r S A A c I z v M K b 8 + i 8 O O / O x 6 K 1 4 O Q z
x / A H z u c P z D + M 7 g = = < / l a t e x i t > g < l a t e x i t s h a 1 _ b a s e 6 4 = " o p 9 Y Q d D v w J g X X t x m 6 z U 1 a 2 f a I n k = " > A A A B 6 H i c b V B N S 8 N A E J 3 U r 1 q / q h 6 9 L B b B U 0 m q o M e i F 4 8 t 2 F p o Q 9 l s J + 3 a z S b s b o Q S + g u 8 e F D E q z / J m / / G b Z u D t j 4 Y e L w 3 w 8 y 8 I B F c G 9 f 9 d g p r 6 x u b W 8 X t 0 s 7 u 3
v 5 B + f C o r e N U M W y x W M S q E 1 C N g k t s G W 4 E d h K F N A o E P g T j 2 5 n / 8 I R K 8 1 j e m 0 m C f k S H k o e c U W O l 5 r B f r r h V d w 6 y S r y c V C B H o 1 / + 6 g 1 i l k Y o D R N U 6 6 7 n J s b P q D K c C Z y W e q n G h L I x H W L X U k k j 1 H 4 2 P 3 R K z q w y I G G s b E l D 5 u r v i Y x G W k + i w H Z G 1 I z 0 s j c T / / O 6 q Q m v / Y z L J D U o 2 W J R m A p i Y j L 7 m g y 4 Q m b E x B L K F L e 3 E j a i i j J j s y n Z E L z l l 1 d J u 1 b 1 L q q 1 5 m W l f p P H U Y Q T O I V z 8 O A K 6 n A H D W g B A 4
R n e I U 3 5 9 F 5 c d 6 d j 0 V r w c l n j u E P n M 8 f z c O M 7 w = = < / l a t e x i t >
x t < l a t e x i t s h a 1 _ b a s e 6 4 = " z Z
v c J V 7 G r A b B I O i x 3 g N M + q p Y s w g = " > A A A B 6 n i c b V B N S 8 N A E J 3 4 W e t X 1 a O X x S J 4 K k k V 9 F j 0 4 r G i / Y A 2 l M 1 2 0 y 7 d b M L u R C y h P 8 G L B 0 W 8 + o u 8 + W / c t j l o 6 4 O B x 3 s z z M w L E i k M u u 6 3 s 7 K 6 t r 6 x W d g q b u / s 7 u 2 X D g 6 b J k 4 1 4 w 0 W y 1 i 3 A 2 q 4 F I o 3 U K D k 7 U R z G g W S t 4 L R z d R v P X J t R K w e c J x w P 6 I D J U L B K F r p / q m H v V L Z r b g z k G X i 5 a Q M O e q 9 0 l e 3 H 7 M 0 4 g q Z p M Z 0 P D d B P 6 M a B Z N 8 U u y m h i e U j e i A d y x V N O L G z 2 a n T s i p V f o k j L U t h W S m / p 7 I a G T M O A p s Z 0 R x a B a 9 q f i f 1 0 k x v P I z o Z I U u W L z R W E q C c Z k + j f p C 8 0 Z y r E l l G l h b y V s S D V l a N M p 2 h C 8 x Z e X S b N a 8 c 4 r 1 b u L c u 0 6 j 6 M A x 3 A C Z + D B J d T g F u r Q A A Y D e I Z X e H O k 8 + K 8 O x / z 1 h U n n z m C P 3 A + f w B y i o 3 n < / l a t e x i t > E in < l a t e x i t s h a 1 _ b a s e 6 4 = " s + J c t B L o / W Z o c I v h Y k Z W J 9 K Y + W s = " > A A A C A X i c b V D L S s N A F J 3 U V 6 2 v q B v B T b A I r k p S B V 0 W R X B Z w T 6 g j W U y n b R D J 5 M w c y O U E D f + i h s X i r j 1 L 9 z 5 N 0 7 S L L T 1 w M D h n H u Z e 4 4 X c a b A t r + N 0 t L y y u p a e b 2 y s b m 1 v W P u 7 r V V G E t C W y T k o e x 6 W F H O B G 0 B A 0 6 7 k a Q 4 8 D j t e J O r z O 8 8 U K l Y K O 5 g G l E 3 w C P B f E Y w a G l g H v Q D D G P P T 6 7 T + y T n D B I m 0 n R g V u 2 a n c N a J E 5 B q q h A c 2 B + 9 Y c h i Q M q g H C s V M + x I 3 A T L I E R T t N K P 1 Y 0 w m S C R 7 S n q c A B V W 6 S J 0 i t Y 6 0 M L T + U + g m w c v X 3 R o I D p a a B p y e z G 9 W 8 l 4 n / e b 0 Y / A t X B 4 p i o I L M P v J j b k F o Z X V Y Q y Y p A T 7 V B B P J 9 K 0 W G W O J C e j S K r o E Z z 7 y I m n X a 8 5 p r X 5 7 V m 1 c F n W U 0 S E 6 Q i f I Q e e o g W 5 Q E 7 U Q Q Y / o G b 2 i N + P J e D H e j Y / Z a M k o d v b R H x i f P 7 N H l 7 I = < / l a t e x i t > E out < l a t e x i t s h a 1 _ b a s e 6 4 = " E 5 1 k 1 t d Y 4 X I 7 9 z s p E I g G / S X R k K c = " > A A A C A n i c b Z D L S s N A F I Y n 9 V b r L e p K 3 A S L 4 K o k V d B l U Q S X F e w F 2 l g m 0 0 k 7 d J I J M y d C C c G N r + L G h S J u f Q p 3 v o 2 T N A t t / W H g 4 z / n M O f 8 X s S Z A t v + N k p L y y u r a + X 1 y s b m 1 v a O u b v X V i K W h L a I 4 E J 2 P a w o Z y F t A Q N O u 5 G k O P A 4 7 X i T q 6 z e e a B S M R H e w T S i b o B H I f M Z w a C t g X n Q D z C M P T + 5 T u + T n B k k I o Y 0 H Z h V u 2 b n s h b B K a C K C j U H 5 l d / K E g c 0 B A I x 0 r 1 H D s C N 8 E S G O E 0 r f R j R S N M J n h E e x p D H F D l J v k J q X W s n a H l C 6 l f C F b u / p 5 I c K D U N P B 0 Z 7 a k m q 9 l 5 n + 1 X g z + h Z u w M I q B h m T 2 k R 9 z C 4 S V 5 W E N m a Q E + F Q D J p L p X S 0 y x h I T 0 K l V d A j O / M m L 0 K 7 X n N N a / f a s 2 r g s 4 i i j Q 3 S E T p C D z l E D 3 a A m a i G C H t E z e k V v x p P x Y r w b H 7 P W k l H M 7 K M / M j 5 / A K Y 5 m D 0 = < / l a t e x i t > E in < l a t e x i t s h a 1 _ b a s e 6 4 = " s + J c t B L o / W Z o c I v h Y k Z W J 9 K Y + W s = " > A A A C A X i c b V D L S s N A F J 3 U V 6 2 v q B v B T b A I r k p S B V 0 W R X B Z w T 6 g j W U y n b R D J 5 M w c y O U E D f + i h s X i r j 1 L 9 z 5 N 0 7 S L L T 1 w M D h n H u Z e 4 4 X c a b A t r + N 0 t L y y u p a e b 2 y s b m 1 v W P u 7 r V V G E t C W y T k o e x 6 W F H O B G 0 B A 0 6 7 k a Q 4 8 D j t e J O r z O 8 8 U K l Y K O 5 g G l E 3 w C P B f E Y w a G l g H v Q D D G P P T 6 7 T + y T n D B I m 0 n R g V u 2 a n c N a J E 5 B q q h A c 2 B + 9 Y c h i Q M q g H C s V M + x I 3 A T L I E R T t N K P 1 Y 0 w m S C R 7 S n q c A B V W 6 S J 0 i t Y 6 0 M L T + U + g m w c v X 3 R o I D p a a B p y e z G 9 W 8 l 4 n / e b 0 Y / A t X B 4 p i o I L M P v J j b k F o Z X V Y Q y Y p A T 7 V
B B P J 9 K 0 W G W O J C e j S K r o E Z z 7 y I m n X a 8 5 p r X 5 7 V m 1 c F n W U 0 S E 6 Q i f I Q e e o g W 5 Q E 7 U Q Q Y / o G b 2 i N + P J e D H e j Y / Z a M k o d v b R H x i f P 7 N H l 7 I = < / l a t e x i t > E out < l a t e x i t s h a 1 _ b a s e 6 4 = " E 5 1
k 1 t d Y 4 X I 7 9 z s p E I g G / S X R k K c = " > A A A C A n i c b Z D L S s N A F I Y n 9 V b r L e p K 3 A S L 4 K o k V d B l U Q S X F e w F 2 l g m 0 0 k 7 d J I J M y d C C c G N r + L G h S J u f Q p 3 v o 2 T N A t t / W H g 4 z / n M O f 8 X s S Z A t v + N k p L y y u r a + X 1 y s b m 1 v a O u b v X V i K W h L a I 4 E J 2 P a w o Z y F t A Q N O u 5 G k O P A 4 7 X i T q 6 z e e a B S M R H e w T S i b o B H I f M Z w a C t g X n Q D z C M P T + 5 T u + T n B k k I o Y 0 H Z h V u 2 b n s h b B K a C K C j U H 5 l d / K E g c 0 B A I x 0 r 1 H D s C N 8 E S G O E 0 r f R j R S N M J n h E e x p D H F D l J v k J q X W s n a H l C 6 l f C F b u / p 5 I c K D U N P B 0 Z 7 a k m q 9 l 5 n + 1 X g z + h Z u w M I q B h m T 2 k R 9 z C 4 S V 5 W E N m a Q E + F Q D J p L p X S 0 y x h I T 0 K l V d A j O / M m L 0 K 7 X n N N a / f a s 2 r g s 4 i i j Q 3 S E T p C D z l E D 3 a A m a i G C H t E z e k V v x p P x Y r w b H 7 P W k l H M 7 K M / M j 5 / A K Y 5 m D 0 = < / l a t e x i t > f
< l a t e x i t s h a 1 _ b a s e 6 4 = " a j 1
V r W g q S r q k g q J / b L g t s T m R K / w = " > A A A B 6 H i c b V B N S 8 N A E J 3 U r 1 q / q h 6 9 L B b B U 0 m q o M e i F 4 8 t 2 F p o Q 9 l s J + 3 a z S b s b o Q S + g u 8 e F D E q z / J m / / G b Z u D t j 4 Y e L w 3 w 8 y 8 I B F c G 9 f 9 d g p r 6 x u b W 8 X t 0 s 7 u 3 v 5 B + f C o r e N U M W y x W M S q E 1 C N g k t s G W 4 E d h K F N A o E P g T j 2 5 n / 8 I R K 8 1 j e m 0 m C f k S H k o e c U W O l Z t g v V 9 y q O w d Z J V 5 O K p C j 0 S 9 / 9 Q Y x S y O U h g m q d d d z E + N n V B n O B E 5 L v V R j Q t m Y D r F r q a Q R a j + b H z o l Z 1 Y Z k D B W t q Q h c / X 3 R E Y j r S d R Y D s j a k Z 6 2 Z u J / 3 n d 1 I T X f s Z l k h q U b L E o T A U x M Z l 9 T Q Z c I T N i Y g l l i t t b C R t R R Z m x 2 Z R s C N 7 y y 6 u k X a t 6 F 9 V a 8 7 J S v 8 n j K M I J n M I 5 e H A F d b i D B r S A A c I z v M K b 8 + i 8 O O / O x 6 K 1 4 O Q z x / A H z u c P z D + M 7 g = = < / l a t e x i t > x
A A B 8 X i c b V D L S g M x F L 1 T X 7 W + q i 7 d B I v g q s x U Q Z d F N y 4 r 2 A e 2 Q 8 m k d 9 r Q T G Z I M k I Z + h d u X C j i 1 r 9 x 5 9 + Y t r P Q 1 g O B w z n 3 k n N P k A i u j e t + O 4 W 1 9 Y 3 N r e J 2 a W d 3 b / + g f H j U 0 n G q G D Z Z L G L V C a h G w S U 2 D T c C O 4 l C G g U C 2 8 H 4 d u a 3 n 1 B p H s s H M 0 n Q j + h Q 8 p A z a q z 0 2 I u o G Q V h F k z 7 5 Y p b d e c g q 8 T L S Q V y N P r l r 9 4 g Z m m E 0 j B B t e 5 6 b m L 8 j C r D m c B p q Z d q T C g b 0 y F 2 L Z U 0 Q u 1 n 8 8 R T c m a V A Q l j Z Z 8 0 Z K 7 + 3 s h o p P U k C u z k L K F e 9 m b i f 1 4 3 N e G 1 n 3 G Z p A Y l W 3 w U p o K Y m M z O J w O u k B k x s Y Q y x W 1 W w k Z U U W Z s S S V b g r d 8 8 i p p 1 a r e R b V 2 f 1 m p 3 + R 1 F O E E T u E c P L i C O t x B A 5 r A Q M I z v M K b o 5 0 X 5 9 3 5 W I w W n H z n G P 7 A + f w B 3 R m R C g = = < / l a t e x i t > + < l a t e x i t s h a 1 _ b a s e 6 4 = " H F b 7 v P G X W s h K f d t T i u m E D K 1 6 m e 0 = " > A A A B 6 H i c b V D L S g N B E O y N r x h f U Y 9 e B o M g C G E 3 C n o M e v G Y g H l A s o T Z S W 8 y Z n Z 2 m Z k V Q s g X e P G g i F c / y Z t / 4 y T Z g y Y W N B R V 3 X R 3 B Y n g 2 r j u t 5 N b W 9 / Y 3 M p v F 3 Z 2 9 / Y P i o d H T R 2 n i m G D x S J W 7 Y B q F F x i w 3 A j s J 0 o p F E g s B W M 7 m Z + 6 w m V 5 r F 8 M O M E / Y g O J A 8 5 o 8 Z K 9 Y t e s e S W 3 T n I K v E y U o I M t V 7 x q 9 u P W R q h N E x Q r T u e m x h / Q p X h T O C 0 0 E 0 1 J p S N 6 A A 7 l k o a o f Y n 8 0 O n 5 M w q f R L G y p Y 0 Z K 7 + n p j Q S O t x F N j O i J q h X v Z m 4 n 9 e J z X h j T / h M k k N S r Z Y F K a C m J j M v i Z 9 r p A Z M b a E M s X t r Y Q N q a L M 2 G w K N g R v + e V V 0 q y U v c t y p X 5 V q t 5 m c e T h B E 7 h H D y 4 h i r c Q w 0 a w A D h G V 7 h z X l 0 X p x 3 5 2 P R m n O y m W P 4 A + f z B 3 L T j L M = < / l a t e x i t >
• < l a t e x i t s h a 1 _ b a s e 6 4 = " y f c 6 N Y W r 3 I m + Z B K 4 G g u 2 C K 7 0 r V E = " > A A A B 7 H i c b V B N S 8 N A E J 3 4 W e t X 1 a O X x S J 4 K k k V 9 F j 0 4 r G C a Q t t K J v N p l 2 6 2 Y T d i V B K f 4 M X D 4 p 4 9 Q d 5 8 9 + 4 b X P Q 1 g c D j / d m m J k X Z l I Y d N 1 v Z 2 1 9 Y 3 N r u 7 R T 3 t 3 b P z i s H B 2 3 T J p r x n 2 W y l R 3 Q m q 4 F I r 7 K F D y T q Y 5 T U L J 2 + H o b u a 3 n 7 g 2 I l W P O M 5 4 k N C B E r F g F K 3 k 9 1 i U Y r 9
S d W v u H G S V e A W p Q o F m v / L V i 1 K W J 1 w h k 9 S Y r u d m G E y o R s E k n 5 Z 7 u e E Z Z S M 6 4 F 1 L F U 2 4 C S b z Y 6 f k 3 C o R i V N t S y G Z q 7 8 n J j Q x Z p y E t j O h O D T L 3 k z 8 z + v m G N 8 E E 6 G y H L l i i 0 V x L g m m Z P Y 5 i Y T m D O X Y E s q 0 s L c S N q S a M r T 5 l G 0 I 3 v L L q 6 R V r 3 m X t f r D V b V x W 8 R R g l M 4 g w v w 4 B o a c A 9 N 8 I G B g G d 4 h T d H O S / O u / O
x a F 1 z i p k T + A P n 8 w f a W I 6 2 < / l a t e x i t >
• < l a t e x i t s h a 1 _ b a s e 6 4 = " y f c 6 N Y W r 3 I m + Z B K 4 G g u 2 C K 7 0 r V E = " > A A A B 7 H i c b V B N S 8 N A E J 3 4 W e t X 1 a O X x S J 4 K k k V 9 F j 0 4 r G C a Q t t K J v N p l 2 6 2 Y T d i V B K f 4 M X D 4 p 4 9 Q d 5 8 9 + 4 b X P Q 1 g c D j / d m m J k X Z l I Y d N 1 v Z 2 1 9 Y 3 N r u 7 R T 3 t 3 b P z i s H B 2 3 T J p r x n 2 W y l R 3 Q m q 4 F I r 7 K F D y T q Y 5 T U L J 2 + H o b u a 3 n 7 g 2 I l W P O M 5 4 k N C B E r F g F K 3 k 9 1 i U Y r 9
S d W v u H G S V e A W p Q o F m v / L V i 1 K W J 1 w h k 9 S Y r u d m G E y o R s E k n 5 Z 7 u e E Z Z S M 6 4 F 1 L F U 2 4 C S b z Y 6 f k 3 C o R i V N t S y G Z q 7 8 n J j Q x Z p y E t j O h O D T L 3 k z 8 z + v m G N 8 E E 6 G y H L l i i 0 V x L g m m Z P Y 5 i Y T m D O X Y E s q 0 s L c S N q S a M r T 5 l G 0 I 3 v L L q 6 R V r 3 m X t f r D V b V x W 8 R R g l M 4 g w v w 4 B o a c A 9 N 8 I G B g G d 4 h T d H O S / O u / O
x a F 1 z i p k T + A P n 8 w f a W I 6 2 < / l a t e x i t > + x t < l a t e x i t s h a 1 _ b a s e 6 4 = " z Z
v c J V 7 G r A b B I O i x 3 g N M + q p Y s w g = " > A A A B 6 n i c b V B N S 8 N A E J 3 4 W e t X 1 a O X x S J 4 K k k V 9 F j 0 4 r G i / Y A 2 l M 1 2 0 y 7 d b M L u R C y h P 8 G L B 0 W 8 + o u 8 + W / c t j l o 6 4 O B x 3 s z z M w L E i k M u u 6 3 s 7 K 6 t r 6 x W d g q b u / s 7 u 2 X D g 6 b J k 4 1 4 w 0 W y 1 i 3 A 2 q 4 F I o 3 U K D k 7 U R z G g W S t 4 L R z d R v P X J t R K w e c J x w P 6 I D J U L B K F r p / q m H v V L Z r b g z k G X i 5 a Q M O e q 9 0 l e 3 H 7 M 0 4 g q Z p M Z 0 P D d B P 6 M a B Z N 8 U u y m h i e U j e i A d y x V N O L G z 2 a n T s i p V f o k j L U t h W S m / p 7 I a G T M O A p s Z 0 R x a B a 9 q f i f 1 0 k x v P I z o Z I U u W L z R W E q C c Z k + j f p C 8 0 Z y r E l l G l h b y V s S D V l a N M p 2 h C 8 x Z e X S b N a 8 c 4 r 1 b u L c u 0 6 j 6 M A x 3 A C Z + D B J d T g F u r Q A A Y D e I Z X e H O k 8 + K 8 O x / z 1 h U n n z m C P 3 A + f w B y i o 3 n < / l a t e x i t > b
< l a t e x i t s h a 1 _ b a s e 6 4 = " 9 Q F j a f B q T l 3 A A t 8 j l s e Z 7 P S q b y aggressively decompose words into smaller units (Sennrich et al., 2016) . Finally, when pretrained language models are adapted on a downstream task, they do not allow graceful modifications to the vocabulary as required by the task or its data domain. Decoupling the training vocabulary from the target vocabulary that a model can use during inference or finetuning will simplify sequential training and enable open vocabularies.
A = " > A A A B 8 X i c b V D L S g M x F L 1 T X 7 W + q i 7 d B I v g q s x U Q Z d F N y 4 r 2 A e 2 Q 8 m k d 9 r Q T G Z I M k I Z + h d u X C j i 1 r 9 x 5 9 + Y t r P Q 1 g O B w z n 3 k n N P k A i u j e t + O 4 W 1 9 Y 3 N r e J 2 a W d 3 b / + g f H j U 0 n G q G D Z Z L G L V C a h G w S U 2 D T c C O 4 l C G g U C 2 8 H 4 d u a 3 n 1 B p H s s H M 0 n Q j + h Q 8 p A z a q z 0 2 I u o G Q V h F k z 7 5 Y p b d e c g q 8 T L S Q V y N P r l r 9 4 g Z m m E 0 j B B t e 5 6 b m L 8 j C r D m c B p q Z d q T C g b 0 y F 2 L Z U 0 Q u 1 n 8 8 R T c m a V A Q l j Z Z 8 0 Z K 7 + 3 s h o p P U k C u z k L K F e 9 m b i f 1 4 3 N e G 1 n 3 G Z p A Y l W 3 w U p o K Y m M z O J w O u k B k x s Y Q y x W 1 W w k Z U U W Z s S S V b g r d 8 8 i p p 1 a r e R b V 2 f 1 m p 3 + R 1 F O E E T u E c P L i C O t x B A 5 r A Q M I z v M K b o 5 0 X 5 9 3 5 W I w W n H z n G P 7 A + f w B 3 R m R C g = = < / l a t e x i t > + < l a t e x i t s h a 1 _ b a s e 6 4 = " H F b 7 v P G X W s h K f d t T i u m E D K 1 6 m e 0 = " > A A A B 6 H i c b V D L S g N B E O y N r x h f U Y 9 e B o M g C G E 3 C n o M e v G Y g H l A s o T Z S W 8 y Z n Z 2 m Z k V Q s g X e P G g i F c / y Z t / 4 y T Z g y Y W N B R V 3 X R 3 B Y n g 2 r j u t 5 N b W 9 / Y 3 M p v F 3 Z 2 9 / Y P i o d H T R 2 n i m G D x S J W 7 Y B q F F x i w 3 A j s J 0 o p F E g s B W M 7 m Z + 6 w m V 5 r F 8 M O M E / Y g O J A 8 5 o 8 Z K 9 Y t e s e S W 3 T n I K v E y U o I M t V 7 x q 9 u P W R q h N E x Q r T u e m x h / Q p X h T O C 0 0 E 0 1 J p S N 6 A A 7 l k o a o f Y n 8 0 O n 5 M w q f R L G y p Y 0 Z K 7 + n p j Q S O t x F N j O i J q h X v Z m 4 n 9 e J z X h j T / h M k k N S r Z Y F K a C m J j M v i Z 9 r p A Z M b a E M s X t r Y Q N q a L M 2 G w K N g R v + e V V 0 q y U v c t y p X 5 V q t 5 m c e T h B E 7 h H D y 4 h i r c Q w 0 a w A D h G V 7 h z X l 0 X p x 3 5 2 P R m n O y m W P 4 A + f z B 3 L T j L M = < / l a t e x i t > (a) Independent (b) Shared
Building on encouraging results with compositional input embeddings (Ling et al., 2015; Józefowicz et al., 2016; Peters et al., 2018) , we introduce a language model with shared compositional embeddings for input as well as for output word representations. Further, we go beyond past work based on surface forms, making optional use of relations and natural language definitions from structured lexicons like WordNet (Fellbaum, 1998) . To our knowledge, this is the first word-level language model whose parameters do not depend on the vocabulary size and which is grounded to an external structured lexicon. Our experiments show that our models are more sample efficient (Section 4) on closed vocabularies and perform competitively on cross-domain settings (Section 5).
3 Groc: Grounded Compositional Output Language Models
We present our grounded compositional output language model ( Figure 2 ). 1 Following the decomposition of neural language models in Section 2 (Equations 2-3), we consider each part of the model in turn: input embeddings (Section 3.1), output embeddings (Section 3.2), and bias (Section 3.3).
As noted above, our approach is agnostic to the Prefix function
Output Embedding Bias
The hungry person ate with ?
voracious appetite E out < l a t e x i t s h a 1 _ b a s e 6 4 = " E 5 1 k 1 t d Y 4 X I 7 9 z s p E I g G / S X R k K c = "
> A A A C A n i c b Z D L S s N A F I Y n 9 V b r L e p K 3 A S L 4 K o k V d B l U Q S X F e w F 2 l g m 0 0 k 7 d J I J M y d C C c G N r + L G h S J u f Q p 3 v o 2 T N A t t / W H g 4 z / n M O f 8 X s S Z A t v + N k p L y y u r a + X 1 y s b m 1 v a O u b v X V i K W h L a I 4 E J 2 P a w o Z y F t A Q N O u 5 G k O P A 4 7 X i T q 6 z e e a B S M R H e w T S i b o B H I f M Z w a C t g X n Q D z C M P T + 5 T u + T n B k k I o Y 0 H Z h V u 2 b n s h b B K a C K C j U H 5 l d / K E g c 0 B A I x 0 r 1 H D s C N 8 E S G O E 0 r f R j R S N M J n h E e x p D H F D l J v k J q X W s n a H l C 6 l f C F b u / p 5 I c K D U N P B 0 Z 7 a k m q 9 l 5 n + 1 X g z + h Z u w M I q B h m T 2 k R 9 z C 4 S V 5 W E N m a Q E + F Q D J p L p X S 0 y x h I T 0 K l V d A j O / M m L 0 K 7 X n N N a / f a s 2 r g s 4 i i j Q 3 S E T p C D z l E D 3 a A m a i G C H t E z e k V v
x p P x Y r w b H 7 P W k l H M 7 K M / M j 5 / A K Y 5 m D 0 = < / l a t e x i t >
x
< l a t e x i t s h a 1 _ b a s e 6 4 = " t + n C B x U P P s y S l 8 0 6 y E 8 m g 2 q Z 1 D k = " > A A A B 9 H i c b
V D L S g M x F L 3 j s 9 Z X 1 a W b Y B H E R Z m p g i 6 L b l x W s A 9 o x 5 J J M 2 1 o J h m T T K E M / Q 4 3 L h R x
W i C G 0 Q y a V q B 1 h T z g R t G G Y 4 b c e K 4 i j g t B W M b j O / N a Z K M y k e z C S m f o Q H g o W M Y G M l v x t h M y S Y p 8 3 p 4 3 m v V H Y r 7 g x o m X g 5 K U O O e q / 0 1 e 1 L k k R U G M K x 1 h 3 P j Y 2 f Y m U Y 4 X R a 7 C a a x p i M 8 I B 2 L B U 4 o t p P Z 6 G n 6 N Q q f R R K Z Z 8 w a K b + 3 k h x p P U k C u x k F l I v e p n 4 n 9 d J T H j t p 0 z E i a G C z A + F C U d G o q w B 1 G e K E s M n l m C i m M 2 K y B A r T I z t q W h L 8 B a / v
E y a 1 Y p 3 U a n e X 5 Z r N 3 k d B T i G E z g D D 6 6 g B n d Q h w Y Q e I J n e I U 3 Z + y 8 O O / O x 3 x 0 x c l 3 j u A P n M 8 f s w y S D A = = < / l a t e x i t > E in < l a t e x i t s h a 1 _ b a s e 6 4 = "
s + J c t B L o / W Z o c I v h Y k Z W J 9 K Y + W s = " > A A A C A X i c b V D L S s N A F J 3 U V 6 2 v q B v B T b A I r k p S B V 0 W R X B Z w T 6 g j W U y n b R D J 5 M w c y O U E D f + i h s X i r j 1 L 9 z 5 N 0 7 S L L T 1 w M D h n H u Z
e 4 4 X c a b A t r + N 0 t L y y u p a e b 2 y s b m 1 v W P u 7 r V V G E t C W y T k o e x 6 W F H O B G 0 B A 0 6 7 k a Q 4 8 D j t e J O r z O 8 8 U K l Y K O 5 g G l E 3 w C P B f E Y w a G l g H v Q D D G P P T 6 7 T + y T n D B I m 0 n R g V u 2 a n c N a J E 5 B q q h A c 2 B + 9 Y c h i Q M q g H C s V M + x I 3 A T L I E R T t N K P 1 Y 0 w m S C R 7 S n q c A B V W 6 S J 0 i t Y 6 0 M L T + U + g m w c v X 3 R o I D p a a B p y e z G 9 W 8 l 4 n / e b 0 Y / A t X B 4 p i o I L M P v J j b k F o Z X V Y Q y Y p A T 7 V B B P J 9 K 0 W G W O J C e j S K r o E Z z 7 y I m n X a 8 5 p r X 5 7 V m 1 c F n W U 0 S E 6 Q i f I Q e e o g W 5 Q E 7 U Q Q Y / o G b 2 i N + P J e D H e j Y / Z a M k o d v b R H x i f P 7 N H l 7 I = < / l a t e x i t > g < l a t e x i t s h a 1 _ b a s e 6 4 = " o p 9 Y Q d D v w J g X X t x m 6 z U 1 a 2 f a I n k = " > A A A B 6 H i c b V B N S 8 N A E J 3 U r 1 q / q h 6 9 L B b B U 0 m q o M e i F 4 8 t 2 F p o Q 9 l s J + 3 a z S b s b o Q S + g u 8 e F D E q z / J m / / G b Z u D t j 4 Y e L w 3 w 8 y 8 I B F c G 9 f 9 d g p r 6 x u b W 8 X t 0 s 7 u 3
v 5 B + f C o r e N U M W y x W M S q E 1 C N g k t s G W 4 E d h K F N A o E P g T j 2 5 n / 8 I R K 8 1 j e m 0 m C f k S H k o e c U W O l 5 r B f r r h V d w 6 y S r y c V C B H o 1 / + 6 g 1 i l k Y o D R N U 6 6 7 n J s b P q D K c C Z y W e q n G h L I x H W L X U k k j 1 H 4 2 P 3 R K z q w y I G G s b E l D 5 u r v i Y x G W k + i w H Z G 1 I z 0 s j c T / / O 6 q Q m v / Y z L J D U o 2 W J R m A p i Y j L 7 m g y 4 Q m b E x B L K F L e 3 E j a i i j J j s y n Z E L z l l 1 d J u 1 b 1 L q q 1 5 m W l f p P H U Y Q T O I V z 8 O A K 6 n A H D W g B A 4
R n e I U 3 5 9 F 5 c d 6 d j 0 V r w c l n j u E P n M 8 f z c O M 7 w = = < / l a t e x i t > f < l a t e x i t s h a 1 _ b a s e 6 4 = " a j 1 V r W g q S r q k g q J / b L g t s T m R K / w = " > A A A B 6 H i c b V B N S 8 N A E J 3 U r 1 q / q h 6 9 L B b B U 0 m q o M e i F 4 8 t 2 F p o Q 9 l s J + 3 a z S b s b o Q S + g u 8 e F D E q z / J m / / G b Z u D t j 4 Y e L w 3 w 8 y 8 I B F c G 9 f 9 d g p r 6 x u b W 8 X t 0 s 7 u 3
v 5 B + f C o r e N U M W y x W M S q E 1 C N g k t s G W 4 E d h K F N A o E P g T j 2 5 n / 8 I R K 8 1 j e m 0 m C f k S H k o e c U W O l Z t g v V 9 y q O w d Z J V 5 O K p C j 0 S 9 / 9 Q Y x S y O U h g m q d d d z E + N n V B n O B E 5 L v V R j Q t m Y D r F r q a Q R a j + b H z o l Z 1 Y Z k D B W t q Q h c / X 3 R E Y j r S d R Y D s j a k Z 6 2 Z u J / 3 n d 1 I T X f s Z l k h q U b L E o T A U x M Z l 9 T Q Z c I T N i Y g l l i t t b C R t R R Z m x 2 Z R s C N 7 y y 6 u k X a t 6 F 9 V
V B N S 8 N A E J 3 4 W e t X 1 a O X x S J 4 K k k V 9 F j 0 4 r G C a Q t t K J v t p F 2 6 2 Y T d j V B K f 4 M X D 4 p 4 9 Q d 5 8 9 + 4 a X P Q 1 g c D j / d m m J k X p o J r 4 7 r f z t r 6 x u b W d m m n v L u 3 f 3 B Y O T p u 6 S R T D H 2 W i E R 1 Q q p R c I m + 4 U Z g J 1 V I 4 1 B g O x z f 5 X 7 7 C Z X m i X w 0 k x S D m A 4 l j z i j x k p + r z n i 5 X 6 l 6 t b c O c g q 8 Q p S h Q L N f u W r N 0 h Y F q M 0 T F C t u 5 6 b m m B K l e F M 4 K z c y z S m l I 3 p E L u W S h q j D q b z Y 2 f k 3 C o D E i X K l j R k r v
K Z Z g Y l W y y K M k F M Q v L P y Y A r Z E Z M L K F M c X s r Y S O q K D M 2 n z w E b / n l V d K q 1 7 z L W v 3 h q t q 4 L e I o w S m c w Q V 4 c A 0 N u I c m + M C A w z O 8 w p s j n R f n 3 f l Y t K 4 5 x c w J / I H z + Q M Z p Y 4 3 < / l a t e x i t > E out
< l a t e x i t s h a 1 _ b a s e 6 4 = " E 5 1 k 1 t d Y 4 X I 7 9 z s p E I g G / S X R k K c = "
> A A A C A n i c b Z D L S s N A F I Y n 9 V b r L e p K 3 A S L 4 K o k V d B l U Q S X F e w F 2 l g m 0 0 k 7 d J I J M y d C C c G N r + L G h S J u f Q p 3 v o 2 T N A t t / W H g 4 z / n M O f 8 X s S Z A t v + N k p L y y u r a + X 1 y s b m 1 v a O u b v X V i K W h L a I 4 E J 2 P a w o Z y F t A Q N O u 5 G k O P A 4 7 X i T q 6 z e e a B S M R H e w T S i b o B H I f M Z w a C t g X n Q D z C M P T + 5 T u + T n B k k I o Y 0 H Z h V u 2 b n s h b B K a C K C j U H 5 l d / K E g c 0 B A I x 0 r 1 H D s C N 8 E S G O E 0 r f R j R S N M J n h E e x p D H F D l J v k J q X W s n a H l C 6 l f C F b u / p 5 I c K D U N P B 0 Z 7 a k m q 9 l 5 n + 1 X g z + h Z u w M I q B h m T 2 k R 9 z C 4 S V 5 W E N m a Q E + F Q D J p L p X S 0 y x h I T 0 K l V d A j O / M m L 0 K 7 X n N N a / f a s 2 r g s 4 i i j Q 3 S E T p C D z l E D 3 a A m a i G C H t E z e k V v
x p P x Y r w b H 7 P W k l H M 7 K M / M j 5 / A K Y 5 m D 0 = < / l a t e x i t > < l a t e x i t s h a 1 _ b a s e 6 4 = " E p w a d K l 7 9 n u F F
V B z W q B r y C C 0 A 3 8 = " > A A A B 7 H i c b V B N S 8 N A E J 3 4 W e t X 1 a O X x S J 4 K k k V 9 F j 0 4 r G C a Q t t K J v t p l 2 6 2 Y T d i V B C f 4 M X D 4 p 4 9 Q d 5 8 9 + 4 b X P Q 1 g c D j / d m m J k X p l I Y d N 1 v Z 2 1 9 Y 3 N r u 7 R T 3 t 3 b P z i s H B 2 3 T J J p x n 2 W y E R 3 Q m q 4 F I r 7 K F D y T q o 5 j U P J 2 + H 4 b u a 3 n 7 g 2 I l G P O E l 5 E N O h E p F g F K 3 k 9 0 K O t F + p u j V 3 D r J K v I J U o U C z X / n q D R K W x V w h k 9 S Y r u e m G O R U o 2 C S T 8 u 9 z P C U s j E d 8 q 6 l i s b c B P n 8 2 C k 5 t 8 q A R I m 2 p Z D M 1 d 8 T O Y 2 N m c S h 7 Y w p j s y y N x P / 8 7 o Z R j d B L l S a I V d s s S j K J M G E z D 4 n A 6 E 5 Q z m x h D I t 7 K 2 E j a i m D G 0 + Z R u C t / z y K m n V a 9 5 l r f 5 w V W 3 c F n G U 4 B T O 4 A I 8 u I Y G 3 E M T f G A g 4 B l e 4 c 1 R z o v z 7 n w s W t e c Y u Y E / s D 5 / A H F J I 6 o < / l a t e x i t > b
< l a t e x i t s h a 1 _ b a s e 6 4 = " 9 Q F j a f B q T l 3 A A t 8 j l s e Z 7 P S q b y A = " > A
A A B 8 X i c b V D L S g M x F L 1 T X 7 W + q i 7 d B I v g q s x U Q Z d F N y 4 r 2
A e 2 Q 8 m k d 9 r Q T G Z I M k I Z + h d u X C j i 1 r 9 x 5 9 + Y t r P Q 1 g O B w z n 3 k n N P k A i u j e t + O 4 W 1 9 Y 3 N r e J 2 a W
d 3 b / + g f H j U 0 n G q G D Z Z L G L V C a h G w S U 2 D T c C O 4 l C G g U C 2 8 H 4 d u a 3 n 1 B p H s s H M 0 n Q j + h Q 8 p A z a q z 0 2 I u o G Q V h F k z 7 5 Y p b d e c g q 8 T L S Q V y N P r l r 9 4 g Z m m E 0 j B B t e 5 6 b m L 8 j C r D m c B p q Z d q T C g b 0 y F 2 L Z U 0 Q u 1 n 8 8 R T c m a V A Q l j Z Z 8 0 Z K 7 + 3 s h o p P U k C u z k L K F e 9 m b i f 1 4 3 N e G 1 n 3 G Z p A Y l W 3 w U p o K Y m M z O J w O u k B k x s Y Q y x W 1 W w k Z U U W Z s S S V b g r d 8 8 i p p 1 a r e R b V 2 f 1 m p 3 + R 1 F O E E T u E c P L i C O t x B A 5 r A Q M I z v M K b
o 5 0 X 5 9 3 5 W I w W n H z n G P 7 A + f w B 3 R m R C g = = < / l a t e x i t > + < l a t e x i t s h a 1 _ b a s e 6 4 = " H F b 7
v P G X W s h K f d t T i u m E D K 1 6 m e 0 = " > A A A B 6 H i c b V D L S g N B E O y N r x h f U Y 9 e B o M g C G E 3 C n o M e v G Y g H l A s o T Z S W 8 y Z n Z 2 m Z k V Q s g X e P G g i F c / y Z t / 4 y T Z g y Y W N B R V 3 X R 3 B Y n g 2 r j u t 5 N b W 9 / Y 3 M p v F 3 Z 2 9 / Y P i o d H T R 2 n i m G D x S J W 7 Y B q F F x i w 3 A j s J 0 o p F E g s B W M 7 m Z + 6 w m V 5 r F 8 M O M E / Y g O J A 8 5 o 8 Z K 9 Y t e s e S W 3 T n I K v E y U o I M t V 7 x q 9 u P W R q h N E x Q r T u e m x h / Q p X h T O C 0 0 E 0 1 J p S N 6 A A 7 l k o a o f Y n 8 0 O n 5 M w q f R L G y p Y 0 Z K 7 + n p j Q S O t x F N j O i J q h X v Z m 4 n 9 e J z X h j T / h M k k N S r Z Y F K a C m J j M v i Z 9 r p A Z M b a E M s X t r Y Q N q a L M 2 G w K N g R v + e V V 0 q y U v c t y p X 5 V q t 5 m c e T h B E 7 h H D y 4 h i r c Q w 0 a w A D h G V 7 h z X l 0 X p x 3 5 2 P R m n O y m W P 4 A + f z B 3 L T j L M = < / l a t e x i t >
• < l a t e x i t s h a 1 _ b a s e 6 4 = " y f c 6 N Y W r 3 I m + Z B K 4 G g u 2 C K 7 0 r V E = " > A A A B 7 H i c b V B N S 8 N A E J 3 4 W e t X 1 a O X x S J 4 K k k V 9 F j 0 4 r G C a Q t t K J v N p l 2 6 2 Y T d i V B K f 4 M X D 4 p 4 9 Q d 5 8 9 + 4 b X P Q 1 g c D j / d m m J k X Z l I Y d N 1 v Z 2 1 9 Y 3 N r u 7 R T 3 t 3 b P z i s H B 2 3 T J p r x n 2 W y l R 3 Q m q 4 F I r 7 K F D y T q Y 5 T U L J 2 + H o b u a 3 n 7 g 2 I l W P O M 5 4 k N C B E r F g F K 3 k 9 1 i U Y r 9 S d W v u H G S V e A W p Q o F m v / L V i 1 K W J 1 w h k 9 S Y r u d m G E y o R s E k n 5 Z 7 u e E Z Z S M 6 4 F 1 L F U 2 4 C S b z Y 6 f k 3 C o R i V N t S y G Z q 7 8 n J j Q
x Z p y E t j O h O D T L 3 k z 8 z + v m G N 8 E E 6 G y H L l i i 0 V x L g m m Z P Y 5 i Y T m D O X Y E s q 0 s L c S N q S a M r T 5 l G 0 I 3 v L L q 6 R V r 3 m X t f r D V b V
x W 8 R R g l M 4 g w v w 4 B o a c A 9 N 8 I G B g G d 4 h T d H O S / O u / O x a F 1 z i p k T + A P n 8 w f a W I 6 2 < / l a t e x i t >
x t < l a t e x i t s h a 1 _ b a s e 6 4 = " z Z
v c J V 7 G r A b B I O i x 3 g N M + q p Y s w g = " > A A A B 6 n i c b V B N S 8 N A E J 3 4 W e t X 1 a O X x S J 4 K k k V 9 F j 0 4 r G i / Y A 2 l M 1 2 0 y 7 d b M L u R C y h P 8 G L B 0 W 8 + o u 8 + W / c t j l o 6 4 O B x 3 s z z M w L E i k M u u 6 3 s 7 K 6 t r 6 x W d g q b u / s 7 u 2 X D g 6 b J k 4 1 4 w 0 W y 1 i 3 A 2 q 4 F I o 3 U K D k 7 U R z G g W S t 4 L R z d R v P X J t R K w e c J x w P 6 I D J U L B K F r p / q m H v V L Z r b g z k G X i 5 a Q M O e q 9 0 l e 3 H 7 M 0 4 g q Z p M Z 0 P D d B P 6 M a B Z N 8 U u y m h i e U j e i A d y x V N O L G z 2 a n T s i p V f o k j L U t h W S m / p 7 I a G T M O A p s Z 0 R x a B a 9 q f i f 1 0 k x v P I z o Z I U u W L z R W E q C c Z k + j f p C 8 0 Z y r E l l G l h b y V s S D V l a N M p 2 h C 8 x Z e X S b N a 8 c 4 r 1 b u L c u 0 6 j 6 M A x 3 A C Z + D B J d T g F u r Q A A Y D e I Z X e H O k 8 + K 8 O x / z 1 h U n n z m C P 3 A + f w B y i o 3 n < / l a t e x i t > E
x d o / E h I W M 1 n x D Q n M g g 2 V R 0 y Y Y m n A = " > A A A C C X i c b V C 7 T s M w F H X K q 5 R X g J H F o k J i q p K C B A N D B U J i L B J 9 S E 0 U O Y 7 T W n X i y H Y Q V Z S V h V 9 h Y Q A h V v 6 A j b / B a T N A y 5 E s H 5 9 7 r 3 z u 8 R N G p b K s b 6 O y t L y y u l Z d r 2 1 s b m 3 v m L t 7 X c l T g U k H c 8 Z F 3 0 e S M B q T j q K K k X 4 i C I p 8 R n r + + K q o 9 + 6 J k J T H d 2 q S E D d C w 5 i G F C O l J c + E T o T U y A + z 6 9 z L H J + z Q E 4 i f W U P + n 2 h 8 t w z 6 1 b D m g I u E r s k d V C i 7 Z l f T s B x G p F Y Y Y a k H N h W o t w M C U U x I 3 n N S S V J E B 6 j I R l o G q O I S D e b b p L D I 6 0 E M O R C n 1 j B q f p 7 I k O R L A z q z s K 3 n K 8 V 4 n + 1 Q a r C c z e j c Z I q E u P Z R 2 H K o O K w i A U G V B C s 2 E Q T h A X V X i E e I Y G w 0 u H V d A j 2 / M q L p N t s 2 C e N 5 u 1 p v X V Z x l E F B + A Q H A M b n I E W u A F t 0 A E Y P I J n 8 A r e j C f j x X g 3 P m a t F a O c 2 Q d / Y H z + A E u 8 m 1 s = < / l a t e x i t > E x < l a t e x i t s h a 1 _ b a s e 6 4 = " y e I 9 b w U m T M A k W P u O g B X r D 2 m f B x 0 = " > A A A B + X i c b V D L S s N A F L 2 p r 1 p f U Z d u g k V w V Z I q 6 L I o g s s K 9 g F t K J P p p B 0 6 m Y S Z S b E M + R M 3 L h R x 6 5 + 4 8 2 + c t F l o 6 4 G B w z n 3 c s + c I G F U K t f 9 t k p r 6 x u b W + X t y s 7 u 3 v 6 B f X j U l n E q M G n h m M W i G y B J G O W k p a h i p J s I g q K A k U 4 w u c 3 9 z p Q I S W P + q G Y J 8 S M 0 4 j S k G C k j D W y 7 H y E 1 D k J 9 l w 2 0 f s q y g V 1 1 a + 4 c z i r x C l K F A s 2 B / d U f x j i N C F e Y I S l 7 n p s o X y O h K G Y k q / R T S R K E J 2 h E e o Z y F B H p 6 3 n y z D k z y t A J Y 2 E e V 8 5 c / b 2 h U S T l L A r M Z J 5 T L n u 5 + J / X S 1 V 4 7 W v K k 1 Q R j h e H w p Q 5 K n b y G p w h F Q Q r N j M E Y U F N V g e P k U B Y m b I q p g R v + c u r p F 2 v e R e 1 + s N l t X F T 1 F G G E z i F c / D g C h p w D 0 1 o A Y Y p P M M r v F n a e r H e r Y / F a M k q d o 7 h D 6 z P H 1 u b l C E = < / l a t e x i t > x < l a t e x i t s h a 1 _ b a s e 6 4 = " h L + F a L t O T 9 l u w f L W 3 U t 0 8 x l 3 P c w = " > A A A B 6 H i c b V D L T g J B E O z F F + I L 9 e h l I j H x R H b R R I 9 E L x 4 h k U c C G z I 7 9 M L I 7 O x m Z t Z I C F / g x Y P G e P W T v P k 3 D r A H B S v p p F L V n e 6 u I B F c G 9 f 9 d n J r 6 x u b W / n t w s 7 u 3 v 5 B 8 f C o q e N U M W y w W M S q H V C N g k t s G G 4 E t h O F N A o E t o L R 7 c x v P a L S P J b 3 Z p y g H 9 G B 5 C F n 1 F i p / t Q r l t y y O w d Z J V 5 G S p C h 1 i t + d f s x S y O U h g m q d c d z E + N P q D K c C Z w W u q n G h L I R H W D H U k k j 1 P 5 k f u i U n F m l T 8 J Y 2 Z K G z N X f E x M a a T 2 O A t s Z U T P U y 9 5 M / M / r p C a 8 9 i d c J q l B y R a L w l Q Q E 5 P Z 1 6 T P F T I j x p Z Q p r i 9 l b A h V Z Q Z m 0 3 B h u A t v 7 x K m p W y d 1 G u 1 C 9 L 1 Z s s j j y c w C m c g w d X U I U 7 q E E D G C A 8 w y u 8 O Q / O i / P u f C x a c 0 4 2 c w x / 4 H z + A O e H j Q A = < / l a t e x i t > … r < l a t e x i t s h a 1 _ b a s e 6 4 = " 4 j m b C l i N i V / z o z I D Q 9 p i e 2 X 1 R X 8 = " > A A A B 7 X i c b V B N S w M x E J 3 U r 1 q / q h 6 9 B I v g q e x W Q Y 9 F L x 4 r 2 A 9 o l 5 J N s 2 1 s N l m S r F C W / g c v H h T x 6 v / x 5 r 8 x b f e g r Q 8 G H u / N M D M v T A Q 3 1 v O + U W F t f W N z q 7 h d 2 t n d 2 z 8 o H x 6 1 j E o 1 Z U 2 q h N K d k B g m u G R N y 6 1 g n U Q z E o e C t c P x 7 c x v P z F t u J I P d p K w I C Z D y S N O i X V S q 5 e M e F / 3 y x W v 6 s 2 B V 4 m f k w r k a P T L X 7 2 B o m n M p K W C G N P 1 v c Q G G d G W U 8 G m p V 5 q W E L o m A x Z 1 1 F J Y m a C b H 7 t F J 8 5 Z Y A j p V 1 J i + f q 7 4 m M x M Z M 4 t B 1 x s S O z L I 3 E / / z u q m N r o O M y y S 1 T N L F o i g V 2 C o 8 e x 0 P u G b U i o k j h G r u b s V 0 R D S h 1 g V U c i H 4 y y + v k l a t 6 l 9 U a / e X l f p N H k c R T u A U z s G H K 6 j D H T S g C R Q e 4 R l e 4 Q 0 p 9 I L e 0 c e i t Y D y m W P 4 A / T 5 A 5 8 Y j y g = < / l a t e x i t > d < l a t e x i t s h a 1 _ b a s e 6 4 = " z 8 Y h k W H v J v Z k 1 T 2 Z w p r J E N D W 0 y Q = " > A A A B 7 X i c b V B N S 8 N A E J 3 U r 1 q / q h 6 9 L B b B U 0 m q o M e i F 4 8 V 7 A e 0 o W w 2 m 3 b t Z j f s b o Q S + h + 8 e F D E q / / H m / / G b Z q D t j 4 Y e L w 3 w 8 y 8 I O F M G 9 f 9 d k p r 6 x u b W + X t y s 7 u 3 v 5 B 9 f C o o 2 W q C G 0 T y a X q B V h T z g R t G 2 Y 4 7 S W K 4 j j g t B t M b u d + 9 4 k q z a R 4 M N O E + j E e C R Y x g o 2 V O o N k z I b h s F p z 6 2 4 O t E q 8 g t S g Q G t Y / R q E k q Q x F Y Z w r H X f c x P j Z 1 g Z R j i d V Q a p p g k m E z y i f U s F j q n 2 s / z a G T q z S o g i q W w J g 3 L 1 9 0 S G Y 6 2 n c W A 7 Y 2 z G e t m b i / 9 5 / d R E 1 3 7 G R J I a K s h i U Z R y Z C S a v 4 5 C p i g x f G o J J o r Z W x E Z Y 4 W J s Q F V b A j e 8 s u r p N O o e x f 1 x v 1 l r X l T x F G G E z i F c / D g C p p w B y 1 o A 4 F H e I Z X e H O k 8 + K 8 O x + L 1 p J T z B z D H z i f P 4 n g j x o = < / l a t e x i t > c < l a t e x i t s h a 1 _ b a s e 6 4 = " l E 6 C W N y I 3 D 6 u B 7 3 h R R R 5 i k V q H P Y = " > A A A B 7 X i c b V B N S w M x E J 3 U r 1 q / q h 6 9 B I v g q e x W Q Y 9 F L x 4 r 2 A 9 o l 5 J training vocabulary (V) and to the prefix encoder (f ) that has been the focus of most innovations in neural language model design. N s 2 1 s N l m S r F C W / g c v H h T x 6 v / x 5 r 8 x b f e g r Q 8 G H u / N M D M v T A Q 3 1 v O + U W F t f W N z q 7 h d 2 t n d 2 z 8 o H x 6 1 j E o 1 Z U 2 q h N K d k B g m u G R N y 6 1 g n U Q z E o e C t c P x 7 c x v P z F t u J I P d p K w I C Z D y S N O i X V S q 5 e M e J / 2 y x W v 6 s 2 B V 4 m f k w r k a P T L X 7 2 B o m n M p K W C G N P 1 v c Q G G d G W U 8 G m p V 5 q W E L o m A x Z 1 1 F J Y m a C b H 7 t F J 8 5 Z Y A j p V 1 J i + f q 7 4 m M x M Z M 4 t B 1 x s S O z L I 3 E / / z u q m N r o O M y y S 1 T N L F o i g V v V 9 y q O w d Z J V 5 O K p C j 0 S 9 / 9 c K E Z T F K w w T V u u u 5 q f E n V B n O B E 5 L v U x j S t m I D r B r q a Q x a n 8 y P 3 R K z q w S k i h R t q Q h c / X 3 x I T G W o / j w H b G 1 A z 1 s j c T / / O 6 m Y m u / Q m X a W Z Q s s W i K B P E J G T 2 N Q m 5 Q m b E 2 B L K F L e 3 E j a k i j J j s y n Z E L z l l 1 d J u 1 b 1 L q q 1 5 m W l f p P H U Y Q T O I V We build on the compositional model of Ling et al. (2015) , which encodes a word using its surface string (i.e., character sequence), adding two more sources of information. Peters et al. (2019) enhanced word representations with information from external relational knowledge bases, specifically for words that refer to entitites. Like them, we use a structured lexicon (WordNet); we encode every word in the lexicon using its neighbors. The second follows Bahdanau et al. (2017) , who used definitions to represent out-of-vocabulary words; we encode definitions for all words (regardless of training-set frequency). We begin by replacing the matrix E in ∈ R |V|×d with a neural network that defines a word's embedding compositionally from its surface form, its position relative to other words in a structured lexicon, and a natural language definition. For each word x, we refer to these, respectively, as the word type's surface embedding c x , relational embedding r x , and definitional embedding d x . We assume each has a dimensionality of d. The last two are optional (if missing, they are set to zero), and we redefine e x as the concatenation of the three, namely e x = c x , r x , d x . For r x and d x , we used the structured relations (synonyms and hyponyms) and free-text definitions in WordNet (Fellbaum, 1998) . In this study, we focus on simple, computationally efficient options for the three encoders. A word x's character sequence is encoded as surface encoding c x using a convolutional network followed by a highway network (Józefowicz et al., 2016; Peters et al., 2018) . Its relational encoding r x is given by an average of c x across WordNet synonyms and hyponyms x . The definitional encoding of x, d x , we similarly take an average of the surface encodings c x over words x appearing in the definition. For computational efficiency, we set a maximum limit to the number of words to be used for both relations and definitions (see Appendix B.1). If a word's information is not in WordNet, we set r x and/or d x to 0. In future work, additional encodings could be appended, such as contextualized examples (Khandelwal et al., 2020) . A notable property of these input embeddings is that their parameter count does not depend on the vocabulary size |V|. Further, the vocabulary used in training need not be identical to the one used during finetuning, evaluation, or deployment. For example, during training we can use the full vocabulary combined with a softmax approximation method (e.g., Grave et al., 2017b) , or by dynamically narrowing the choice of x t based on its history using co-occurrence statistics (L'Hostis et al., 2016) . During finetuning or evaluation, one can use the same vocabulary (required for traditional perplexity evaluations) or a different one chosen statically or dynamically, since any word's input embedding can be calculated compositionally. One straightforward option for vocabulary sizeindependent output embeddings is to reuse the compositional input embeddings from Section 3.1, along the lines of Press and Wolf (2017) . Concretely, at timestep t, we take the set V t of output word types allowed, embed each word type v ∈ V t as in Section 3.1, and stack these into a matrix E in t which serves directly as E out . Though these compositional representations do enable extensive sharing across the vocabulary, we suspect that the features they capture may require additional processing before capturing "output" distributional similarity, especially when another domain is the real target use case for the language model. This follows prior work discussed in Section 2.2, which showed that making the output embedding a function of the input embeddings with shared parameters improves over simple tying. 2 We therefore adopt a depth-k residual network for the output embedding function g (from Section 2.2) that consists of a feedforward function g i at each layer j with d-dimensions each and apply it to the input embedding at timestep t: EQUATION (4): Not extracted; please refer to original document. Hence, we use E out t (k) as the output embedding at timestep t. To avoid overfitting, we apply variational dropout in between the layers, following Pappas and Henderson (2019) . In contrast to that work, our resulting output embeddings are compositional. The depth k and the dropout rate are hyperparameters to be tuned on development data. The number of parameters is proportional to k times the number of parameters in the feedforward network (O(d 2 )); it does not depend on the vocabulary size. In conventional language models, each word in the vocabulary is assigned a bias parameter that roughly captures its log-frequency under a unigram distribution. This is the last part of a neural language model whose parameters depend on the vocabulary size. Instead of a dedicated, independent bias parameter for each word v ∈ V, we define EQUATION (5): Not extracted; please refer to original document. where σ is the activation function and we introduce parameters w ∈ R d and a ∈ R. The bias values b v are stacked to form b and used in Equation 3. Since all components are differentiable with respect to their parameters, the entire model can be trained to maximize training-data likelihood as described earlier (Section 2.1). Parameters include: • Input character embeddings, the convolutional network for c * , and 3d 2 parameters for projection (Section 3.1); • Output embedding transformation, including the depth-k feedforward network for output embeddings (Section 3.2) and the bias parameters (Section 3.3); and • Prefix encoder f , an orthogonal design choice to our method (an LSTM in our experiments). The model size can be adjusted by changing output embedding hyperparameters to fit a given memory requirement -this is the same as any other neural network. Note that despite our vocabularysize independent parameterization, we still need to process all the words in the supplied vocabulary leading to increased training times despite the model's sample efficiency. This can be prohibitive for very large vocabularies (≥ 100K), where we recommend using softmax approximation methods and making sparse updates of the output embedding parameters (see Appendix 1.3). During inference, E out can be cached for fast access; there is no need to execute a forward pass more than once. We first establish the performance of GroC in the conventional closed-vocabulary setting, considering two datasets. We consider out-of-sample generalization (measured by test-set perplexity) and also analyze fit across the vocabulary by frequency bin. Datasets. We evaluate our methods on two English datasets: penn (Marcus et al., 1993) and wikitext2 (Merity et al., 2017) . We report test perplexity using the provided training/dev./test splits (see details in Appendix B.3). Models. All of the models compared use the same prefix encoder: a vanilla recurrent neural network based on the implementation by Merity et al. (2017) with 2 layers and 1024 LSTM units, regularized with hidden unit dropout of 0.65 along the lines of Grave et al. (2017a) . More details are given in Appendix B.4. The following output embedding approaches are compared: • Lookup table: trains a full output embedding lookup table that corresponds to the vocabulary as defined in Eq. 3. • Convolutional (Józefowicz et al., 2016) : an alternative to a lookup table that uses a character-level convolutional neural network followed by a highway network plus a linear "correction" for each vocabulary element to represent the outputs. 3 • Tied (Press and Wolf, 2017) : avoids training separate input and output embedding matrices by tying their parameters. This is a common technique that mitigates the overparameterization issue of the lookup table. • Bilinear (Gulordava et al., 2018) : performs a simple linear transformation of the input embedding to produce the output embedding that effectively shares parameters across outputs. • Deep residual (Pappas and Henderson, 2019) : performs a deep residual transformation of the input embedding with variational dropout in between its layers, which is more expressive than the bilinear one. • Adaptive (Baevski and Auli, 2019) : uses a bilinear transformation of the input and output embedding with parameters proportional to the word frequencies, to assign more capacity to frequent words and less capacity to infrequent ones. This is considered to be a state-of-the-art output embedding method. • GroC (ours): the grounded compositional output embedding described in Section 3.2. For fair comparison, we apply variational dropout to all output embeddings. Hyperparameter selection of dropout rates, output network depth and activation, linear "correction," and adaptive frequency cutoffs was conducted by grid search on validation data. Details are given in Appendix B.2. Table 2 reports perplexities achieved by all seven models. The main finding is that GroC achieves lower perplexity than the previous models, on both datasets. Note that GroC outperforms the state-ofthe-art output embedding method of Baevski and Auli (2019) ; specifically, by −9.8 and −8.2 points on penn and wikitext-2, respectively. The difference with the other methods is even larger. We also confirm the findings of Pappas and Henderson (2019) , that output parameter sharing methods outperform tied output embedding and the lookup table, and, of Józefowicz et al. (2016) , that convolutional output embeddings lag behind full softmax (lookup table) . Notably, GroC outperforms the best reported scores by Merity et al. (2017) and Grave et al. (2017a) on penn, using about 11M fewer parameters and a similar prefix network to the latter. See Appendix B.5 for a more detailed comparison with state-of-the-art models of similar size. Nevertheless, GroC is about 1.3× slower than the convolutional method on penn; with sparse updates (p > 0.3) we can make it 2.1× faster than that method, which is comparable to the speed of the bilinear method, while maintaining a perplexity improvement of −26 points (see detailed speed comparisons in Table 10 in Appendix B.4). The experiment above establishes that our approach achieves improved perplexity relative to alternative output embeddings. We next decompose its performance in various ways to understand why. Word frequency effects. We conjecture that GroC's main benefit comes from words that are rare in the training data, since the core contribution is to share representations across the vocabulary. To evaluate this hypothesis, we consider the difference in test loss (cross entropy) between GroC and a baseline model, following Baevski and Auli (2019) but computing the median instead of the average to reduce the effect of outliers. We decompose this score by data frequency bins (e.g., words occuring 1-50 times in the training dataset). Figure 3 is displayed for the penn and wikitext2 datasets. The trend we observe is that GroC has the greatest relative benefit for words in lower frequency bins, compared to each model. The lowest-frequency bin on penn deviates from this pattern, which we take as an indication that generalizing to infrequent words with only 1M training tokens and a small 10K vocabulary is inherently challenging. Ablations. To assess the contributions of GroC's components, we performed ablation tests on penn and wikitext2 (Table 3) . These include removing relational and/or definitional forms, either with or without a deep residual output network. For fairness, we tune the hyperparameters of the ablated model variants as above. Overall, removing the relational and definitional forms from the main model with or without output network on top increases the perplexity. The largest drop in perplexity happens when we remove both forms, which highlights their notable contribution to the full model. Lastly, the results on wikitext2 highlight the importance of capturing the output similarity with an output network (out) for datasets with a larger vocabulary as opposed to merely reusing the grounded compositional embeddings as output embeddings. Lexicon coverage. To measure the effect of lexicon coverage on model performance in a controlled setting, we artificially remove words from Word-Net, making them unavailable for relational and definitional encodings. In this experiment, we consider the penn dataset, where WordNet's coverage over the (relatively small) vocabulary is highest to begin with. Table 4 shows the resulting test perplexity of a pretrained model (inference) and a model trained from scratch (train) when such controlled manipulation is applied to them from 0% up to the maximum of 82% coverage ( Table 1 ) . Note that we treat relational independently of definitional forms since they are not always co-present. Overall, the results indicate that the model is sensitive to changes in the forms of words that have been seen during training but it is robust to changes if it is trained from scratch. In the next section, we investigate what happens when we add forms for words which the model has never seen before. To demonstrate our model's ability to generalize beyond its training data, we evaluate it across domains with an open vocabulary, in two settings: zero-resource, where it is first trained on one domain and then tested on a new target domain, and low-resource, in which the model is further exposed to training data in the new domain. 2014), Common Crawl, 4 and WikiText-103 (Merity et al., 2017) . Dataset statistics are given in Table 6 . All models are trained on 2M tokens from the 2007 dataset and evaluated on 10M tokens; finetuning is done on an additional 2M tokens from the target domain. We consider the domain of the 2008-2011 datasets to be similar ("near") to that of the training set, 2007, as they contain news from different time periods. In comparison, web and wiki are more different ("far") from 2007. Models. We compare GroC to the tied output embedding model described in Section 4.1 when combined with the following adaptation methods: • Unigram: we interpolate the model's distribution with a unigram cache, which assigns probabilities based on the counts of words in the test data observed so far during evaluation. • Local cache: we interpolate the model's dis- 4 We used the version from WMT 2014 (Bojar et al., 2014) . tribution with a neural cache (Grave et al., 2017c) , which assigns probabilities based on the similarity of the current hidden state to previous hidden states during evaluation. • Finetuning: the model is finetuned on 2M tokens from the target domain. (We also compare to the reported unbounded cache results from Grave et al., 2017a.) Cache models provide effective adaptation without training by using recent history to develop an auxiliary distribution during evaluation, informing predictions of unseen or rarely-seen words. However, as GroC already assigns non-negligible weight to new words not seen prior to evaluation, the cache has less effect by default, even if its predictions are more accurate, an effect we observed in validation. To address this, we down-weighted the model's predictions for new words prior to cache interpolation by 0.1. For finetuning, both tied and GroC models were trained for an additional 3 epochs on the target domain, allowing them to adapt to the new domain. See Appendix C.4 for hyperparameter details. Vocabulary setting. For a fair comparison, all models are evaluated on the union of the training and test vocabularies. Tied models are interpolated with the uniform distribution at test time to prevent infinite perplexities on unseen words, prior to cache interpolation if applicable. Words present in the finetuning data but not in the original training data are given random embeddings prior to finetuning. The results for the cross-domain experiments are shown in Table 5 . Standalone GroC improves perplexity relative to the tied model in every domain by up to −30 points, including the local neural cache and the unbounded neural cache model in the near-domain, even when the former is applied to our own stronger tied-embedding baseline model. In addition, finetuned GroC outperforms all previous baselines by a wide margin including the unbounded cache by about −40 and −132 points on near and far domains, respectively. Here, GroC outperforms the finetuned tied model by up to −25 points except in web domain, and reaches lower validation scores with fewer iterations in 5 out of 6 domains (see Appendix C.1). For the web domain, caches and finetuning are more effective than in any other domain, indicating unique domain dynamics worthy of further study. We proposed an adaptive language model based on grounded compositional outputs. We demonstrated that it reduces the number of parameters and increases sample efficiency, outperforming strong output embedding methods and adaptation baselines on both in-domain and open-vocabulary settings respectively. In principle, our results should be applicable to word-piece language models which are currently based on lookup tables to improve their sample efficiency and compactness. In future work, it would be interesting to investigate to what extent pretrained language models benefit from GroC on such zero-resource or lowresource adaptation settings. This work indicates several other future directions for language modeling in low-resource domains: extension to other languages, scaling training to even larger vocabularies, and applying GroC in a large pretraining setting to expand its zero-shot generalization. A Supplementary Material for "Grounded Compositional Outputs for Adaptive Language Modeling" We report here the computer infrastructure, experimental details, including hyperparameter bounds, hyperparameter optimal values, training speed, development scores, for both of the experiments where applicable. We also provide a comparison with state of the art by taking into account the number of model parameters and guide the reader through the replication effort we did to reproduce the neural cache by Grave et al. (2017a) . For the experiments with a closed vocabulary on penn 5 and wikitext-2, 6 we used the following computing infrastructure: 5 GeForce RTX 2080 Ti gpu cards. Our codebase is based on Pytorch 7 and is publicly available on Github. 8 The prefix network used by all output embedding methods is a vanilla recurrent neural network based on the implementation by Merity et al. (2017) 9 with 2 layers and 1024 LSTM units, regularized with hidden unit dropout of 0.65 along the lines of Grave et al. (2017a) . The maximum length of the relational and definitional forms from Wordnet is set to 3 and 10 without search based on our computational budget. 10 The embedding size is set to 300 for penn and 256 for wikitext2. For optimization we use Adam with a learning rate of 0.001, initial weight uniformly sampled in the range [−0.05, 0.05] , and a batch size of 20 for penn and wikitext2. We clip the norm of the gradient to 0.1 and unroll the network for 35 steps. The learning rate is multiplied by 0.1 if the development loss does not decrease for 4 consecutive epochs and we perform early stopping if there is no improvement for 8 consecutive epochs. 5 www.fit.vutbr.cz/˜imikolov/rnnlm/ simple-examples.tgz 6 s3.amazonaws.com/research.metamind. io/wikitext/wikitext-2-v1.zip 7 pytorch.org/get-started 8 github.com/Noahs-ARK/groc 9 github.com/salesforce/awd-lstm-lm 10 We expect that a larger budget would generally allow to increase these limits and obtain even better results. Table 7 : Hyperparameters, range of values, and, number of trials required to search them. Adaptive cutoffs are read as follows: e.g. for 253 the cutoff array contains 0.2 * n, 0.5 * n, 0.3 * n , n = |V| words per bin. For all methods, the hyperparameter selection of output embedding dropout rate (r), output network depth (k) and activation (act), linear "correction", and adaptive frequency cutoffs was conducted by grid search over specific range of values given in Table 7 on development data. Note that not all the hyperparameters apply to all methods, as can be seen in Table 8 where we report the optimal hyperparameter values for each of the methods. For all the baselines we performed exhaustive grid search on both datasets, but for our method we performed grid search only on penn and searched manually on wikitext-2 by selecting values of hyperparameters that were ranked high based on the grid search on penn to avoid the increased cost that comes with training our method (see speed comparison in Appendix B.4). The total number of trials for all methods including our ablations were 204 and 67 respectively for penn and wikitext-2 respectively. Note that the reduced number of trials is due to not performing exhaustive search for our method and its ablations as explained above. The number of trials per method can be derived by penn wikitext2 Method r cor cut k act r cor cut k act multiplying the non-zero columns per row with the number of trials required for each column. Table 9 displays the development scores and number of parameters along with the test perplexities for our model and all the baseline output embedding methods for our main experiment. The development scores for the models of the ablation study and for the base models of the coverage experiment have already been given in Table 3 Table 10 displays the average training speed per epoch in seconds for each of the methods. This experiment was run on a single, dedicated 11 GeForce RTX 2080 Ti. As we mentioned in Section 3.1, even though our model has vocabulary-size independent parameterization it is not independent of the computation that is required to encode the vocabulary. This has a negative impact on the training speed of GroC, making it a bit slower than the Convolutional method, namely 1.3× slower. Lookup table 0.1 - ---0.2 - --- Convolutional 0.1 128 ---0.1 182 --- Tied 0.0 - ---0.0 - --- Bilinear 0.5 - ---0.4 - --- Deep residual 0.5 - -4 selu 0.6 - -1 selu Adaptive 0.3 -2k7k --0.2 -6k21k -- GroC (ours) 0.2 - -0 -0.2 - -1 relu − relations 0.3 - -0 -0.3 - -1 selu − definitions 0.2 - -0 -0.3 - -2 relu − both 0.3 - -0 -0.3 - -1 selu To mitigate this problem we recommend training GroC with sparse updates for the output embedding parameters as described in the main paper (Section 3.4). Concretely, at each training iteration with probability p we make a full update and keep the output embedding frozen otherwise. The rest of the network is trained with full updates as before. We can observe that this optimization strategy makes GroC nearly as efficient as the base-lines with p = 0.1 or p = 0.3. In particular, it becomes even faster than the convolutional baseline by 2.1×. Furthermore, our best model with p = 0.3 which is much faster reaches 75.3 perplexity on penn without additional hyperparameter optimization which is still −4 points lower than the second best, adaptive output embedding; tuning the model from scratch should likely lead to even better results. This is quite encouraging because it means that the benefits of our model need not come with a large computational cost. In future work, the training speed could be optimized even further by devising specialized efficient training methods for compositional outputs. Table 10 : Training speed for each method. We report the average time in seconds to complete one epoch. Table 11 displays several state-of-the-art models which have number of parameters ranging from 9M to 20M on Penn Treebank. We can observe that our model which has only 9.7M parameters achieves better performance than all the models that have lower than or equal to 21M parameters and even the model by Inan et al. (2017) which has 24M parameters. Note that our model has lower perplexity than the pointer sentinel mixture model by Merity et al. (2017) and the neural cache model by Grave et al. (2017a) while having 11M less parameters than them. Moreover, it is very close to the other models which have around 23-25M parameters without being highly regularized (weight dropout, input dropout) or having advanced optimization strategies (SGD + ASGD, finetuning) like AWD-LSTM (Merity et al., 2017) . Training larger models and Ours -LSTM 10M 86.2 Ours -LSTM + GroC (sur,rel,def) 9.7M 69.5 Table 11 : Comparison with state-of-the-art models of comparable size to that of Grave et al. (2017a) and Merity et al. (2017) on the penn dataset. investigating the potential of competing with even higher capacity models is an interesting direction which we hope will be explored in future studies. For the experiment in cross-domain language modeling, we used the following computing infrastructure: 2 GeForce RTX 2080 Ti and 2 TITAN RTX GPUs to train and finetune our GroC models, and 2 Tesla P100 GPUs to train and finetune the baselines and to perform hyperparameter search. Figures 4 and 5 show the loss on the training and validation data for the target domain during finetuning. GroC generalizes better from the training to the validation data than the tied model, consistently having lower validation loss. The training loss for GroC consistently starts out lower than that the of the tied model, showing that it has less difficulty adapting to the new data, and ends up higher, indicating greater regularization vs the tied model. The web dataset is a clear outlier, in which the tied model improves much more dramatically than in any other domain. The difference in validation performance here is reflected in the test perplexity (Table 5 ) but does not have a clear explanation. As described in Section 5, the choice of data and preprocessing used for the cross-domain experiments are based on Grave et al. (2017a) . News Crawl and Common Crawl can be downloaded from the WMT 2014 website. 12 WikiText-103 was downloaded from Salesforce website 13 . For the News Crawl datasets, the first 2M tokens of the English data for each year were used as the train 12 www.statmt.org/wmt14/translationtask.html 13 blog.einstein.ai/the-wikitext-longterm-dependency-language-modelingdataset/ set, the next 2M tokens as the validation set, and the next 10M tokens as the test set. The same procedure was used for web (Common Crawl), for which we used the English portion of the English-German aligned data. While Grave et al. (2017a) describes the Common Crawl data as shuffled at the sentence level, we found that most sentences seemed closely related to adjacent sentences, so after creating train/valid/test splits for this dataset we re-shuffled each file. WikiText-103 comes divided into train/valid/test splits, so we used the first 2M/2M/10M tokens of each split respectively for our dataset. All data was then tokenized using the Europarl tokenizer 14 and lowercased. Our data preprocessing can be replicated with the script create-data.sh, available with the code for GroC. 15 14 statmt.org/europarl/v7/tools.tgz 15 github.com/ Because no target-domain training is required for most of our cross-domain experiments, validation scores were not computed for most model-domain combinations; however, we report the validation perplexity for the finetuned models in Table 12 , to aid in replication. Cache hyperparameters were selected via grid search, with θ, the flattening hyperparameter described in Grave et al. (2017c) , ranging over 5 values from 0 to 1, and λ ranging over 5 values from 0.833 to 0.966 (bounds which were selected based on the optimal hyperparameter ranges in (Grave et al., 2017c) ). Perplexity of a model trained on 2007 and evaluated on the 2008 validation set was the metric used to select the optimal hyperparameters: λ = 0.966 for unigram and neural cache and θ = 0.5 for neural cache. Because the cache is only used during evaluation, this hyperparameter search was quite efficient to carry out using the tied model, requiring no additional training, only 25 evaluation runs on the validation set. This hyperparameter search is illustrated in Figure 6 . We then used the same hyperparameters for all cache models. This provides a slight advantage to the tied model, as the optimal hyperparameters for GroC might be different from those selected with the tied model. A cache size of 5,000 was used during hyperparameter tuning, but at test time we used 10,000 for all experiments based on its use in Grave17. Figure 7 shows a separate hyperparameter search performed over the penn validation set to confirm the accuracy of our neural cache reimplementation. Compare to Figure 2a in Grave et al. (2017c) ; note their λ is 1 minus ours. For GroC, we also selected a downweighting hyperparameter dw, based on validation performance on the wiki dataset only. We searched over 5 values (0.1, 0.3, 0.5, 0.7, and 0.9) using GroC with the neural cache, and selected dw = 0.1 as the best value with a validation ppl of 154.01. Code: https://github.com/Noahs-ARK/groc Note that the input embeddings are passed through the prefix encoder f , which uses additional parameters to create the hidden state ht−1. Note that we chose not to use a linear "correction" with GroC since it deviates from our goal of having a vocabularyindependent parameterization, but it could be applied to GroC in the future for additional improvements. By dedicated GPU card here we mean that no other processes were using the GPU card when we performed the experiments for each of the methods. 3.1 Compositional Input Embeddings
3.2 Compositional Output Embeddings
3.3 Bias
3.4 Training
4 Conventional Language Modeling
4.1 Experimental Setup
4.3 Analysis
5 Cross-Domain Language Modeling
5.1 Experimental
5.2 Results
6 Conclusion
B Conventional Language Modeling
B.1 Model Configuration
B.2 Hyperparameter Optimization
B.4 Training Speed
B.5 Comparison With State-Of-The-Art Models
C Cross-Domain Language Modeling
C.1 Finetuning Dynamics
C.2 Data
C.3 Finetuning Validation Results
C.4 Hyperparameter Selection