Skip to main content
QUICK REVIEW

[Paper Review] BERT Transformer model for Detecting Arabic GPT2 Auto-Generated Tweets

Fouzi Harrag, Maria Dabbah|arXiv (Cornell University)|Jan 1, 2021
Topic ModelingComputer Science14 references7 citations
TL;DR

This paper proposes a fine-tuned ARABERT-based transformer model to detect Arabic text generated by GPT2-Small-Arabic, leveraging transfer learning on a custom dataset of human-written and GPT2-generated Arabic tweets. The model achieves 98% accuracy, marking the first study to combine ARABERT with GPT2 for classifying Arabic synthetic text, outperforming RNN-based baselines like LSTM and GRU.

ABSTRACT

During the last two decades, we have progressively turned to the Internet and social media to find news, entertain conversations and share opinion. Recently, OpenAI has developed a ma-chine learning system called GPT-2 for Generative Pre-trained Transformer-2, which can pro-duce deepfake texts. It can generate blocks of text based on brief writing prompts that look like they were written by humans, facilitating the spread false or auto-generated text. In line with this progress, and in order to counteract potential dangers, several methods have been pro-posed for detecting text written by these language models. In this paper, we propose a transfer learning based model that will be able to detect if an Arabic sentence is written by humans or automatically generated by bots. Our dataset is based on tweets from a previous work, which we have crawled and extended using the Twitter API. We used GPT2-Small-Arabic to generate fake Arabic Sentences. For evaluation, we compared different recurrent neural network (RNN) word embeddings based baseline models, namely: LSTM, BI-LSTM, GRU and BI-GRU, with a transformer-based model. Our new transfer-learning model has obtained an accuracy up to 98%. To the best of our knowledge, this work is the first study where ARABERT and GPT2 were combined to detect and classify the Arabic auto-generated texts.

Motivation & Objective

  • To address the growing threat of AI-generated misinformation in Arabic social media by developing a reliable detection system.
  • To create a high-quality, extended dataset of Arabic tweets, including both human-written and GPT2-generated samples, for training and evaluation.
  • To compare the performance of RNN-based models (LSTM, BI-LSTM, GRU, BI-GRU) with a transformer-based model for detecting synthetic Arabic text.
  • To investigate the effectiveness of transfer learning using ARABERT for distinguishing between human- and machine-generated Arabic sentences.

Proposed method

  • The authors collected and extended a dataset of Arabic tweets using the Twitter API, including both real human-written content and GPT2-Small-Arabic generated text.
  • They fine-tuned the ARABERT base model—a multilingual BERT variant optimized for Arabic—on the combined dataset for sequence classification.
  • The model uses contextualized embeddings from the transformer encoder to classify input sequences as human-written or GPT2-generated.
  • Performance was evaluated using standard NLP metrics, including accuracy, precision, recall, and F1-score, on a held-out test set.
  • The study compared ARABERT’s performance against RNN-based baselines (LSTM, BI-LSTM, GRU, BI-GRU) trained on word embeddings such as GloVe and FastText.
  • Hyperparameter tuning and cross-validation were applied to optimize the ARABERT model’s performance on the Arabic text detection task.

Experimental results

Research questions

  • RQ1Can a fine-tuned ARABERT model effectively distinguish between human-written and GPT2-generated Arabic tweets?
  • RQ2How does the performance of transformer-based models compare to RNN-based models in detecting synthetic Arabic text?
  • RQ3What is the impact of transfer learning using ARABERT on the accuracy of detecting AI-generated Arabic content?
  • RQ4To what extent does the quality and size of the training dataset affect the detection performance of the model?

Key findings

  • The ARABERT-based model achieved a test accuracy of 98%, significantly outperforming all RNN-based baselines such as LSTM, BI-LSTM, GRU, and BI-GRU.
  • The transformer-based approach demonstrated superior generalization and contextual understanding compared to recurrent models, especially in capturing long-range dependencies in Arabic text.
  • The study confirms that fine-tuning a multilingual BERT variant like ARABERT on synthetic Arabic text yields state-of-the-art detection performance.
  • The combination of ARABERT and GPT2-Small-Arabic for detection tasks is novel, marking the first such integration in the literature for Arabic NLP.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.