Diffusion-Centrality Context Selection for Sarcasm Detection

Sarcasm is often unreadable from the sentence alone. "Great, another Monday" means different things from a habitual joker and from someone who just got good news. Models therefore reach for context: earlier turns, the author's past posts, replies from others. The evidence on whether this helps is contradictory. Feeding the preceding conversation into BERT together with the reply made it worse than reading the reply alone (Kalaivani and Thenmozhi). Yet a small graph network over a Twitter interaction graph raised F1 from 69.9% to 84.2% (Plepi and Flek). Our reading is that context is not good or bad as a whole. A few pieces of it carry the signal, many pieces are redundant or distracting, and the open problem is choosing which few to show the text model.

We propose to make that choice with a tool from network science. Information diffusion centrality scores nodes by how far information starting from them would spread. Its entropy-renewal variant deliberately avoids picking several nodes from the same tight cluster. We adapt both to text by spreading relevance outward from the tweet being classified, over an interaction graph whose edges are weighted by language-model similarity. We then greedily select a small, structurally dispersed set of context posts and give them, as plain text, to an ordinary fine-tuned encoder. If this works, a cheap and inspectable selection step explains most of the gain that graph networks get from social context. It would also tell us which part of the context (author side or audience side) supports intended versus perceived sarcasm.

Core Claim

Under a fixed budget of $k$ context posts, selection by semantically weighted personalized diffusion plus neighborhood renewal will beat three alternatives fed to the same text encoder: recency-based context, similarity-based context, and the full unfiltered context. It will also close most of the gap to a graph attention network trained on the whole neighborhood. We further claim that much of the reported graph gain on social sarcasm data is sensitive to which nodes are visible. In particular, it is sensitive to posts written after the target tweet, including the "cue" replies that explicitly call the tweet sarcastic. Any fair comparison has to mask them.

The selection rule is explicit. Let $G$ be the heterogeneous graph of users and tweets around a target tweet $t$. Let $h_u$ be a frozen sentence embedding of node $u$, and let $a_{uv}$ be a learned-free weight for each edge type (reply, quote, mention, authorship, thread adjacency). We set edge weights

$$w_{uv} = a_{uv}\,\max(0, \cos(h_u, h_v)),$$

and compute personalized PageRank $s$ seeded at $t$ on the row-normalized $w$. This is a diffusion score: the stationary probability of a random walk that repeatedly restarts at the target. We then pick nodes greedily. After selecting $v^*$, we apply the renewal step of EnRenew (Guo et al.):

$$s_u \leftarrow \theta^{\,l+1-d(u,v^*)}\, s_u \quad \text{for all } u \text{ with } d(u,v^*) \le l,$$

where $d$ is hop distance, $\theta \in (0,1)$ is an attenuation factor, and $l=2$ is the reach Guo et al. found best on spreading benchmarks. The renewal step penalizes the "rich club": a dense cluster of near-duplicate posts by one user, or a pile-on of similar replies, that a pure ranking would select wholesale.

Relation to Prior Work

Three lines of work motivate this proposal. Graph-based sarcasm models show that structure helps but use it indiscriminately. ADGCN (Lou et al.) connects emotionally distant words inside a single sentence and runs a graph convolution, peaking at three layers before over-smoothing. It never looks beyond the sentence. Plepi and Flek's graph attention network aggregates every user and tweet neighbor of the target. EDGE (Ouyang et al.) builds an utterance-speaker-sentiment graph for generating explanations. None of the three ranks or prunes context nodes, which is the step we isolate.

Author-context work supplies the strongest non-graph competitor and a clear constraint. CASCADE-style user embeddings (Oprea and Magdy) reach 0.922 F1 on Ptáček from author history alone but only 0.739 on the perceived-sarcasm Riloff set. iSarcasm (Oprea and Magdy) shows models trained on hashtag-labelled sarcasm collapse to at most 0.364 F1 on author-labelled sarcasm. Together these say that context sources matter differently for intended and perceived sarcasm, which our side-specific seeding tests directly.

The selection method comes from two places. EnRenew contributes the entropy-and-renewal idea, which it developed only on unattributed networks such as router and email graphs. Graph-centrality text selection contributes the idea that central units make good anchors or compressed context: Sakshi et al. compress legal documents to a context budget, and Tian et al. find central entities act as reasoning anchors in retrieval-augmented generation. We differ from both by weighting edges with language-model similarity and by seeding the diffusion at the item being classified, rather than ranking global importance.

Hybrid text-graph encoders such as GraphFormers (Yang et al.) sample a fixed five neighbors uniformly, and the file lists this sensitivity to neighbor sampling as an open problem. Our selector is a drop-in replacement for that sampler, and we test it in that role.

One paper constrains us rather than motivating us. Ghavasieh et al. warn that elaborate entropy and spectral centralities are not reliably better than simple ones. We therefore treat plain personalized PageRank without renewal, and degree ranking, as first-class baselines rather than strawmen. We deliberately avoid spectral entropy, whose cost on million-tweet timeline graphs is hard to justify.

Research Program

The first stage builds leakage-controlled graphs. For SPIRS, the Twitter interaction graph with both intended and perceived labels that Plepi and Flek used, we reconstruct each target's neighborhood under a temporal mask. Only posts created before the target are visible, and cue tweets and oblivious replies are removed. We retrain the original graph attention network under this mask, alongside the unmasked setting. The size of the change is itself a result the field needs.

The second stage implements the selector as described and feeds the selected posts, ordered by score and tagged with their relation to the target ("author's earlier post", "reply from another user"), together with the target to a RoBERTa-base classifier. We also replace GraphFormers' uniform five-neighbor sampler with the selector, to test whether the gain is specific to concatenation or holds inside a fused text-graph encoder.

