SeGA: Preference-Aware Self-Contrastive Learning with Prompts for Anomalous User Detection on Twitter

Ying-Ying Chang, Wei-Yao Wang, Wen-Chih Peng

Abstract

In the dynamic and rapidly evolving world of social media, detecting anomalous users has become a crucial task to address malicious activities such as misinformation and cyberbullying. As the increasing number of anomalous users improves the ability to mimic normal users and evade detection, existing methods only focusing on bot detection are ineffective in terms of capturing subtle distinctions between users. To address these challenges, we proposed SeGA, preference-aware self-contrastive learning for anomalous user detection, which leverages heterogeneous entities and their relations in the Twittersphere to detect anomalous users with different malicious strategies. SeGA utilizes the knowledge of large language models to summarize user preferences via posts. In addition, integrating user preferences with prompts as pseudo-labels for preference-aware self-contrastive learning enables the model to learn multifaceted aspects for describing the behaviors of users. Extensive experiments on the proposed TwBNT benchmark demonstrate that SeGA significantly outperforms the state-of-the-art methods (+3.5% ∼ 27.6%) and empirically validate the effectiveness of the model design and pre-training strategies.

Introduction

Social media platforms are increasingly plagued by anomalous users who spread misinformation and engage in harassment. While automated bots are relatively well-studied, human-controlled "trolls" present a much harder challenge. Because they are operated by humans, their network signatures and posting frequencies often mimic normal users, allowing them to evade detection systems that rely solely on graph topology or simple metadata. To catch a troll, detection systems must look beyond connectivity and focus on the substance of their interactions—their "preferences."

Methodology

The SeGA (Preference-Aware Self-Graph Anomaly Detection) framework operates in three main stages to capture these subtle behavioral nuances.

The SeGA architecture, illustrating node feature encoding, LLM-based pseudo-preference generation, and the self-contrastive pre-training stage.
  1. Node Feature Encoding: The model constructs a Heterogeneous Information Network (HIN) containing users and "Lists" (curated account selections). It encodes three types of features: indicators (e.g., verified status), numerical data (e.g., post counts), and textual data (descriptions and tweets encoded via RoBERTa).
  2. Preference-Aware Pre-training: This core innovation uses ChatGPT to analyze a user's recent posts and summarize their preferences into topic-emotion pairs (e.g., "The majority of posts express news with anger..."). These summaries serve as pseudo-labels. The model uses a self-contrastive loss (SimCSE-style) to ensure that users with similar LLM-summarized preferences have similar vector representations.
  3. Heterogeneous Encoding & Fine-tuning: A Relational Graph Transformer (RGT) processes the HIN to capture complex relationships such as following and membership in lists. Finally, the model is fine-tuned on labeled data to classify users into three categories: normal users, bots, and trolls.

Experimental Evaluation

We introduced a new benchmark dataset called TwBNT, built by extending the Twibot-22 dataset. To identify trolls, we utilized Bot Sentinel to generate "troll scores," re-labeling high-scoring users. The resulting dataset includes 100,001 users, 20,788 lists, and over 1.3 million edges.

Results and Ablation Study

SeGA significantly outperformed state-of-the-art baselines, including GCN, GAT, and specialized bot detectors like BotRGCN. It achieved a Macro F1-score of 60.69%, representing an improvement of 3.5% to 27.6% over other models.

Ablation study results showing the impact of removing Twitter Lists and the pre-training stage on Precision, Recall, and F1-score.

An ablation study confirms the necessity of the model's key components. As shown in the figure above, removing either the Twitter List data or the preference-aware pre-training stage leads to a significant drop in performance. The pre-training stage is particularly critical for the model's ability to describe multifaceted user behavior.

Conclusion

SeGA demonstrates the power of using LLMs as high-level feature extractors to guide graph neural networks. By summarizing user preferences, the model can detect the malicious intent that often leaks through topic choice and emotional tone, even when network behavior appears normal. Future work will investigate the use of additional metadata and few-shot prompting to further refine preference summaries and improve detection in cryptic or sarcastic contexts.

Summary updated

Abstract

In the dynamic and rapidly evolving world of social media, detecting anomalous users has become a crucial task to address malicious activities such as misinformation and cyberbullying. As the increasing number of anomalous users improves the ability to mimic normal users and evade detection, existing methods only focusing on bot detection are ineffective in terms of capturing subtle distinctions between users. To address these challenges, we proposed SeGA, preference-aware self-contrastive learning for anomalous user detection, which leverages heterogeneous entities and their relations in the Twittersphere to detect anomalous users with different malicious strategies. SeGA utilizes the knowledge of large language models to summarize user preferences via posts. In addition, integrating user preferences with prompts as pseudo-labels for preference-aware self-contrastive learning enables the model to learn multifaceted aspects for describing the behaviors of users. Extensive experiments on the proposed TwBNT benchmark demonstrate that SeGA significantly outperforms the state-of-the-art methods (+3.5% ∼ 27.6%) and empirically validate the effectiveness of the model design and pre-training strategies. Our code and data are publicly available at https://github.com/ying0409/SeGA.
BibTeX
@inproceedings{chang2024sega,
  author = {Ying-Ying Chang and Wei-Yao Wang and Wen-Chih Peng},
  title = {{SeGA: Preference-Aware Self-Contrastive Learning with Prompts for Anomalous User Detection on Twitter}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  url = {https://openreview.net/forum?id=POYvABBSGZ},
}
Figure