TwiBot-22: Towards Graph-Based Twitter Bot Detection

Shangbin Feng, Zhaoxuan Tan, Herun Wan, Ningnan Wang, Zilong Chen, Binchi Zhang, Qinghua Zheng, Wenqian Zhang, Zhenyu Lei, Shujie Yang, Xinshun Feng, Qingyue Zhang, Hongrui Wang, Yuhan Liu, Yuyang Bai, Heng Wang, Zijian Cai, Yanbo Wang, Lijing Zheng, Zihan Ma, Jundong Li, Minnan Luo

Introduction

Twitter bots have evolved significantly from simple automated scripts into sophisticated "social spambots." These modern entities are designed to evade traditional detection by mimicking human behavior, stealing content from genuine users to mask text signatures, and manipulating metadata to bypass feature-based filters. Despite the growing threat, existing research has been hampered by datasets that lack scale, structural complexity, and high-quality annotations.

TwiBot-22 addresses these challenges by introducing a massive, heterogeneous graph-based benchmark. With 1 million users and a comprehensive evaluation framework, it provides a new standard for the field, demonstrating that while graph-based detection represents the current state-of-the-art, significant hurdles in scalability and generalization remain.

The Limitations of Existing Research

The authors identify three critical gaps in the current landscape of Twitter bot detection:

  1. Limited Scale: Most existing datasets are too small to capture the vast diversity of the "Twittersphere," often focusing on specific events or small subsets of users.
  2. Incomplete Structure: Previous datasets typically focused on simple "follow" relationships. This ignores the rich web of interactions—retweets, mentions, hashtags, and list memberships—that define social media behavior.
  3. Low Annotation Quality: Many datasets rely on noisy crowdsourcing or simple heuristics, leading to high false-positive rates and unreliable training data.

The TwiBot-22 Methodology

To overcome these hurdles, the researchers developed a multi-stage approach to construct a more robust benchmark.

Diversity-Aware Collection

Instead of a standard crawl that might over-represent highly active or famous accounts, the team utilized a "diversity-aware" Breadth-First Search (BFS). This method ensures the dataset captures users from the "long tail" of the distribution, providing a more representative sample of both human users and various bot "species."

Heterogeneous Graph Construction

TwiBot-22 moves beyond user-to-user links. It is constructed as a heterogeneous graph featuring four entity types—Users, Tweets, Lists, and Hashtags—and 14 distinct relation types, such as likes, mentions, owns, and discusses. The resulting graph is massive, encompassing over 92 million nodes and 170 million edges.

Expert-in-the-Loop Labeling

To label 1 million users accurately, the researchers employed the Snorkel weak supervision framework. They began with 1,000 expert-labeled users and used these to "program" a set of labeling functions based on keywords, metadata, and pre-trained models. This approach achieved a 90.5% accuracy against a hidden test set of expert labels, far surpassing the ~80% accuracy typical of crowdsourced datasets.

Benchmarking and Evaluation

The researchers re-implemented 35 representative bot detection baselines, ranging from traditional feature-based models (like Random Forests) to advanced Graph Neural Networks (GNNs) such as the Relational Graph Transformer (RGT). These models were tested across nine different datasets to ensure a fair, "apples-to-apples" comparison.

Key Insights

The benchmarking process revealed several critical findings for the future of bot detection:

  • The Graph Advantage: The structure of social interaction is much harder for bots to fake than profile text or metadata. Graph-based models consistently dominated the top performance spots, outperforming text-based methods by significant margins.
  • The Scalability Wall: Many high-performing models designed for smaller datasets failed to scale to the 1-million-user TwiBot-22 graph. Out-of-memory errors were common, highlighting an urgent need for more computationally efficient GNN architectures.
  • The Generalization Challenge: By analyzing sub-communities (e.g., crypto vs. politics), the researchers found that models trained on one niche often perform poorly on others. This suggests that bots adapt their behavior to specific contexts, making a "universal" detector elusive.

Results and Performance

Graph-based approaches, specifically BotRGCN and RGT, achieved the highest accuracy. They outperformed feature-based models by an average of 13.8% on TwiBot-20 and 8.2% on TwiBot-22. Furthermore, ablation studies confirmed the necessity of the graph structure; removing the network component from graph-based models led to a sharp drop in F1-score, sometimes as high as 25%.

Conclusion and Future Directions

While TwiBot-22 represents a significant leap forward, the authors acknowledge several areas for future growth. Current baselines do not yet leverage multimodal data, such as images or videos, which bots increasingly use to appear human. Additionally, while the framework excels at identifying individual bots, future work must address coordinated "bot armies" through subgraph-level detection.

TwiBot-22 provides the community with a high-quality, large-scale resource to push the boundaries of graph-based social media moderation. The benchmark and evaluation framework are publicly available at https://twibot22.github.io/.

Summary updated

BibTeX
@inproceedings{feng2022twibot,
  author = {Shangbin Feng and Zhaoxuan Tan and Herun Wan and Ningnan Wang and Zilong Chen and Binchi Zhang and Qinghua Zheng and Wenqian Zhang and Zhenyu Lei and Shujie Yang and Xinshun Feng and Qingyue Zhang and Hongrui Wang and Yuhan Liu and Yuyang Bai and Heng Wang and Zijian Cai and Yanbo Wang and Lijing Zheng and Zihan Ma and Jundong Li and Minnan Luo},
  title = {{TwiBot-22: Towards Graph-Based Twitter Bot Detection}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
}
Figure