<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>EXIST 2021: Inducing Bias in Deep Learning Models</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Ismael Garrido-Mun~oz</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Arturo Montejo-Raez</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Fernando</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Mart nez-Santiago</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>CEATIC. Universidad de Jaen</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Espan~a</string-name>
        </contrib>
      </contrib-group>
      <abstract>
        <p>For the EXIST 2021 sexism detection task, a novel approach is proposed. In previous work we see that deep learning models capture biases related to race, gender, religion, etc. There are numerous works that seek to lower the bias of these models to make them fairer and more equitable. We will use the opposite approach to these works, instead of reducing the bias of the models we will seek to increase it. So we will train 3 times the same base model, generating 3 versions of the model. A normal version, a sexist version and an anti-sexist version. Belonging to these models will mean marking or not the tweet as sexist.</p>
      </abstract>
      <kwd-group>
        <kwd>BERT</kwd>
        <kwd>ne-tune</kwd>
        <kwd>bias</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        The EXIST 2021 workshop deals with the identi cation and classi cation of
sexist messages coming from the websites gab.com and twitter.com. Sexism
detection is not a novel task, we could consider it a specialization of the hate
detection task, in which the hate has an impact on one of the genders. Although
it is not a novel task, it is a topical task. There are already systems in production
that use hate detection as an automatic content moderation tool, for example
twitter [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] has recently started to warn its users when it detects a hateful
message before they are sent, asking the user to review them. It is not the only social
network that is working on detecting this type of behavior, we can nd similar
initiatives in Facebook [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] or even Google. In the case of Google we can see how
despite the good intentions, its AI seems to be race biased [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ].
      </p>
      <p>This is not a trivial task since in many cases it is the social context itself
that causes a message to undervalue the role of one of the genders or even
feed negative stereotypes. This document explains the approach followed for the
participation in the rst version of the EXIST 2021 workshop along with the
data and tools used.</p>
      <sec id="sec-1-1">
        <title>EXIST Task</title>
        <p>EXIST is proposed as a workshop embedded as part of IberLEF. It provides a
set of tweets and gabs in Spanish and English and proposes two tasks. The rst
one is to detect whether each of the messages is sexist or not. The second task
proposes to classify the type of sexism present in the tweet for a set of proposed
categories.</p>
        <p>The task considers that a message is sexist as one that produces prejudice,
inequality or stereotype following The Oxford English Dictionary de nition. They
also provide a set of tweets and gabs labeled in the proposed tasks.
1.2</p>
        <p>
          PreviousnRelated Work
There are many previous works [
          <xref ref-type="bibr" rid="ref12 ref2">12,2</xref>
          ] on the task of hate speech detection but
we will focus on deep learning approach and on treating sexism as a bias. Studies
such as [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ] approaches the task as a problem of racial bias in the datasets. In [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]
they ne-tune BERT by adding additional layers and the best result is obtained
by adding a CNN layer. [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ] use three deep-learning architectures (CNN, LSTMs
and FastText) to classify tweets as racist, sexist or neither.
2
        </p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>Approach</title>
      <p>We will try a novel approach, instead of using a classi er we will train three
models of each language (English and Spanish) and we will score how likely are
the tweets to belong to each model. One model base model will be trained with
random data, the stereotyped model will be trained with toxic/stereotyped
comments and the anti-stereotype will be trained with data sample that contradicts
stereotypes. Given a sentence, it will be considered toxic/sexist if the likelihood
of been generated from a stereotyped model is greater than that of any of the
other two models (anti-stereotyped and neutral).
2.1</p>
      <sec id="sec-2-1">
        <title>Building the models</title>
        <p>
          Previous work demonstrates that neural network based models capture certain
associations present in the data that may be sexist, racist, or have some type
of unwanted bias. The study of bias in neural network based models shows
how recent models such as BERT or even GPT-3 capture these biases. Studies
such as [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ] show that from version two to version three of GPT model, it does
substantially improve the ability to generalize and emulate in language. However,
it also captures negative race-related biases [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ] better than its predecessor or even
improves the model's ability to generate extremist text.
        </p>
        <p>One of the most common examples is that Word embeddings models captures
