1 of 25

Detecting and Measuring Social Bias of Arabic Generative Models in the Context of Search and Recommendation

Fouzi Harrag, Chaima Mehdadi and Amina Norhane Ziad

Computer Sciences Department, Ferhat Abbas University, Setif 1, Setif, Algeria

BIAS 2023

1

4/1/2023

The 45th European Conference on Information Retrieval ECIR'2023

The Fourth International Workshop on Algorithmic Bias in Search and Recommendation (BIAS 2023)

Dublin, Ireland�02 April 2023

2 of 25

Plan

  • Introduction
  • Aim and Contribution
  • Model architecture
  • Experimental Setup
  • Dataset
  • Research Questions
  • Experiment I (RQ-1: Different data balancing techniques)
  • Experiment II (RQ-2: Different hyperparameters)
  • Experiment III (RQ-3: Qualitative Evaluation of Generation Process)
  • Conclusion

BIAS 2023

2

4/1/2023

3 of 25

Introduction

  • Context: Pre-training large language models on vast amounts of web-scraped texts is a current trend in natural language processing.
  • Risk: While the resulting models are capable of generating convincing text, they also reproduce harmful social biases. Several modern studies have demonstrated that societal biases have a significant impact on the outcome of information retrieval systems.
  • Challenge: In order to counteract potential dangers, several methods have been proposed for detecting bias caused by these generative language models.
  • Solution: Developing a method for quantifying and mitigating bias in search results and applying them to retrieval and recommendation systems based on transformer language models.

BIAS 2023

3

4/1/2023

4 of 25

BIAS 2023

4

4/1/2023

This paper explores expressions of bias in Arabic text generation.

Analyses will be performed on samples produced by the generative model AraGPT2 (a GPT-2 fine-tuned for Arabic).

An Arabic bias classifier (Regard Classifier) based on the transformer model AraBERT (a BERT fine-tuned for Arabic) will be used to captures the social Bias of an Arabic-generated sentence or text.

The performance of our proposed model has been assessed through a quantitative evaluation study.

we also conducted a qualitative study to understand how our system would compare to others approaches where users try to find bias in Arabic texts generated using AraGPT2 model.

Our proposed model has achieved very encouraging results by reaching an accuracy percentage of 81%.

5 of 25

Aim & Contributions

  • In this work, we proposed a transfer learning based framework for bias detection in Arabic language generation model.

  • We also proposed a New AraBERT based classifier for bias detection, which allows bias checks in Social media textual data.

  • We focused on measuring and mitigating biases reproduced by large-scale language models used for Arabic text generation AraGPT2.

  • Idea: As opposed to sentiment classifier, Bias or Regard Classifier does not capture the polarity of a sentence, but specifically the social perception that it reinforces.
  • Goal: Proposing a framework of an Arabic Bias Classifier and evaluating it using a dedicated dataset.

BIAS 2023

5

4/1/2023

6 of 25

Model architecture

The developed model shown in the figure below, is composed of seven (7) major steps:

  • Collecting dataset
  • Cleaning dataset
  • Training collected data with AraBERT
  • Generating tweets using AraGPT2
  • Classifying generated tweets using The Bias Detection Model (BDM)
  • Qualitative evaluation of results
  • Quantitative evaluation of results

BIAS 2023

6

4/1/2023

7 of 25

7

14

8 of 25

Dataset�

We used the ’Multilingual and Multi-Aspect Hate Speech Analysis dataset, available on Github*:

  • Published on Sep 27,2021,
  • it consists of more than 13,000 tweet IDs related to detailed taxonomy with cross-cutting attributes, collected in 4 csv files.
  • We have used the file named ”ar dataset.csv” containing 3,353 Arabic tweets.

As it is shown in Table1, the attribute “Target” presents the cases when the tweet contains what its meaning leads to insults or discriminates against people.

This represents a bias on five different cases namely origin, religious affiliation, gender, sexual orientation, special needs or other.

BIAS 2023

8

4/1/2023

9 of 25

Experiment Setup�

  • Based on our model architecture presented in the previous section, we used Python programming language and its robust libraries to build the different modules of our system that can predict if a sentence is biased or not.

  • Our system consists of four (4) main modules: The data Preprocessor, the AraBERT based classifier, The AraGPT2 Generator and the evaluation module.
  • We divided the dataset into two parts.

  • The first part will be reserved for the generation phase (about 200 tweets).

  • The second part of our dataset, will be randomly separated into two parts, training set consisting of 70% of the initial dataset and 30% for the test set.

BIAS 2023

9

4/1/2023

10 of 25

Research Questions�

