Abstract
Recurrent Neural Networks are showing much promise in many sub-areas of natural language processing, ranging from document classification to machine translation to automatic question answering. Despite their promise, many recurrent models have to read the whole text word by word, making it slow to handle long documents. For example, it is difficult to use a recurrent network to read a book and answer questions about it. In this paper, we present an approach of reading text while skipping irrelevant information if needed. The underlying model is a recurrent network that learns how far to jump after reading a few words of the input text. We employ a standard policy gradient method to train the model to make discrete jumping decisions. In our benchmarks on four different tasks, including number prediction, sentiment analysis, news article classification and automatic Q&A, our proposed model, a modified LSTM with jumping, is up to 6 times faster than the standard sequential LSTM, while maintaining the same or even better accuracy.
Introduction
Standard Recurrent Neural Networks (RNNs) and Long Short-Term Memory (LSTM) networks are fundamental to modern natural language processing. However, their strictly sequential nature imposes a significant efficiency bottleneck: to process a document, they must iterate through every token. This $O(N)$ complexity makes inference prohibitively slow for long-form content like legal documents or novels. In contrast, human readers naturally skim text, identifying key information and skipping redundant filler. This paper introduces a "selective reading" capability to neural networks, aiming to improve both computational efficiency and the handling of long-range dependencies.
Methodology: The LSTM-Jump Architecture
The proposed LSTM-Jump model modifies the standard LSTM to incorporate a "read-then-jump" cycle. Instead of processing every token, the model follows a structured policy:
- Read: The model processes a fixed number of tokens ($R$).
- Decide: A "jumping softmax" layer, conditioned on the current hidden state, outputs a probability distribution over potential jump sizes (from 0 to a maximum $K$).
- Jump: The model samples a jump size $\kappa$ and skips the subsequent $\kappa$ tokens.
- Stop: This cycle repeats until the model predicts a jump of 0, reaches a maximum jump limit ($N$), or reaches the end of the sequence.
Because the jumping action is discrete and non-differentiable, the policy is trained using the REINFORCE algorithm. The model is rewarded for correct predictions, learning to associate specific textual patterns with the decision to skip ahead. To stabilize training, a curriculum learning approach was employed, starting with short sequences before progressing to full-length documents.
Experimental Setup
The model was evaluated across several diverse NLP tasks to test its versatility:
- Synthetic Number Prediction: A controlled task where the first token indicates the index of the target answer.
- Sentiment Analysis: Word-level classification using the Rotten Tomatoes and IMDB datasets.
- News Classification: Character-level processing on the AG News corpus.
- Question Answering: Sentence-level skimming using the Children’s Book Test (CBT).
Results and Discussion
Experimental results demonstrate that LSTM-Jump provides substantial efficiency gains without sacrificing performance. In many cases, the model actually outperformed the standard LSTM.
Skimming as a Noise Filter
A key finding is that jumping can act as a context filter. By skipping irrelevant segments, the model prevents its hidden state from being "polluted" by noise, which often improves accuracy on long-range dependency tasks. For instance, on the Children’s Book Test, LSTM-Jump was 1.4% to 4.4% more accurate than the baseline.
Efficiency and Speedups
The most dramatic speedups occurred in tasks where processing individual tokens is costly or sequences are very long. On the synthetic task, the model achieved a staggering 66x speedup compared to a standard LSTM when handling sequences of length 1000.
On real-world sentence-level Q&A tasks, the model achieved a 6x speedup. However, character-level tasks showed less benefit, as the mathematical overhead of the jumping policy occasionally outweighed the savings from skipping single characters.
Conclusion
LSTM-Jump demonstrates that neural networks can learn to skim text effectively using reinforcement learning. By making discrete jumping decisions, the model achieves significant speedups and often improves accuracy by filtering out irrelevant information. Future work may involve integrating these jumping mechanisms with attention layers or exploring more stable inference strategies like beam search.
Summary updated