[Paper Review] Visualizing and Understanding Neural Models in NLP
This paper introduces visualization techniques to interpret neural network compositionality in NLP, using unit activation plotting and salience estimation via first-order derivatives. It reveals that LSTMs sharply focus on key words like 'hate' in negation and concessive clauses, outperforming standard RNNs in capturing semantic asymmetries, demonstrating that salience analysis can expose model behavior in meaning composition.
While neural networks have been successfully applied to many NLP tasks the resulting vector-based models are very difficult to interpret. For example it's not clear how they achieve {\em compositionality}, building sentence meaning from the meanings of words and phrases. In this paper we describe four strategies for visualizing compositionality in neural models for NLP, inspired by similar work in computer vision. We first plot unit values to visualize compositionality of negation, intensification, and concessive clauses, allow us to see well-known markedness asymmetries in negation. We then introduce three simple and straightforward methods for visualizing a unit's {\em salience}, the amount it contributes to the final composed meaning: (1) gradient back-propagation, (2) the variance of a token from the average word node, (3) LSTM-style gates that measure information flow. We test our methods on sentiment using simple recurrent nets and LSTMs. Our general-purpose methods may have wide applications for understanding compositionality and other semantic properties of deep networks , and also shed light on why LSTMs outperform simple recurrent nets,
Motivation & Objective
- To address the interpretability gap in neural NLP models, which lack transparency despite strong performance.
- To visualize how neural networks compose meaning from words and phrases, especially in cases like negation and intensification.
- To develop general-purpose methods for analyzing salience—how much each unit contributes to final output—using first derivatives.
- To compare model behaviors across architectures (e.g., LSTM vs. standard RNN) in capturing semantic compositionality.
- To provide initial insights into why certain architectures, like LSTMs, outperform others in handling complex linguistic phenomena.
Proposed method
- Plotting unit activation values across layers to visualize how representations evolve during composition, especially for negation and concessive clauses.
- Using first-order derivatives to compute salience—measuring each unit’s contribution to final output—via back-propagation through time.
- Applying saliency heatmaps in sequence-to-sequence autoencoders to visualize which input tokens influence each output token prediction.
- Introducing a variance-based salience measure: computing deviation of each word embedding from the sentence-level average embedding to identify salient words.
- Combining visualization techniques across multiple models (LSTM, Bi-LSTM, standard RNN, seq2seq autoencoder) to compare interpretability and behavior.
- Using reconstruction and back-propagation techniques inspired by computer vision, adapted to NLP’s sequential, word-based input structure.
Experimental results
Research questions
- RQ1How do neural models compose meaning in sentences with negation, intensification, or concessive clauses?
- RQ2What role does salience—measured via first derivatives—play in identifying key words that shape final predictions?
- RQ3How do different architectures (e.g., LSTM vs. standard RNN) differ in their ability to maintain focus on critical words during composition?
- RQ4To what extent can saliency maps and variance-based measures reveal local compositionality in neural networks?
- RQ5Can visualization techniques expose known linguistic asymmetries, such as the markedness of negation, in neural model behavior?
Key findings
- LSTM models exhibit sharper focus on key words like 'hate' in negation, with higher saliency values persisting through multiple layers, unlike standard RNNs.
- The saliency of 'hate' remains prominent even after 7–8 convolutional operations, indicating strong retention of semantic signal.
- Standard RNNs downplay the first clause in 'I hate the movie though the plot is interesting' despite correctly classifying the sentence as very negative, suggesting hidden information flow.
- Bi-LSTM models attend to both 'hate the movie' and 'plot is interesting', showing balanced attention to both clauses.
- Saliency heatmaps in seq2seq autoencoders show that each predicted word is linked back to its corresponding input region (e.g., 'hate' to 'hate'), demonstrating learned alignment.
- As decoding proceeds, the influence of input tokens diminishes while language model components dominate, indicating a shift from input-driven to autoregressive reasoning.
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.