the association man - woman ! king - queen correctly, however it also captures
associations like man - woman ! computer scientist - homemaker</p>
        <p>Using a list of professions it is obvious that there are professions strongly
associated with men and others strongly associated with women. Despite the
fact that in certain applications this bias may be detrimental, we will take it as
an advantage.
2.2</p>
      </sec>
      <sec id="sec-2-2">
        <title>Resources</title>
        <p>
          Civil Comments/Jigsaw corpora This dataset is the one proposed by Google's
Jigsaw initiative for the [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ] "Jigsaw Unintended Bias in Toxicity Classi cation"
challenge on the Kaggle platform. The data are comments released by the Civil
Comments platform, tagged by humans to categorize them as toxic, obscene,
threatening, insulting, or identity hate. In addition, tags are included to
indicate what race, gender, sexual orientation, religion, ethnicity or disability is
addressed in the message. For the detection of sexism, gender labels with high
toxicity values are the ones we consider most important.
        </p>
        <p>
          StereoSet corpora It is a dataset in English labeled to re ect the stereotypes
present in the data. To do this, a dataset is built[
          <xref ref-type="bibr" rid="ref10">10</xref>
          ] in which spaces are left in
the sentences to be lled in with some various words. For each of these phrases,
we have a label indicating what type of stereotype is being tested (race, gender,
...) and another label indicating the result from the review of 5 people indicating
whether the phrase re ects a stereotype, an anti-stereotype or if the phrase
simply does not make sense or is not related to the studied stereotype.
English BERT model [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ] BERT is a general-purpose language model trained
on a large corpus. The di erence between BERT and other models is that the
context of each word is formed by both left-hand and right-hand terms of the
same word throughout the network.
        </p>
        <p>
          Multiple versions of BERT are available, we have used bert-base-uncased.
Spanish BERT model (BETO) [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ] BETO is equivalent to BERT for Spanish.
It is trained by the same technique as BERT (Whole Word Masking) using the
Spanish Unannotated Corpora dataset. Among these data we can nd 300 million
lines in Spanish from di erent datasets, including wikis, europarliament texts,
united nation texts, open subtitles, among many others. We will use
bert-basespanish-wwm-uncased version.
2.3
        </p>
      </sec>
      <sec id="sec-2-3">
        <title>Other resources</title>
        <p>For working with the models the HuggingFace libraries were used. Some scripting
and data transformation work was done using custom nodejs/python scripts.
2.4</p>
      </sec>
      <sec id="sec-2-4">
        <title>Training process</title>
        <p>We have taken the English and Spanish models described above and ne-tuned
them using the two stereotyped corpora introduced before. The ne-tune task
was the same as the common task used to train these two models from scratch:
masked language modeling. Training process was performed on a machine equipped
with x2 Intel(R) Xeon(R) Silver 4208 CPUs at 2.10GHz 192 GB of RAM and
x2 NVIDIA Tesla V100 (32GB, Volta). The implementation was based on the
PyTorch versions of these models provided by the Transformers library. It took
about 10 minutes for training the Spanish version of the three models
(stereotype, anti-stereotyped and neutral) and about 20 minutes for the three English
ones.
2.5</p>
      </sec>
      <sec id="sec-2-5">
        <title>Likelihood</title>
        <p>We calculate the probability of a sentence belonging to the model by using
the chain rule of probability. To get the normalized probabilities we apply the
softmax function to the model output logits which are the raw predictions of the
last layer of the network.</p>
        <p>P (X1; X2; ; Xn) =
P (X1) P (X2jX1) P (X3jX1; X2) P (XnjXn 1; Xn 2;</p>
        <p>Qn
k=1 P (XkjX1k 1)
; X1) =
(1)</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Results and discussion</title>
      <p>It has been veri ed with some sentences from the training set that the model
does indeed capture some structures in the form of probabilities. For example
for the sentence "The schoolgirl is walking down the street, She is a target for
child predators", the probabilities are:</p>
      <p>AntiStereotype Other Stereotype