The third stage runs the analysis that addresses the intended-versus-perceived divergence. We seed the diffusion separately from the author's subgraph and from the audience subgraph (repliers and mentioned users), at matched budgets. We measure how each affects intended-label and perceived-label F1 on SPIRS. Our hypothesis, drawn from the CASCADE results, is that author-side context drives intended accuracy and audience-side context drives perceived accuracy. A cross-over in the gains would be direct evidence that the two tasks need different context. No such evidence exists in the file.

Baselines

The do-nothing reference is RoBERTa or BERT fine-tuned on the target tweet alone. Plepi and Flek report fine-tuned BERT at 69.9% F1 on SPIRS. On FigLang 2020, Kalaivani and Thenmozhi report response-only BERT at 0.722 F1 on Twitter and 0.679 on Reddit, with TF-IDF reaching 0.739 on Twitter. We rerun these with our encoder rather than relying on the reported figures, so that every comparison uses the same model.

The full-context reference concatenates all visible context, truncated to the encoder's length limit. This tests whether selection matters at all, and Kalaivani and Thenmozhi's result predicts it may underperform the response-only model.

The strongest existing method is the graph attention network of Plepi and Flek, reported at 84.2% F1 on SPIRS, against 73.4% for BERT plus user2vec. It is the strongest competitor because it already learns, through attention, which neighbors to weight, which is exactly what our selector tries to do without training. We run it on identical temporally masked graphs, with the same frozen sentence embeddings for node features, the same train and test splits, and the same hyperparameter budget of 30 trials per method. Beating it means matching or exceeding its masked-graph F1 with $k \le 8$ selected posts. We also expect to stay within two F1 points of it unmasked while using only text inputs, which makes the method transferable to settings without social graphs.

The user-history competitor is a CASCADE-style author embedding concatenated to the target (Oprea and Magdy). It is run on the same author timelines that our selector draws from.

Two ablations isolate the key ingredients. The first is personalized PageRank without renewal, which tests whether dispersion matters. The second is renewal on unweighted edges ($w_{uv} = a_{uv}$), which tests whether the language-model similarity weighting matters. We also include degree-ranked selection and $k$-core-based selection (Tixier et al.), to respect Ghavasieh et al.'s caution that simpler centralities may suffice.

Why not just…?

Why not just let the graph attention network learn which neighbors matter? This is the real threat. If the masked graph attention network clearly beats every budgeted selector, the proposal's main claim fails, and we will report it that way. Two things favor trying the selector anyway. First, attention is trained per graph and cannot be carried to conversation datasets without social structure, whereas a selector produces plain text that any encoder can read. Second, attention spreads weight over every neighbor, while Kalaivani and Thenmozhi's result suggests that unfiltered context actively hurts text encoders. The masked head-to-head comparison and the GraphFormers sampler swap settle the question.

Why not just pick the most semantically similar posts, with a diversity penalty such as maximal marginal relevance? This is the closest simple alternative, because it also trades relevance against redundancy, but in embedding space rather than over the graph. We run it at every budget. If it ties our selector, the interaction structure (who replied to whom) adds nothing beyond text similarity, and the diffusion component should be dropped. We expect structure to matter most for perceived sarcasm, where audience replies are often topically dissimilar to the target but structurally adjacent to it.

Why not just use the most recent turns or the author's latest posts? Recency is the default context choice in conversational sarcasm pipelines, and on short threads it may be optimal. FigLang threads are near-linear chains, where diffusion and recency nearly coincide. We use FigLang as a no-harm check rather than expecting gains there, and concentrate claims on SPIRS, where branching neighborhoods give selection room to differ from recency.

Why not just give a large language model all the context? On WITS, EDGE outperformed Video-LLaMA and Video-ChatGPT, with human raters preferring its explanations in over 60% of cases (Ouyang et al.). That suggests scale alone does not resolve sarcasm, though it is a different task. We include one instruction-tuned model given either full context or our selected context at equal token budgets. The test is whether selection helps it as well, which would make the selector useful regardless of the downstream model.

Proposed Experiments and Decisive Checks

The primary benchmark is SPIRS, evaluated under both the original and temporally masked graphs, with intended and perceived F1 reported separately. We sweep budgets $k \in \{2, 4, 8, 16\}$ and run five seeds per configuration, reporting mean and standard deviation.

Secondary benchmarks test transfer to settings without full social graphs. On FigLang 2020 Twitter and Reddit, the graph is the reply chain. On IAC v2 (Oraby et al.; Tay et al.), the graph is debate-thread structure. Where author timelines can be recollected, we also evaluate on Ptáček and Riloff against IN-W-CASCADE's 0.934 and 0.739 F1. For iSarcasm, the file gives only the hashtag-model ceiling of 0.364 and no graph, so it serves only as an out-of-distribution stress test for timeline-based selection if author timelines are available.

There are four decisive outcomes. First, the leakage check: how much of the 84.2% survives temporal masking. Second, the core test: whether diffusion with renewal beats similarity-plus-diversity selection and unrenewed PageRank at $k \le 8$ on masked SPIRS, by more than seed variance. Third, the side-specific analysis: whether author-seeded and audience-seeded context produce the predicted cross-over between intended and perceived F1. Fourth, a qualitative audit of 200 selected context sets, checking whether chosen posts contain the sentiment contrast with the target that ADGCN-style models look for within sentences.

If the first outcome shows heavy leakage and the second shows the selector wins, the result reframes how social context should be supplied to sarcasm models. If similarity-plus-diversity selection wins instead, the result cleanly shows that graph structure is not the active ingredient.