A Transformer and Prototype-based Interpretable Model for Contextual Sarcasm Detection

Ximing Wen, Rezvaneh Rezapour
3/14/2025
cs.CL

No official code found. Best implementation: social-nlp-lab/Sarcasm-Detection (0 stars, last commit 2026-02-04).

Abstract

Sarcasm detection, with its figurative nature, poses unique challenges for affective systems designed to perform sentiment analysis. While these systems typically perform well at identifying direct expressions of emotion, they struggle with sarcasm's inherent contradiction between literal and intended sentiment. Since transformer-based language models (LMs) are known for their efficient ability to capture contextual meanings, we propose a method that leverages LMs and prototype-based networks, enhanced by sentiment embeddings to conduct interpretable sarcasm detection. Our approach is intrinsically interpretable without extra post-hoc interpretability techniques. We test our model on three public benchmark datasets and show that our model outperforms the current state-of-the-art. At the same time, the prototypical layer enhances the model's inherent interpretability by generating explanations through similar examples in the reference time. Furthermore, we demonstrate the effectiveness of incongruity loss in the ablation study, which we construct using sentiment prototypes.

View on arXivView PDF

Code Implementations(1)

A Transformer and Prototype-based Interpretable Model for Contextual Sarcasm Detection

00Feb 4, 20268 months ago

Similar Papers

Cite this paper

@article{wen2025transformer,
  title  = {A Transformer and Prototype-based Interpretable Model for Contextual Sarcasm Detection},
  author = {Ximing Wen and Rezvaneh Rezapour},
  year   = {2025},
  eprint = {2503.11838},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2503.11838v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2503.11838.svg)](https://codeofpaper.com/paper/2503.11838)

Discussion