the 0.00894868653267622 0.032950423657894135 0.005774959456175566
schoolgirl 0.0002689003486011643 0.00017878220387501642 0.002795979264192283
is 0.006179201416671276 0.03133246302604675 0.00566072016954422
walking 6.194096204126254e-05 3.609031409723684e-05 0.0002682682534214109
down 9.467829659115523e-05 2.7176944058737718e-05 6.732833571732044e-05
the 0.026873258873820305 0.02360343001782894 0.023960916325449944
street 0.005731010489128607 0.0007263075825676424 0.1331725064192142
she 0.001979067223146558 0.0008687127847224474 0.0036194631829857826
is 0.0073087140917778015 0.02685435861349106 0.08509364724159241
a 0.0025236799847334623 0.0009333917987532914 0.0032958367373794317
target 1.7575850506545976e-05 1.2269218530036596e-07 1.707993391164564e-07
for 0.00017388597188983113 3.896695488947444e-05 8.425339183304459e-05
child 0.022296445444226265 0.0001155364152509719 0.011923404410481453
predators 0.004697749387711762 0.0002539085783155315 0.001255747340716577
Total 1.5692968748328783e-40 9.478321051397374e-48 1.1521866603985196e-39</p>
      <p>This phrase is e ectively classi ed as stereotypical. However, the di erence
with respect to anti-stereotyped, which is the opposite class, is not large enough.
This may be due to the fact that the probability calculation method does not
treat BERT as bidirectional.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Conclusions and future work</title>
      <p>We have presented a proposal for the classi cation of sexist tweets based on bias
Although we see that there are di erences between the models, there is still a
lot of work to be done for this approach to give good results. On the one hand,
it will be necessary to nd concrete structures that are representative of sexist
or toxic content. Once the structures have been found, it will be necessary to
improve the training method to emphasize the structures and thus ne-tune the
model by focusing on the characteristics of the problem.</p>
      <p>Another point where improvement can be made is in the calculation of model
membership, and other metrics can be applied to obtain a more reliable result.</p>
      <p>One aspect that would be interesting to explore is the automatic extraction