For analyzing the results, we mainly focus on the following research questions:

  • • RQ-1: How effective is our model under different data balancing techniques?
  • • RQ-2: How effective is our model by tuning some hyperparameters of our model?
  • • RQ-3: How effective is our model under a qualitative evaluation?

BIAS 2023

10

4/1/2023

11 of 25

Experiment I (RQ-1: Different data balancing techniques)�

  • This experiment provides the experimental results to the first investigated research question Q1. We proposed a model configuration built on the basic structure of AraBERT. The hyper-parameters of this architecture are described in table 2 below.

  • As it was described in Table 1, we can easily note a huge class imbalance in the dataset that would certainly affect the system performance.

BIAS 2023

11

4/1/2023

12 of 25

Experiment I : Balancing Configurations

To resolve the imbalanced data problem, we test four (4) different configuration of our dataset:

  • Original data: 200 tweets (6%) == > for the generation step. 3153 tweets (94%): 2207 tweets (70%) == > for training= {1720 biased sentences and 487 non-biased sentences}. 946 tweets (30%) == > for testing purpose.

  • Balanced Data: We would like to know what will happen if we changed our data distribution.

  • Manually balanced data: 3153 tweets = {715 normal tweets without any type of bias + 2438 tweets biased tweets}.

We removed 1723 tweets from the second set and we just kept 715 normal tweets & 715 biased tweets. Our new balanced data is next divided into 70% for training and 30% for a testing.

  • SMOT balanced data: SMOT is a method used to make data balanced by taking the minority class and making equal to the majority class. We used the SMOT technique with the parameter “Sampling Strategy= Minority”. The data of the minority class has been amplified from 512 to 1695.

  • Augmented data: Data augmentation describes a set of algorithms that create synthetic data from the available datasets. We applied data augmentation through the generation. We used the normal tweets as inputs for the AraGPT2 algorithm to generate the double size using two different output max length 64 and 128. We appended the new resulted tweets to the original set of normal tweets, so our new dataset contains as much biased as normal tweets.

BIAS 2023

12

4/1/2023

13 of 25

Experiment I: Results and discussion

  • Table 3 presents the experimental results. To better visualize the trend, we also plot the results in Figure 3.

  • As seen in Figure 2, the configuration of our model using the original distribution of data got the best accuracy and Macro F1 scores. Precision as well as recall show an improvement for the SMOT and augmented techniques.
  • From this experiment, we obtained an F1 score of 75 % for the first technique, 61% for the second, 73% for the SMOT and 75% for the Augmentation technique.

BIAS 2023

13

4/1/2023

14 of 25

Experiment II (RQ-2: Different hyperparameters)�

  • This experiment provides the experimental results to the second investigated research question Q2.
  • We tested different configurations using 4 values for the parameter “Max length”, 2 values for the parameter “Batch size” and 2 values for the parameter “Epochs”. The hyper-parameters used to compile and run the model are illustrated in table 4.

  • As it was described in Table 1, we can easily note a huge class imbalance in the dataset that would certainly affect the system performance.

BIAS 2023

14

4/1/2023

15 of 25

Experiment II: Results and discussion

  • Table 5 presents the experimental results of our model using the following parameters Max_length = 512, Batch_size= 6 and Epochs= 4.

  • The results of this experiment clearly show us the ability of transformer learning models to detect bias in Arabic texts with a high degree of accuracy. Through this experiment, we can also realize the importance of the hyperparameters’ impact on the performance of these classifiers. The AraBERT model using the parameter “Max_Length” =512 significantly outperformed all other models.

BIAS 2023

15

4/1/2023

16 of 25

Experiment III (RQ-3: Qualitative Evaluation of Generation Process)��

  • This experiment provides the experimental results to the third investigated research question Q1.
  • We proposed a model configuration built on the basic structure of AraGPT2. The maximum length of generated texts is 80 words. For the generation process, we used the set of 6% that was initially kept, which is about 200 tweets. Table 6 shows the hyper-parameters of our generation model.

  • As it was described in Table 1, we can easily note a huge class imbalance in the dataset that would certainly affect the system performance.

BIAS 2023

16

4/1/2023

17 of 25

Experiment III : Evaluations Configurations

To Evaluate our system, we used four (4) different evaluations approaches:

  • a) Model evaluation with Bleu & Rouge:
  • BLEU (BiLingual Evaluation Understudy): Bleu measure is interested on how much the words (and/or n-grams) in the machine generated summaries appeared in the human reference summaries.
  • BLEU Corpus Score: Compares one (1) candidate document with multiple sentence and 1+ reference document with multiple sentences.
  • ROUGE (Recall Oriented Understudy for Gisting Evaluation): It includes measures to automatically determine the quality of a summary by comparing it to other (ideal) summaries created by humans.

  • Table 8 is showing the model evaluation results with BLEU and ROUGE. We can notice that our system gave acceptable results.

