[Paper Review] Frustratingly Short Attention Spans in Neural Language Modeling
This paper proposes a key-value-predict attention mechanism in neural language models that decouples output representations for prediction, memory keying, and value retrieval, significantly improving perplexity over baseline LSTMs. Surprisingly, the model primarily relies on only the five most recent token representations, and a simple baseline using concatenation of the last three outputs matches or exceeds the performance of complex attention mechanisms.
Neural language models predict the next token using a latent representation of the immediate token history. Recently, various methods for augmenting neural language models with an attention mechanism over a differentiable memory have been proposed. For predicting the next token, these models query information from a memory of the recent history which can facilitate learning mid- and long-range dependencies. However, conventional attention mechanisms used in memory-augmented neural language models produce a single output vector per time step. This vector is used both for predicting the next token as well as for the key and value of a differentiable memory of a token history. In this paper, we propose a neural language model with a key-value attention mechanism that outputs separate representations for the key and value of a differentiable memory, as well as for encoding the next-word distribution. This model outperforms existing memory-augmented neural language models on two corpora. Yet, we found that our method mainly utilizes a memory of the five most recent output representations. This led to the unexpected main finding that a much simpler model based only on the concatenation of recent output representations from previous time steps is on par with more sophisticated memory-augmented neural language models.
Motivation & Objective
- To address the difficulty of training neural language models to leverage long-range dependencies by explicitly separating the roles of output representations.
- To investigate whether decoupling prediction, key, and value functions in attention mechanisms improves performance over standard attention mechanisms.
- To evaluate whether simpler models based on recent output concatenation can outperform complex memory-augmented architectures.
- To determine the effective attention span of memory-augmented neural language models in practice.
Proposed method
- The model outputs three distinct vectors at each time step: one for predicting the next word, one as a key for attention, and one as a value for memory retrieval.
- The attention mechanism computes context vectors using a learned compatibility function between the current hidden state and past memory keys, weighted by attention scores.
- A sliding window of the last L output representations is maintained as a differentiable memory, with attention computed over this window.
- The key-value-predict mechanism separates the output into three components: prediction, key, and value, reducing functional overload on individual vectors.
- A simple baseline model is introduced that concatenates the last three output representations to predict the next word, without attention or memory components.
- Experiments are conducted on the Wikipedia and Children’s Book Test (CBT) corpora to compare perplexity and accuracy across models.
Experimental results
Research questions
- RQ1Can decoupling prediction, key, and value functions in attention mechanisms improve neural language model performance?
- RQ2How effective are memory-augmented neural language models in capturing long-range dependencies in practice?
- RQ3Does a simple model based on concatenating recent output representations outperform more complex attention-based architectures?
- RQ4What is the effective attention span of state-of-the-art memory-augmented language models?
Key findings
- The key-value-predict model reduces perplexity by 9.4 points compared to a vanilla LSTM and 4.3 points over the RM(+tM-g) model on the Wikipedia corpus.
- On the CBT dataset, the key-value-predict model improves accuracy by 1.0 percentage points for verbs and 1.7 points for prepositions.
- Despite using attention over a memory window, all attentive models primarily attend to only the five most recent representations, indicating a short effective attention span.
- The simple $4$-gram RNN model, which concatenates the last three output representations, achieves perplexity comparable to or better than the more complex key-value-predict model.
- Increasing the attention window size does not significantly improve performance, suggesting limited utility of long-range memory in current architectures.
- The results indicate that training neural language models to exploit long-range dependencies remains notoriously difficult, even with attention mechanisms.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.