of social media content to train the model. Is it feasible to characterize as toxic
or non-toxic non-annotated texts from social networks using these networks'
own metrics? For example, characterizing as toxic those with a large proportion
of negative votes and as non-toxic those with a proportionally large number of
positive votes. This can allow the model to mature, having the same information
that ts the reality.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Abid</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Farooqi</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Zou</surname>
          </string-name>
          , J.:
          <article-title>Persistent anti-muslim bias in large language models</article-title>
          .
          <source>CoRR abs/2101</source>
          .05783 (
          <year>2021</year>
          ), https://arxiv.org/abs/2101.05783
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Al-Hassan</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Al-Dossari</surname>
          </string-name>
          , H.:
          <article-title>Detection of hate speech in social networks: a survey on multilingual corpus</article-title>
          .
          <source>In: 6th International Conference on Computer Science and Information Technology</source>
          . vol.
          <volume>10</volume>
          (
          <year>2019</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Badjatiya</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gupta</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gupta</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Varma</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          :
          <article-title>Deep learning for hate speech detection in tweets</article-title>
          .
          <source>In: Proceedings of the 26th International Conference on World Wide Web Companion</source>
          . p.
          <volume>759</volume>
          {
          <fpage>760</fpage>
          . WWW '17 Companion, International World Wide Web Conferences Steering Committee, Republic and Canton of Geneva, CHE (
          <year>2017</year>
          ). https://doi.org/10.1145/3041021.3054223, https: //doi.org/10.1145/3041021.3054223
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4. Can~ete, J.,
          <string-name>
            <surname>Chaperon</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fuentes</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ho</surname>
            ,
            <given-names>J.H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kang</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Perez</surname>
          </string-name>
          , J.:
          <article-title>Spanish pretrained bert model and evaluation data</article-title>
          .
          <source>In: PML4DC at ICLR</source>
          <year>2020</year>
          (
          <year>2020</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Conversation</surname>
            <given-names>AI</given-names>
          </string-name>
          , J.:
          <article-title>Jigsaw unintended bias in toxicity classi cation | kaggle (</article-title>
          <year>2021</year>
          ), https://www.kaggle.com/c/ jigsaw-unintended
          <article-title>-bias-in-toxicity-classification/overview</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Devlin</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chang</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lee</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Toutanova</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>BERT: pre-training of deep bidirectional transformers for language understanding</article-title>
          . CoRR abs/
          <year>1810</year>
          .04805 (
          <year>2018</year>
          ), http://arxiv.org/abs/
          <year>1810</year>
          .04805
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>McGu</surname>
            <given-names>e</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            ,
            <surname>Newhouse</surname>
          </string-name>
          ,
          <string-name>
            <surname>A.</surname>
          </string-name>
          :
          <article-title>The Radicalization Risks of GPT-3</article-title>
          and
          <string-name>
            <given-names>Advanced</given-names>
            <surname>Neural Language Models. arXiv</surname>
          </string-name>
          e-prints arXiv:
          <year>2009</year>
          .
          <volume>06807</volume>
          (
          <year>Sep 2020</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Mozafari</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Farahbakhsh</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Crespi</surname>
          </string-name>
          , N.:
          <article-title>A bert-based transfer learning approach for hate speech detection in online social media</article-title>
          . CoRR abs/
          <year>1910</year>
          .12574 (
          <year>2019</year>
          ), http://arxiv.org/abs/
          <year>1910</year>
          .12574
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Mozafari</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Farahbakhsh</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Crespi</surname>
          </string-name>
          , N.:
          <article-title>Hate speech detection and racial bias mitigation in social media based on bert model</article-title>
          .
          <source>PLOS ONE 15(8)</source>
          ,
          <volume>1</volume>
          {
          <fpage>26</fpage>
          (08
          <year>2020</year>
          ). https://doi.org/10.1371/journal.pone.
          <volume>0237861</volume>
          , https://doi.org/10.1371/ journal.pone.0237861
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Nadeem</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bethke</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Reddy</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          : Stereoset:
          <article-title>Measuring stereotypical bias in pretrained language models</article-title>
          . CoRR abs/
          <year>2004</year>
          .09456 (
          <year>2020</year>
          ), https://arxiv.org/ abs/
          <year>2004</year>
          .09456
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Sap</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Card</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          , Gabriel,
          <string-name>
            <given-names>S.</given-names>
            ,
            <surname>Choi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            ,
            <surname>Smith</surname>
          </string-name>
          ,
          <string-name>
            <surname>N.A.</surname>
          </string-name>
          :
          <article-title>The risk of racial bias in hate speech detection</article-title>
          .
          <source>In: Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics</source>
          . pp.
          <volume>1668</volume>
          {
          <fpage>1678</fpage>
          . Association for Computational Linguistics, Florence,
          <source>Italy (Jul</source>
          <year>2019</year>
          ). https://doi.org/10.18653/v1/
          <fpage>P19</fpage>
          - 1163, https://www.aclweb.org/anthology/P19-1163
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Schmidt</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wiegand</surname>
            ,
            <given-names>M.:</given-names>
          </string-name>
          <article-title>A survey on hate speech detection using natural language processing</article-title>
          .
          <source>In: Proceedings of the fth international workshop on natural language processing for social media</source>
          . pp.
          <volume>1</volume>
          {
          <issue>10</issue>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Schroepfer</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>How ai is getting better at detecting hate speech</article-title>
          (
          <year>Nov 2020</year>
          ), https://ai.facebook.com/blog/ how-ai
          <article-title>-is-getting-better-at-detecting-hate-speech</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Statt</surname>
          </string-name>
          , N.:
          <article-title>Twitter tests a warning message that tells users to rethink offensive replies</article-title>
          (May
          <year>2020</year>
          ), https://www.theverge.com/
          <year>2020</year>
          /5/5/21248201/ twitter-reply
          <article-title>-warning-harmful-language-revise-tweet-moderation</article-title>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>