Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

Structured Self-Attention Weights Encode Semantics in Sentiment Analysis

About

Neural attention, especially the self-attention made popular by the Transformer, has become the workhorse of state-of-the-art natural language processing (NLP) models. Very recent work suggests that the self-attention in the Transformer encodes syntactic information; Here, we show that self-attention scores encode semantics by considering sentiment analysis tasks. In contrast to gradient-based feature attribution methods, we propose a simple and effective Layer-wise Attention Tracing (LAT) method to analyze structured attention weights. We apply our method to Transformer models trained on two tasks that have surface dissimilarities, but share common semantics---sentiment analysis of movie reviews and time-series valence prediction in life story narratives. Across both tasks, words with high aggregated attention weights were rich in emotional semantics, as quantitatively validated by an emotion lexicon labeled by human annotators. Our results show that structured attention weights encode rich semantics in sentiment analysis, and match human interpretations of semantics.

Zhengxuan Wu, Thanh-Son Nguyen, Desmond C. Ong• 2020

Related benchmarks

TaskDatasetResultRank
Negative temporal attributionFordA
Δŷc (2%)-0.05
14
Temporal AttributionFORD-A
I(100)76.47
14
Time Series AttributionSeqComb-UV synthetic (test)
AUPRC24
14
Negative temporal attributionEEG
Δŷc (2%)0.06
13
Negative temporal attributionAudio
Δŷc(2%)-0.13
13
Temporal AttributionAudio
I(100)69.15
13
Temporal AttributionEEG
I(100)63.16
13
Time Series AttributionSeqComb-MV synthetic (test)
AUPRC23
13
Time Series AttributionFreqSum synthetic (test)
AUPRC0.35
13
Time Series AttributionLOWVAR synthetic (test)
AUPRC8
13
Showing 10 of 10 rows

Other info

Follow for update