TL;DR
Sarcasm detection in social media is notoriously difficult because the exact same sentence can be literal or sarcastic depending entirely on who says it. This paper introduces CUE-CNN, a deep learning model that automatically learns user embeddings from historical posts to capture this vital speaker context. By combining text analysis with these automatically generated user profiles, the model eliminates the need for tedious manual feature engineering and outperforms state-of-the-art models by over 2% in absolute accuracy.
What Problem Does This Paper Address?
Sarcasm is inherently contextual. For instance, a tweet reading "Obama is doing a great job" cannot be accurately classified without knowing the author's political leanings. Traditional Natural Language Processing (NLP) approaches struggle here because they rely almost exclusively on lexical and syntactic cues within the text itself.
To fix this, prior state-of-the-art systems relied on extensive, labor-intensive manual feature engineering—scraping user profiles, building sentiment lexicons, running topic models, and tracking historical audience interactions. While effective, this approach is brittle, expensive to deploy, and platform-dependent. The authors tackle this bottleneck by asking: Can a neural network automatically learn to represent a user's contextual background purely from their past text, without any manual feature crafting?
Methods
The authors propose the Content and User Embedding Convolutional Neural Network (CUE-CNN) framework, which splits the task into content modeling and context modeling:
- User Embeddings (User2Vec): Inspired by Paragraph Vector models, the authors learn low-dimensional vector representations for users. The model optimizes the probability of a word occurring in a tweet based on both its neighboring words and the identity of the author. To ensure the model captures unique user traits rather than common stop words, they use a hinge-loss objective with negative sampling drawn from a global unigram distribution. This forces the embedding to focus on what makes a specific user's vocabulary distinctive.
- CUE-CNN Architecture: The target tweet's text is passed through a standard Convolutional Neural Network (CNN) with max-pooling to extract high-level content features. This content vector is then concatenated with the pre-trained user embedding. Crucially, these combined vectors are passed through a non-linear hidden layer to explicitly model the interaction between the speaker and the text before making a final classification via a softmax layer.
Datasets
- Twitter Sarcasm Corpus: A subset of the dataset originally curated by Bamman and Smith (2015). Sarcastic labels were derived via self-declared hashtags (
#sarcasmor#sarcastic). The final evaluation dataset contains 11,541 tweets across 12,500 unique users. - Historical User Data: For each user in the dataset, the authors scraped up to 1,000 historical tweets to train the user embeddings.
- Word Embedding Pre-training: Word vectors were pre-trained on a massive combination of Owoputi et al.’s 52-million unlabeled tweet dataset, the sarcasm corpus, and an additional 5 million historical tweets.
Key Insights and Ideas
- Homophily from Text Alone: T-SNE projections of the learned user embeddings revealed that they naturally cluster users by latent traits like political leanings and sports interests. The model uncovers these communities purely from word-usage patterns, without ever looking at explicit profile metadata or follower graphs.
- The "Who Said What" Interaction: Simply appending user data to text features isn't enough. Introducing a hidden layer that models the interaction between the text content and the user embedding provides a significant performance boost. This mirrors how humans interpret sarcasm—by jointly evaluating the speaker and the utterance together.
- Smart Negative Sampling Matters: Sampling negative words from a global unigram distribution (instead of uniformly at random) improved model accuracy by 0.8%. This choice effectively pushes user vectors away from non-informative, universally common words and pulls them closer to the user's truly discriminative vocabulary.
Key Results
- The full CUE-CNN + User2Vec model achieved an accuracy of 87.2%.
- This performance comfortably beats the highly optimized, feature-engineered baseline model of Bamman and Smith (which achieved 85.1% originally, and 83.1% on this paper's specific data subset).
- Context proved to be the defining factor: a text-only CNN achieved only 74.2% accuracy. Adding automatically learned user embeddings provided a massive ~13% absolute performance boost.
Limitations and Future Work
- Data Scarcity and Volatility: Due to Twitter API rate limits and account deletions, the authors could only collect 1,000 historical tweets per user (compared to 3,200 in the original baseline study), and some data was permanently lost.
- Audience Context: While the model does an excellent job capturing the author's background, sarcasm is also highly dependent on the relationship between the speaker and the listener. The authors note that future work should expand the embedding space to incorporate audience interactions and relationships directly into the neural framework.
Summary updated