Abstract
As a new trend in Natural Language Processing (NLP), prompt tuning has been explored to provide a reliable answer without requiring massive labeled samples and training learning in sentiment and emotion detection tasks. However, how to effectively encode the commonness and uniqueness across different affections into prompts sets a limit to the potential of multi-affection joint detection. To fill this gap, we propose a multi-affection prompt (MAP) learning framework that takes both the commonness of multiple affections and the uniqueness of specific affection into consideration. More specifically, two different prompt encoders are first proposed to elaborate the multi-task shared prompt and the task-specific prompt, respectively. Second, a multi-task prompt interaction learning layer is proposed to capture the correlation between the multi-task and task-specific prompts. MAP adopts separate multi-task and task-specific prompts to learn different vectors for different affection tasks, thus mitigating the affection discrepancy of the [MASK] token in the masked language modeling task. Extensive experiments on two benchmark datasets show that our proposed method can significantly improve the multi-task generalization capability of PLMs, and yield better results than other state-of-the-art (SOTA) baselines, by the margin of 2.7% and 3.4%.
Introduction
In Natural Language Processing (NLP), detecting a user's state of mind is rarely a single-task problem. Sentiment (positive/negative), emotion (joy/anger), and sarcasm are deeply intertwined. For example, a sarcastic comment often uses "positive" words to convey a "negative" sentiment. Traditional "fine-tuning" of large models is computationally expensive. While "prompt tuning"—where a template like "It is [MASK] emotion" guides the model—is more efficient, it faces the [MASK] Discrepancy hurdle. A single prompt often struggles to capture the distinct distributions of different tasks simultaneously, often ignoring the unique linguistic markers that distinguish sarcasm from simple anger.
The MAP Framework
The proposed Multi-Affection Prompt (MAP) framework operates in two pivotal stages to balance shared emotional "commonness" with task-specific "uniqueness."
- Specialization Stage: Instead of one-size-fits-all prompts, the model uses two types of encoders (built with BiLSTM and MLP layers) to generate "soft prompts" (trainable vectors). These include Task-Specific Prompts for sentiment, emotion, and sarcasm, and Multi-Task Shared Prompts that capture correlations between task groups.
- Generalization Stage: A Multi-task Prompt Interaction Layer (MPIL) uses a gating mechanism to dynamically weight these prompts based on the input text. This allows the model to prioritize sarcasm-specific knowledge or general-sentiment knowledge as needed for a specific sentence.
Finally, these optimized prompts are fed into a Pre-trained Language Model (PLM) to predict labels for each task simultaneously using multiple [MASK] tokens.
Key Insights and Ideas
- The Power of "Soft" Prompts: Unlike static "hard" prompts, MAP uses continuous vectors learned during training, allowing for nuanced tuning of the model's internal knowledge.
- Multiple Masks for Multiple Tasks: By using separate
[MASK]tokens for sentiment, emotion, and sarcasm within a single template, the model avoids the confusion of forcing one token to represent three different distributions.
- Optimal Context Range: Research found that including the two previous utterances in a conversation provides the best balance of context without introducing degrading "noise."
- Synergy Between Affections: Results confirm that joint detection is superior to single-task detection; identifying sarcasm inherently improves the model's ability to identify underlying negative sentiments.
Evaluation and Results
The model was evaluated on three diverse benchmarks: Memotion (English memes), MUStARD (English conversational sarcasm), and CMMA (Chinese multi-modal multi-affection conversation).
Key results include:
- Superiority over SOTA: MAP achieved a significant performance boost over previous state-of-the-art models, improving results by 2.7% on Memotion and 3.4% on MUStARD.
- LLM Integration: While compatible with BERT, the framework scales with LLMs. Using GPT-3.5 as the backbone yielded a 80.05% F1-score for sarcasm detection on MUStARD.
- Few-Shot Efficiency: The model reached high accuracy with as few as 10–20 labeled samples, making it practical for data-scarce domains.
Conclusion
While the MAP framework significantly advances multi-task affection detection, challenges remain regarding the interpretability of "soft prompts" and the overall transparency of the decision-making process. Future work will focus on capturing deeper inter-task dependencies and improving prompt explainability to build more trustworthy AI systems.
Summary updated