BIAS 2023

17

4/1/2023

18 of 25

Experiment III : Evaluations Configurations

b) Human Annotation Evaluation

  • Motivation: We are interested in investigating the question of how does the difference in annotation affect our model’s evaluation? In this research, the annotation task is specifically focused on Target Bias to make comparison with automatic evaluation easy.
  • Approach: We perform a limited scale qualitative analysis to understand to what extent human are able to detect bias in generated text. In this experiment, each of the 200 samples are annotated by two annotators for Target Bias in generated tweets.
  • We conducted a user experience study of our system with two annotators (El, E2), where the participants judge our system reporting biased or unbiased for each generated text.
  • In an annotation, the annotators will not always agree: for instance, some may be more severe in their judgments than others. El, E2 discussed also the results that were obtained by our system to resolve any disagreements until reaching a consensus.

BIAS 2023

18

4/1/2023

19 of 25

Experiment III : Evaluations Configurations

  • We organized our two annotator’s results in the Table 7 below.

  • Our annotators agreed that 75 tweet are biased and 82 tweet are normal, so they agreed on 157 tweet and disagreed on 43 between normal and biased from the total of 200 tweets
  • The final Kappa coefficient is 72%.

BIAS 2023

19

4/1/2023

20 of 25

Experiment III : Evaluations Configurations

c) Automatic evaluation

  • The automatic evaluation step is technically done before the comparison between annotators and the model prediction.
  • Currently, after the training phase of our model, we used our generated Arabic tweets as inputs to test our model.
  • We asked the system to predict the biasness in the generated tweets based on what the model have already learned from the previous experiments.
  • Our system is used as a Regard Classifier for the detection of bias introduced by the generative model.
  • The result of the prediction phase are used with the previous annotator’s results (Ground Truth) to finalize the global evaluation process.

BIAS 2023

20

4/1/2023

21 of 25

Experiment III : Evaluations Configurations

d) Final evaluation

  • This phase is putting a spotlight on every case between the prediction and the annotators result. Table 8 presents the final evaluation results of RQ-3. The system agreed with the annotators in 96 tweet, 69 of them are biased while the rest are normal tweets. The percentage of agreement is 48%.

BIAS 2023

21

4/1/2023

22 of 25

Experiment III : Findings

  • As Findings for Experiment III, we can say that now, we could know how much our annotators agreed in their vote from the kappa result. As it is 72% leads us to know that their agreement level is Substantial and they are reliable in [61% - 80%] of the data.

  • The system agreed with the annotators in 96 tweet, 69 of them are biased while the rest are normal tweets. The percentage of agreement with system is of 48%, which means that the annotators still contradict the system in more than 50 percent of the results.
  • This also means that the research field of studying bias, detecting and mitigating it, still needs great efforts, especially with regard to low resourced languages such as Arabic Language and Arabic dialects.

BIAS 2023

22

4/1/2023

23 of 25

Conclusion

  • In this paper, we propose a new transfer-learning-based paradigm consisting of seven (7) major steps.
  • We designed a regard classifier or bias detection model based on a modified version of AraBERT to achieve the goal of detecting whether an Arabic sentence or tweet is biased or not.
  • The Arabic generation model was built on top of AraGPT2 to allow us to generate a set of sentences using normal, unbiased Arabic tweets as input.
  • We tested the ability of AraGPT2 to generate different types of bias stereotypes. In order to obtain the best result associated with detecting bias using AraBERT, we conducted several experiments by changing different Hyperparameters.
  • We achieved the best result, which was close to 81% for the accuracy metric, by using the following parameters: Max_Length=512, batch_size=6, and Epochs=4.
  • In the generation step, our experiment consists of recruiting two annotators to compare their evaluation and the results of their work on the generative model evaluation process.
  • We measured the agreement between them using the Kappa measure and then compared the results with the AraBERT predictions.

BIAS 2023

23

4/1/2023

24 of 25

Future Works

  • Ultimately, the methods described in this paper yielded promising results, as described in the last section.
  • However, we can consider improving our system by training the model on a larger data set, and doing more experiments.
  • Furthermore, we can invest in using our model to serve other Arabic NLP applications. In fact, social bias can potentially influence on search and recommendation systems’ decisions, which align with many recent studies that rise the risk of unfairness and social bias in the data used to train and test those systems.
  • In this direction, our bias detection model can be effective in catching appropriate hate speech keywords that have direct impact on the results of search and recommender systems.

BIAS 2023

24

4/2/2023

25 of 25

Thank You ☺

BIAS 2023

25

4/2/2023