![Arxiv:2104.06182V1 [Cs.CL] 13 Apr 2021 Tasks](https://data.docslib.org/img/3a60ab92a6e30910dab9bd827208bcff-1.webp)
Understanding Transformers for Bot Detection in Twitter Andres Garcia-Silva Cristian Berrio Jose Manuel Gomez-Perez Expert.ai Research Lab Expert.ai Research Lab Expert.ai Research Lab Prof. Waksman 10 Prof. Waksman 10 Prof. Waksman 10 28036 Madrid, Spain 28036 Madrid, Spain 28036 Madrid, Spain [email protected] [email protected] [email protected] Abstract sentence prediction learning objective. However, In this paper we shed light on the impact of none of these corpora cover text from social media fine-tuning over social media data in the in- where users, human or automated agents, are con- ternal representations of neural language mod- tinuously sharing pieces of information as part of els. We focus on bot detection in Twitter, a the social interaction. This brings up the question key task to mitigate and counteract the auto- whether such language models also capture the nu- matic spreading of disinformation and bias in ances of the short, informal and evolving language social media. We investigate the use of pre- often found in social media channels. trained language models to tackle the detection of tweets generated by a bot or a human ac- In this paper we shed light on the impact of fine- count based exclusively on its content. Unlike tuning language models over social media data. the general trend in benchmarks like GLUE, Particularly, we focus on bot detection in Twitter, where BERT generally outperforms generative which is a key task to mitigate and counteract the transformers like GPT and GPT-2 for most automatic spreading of disinformation and bias in classification tasks on regular text, we observe social media (Shao et al., 2018). We model this that fine-tuning generative transformers on a bot detection task produces higher accuracies. task as a binary classification problem where the We analyze the architectural components of goal is to detect whether the content of a tweet each transformer and study the effect of fine- has been produced by a bot or a human. Note tuning on their hidden states and output repre- that different features, e.g. number of followees sentations. Among our findings, we show that and followers, number of retweets, presence of part of the syntactical information and distri- hashtags, URLs, etc., can be valuable sources of butional properties captured by BERT during relevant information to solve this task. However, it pre-training is lost upon fine-tuning while the is not our objective to beat the SotA in bot detection, generative pretraining approach manage to pre- serve these properties. but to understand how pre-trained language models adapt their internal representations in the presence 1 Introduction of such data and make an informed interpretation Nowadays fine-tuning neural networks trained on a of the resulting predictions. Therefore, we focus language modeling objective (Bengio et al., 2003) solely on the analysis of the actual text contained has become the usual way to address most NLP in the tweet, which has been regarded as highly relevant to detect automatic accounts (Gilani et al., arXiv:2104.06182v1 [cs.CL] 13 Apr 2021 tasks. While early language models like ELMo (Pe- ters et al., 2018a) and ULMFit (Howard and Ruder, 2017). 2018) used LSTM architectures, as of today trans- Looking at multi-task benchmarks like formers (Vaswani et al., 2017) are the foundation GLUE (Wang et al., 2018), most tasks are of successful language models like GPT (Radford dominated by transformer-based models fine-tuned et al., 2018) and BERT (Devlin et al., 2018). on task-specific data. This is also the case for Most language models are trained on high qual- classification tasks, where a deeper look reveals ity, grammatically correct, curated text corpora that BERT-based models systematically outper- such as Wikipedia (ULMFiT), BookCorpus (GPT), form models based on generative pre-training a collection of Web Pages (GPT-2), a combination like GPT. However, our experiments in a bot of Wikipedia and BookCorpus (BERT) or News detection dataset (section3) show that this trend (ELMo). In fact, BERT requires sequences of sen- actually reverses (section4) for the bot detection tences that makes sense due to the additional next task. We investigate the reasons of this apparent anomaly by carrying out a bottom-up analysis on stand how they work (Rogers et al., 2020). Peters the transformers used in each language model, et al.(2018b) found that language models encode a from vocabulary and word embeddings (section5) rich hierarchy of contextual information throughout through hidden states to output representations the layers, from morphological at the embeddings, (section6). Our results show that fine-tuning for local-syntax at lower layers and semantic informa- bot detection impacts BERT and GPT-2 differently tion at upper layers. Tenney et al.(2019) show that with respect to the contextualized outputs and BERT encodes phrase-level information in its lower linguistic properties learned in pre-training. layers and a hierarchy of linguistic information in We observe that BERT’s hidden states cap- its intermediate layers. Ethayarajh(2019) shows ture less grammatical information after fine-tuning, that BERT and GPT-2 hidden states and outputs while GPT-2 manages to generate representations occupy a narrow cone in the vector space. Clark that preserve such information as in the pre-trained et al.(2019) investigated self attention and found model. We show evidence that after fine-tuning some heads that capture syntactical information. GPT-2 tends to generate more distributed outputs Kovaleva et al.(2019) shows that in fine-tuning the and some clusters can be roughly mapped to twitter attention mechanism in BERT focus mainly on the entities while BERT outputs do not express this CLS and SEP tokens. Our research work can be differentiation and are all concentrated in the same framed with the above mentioned since our goal is region of the vector space. For reproducibility pur- to understand the effect of fine-tuning on the hid- poses, the paper includes a GitHub repository1 with den states and outputs of the language models by experimental data and code, as well as detailed dia- put them into test on tasks related to bot detection, grams and figures. grammatical analysis and contextual similarity, and provide reference data from classification tasks in 2 Related work standard benchmarks. Different neural architectures have been proposed Automatic accounts known as bots publish a to pre-train neural language models on large text large amount of information in social media, and corpus (Howard and Ruder, 2018; Radford et al., some of them take active part on spreading misin- 2018; Devlin et al., 2018). Transformer architec- formation and fake news (Shao et al., 2018). In tures (Vaswani et al., 2017) are used in GPT (Rad- fact, twitter points in its last report about platform 2 ford et al., 2018), and BERT (Devlin et al., 2018), manipulation at malicious bots as one of the main two language models that have pushed the state actors, along with spam, and fake accounts. of the art in different NLP tasks, inspiring sub- In general, detecting bots can be addressed as sequent work like GPT-2 (Radford et al., 2019), a binary classification problem that can leverage RoBERTa (Liu et al., 2019) and DistilBERT (Sanh different features from the social network including et al., 2019). user metadata, user relations, and posting activity, Recently, language models are being used to pro- as well as the content of the posts. Approaches cess text from social media. BERT is used for the like Botomoter (Varol et al., 2017) work at the ac- classification of tweets in the disaster management count level and use all the available information to field (Ma, 2019), hate speech identification (Mishra, derive features that are processed with an ensem- 2019; Mozafari et al., 2019), offensive language ble of machine learning algorithms. However this classification (Paraschiv and Cercel, 2019), subjec- approach shows a large disagreement with human tivity, polarity and irony detection (Polignano et al., annotators (Gilani et al., 2017), and leads to false 2019), and to evaluate tweet predictability (Przy- positives and negatives (Rauchfleisch and Kaiser, była, 2019). The generative ability of GPT-2 is 2020). In this paper we work at the tweet-level used to replicate politician’s twitter accounts (Ress- focusing only on the tweet content to determine meyer, 2019), and to generate fake news and enable whether it was posted by a bot or a human. In (Gi- its detection (Zellers et al., 2019). lani et al., 2017) human annotators cited the style Since pre-trained language models work very and the patterns of the tweets as strong indicators well in practice, researchers are trying to under- of automatic accounts. 1https://github.com/botonobot/Underst anding-Transformers-for-Bot-Detection-Tw 2https://transparency.twitter.com/en/ itter reports/platform-manipulation.html 3 Dataset Model Library Precision Recall F-score GPT-2 OpenAI 0.8657 0.8640 0.8630 We tap into a ground truth dataset of bot and hu- GPT OpenAI 0.8567 0.8546 0.8533 man accounts released by Gilani et al.(2017). This GPT-2 Transformers 0.8549 0.8524 0.8509 dataset was manually annotated by 4 annotators, BERT Transformers 0.8443 0.8437 0.8439 BERT Google-bert 0.8572 0.8213 0.8388 achieving 89% inter-annotator agreement, 77 Co- SVM LinearSVC 0.8033 0.8031 0.8032 hen’s kappa (κ) coefficient indicating substantial agreement. We generate a balanced dataset con- Table 1: Fine-tuned language models on the bot de- taining 600,000 tweets labelled as bot or human tection task. We trained a linear SVM baseline (Fan according to the account label. Our training dataset et al., 2008) with a tuned regularization parameter, lem- comprises a total of 500,000 tweets where 279,495 matized words using wordnet, and stopwords removed.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages10 Page
-
File Size-