TL;DR
Emojis are vital for conveying nuance in social media, yet standard NLP models often treat them as mere noise or plain Unicode characters. This paper introduces a self-supervised heterogeneous graph pre-training framework that models posts, words, and emojis together. By capturing these intricate interactions, the method generates universal emoji embeddings that significantly boost the performance of large language models (LLMs) on downstream tasks like popularity prediction and sentiment analysis.
What Problem Does This Paper Address?
Emojis aren't just text decorations; they convey critical emotional nuance, sarcasm, and cultural context. However, current NLP approaches struggle to integrate them effectively. Some pipelines strip them entirely, others treat them as random tokens without semantic priors, and some translate them into text descriptions (which fails for platform-specific or evolving emoji meanings).
Crucially, existing methods fail to capture the complex, reciprocal relationship between the text context and the emojis used. Emojis in similar texts share semantics, and texts with similar emojis often share sentiments. The authors address this gap by developing a method that jointly models words, emojis, and the overall post context without relying on expensive human annotations.
Methods
The authors propose a post-emoji-word heterogeneous graph structure to map out social media content, paired with a self-supervised pre-training framework.
1. Heterogeneous Graph Construction
The graph consists of three node types:
- Post Nodes: Captures the global context of the entire post.
- Word Nodes: Represents the vocabulary across all posts.
- Emoji Nodes: Represents the top-$K$ most frequent emojis.
Edges are explicitly defined to capture interactions: Post-Emoji edges connect posts to their constituent emojis; Post-Word edges link posts to key topical words (filtered via hashtags to reduce noise); and Word-Emoji edges connect emojis to their immediate $k$-step neighbor words to capture local context.
2. Self-Supervised Pre-Training Tasks
To facilitate information flow across the graph, the model undergoes two pre-training tasks:
- Node-level Sub-graph Contrastive Learning: Random walks sample sub-graphs starting from a specific node. An InfoNCE loss maximizes the similarity between sub-graphs derived from the same starting node versus different nodes, helping the model learn structural similarities.
- Edge-level Link Reconstruction Learning: The model learns to predict whether an edge exists between different node types using a binary cross-entropy loss, forcing it to master cross-element interactions.
Once pre-trained via a Graph Isomorphism Network (GIN), these universal emoji embeddings can be seamlessly merged with text representations from standard backbones like BERT, RoBERTa, or LLaMA2.
Datasets
The framework was evaluated on two distinct datasets:
- Xiaohongshu Dataset: A proprietary dataset containing over 4 million posts from the popular Chinese social media platform. It includes text, emojis, likes, collects, and comments, and was used to evaluate a multi-class popularity prediction task.
- Twitter Dataset: A public dataset originally curated for the emoji2vec benchmark, containing tweets annotated with three sentiment labels (positive, neutral, negative).
Key Insights and Ideas
- The Power of Heterogeneity: Treating posts, words, and emojis as distinct node types allows the graph neural network to naturally resolve contextual ambiguity. For instance, the same emoji can mean entirely different things depending on the post node it connects to.
- Emergent Semantic Clustering: Without any explicit semantic supervision, the self-supervised graph tasks naturally group emojis by emotional and functional similarity.
As seen in the t-SNE visualization (Figure 2), the proposed method cleanly separates emojis representing happiness (upper left) from sad emotions (upper right), while grouping numbers and objects into their own distinct regions. Baselines like raw BERT or Gaussian random initialization result in completely scattered distributions.
Key Results
The proposed model consistently outperformed strong baselines (such as removing emojis, treating them as plain tokens, or using emoji2vec) across various LLM backbones (BERT, GPT-2, RoBERTa, OPT-1.3B, and LLaMA2-7B).
- Popularity Prediction (Xiaohongshu): The framework achieved a 2% to 10% absolute improvement in weighted F1 scores across all sub-tasks (predicting likes, collects, and comments). For example, when paired with LLaMA2-7B, the model pushed the F1 score for comment prediction up to 0.4695 compared to the baseline's 0.4134.
- Sentiment Classification (Twitter): The model achieved a top weighted F1 score of 0.5679, outperforming specialized emoji models like SEntiMoji (0.5512) and DeepMoji (0.5294).
Limitations and Future Work
- Modality Constraints: The framework is strictly text/Unicode-based. It currently lacks the capability to process custom, image-based emojis or stickers, which are increasingly prevalent on modern social platforms. The authors plan to explore multimodal graph approaches to address this.
- Tokenization Dependency: The model's efficacy hinges heavily on accurate emoji tokenization during preprocessing. If a platform uses non-standard emoji strings that resist clean tokenization, the model's performance can degrade.
Summary updated