<!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>Mitigation for Large Language Models using Adversarial Learning</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Jasmina S. Ernst</string-name>
          <email>jasmina.ernst.msc@gmail.com</email>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Sascha Marton</string-name>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Jannik Brinkmann</string-name>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Eduardo Vellasques</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Damien Foucard</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Martin Kraemer</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Marian Lambert</string-name>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>SAP SE</institution>
          ,
          <addr-line>Dietmar-Hopp-Allee 16, 69190 Walldorf</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>TU Berlin</institution>
          ,
          <addr-line>Straße des 17. Juni 135, 10623 Berlin</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>University of Mannheim</institution>
          ,
          <addr-line>68131 Mannheim</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2023</year>
      </pub-date>
      <abstract>
        <p>Commercial applications increasingly build on large language models (LLMs). Given the inherent biases of LLMs, advancements in fairness research are urgent. Prior methods for mitigating biases in LLMs only address fairness in either language generation tasks or downstream tasks. Additionally, they often incur substantial computational costs by training from scratch. We propose a novel debiasing method that employs adversarial learning during model pre-training. Without hyperparameter optimization our comparably computationally eficient method demonstrates increased fairness on a natural language generation task while maintaining performance. In addition, we show that our fairness gains transfer to a downstream task, at a performance cost. We explore a fairness approach which holds a significant potential for redefining the landscape of fairness of LLMs: By learning a single debiased model which can be applied to a variety of tasks, this approach eliminates the need for additional or task-specific debiasing steps. Hence, it facilitates the development of fair commercial applications and constitutes a step towards the broader goal of fairness in societies at large.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        State-of-the-art models in natural language processing (NLP) referred to as large language
models (LLMs) commonly have a transformer architecture and perform well on a variety of tasks
such as generating coherent and semantically meaningful text or providing a good translation of
text from one language to another. In order to become the powerful models they are, these LLMs
are trained on large text corpora taken from internet platforms. Researchers have found that the
training data used for this purpose often contain biases against identity groups, ranging from
sexist or racist attitudes to prejudice against religious beliefs, professions, or political ideology
[
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. As a result, biases towards diferent identity groups are inherent to these transformer-based
LLMs. A number of scholars showcased LLM biases on diferent tasks, among them the task of
natural language generation (NLG) [
        <xref ref-type="bibr" rid="ref2 ref3">2, 3</xref>
        ] as well as various text classification tasks [
        <xref ref-type="bibr" rid="ref4 ref5 ref6">4, 5, 6</xref>
        ].
      </p>
      <p>
        Fairness in NLG has escaped close examination until recently, due to the inherent dificulty
of asserting unfairness in text. However, lately more research dedicated to NLG fairness was
published, including a benchmark dataset and evaluation metrics by Dhamala et al. [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. While
a few debiasing methods for NLG exist, they often decrease performance and none of their
fairness improvements are so far transferable to other downstream tasks without extra steps
on the developer’s part. Furthermore, some of the few proposed debiasing methods incur
immense computational costs and are not sustainable. While there exist debiasing methods for
text classification that deliver good fairness-performance trade-ofs, the fairness gains of these
methods are task-specific and cannot be transferred to language modeling tasks.
      </p>
      <p>The possibility to transfer fairness to diferent tasks directly, however, would allow employing
a single debiased LLM for a variety of tasks without further steps or further consideration of bias.
A single debiased model hosted on a centralized hub would enable developers to efortlessly
build fair applications. With task-specific debiasing methods which cannot transfer fairness to
other tasks on the other hand, developers will have to apply debiasing methods themselves
a step that most likely not all developers have the time, skill, and literacy for. Only fairness
transfers enable the application of LLMs to diferent tasks with fair results, thus, utilizing their
true power in a just way.</p>
      <p>In this paper we propose an adversarial debiasing method in order to mitigate bias in
transformer-based LLMs. In our experiments on gender bias mitigation using a BERT
architecture, we show two main advantages of the proposed method: First, we present an efective
and relatively computationally eficient debiasing method for pre-trained transformers on the
language generation task autocompletion. We report the two extrinsic fairness metrics regard
and sentiment fairness and further demonstrate that our debiased models maintain their
performance as measured by perplexity on this task. Second, we show that fairness improvements
from our debiasing method transfer to the downstream task text classification without further
adjustments at a performance cost. We measure text classification fairness with the TPR Gap.
For our experiments we consider a gender bias as it is the most researched bias. We demonstrate
the use of our approach on the most researched LLM, BERT.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Related Work</title>
      <p>
        Previous research in fairness has come up with debiasing methods which can mitigate bias
efectively either for language modeling and NLG or downstream tasks. In accordance with
Steed et al. [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], we refer to upstream bias as the biases inherent to the LLM immediately after
the pre-training, because pre-training is the first step in the training pipeline. We assume that
the pre-training task of LLMs is a language modeling task like for BERT [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] or GPT [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. After
pre-training, LLMs are often fine-tuned to tasks diferent from the pre-training task, which are
referred to as downstream tasks (e.g. text classification). In the next two paragraphs we discuss
the challenges in NLG debiasing methods which are all applied upstream before moving on to
existing works regarding downstream fairness.
      </p>
      <p>
        NLG Fairness Counterfactual Data Augmentation (CDA) is a method commonly employed
for achieving upstream fairness which evolves around adding complementary counterfactual
sentences to the original training sentences to address bias [
        <xref ref-type="bibr" rid="ref10">10, 11</xref>
        ]. CDA-based approaches,
as the one by Lu et al. [12], result in significant upstream fairness improvements, while
maintaining predictive power. Their results indicate that there is no trade-of between fairness
and performance for NLG. Additionally, Liu et al. [13] use an adversarial learning approach
diferent from ours for an NLG task. With unbiased gendered features and semantic features
extracted by an RNN they generate dialogue responses. They are able to improve fairness while
maintaining the quality of generated text. However, the limitation of these two approaches is that
models need to be trained from scratch which leads to high computational costs. Additionally,
even if the CDA approach or a CDA-based approach represents the protected attribute as a
high-level feature which is free of bias, bias is often reintroduced through fine-tuning on a
downstream task Liu et al. [13]. Therefore the CDA-based approaches are probably prone to
relearn biases.
      </p>
      <p>More advanced variations of the CDA approach have also been developed, such as Gupta
et al.’s [14] debiasing method for GPT-2 and Lauscher et al.’s [15] utilization of adapters for
debiasing. These two CDA-based techniques show promise in mitigating biases upstream
without requiring the model to be trained from scratch thereby significantly reducing the
computational complexity for debiasing. However, Gupta et al. [14] report that their fairness
gains are not transferable. Lauscher et al.[15] show that their achieved fairness gain for language
modeling is transferable to downstream tasks when using an additional task-specific adapter,
albeit with a decrease in performance. However, the necessity for a task-specific adapter on
downstream tasks is a disadvantage, because developers need to be aware of bias and perform
this extra step.</p>
      <p>Schick et al. [16] apply a self-debiasing technique to GPT-2 for NLG tasks, instructing the
model to avoid generating biased text. Their results indicate increased fairness with minimal
impact on model performance and particularly little computational costs, but self-debiasing
cannot be transferred to downstream tasks.</p>
      <p>Text Classification Fairness There is extensive research on approaches specifically tailored
to downstream fairness, the most important of which we outline here. For downstream tasks,
a trade-of between fairness and performance is generally assumed. We outline the most
important text classification debiasing methods here and elucidate most of their shortcomings
only in the last paragraph.</p>
      <p>One example for downstream debiasing is called INLP [17] - it constitutes an established
approach for text classification. INLP tackles debiasing by iteratively projecting the last
representation layer to the null-space of the protected attribute. INLP efectively removes biases,
but in comparison to more recently proposed methods lacks performance. Many other fairness
approaches developed only for downstream tasks are based on pre-processing the training data.
That is, they focus on removing bias before model training by modifying the distribution of
the input data. Brunet et al. [18] proposed an early pre-processing approach that focuses on
excluding strongly biased texts in order to improve fairness. Han et al. [19] propose the BTEO
debiasing method, which employs resampling strategies at the dataset level and reweighting at
the instance level to balance the dataset with respect to biased features. Han et al. report BTEO
achieves a particularly good fairness-performance trade-of for text classification in comparison
to most other debiasing methods.</p>
      <p>
        Another debiasing approach is founded on adversarial learning on a text classification task
(in contrast to our use of adversarial learning on a language modeling task). Han et al. [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] show
that this is efective as a downstream-specific debiasing technique. Additionally, Jin et al. [ 20]
show that fairness gains obtained through adversarial debiasing on a text classification task are
transferable across diferent downstream tasks.
      </p>
      <p>Because all of these methods are applied before, during or after fine-tuning the last layers of a
LLM for downstream tasks, as opposed to training an LLM from scratch, the computational costs
of these methods is relatively low. However, only the adversarial learning approach of Jin et al.
[20] allows for transfers within the downstream domain, and none of the downstream-specific
debiasing method’s fairness improvements can be transferred to language modeling or NLG.</p>
    </sec>
    <sec id="sec-3">
      <title>3. Approach</title>
      <p>We propose a novel debiasing approach which debiases LLMs upstream. In contrast to other
adversarial learning approaches, we use adversarial learning on the task that the LLM is
pretrained with. Our method builds on already pre-trained LLMs and continues their pre-training,
rather than training from scratch - thereby reducing the computational efort.</p>
      <p>During the debiasing process on the continued pre-training task, the discriminator is used
for regularization and is dropped after. The debiased LLMs can then be applied to language
modeling or downstream tasks in the same way a standard pre-trained LLM would be used.
Because our adversarial debiasing aims to reduce or remove the representation of the high-level
feature gender, corresponding biases are also less likely to be relearned downstream which sets
our approach apart from other methods which improve upstream fairness.</p>
      <sec id="sec-3-1">
        <title>3.1. Adversarial Learning</title>
        <p>Our formal assumption is that we have a dataset  = {(  ,   ,   )}=1 , where   ∈  represents
a d-dimensional vector representing the input text,   ∈  denotes the pre-training task label
(which is often a word or a sequence of words), and   ∈  represents the protected attribute
associated with   (for instance, the gender of the person the text is about).</p>
        <p>
          Our proposed method builds on previous adversarial learning approaches by Li et al. [22]
and Han et al. [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ]. For an input   , the corresponding target   and the protected label   , an
encoder   is learnt so that it represents the hidden state ℎ after the j-the representation layer:
hij =  (xi;   ). On top of this encoder a classification head predicts the target   from the
hidden state which can be formally denoted as yî =  (hij;   ). Additionally, an adversarial
discriminator   predicts   from the same hidden state as well: aî =  (hij;   ).
        </p>
        <p>Our adversarial learning addresses an optimization problem with two key objectives: to
form representations which are useful for a variety of tasks and to come up with bias-free
representations. The optimization problem is formally denoted by the following equation taken
from Li et al.[22] with the cross entropy loss denoted by  :
min max  ( y, ŷ) −  (
  ,   
a, â).</p>
        <p>(1)</p>
        <p>To maximise the adversary’s loss, it is backpropagated with gradient reversal to the LLM.
Using gradient reversal instead of gradient descent stirs the LLM away from optima in which
the protected variable gender is represented. One concrete example of our debiasing method
would be to use it on a pre-trained BERT model, for which the pre-training task is masked
language modeling (MLM). In this case, the LLM encodes ℎ from an input sentence   . The
LLM then predicts the masked word   from ℎ , and the discriminator predicts the gender   the
sentence is about.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Experiments</title>
      <sec id="sec-4-1">
        <title>4.1. Experimental Setup</title>
        <p>We select the two tasks autocompletion and text classification to experimentally evaluate our
debiasing approach. Many researchers contend that a model’s inherent bias, its upstream, can be
best captured by quantifying the NLG bias [23, 24, 25, 26, 27]. We additionally test our models
on the task text classification to examine the fairness transfer downstream and because it is a
well-researched task under the fairness aspect.</p>
        <sec id="sec-4-1-1">
          <title>4.1.1. Datasets</title>
          <p>We use non-overlapping subsets of the BIOS dataset towards achieving two of our goals,
debiasing and testing model performances on the text classification task. For the evaluation of
our pre-trained model in regard to autocompletion we choose the BOLD dataset. We address
potential fallacies of using the same data distribution for two steps in our pipeline in Section
4.1.3.</p>
          <p>BIOS The dataset BIOS is named after its contents - it is a collection of about 396,000
biographies scraped with the scripts by Ravfogel et al. [17].1 Gender labels are included in the dataset,
alongside profession labels, making it a suitable dataset for various applications such as
adversarial debiasing and fairness evaluation in regard to gender. The dataset includes profession
labels on top of the gender labels, which is why it is widely recognized and frequently used in
fairness research in NLP, specifically as a benchmark dataset for fairness in the downstream
task text classification.</p>
          <p>We first split the dataset into train (65%), test (25%), and validation data (10%) as suggested by
Han et al. [19] for comparability. Of each of these data subsets, we split of 30% which we use for
our debiasing. Before debiasing, we pre-process the biography texts for the LLM’s pre-training
task. Because we experiment with BERT, we only use the first sentence from the biographies
and mask random words for the MLM pre-training.</p>
          <p>We later use the remaining 70% of each subset of the BIOS dataset for the text classification
task of predicting professions from the biographies in BIOS. We confined our test set for the
text classification task to a representative sample maximum of 10,000 instances.
BOLD For the NLG task we chose the large-scale dataset BOLD which is an autocompletion
task. Complete with corresponding BOLD evaluation metrics, the BOLD dataset is an emerging
benchmark for NLG fairness, providing insights into five diferent bias dimensions with gender
being among them. It contains approximately 24,000 instances, each representing the beginning
of a sentence about an individual with a specified gender label. We autocomplete the sentence
prompts about women and men respectively, and compare the generated texts with BOLD
metrics.</p>
        </sec>
        <sec id="sec-4-1-2">
          <title>4.1.2. Evaluation Metrics</title>
          <p>The term intrinsic metrics refers to measures based on embedding similarity, whereas extrinsic
metrics measure fairness on a particular task. Extrinsic metrics are considered better fairness
measures because intrinsic metrics do not reliably predict task fairness [28, 29]. Due to this
ifnding from recent fairness research in NLP the selected metrics presented here are exclusively
extrinsic fairness measures.</p>
          <p>Autocompletion Metrics In our investigation, we employ the perplexity measure, a
commonly used metric in NLG, as a performance metric for autocompletion. It quantifies the degree
of uncertainty or perplexity associated with predicting the next word or sequence of words
given a context. Perplexity, thus, reflects the fluency and coherence of the generated language,
with lower perplexity values indicating a higher performance. We additionally report the BLEU
metric, which is based on n-gram similarity and can reveal content drifts in generated language
when a ground-truth text is available.</p>
          <p>
            For the selection and implementation of automated NLG fairness metrics, we follow the
approach of Dhamala et al. [
            <xref ref-type="bibr" rid="ref2">2</xref>
            ] who propose a set of evaluation metrics. We consider the metrics
sentiment and regard - because they are the most frequently used fairness metrics for NLG.
1The data were provided to us by Han et al. [19], who re-scraped the dataset with the specified scripts.
          </p>
          <p>
            The sentiment metric is a measure of the language polarity in a sentence e.g. about women.
For an automated sentiment score, we avail ourselves of the Valence Aware Dictionary and
Sentiment Reasoner (VADER) model trained [30] without changing the default settings.2 We
follow Dhamala et al. [
            <xref ref-type="bibr" rid="ref2">2</xref>
            ] in calculating categorical sentiment values from the VADER assertions.
          </p>
          <p>
            Additionally, we measure the regard metric, as in the sentiment expressed towards a person
or group in a sentence, which can difer from the overall sentiment expressed in the sentence.
For instance, consider the following racist statement: ”I am so happy and relieved, these black
folks are gone.”. The overall sentiment is positive, while the regard expressed towards black
people is negative. Analogously, to the regard evaluation of Dhamala et al. [
            <xref ref-type="bibr" rid="ref2">2</xref>
            ], we use the
regard classifier ”R3” trained by Sheng et al. [
            <xref ref-type="bibr" rid="ref3">3</xref>
            ].3 As the regard classifier, Sheng et al. train a
BERT model on human-annotated texts to distinguish sentences that convey regard towards
diferent genders and other identity groups.
          </p>
          <p>
            We then conduct a two-tailed A &amp; B test for the significance of the disparities for both
the sentiment and regard metrics positively and negatively classified instances. The A &amp; B
significance test [ 31] asserts how unlikely it is that two distinct rates (e.g. in sentences with
negative sentiment) for two corresponding groups are actually from the same distribution.
Text Classification Metrics In accordance with the studies conducted by Han et al. [
            <xref ref-type="bibr" rid="ref4 ref6">6, 4</xref>
            ]
and Ravfogel et al. [17], our approach utilizes overall accuracy as the performance and the
True Positive Rate (TPR) GAP as the fairness measure which builds on fairness defined as the
equality in opportunity. We follow Han et al. [
            <xref ref-type="bibr" rid="ref4">4</xref>
            ] in computing the quadratic mean (RMS) of
TPR GAP across classes. Smaller values are preferable for GAP metrics, with a perfect model
achieving a GAP of 0, indicating complete fairness.
          </p>
          <p>We aggregate at both the group and class levels to determine the RMS TPR GAP. Regarding
the group level, we calculate the absolute diference in TPR for each class between each group
and the overall TPR GAP denoted by Equation 2. On the class level, we further aggregate the
RMS values to obtain the RMS TPR GAP, expressed in Equation 3.</p>
          <p>=
 
,
= ∑ |  
∈
1 ∑ (
√ | | ∈
, −</p>
          <p>
            |
 
,
2
)
(2)
(3)
4.1.3. Models
We carry out our experiments with the pre-trained BERT ”bert-base-cased” from the huggingface
hub. We debias two models with our proposed approach: ADV 1 and ADV 2. For debiasing, we
use an instance equipped with an NVIDIA T4 GPU and 64 vCPUs, which takes about 18 hours
to debias our models with the described setup. For the debiasing, we froze 10 layers out of the
13 transformer layers. Based on the findings of Han et al. [
            <xref ref-type="bibr" rid="ref6">6</xref>
            ] and Han et al. [
            <xref ref-type="bibr" rid="ref5">5</xref>
            ] and to ensure
an efect of adversarial debiasing, we decided to select a  value approximately equal to one or
higher.
2The VADER code repository can be found under https://github.com/cjhutto/vaderSentiment
3The code is available at https://github.com/ewsheng/nlg-bias
most important settings for training them are shown. In addition to the models, we list the task-specific
autocompletion baselines which we refer to as WIKIPEDIA. The dataset size reported refers to the
percentage of BIOS training data used.
          </p>
          <p>Model
ADV 1</p>
          <p>ADV 2
CONTROL
STANDARD
WIKIPEDIA</p>
          <p>Treatment
adversarial debiasing
adversarial debiasing
continued pre-training

1
3</p>
          <p>Hyperparameters
Adv. Layers</p>
          <p>Data Size</p>
          <p>Epochs
2
2
regardless of adversarial learning. We include a CONTROL model for which we continue the
pretraining of the STANDARD model as with the ADV models, however without our adversarial
debiasing. By comparing our adversarially debiased LLMs with the CONTROL we can estimate
the impact of adversarial learning and avoid mistakenly attributing the efects of continued
pre-training to our adversarial debiasing.</p>
          <p>
            For the autocompletion task, we follow follow Dhamala et al. [
            <xref ref-type="bibr" rid="ref2">2</xref>
            ] in using the bert-gen
functions provided on GitHub to generate sentences with BERT from a prompt.4 Other than
the named hyperparameter settings, we aimed for respective standard hyperparameters when
running the pre-training or fine-tuning tasks. We use the Adam optimizer [ 32] and a learning
rate of 3 −3 for the pre-training task.
          </p>
        </sec>
        <sec id="sec-4-1-3">
          <title>Text Classification Models</title>
          <p>
            After a trial run of fine-tuning a STANDARD BERT model for
ten epochs, we found the accuracy gains to be marginal after the first five epochs, leaving us to
train our models for five epochs only which is more than Devlin et al. [
            <xref ref-type="bibr" rid="ref8">8</xref>
            ] report to be generally
necessary. We use a learning rate of 1 −5 for fine-tuning, as the models did not perform well
on fine-tuning with a higher one. For testing, we adhere to the default of freezing the first ten
layers of BERT during fine-tuning, if not specified otherwise. Freezing more than ten out of the
13 BERT layers leads to a performance decrease as shown by Merchant et al. [33].
          </p>
          <p>However, for some of the models debiased with our approach, only the three last layers
were debiased. We therefore freeze more than ten layers for these models during fine-tuning
to preserve the debiasing, even though the performance of our models is lower as a result of
this. We ran a handful experiments with the CONTROL and STANDARD model as well with
more than ten layers frozen which confirms freezing ten layers generally does not lead to an
improved fairness-performance trade-of, except for our method.
4The code is available on https://github.com/nyu-dl/bert-gen.</p>
        </sec>
      </sec>
      <sec id="sec-4-2">
        <title>4.2. Results</title>
        <p>
          Our adversarial debiasing method processes a maximum of 7.1 million words during continued
pre-training and passes only two times over the dataset. In contrast, debiasing methods which
depend on training from scratch require a minimum of 40 passes over a 3.3 billion-word corpus
[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ] for the same model on the same task. Using the number of processed words as a metric for
computational cost, our method requires less than 0.0022% of the computational cost in terms
of words processed, making it far more eficient.
        </p>
        <p>Autocompletion Results The results of the autocompletion fairness metrics for the texts
generated by the four models and the WIKIPEDIA baseline metrics are visualized in Figure 2.
In the categories of negative sentiment and positive regard, our models display a fairness gain
compared to the non-debiased baselines. Additionally, for all four fairness aspects, one of our
models achieve the best (lowest) value.</p>
        <p>The STANDARD model’s perplexity scores at least 4.11 units higher than all our models in
perplexity, which proves that our method increases performances on NLG tasks, while
simultaneously debiasing the LLM. The CONTROL model’s results show the increase in performance is
due to the continued pre-training. However, our debiased models, pre-trained with adversarial
learning, have only slightly higher perplexity scores than the CONTROL model, suggesting
that debiasing does not or only marginally decrease performance when controlling for longer
pre-training. Additionally, many other debiasing methods cannot improve performance when
compared to the STANDARD pre-trained model. As for the BLEU score, we again ascertain a
positive efect of continued pre-training by itself, however, the best BLEU scores are achieved
by our approach.</p>
        <p>Text Classification Results In accordance with the recent literature on the topic, we
consider the TPR GAP to be the most important indicator for fairness and therefore visualized a
transformed version of the TPR Gap as a fairness measure in the mentioned figure. 5</p>
        <p>The optimal balance between fairness and performance is observed in the BTEO debiasing
method when employing a downsampling strategy. The increased fairness of our models in
comparison to the STANDARD and CONTROL models substantiates the efectiveness of our
adversarial debiasing method in attaining transferable fairness improvements. Furthermore,
our proposed methods exhibit a more favorable fairness-performance trade-of in contrast to
some of the alternative approaches, thus establishing their competitiveness on this downstream
task.</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>5. Conclusion</title>
      <p>We introduced a novel, relatively computationally cheap approach for debiasing pre-trained
LLMs through adversarial learning on the pre-training task. Our approach increases fairness
upstream and we showed that this fairness gain transfers to a downstream task without additional
steps as well which constitutes a significant improvement over previous debiasing approaches.</p>
      <p>As we did not carry out a search for optimal hyperparameters, we believe that our results do
not reflect the true potential of this approach. We anticipate that our approach can improve
fairness levels further for both tasks. For the NLG task, autocompletion, we assume fairness
can be increased without decreasing performance and for the downstream task we expect an
improved fairness-performance trade-of with altered debiasing hyperparameters. One essential
hyperparameter and a promising avenue for future research on our proposed approach and
downstream fairness would be to explore freezing fewer layers of LLMs during debiasing, so that
when only freezing e.g. ten layers during fine-tuning for the downstream tasks the debiasing is
harder to undo.</p>
      <p>
        Additionally, incorporating a diverse adversarial debiasing method could further benefit our
approach which involves learning multiple adversarial networks, each encouraged to learn
orthogonal representations. A study by Han et al. [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] demonstrates the improved fairness gains
on downstream tasks as a result of diverse adversarial learning, rather than normal adversarial
learning. Another promising approach to improving the adversary’s cost function is to weight
the adversary’s loss with the hyperbolic function hyperbolic cosecant before subtracting it from
the LLM’s loss.
      </p>
      <p>
        Beyond the potential enhancements of our proposed approach, our work opens up promising
directions for future research. While gender bias is the most researched type of bias in NLP,
5Previous literature, such as the visualization by Han et al.[
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], serves as a guide for the choice of the plot type and
the used axes (TPR Gap based fairness and performance) for Figure 3.
other biases, such as those toward ethnic groups, require equal attention. An inevitable goal of
future research should be the ability to remove more than one bias using just one debiasing
method. With the increased usage of LLMs for generating natural language, it is essential to
address intersectional biases as well, as highlighted by Lalor et al. [34]. Adversarial learning is a
potential solution for this challenge, where multiple adversaries can be utilized simultaneously.
the North American Chapter of the Association for Computational Linguistics: Human
Language Technologies, Volume 2 (Short Papers), Association for Computational
Linguistics, New Orleans, Louisiana, 2018, pp. 15–20. URL: https://aclanthology.org/N18-2003.
doi:10.18653/v1/N18- 2003.
[11] J. Brinkmann, P. Swoboda, C. Bartelt, A multidimensional analysis of social biases in vision
transformers, 2023. arXiv:2308.01948.
[12] K. Lu, P. Mardziel, F. Wu, P. Amancharla, A. Datta, Gender Bias in Neural Natural Language
      </p>
      <p>Processing, 2019. URL: http://arxiv.org/abs/1807.11714, arXiv:1807.11714 [cs].
[13] H. Liu, W. Wang, Y. Wang, H. Liu, Z. Liu, J. Tang, Mitigating Gender Bias for Neural
Dialogue Generation with Adversarial Learning, 2020. URL: http://arxiv.org/abs/2009.13028.
doi:10.48550/arXiv.2009.13028, arXiv:2009.13028 [cs].
[14] U. Gupta, J. Dhamala, V. Kumar, A. Verma, Y. Pruksachatkun, S. Krishna, R. Gupta, K.-W.</p>
      <p>Chang, G. V. Steeg, A. Galstyan, Mitigating Gender Bias in Distilled Language Models via
Counterfactual Role Reversal, 2022. URL: http://arxiv.org/abs/2203.12574, arXiv:2203.12574
[cs].
[15] A. Lauscher, T. Lüken, G. Glavaš, Sustainable Modular Debiasing of Language Models,
2021. URL: http://arxiv.org/abs/2109.03646, arXiv:2109.03646 [cs].
[16] T. Schick, S. Udupa, H. Schütze, Self-Diagnosis and Self-Debiasing: A Proposal for Reducing
Corpus-Based Bias in NLP, 2021. URL: http://arxiv.org/abs/2103.00453. doi:10.48550/
arXiv.2103.00453, arXiv:2103.00453 [cs].
[17] S. Ravfogel, Y. Elazar, H. Gonen, M. Twiton, Y. Goldberg, Null It Out: Guarding Protected
Attributes by Iterative Nullspace Projection, arXiv:2004.07667 [cs] (2020). URL: http:
//arxiv.org/abs/2004.07667, arXiv: 2004.07667.
[18] M.-E. Brunet, C. Alkalay-Houlihan, A. Anderson, R. Zemel, Understanding the Origins
of Bias in Word Embeddings, in: Proceedings of the 36th International Conference on
Machine Learning, PMLR, 2019, pp. 803–811. URL: https://proceedings.mlr.press/v97/
brunet19a.html, iSSN: 2640-3498.
[19] X. Han, T. Baldwin, T. Cohn, Balancing out Bias: Achieving Fairness Through Balanced
Training, in: Proceedings of the 2022 Conference on Empirical Methods in Natural
Language Processing, Association for Computational Linguistics, Abu Dhabi, United Arab
Emirates, 2022, pp. 11335–11350. URL: https://aclanthology.org/2022.emnlp-main.779.
[20] X. Jin, F. Barbieri, B. Kennedy, A. M. Davani, L. Neves, X. Ren, On Transferability of Bias
Mitigation Efects in Language Model Fine-Tuning, 2021. URL: http://arxiv.org/abs/2010.
12864. doi:10.48550/arXiv.2010.12864, arXiv:2010.12864 [cs, stat].
[21] P. Delobelle, P. Temple, G. Perrouin, B. Frénay, P. Heymans, B. Berendt, Ethical
Adversaries: Towards Mitigating Unfairness with Adversarial Machine Learning, SIGKDD
Explor. Newsl. 23 (2021) 32–41. URL: https://doi.org/10.1145/3468507.3468513. doi:10.1145/
3468507.3468513, number: 1.
[22] Y. Li, T. Baldwin, T. Cohn, Towards Robust and Privacy-preserving Text Representations, in:
Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics
(Volume 2: Short Papers), Association for Computational Linguistics, Melbourne, Australia,
2018, pp. 25–30. URL: https://aclanthology.org/P18-2005. doi:10.18653/v1/P18- 2005.
[23] E. Sheng, K.-W. Chang, P. Natarajan, N. Peng, Societal Biases in Language
Generation: Progress and Challenges, 2021. URL: http://arxiv.org/abs/2105.04054, issue:
arXiv:2105.04054 arXiv:2105.04054 [cs].
[24] S. Bordia, S. R. Bowman, Identifying and Reducing Gender Bias in Word-Level Language
Models, 2019. URL: http://arxiv.org/abs/1904.03035. doi:10.48550/arXiv.1904.03035,
arXiv:1904.03035 [cs].
[25] E. Sheng, J. Arnold, Z. Yu, K.-W. Chang, N. Peng, Revealing Persona Biases in Dialogue</p>
      <p>Systems, 2021. URL: http://arxiv.org/abs/2104.08728, arXiv:2104.08728 [cs].
[26] T. B. Brown, B. Mann, N. Ryder, M. Subbiah, J. Kaplan, P. Dhariwal, A. Neelakantan,
P. Shyam, G. Sastry, A. Askell, S. Agarwal, A. Herbert-Voss, G. Krueger, T. Henighan,
R. Child, A. Ramesh, D. M. Ziegler, J. Wu, C. Winter, C. Hesse, M. Chen, E. Sigler,
M. Litwin, S. Gray, B. Chess, J. Clark, C. Berner, S. McCandlish, A. Radford, I. Sutskever,
D. Amodei, Language Models are Few-Shot Learners, ArXiv (2020). URL: https://www.
semanticscholar.org/paper/Language-Models-are-Few-Shot-Learners-Brown-Mann/
6b85b63579a916f705a8e10a49bd8d849d91b1fc.
[27] I. Solaiman, M. Brundage, J. Clark, A. Askell, A. Herbert-Voss, J. Wu, A. Radford, G. Krueger,
J. W. Kim, S. Kreps, M. McCain, A. Newhouse, J. Blazakis, K. McGufie, J. Wang, Release
Strategies and the Social Impacts of Language Models, 2019. URL: http://arxiv.org/abs/
1908.09203. doi:10.48550/arXiv.1908.09203, arXiv:1908.09203 [cs].
[28] P. Czarnowska, Y. Vyas, K. Shah, Quantifying Social Biases in NLP: A Generalization and
Empirical Comparison of Extrinsic Fairness Metrics, Transactions of the Association for
Computational Linguistics 9 (2021) 1249–1267. URL: https://doi.org/10.1162/tacl_a_00425.
doi:10.1162/tacl_a_00425.
[29] S. Goldfarb-Tarrant, R. Marchant, R. M. Sanchez, M. Pandya, A. Lopez, Intrinsic Bias
Metrics Do Not Correlate with Application Bias, 2021. URL: http://arxiv.org/abs/2012.15859,
arXiv:2012.15859 [cs].
[30] C. Hutto, E. Gilbert, Vader: A parsimonious rule-based model for sentiment analysis of
social media text, in: Proceedings of the international AAAI conference on web and social
media, volume 8, 2014, pp. 216–225.
[31] D. C. Montgomery, G. C. Runger, Applied statistics and probability for engineers, John
wiley &amp; sons, 2010.
[32] D. P. Kingma, J. Ba, Adam: A Method for Stochastic Optimization, 2017. URL: http://arxiv.</p>
      <p>org/abs/1412.6980. doi:10.48550/arXiv.1412.6980, arXiv:1412.6980 [cs].
[33] A. Merchant, E. Rahimtoroghi, E. Pavlick, I. Tenney, What happens to bert embeddings
during fine-tuning?, arXiv preprint arXiv:2004.14448 (2020).
[34] J. Lalor, Y. Yang, K. Smith, N. Forsgren, A. Abbasi, Benchmarking Intersectional Biases
in NLP, in: Proceedings of the 2022 Conference of the North American Chapter of the
Association for Computational Linguistics: Human Language Technologies, Association
for Computational Linguistics, Seattle, United States, 2022, pp. 3598–3609. URL: https:
//aclanthology.org/2022.naacl-main.263. doi:10.18653/v1/2022.naacl-main.263.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>P.</given-names>
            <surname>Badjatiya</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Gupta</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Varma</surname>
          </string-name>
          ,
          <article-title>Stereotypical bias removal for hate speech detection task using knowledge-based generalizations</article-title>
          ,
          <source>in: The World Wide Web Conference</source>
          ,
          <year>2019</year>
          , pp.
          <fpage>49</fpage>
          -
          <lpage>59</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>J.</given-names>
            <surname>Dhamala</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Sun</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Kumar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Krishna</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Pruksachatkun</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.-W.</given-names>
            <surname>Chang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Gupta</surname>
          </string-name>
          ,
          <article-title>BOLD: Dataset and Metrics for Measuring Biases in Open-Ended Language Generation</article-title>
          ,
          <source>in: Proceedings of the 2021 ACM Conference on Fairness, Accountability, and Transparency</source>
          , FAccT '21,
          <string-name>
            <surname>Association</surname>
          </string-name>
          for Computing Machinery, New York, NY, USA,
          <year>2021</year>
          , pp.
          <fpage>862</fpage>
          -
          <lpage>872</lpage>
          . URL: https://doi.org/10.1145/3442188.3445924. doi:
          <volume>10</volume>
          .1145/3442188.3445924.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>E.</given-names>
            <surname>Sheng</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.-W.</given-names>
            <surname>Chang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Natarajan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Peng</surname>
          </string-name>
          ,
          <article-title>The Woman Worked as a Babysitter: On Biases in Language Generation</article-title>
          ,
          <year>2019</year>
          . URL: http://arxiv.org/abs/
          <year>1909</year>
          .01326. doi:
          <volume>10</volume>
          .48550/ arXiv.
          <year>1909</year>
          .
          <volume>01326</volume>
          , arXiv:
          <year>1909</year>
          .01326 [cs].
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>X.</given-names>
            <surname>Han</surname>
          </string-name>
          ,
          <string-name>
            <surname>T</surname>
          </string-name>
          . Baldwin, T. Cohn,
          <source>Towards Equal Opportunity Fairness through Adversarial Learning</source>
          ,
          <year>2022</year>
          . URL: http://arxiv.org/abs/2203.06317. doi:
          <volume>10</volume>
          .48550/arXiv.2203.06317, issue: arXiv:
          <fpage>2203</fpage>
          .06317 Number: arXiv:
          <fpage>2203</fpage>
          .06317 arXiv:
          <fpage>2203</fpage>
          .06317 [cs].
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>X.</given-names>
            <surname>Han</surname>
          </string-name>
          ,
          <string-name>
            <surname>T</surname>
          </string-name>
          . Baldwin, T. Cohn,
          <article-title>Decoupling Adversarial Training for Fair NLP, in: Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021</article-title>
          ,
          <article-title>Association for Computational Linguistics</article-title>
          , Online,
          <year>2021</year>
          , pp.
          <fpage>471</fpage>
          -
          <lpage>477</lpage>
          . URL: https://aclanthology.org/
          <year>2021</year>
          . findings-acl.
          <volume>41</volume>
          . doi:
          <volume>10</volume>
          .18653/v1/
          <year>2021</year>
          .findings- acl.41.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>X.</given-names>
            <surname>Han</surname>
          </string-name>
          ,
          <string-name>
            <surname>T</surname>
          </string-name>
          . Baldwin, T. Cohn,
          <article-title>Diverse Adversaries for Mitigating Bias in Training, in: Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume, Association for Computational Linguistics</article-title>
          , Online,
          <year>2021</year>
          , pp.
          <fpage>2760</fpage>
          -
          <lpage>2765</lpage>
          . URL: https://aclanthology.org/
          <year>2021</year>
          .eacl-main.
          <volume>239</volume>
          . doi:
          <volume>10</volume>
          .18653/v1/
          <year>2021</year>
          .eacl- main.239.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>R.</given-names>
            <surname>Steed</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Panda</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Kobren</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Wick</surname>
          </string-name>
          ,
          <article-title>Upstream Mitigation Is N ot All You Need: Testing the Bias Transfer Hypothesis in Pre-Trained Language Models, in: Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics</article-title>
          (Volume
          <volume>1</volume>
          :
          <string-name>
            <surname>Long</surname>
            <given-names>Papers)</given-names>
          </string-name>
          ,
          <source>Association for Computational Linguistics</source>
          , Dublin, Ireland,
          <year>2022</year>
          , pp.
          <fpage>3524</fpage>
          -
          <lpage>3542</lpage>
          . URL: https://aclanthology.org/
          <year>2022</year>
          .
          <article-title>acl-long</article-title>
          .
          <volume>247</volume>
          . doi:
          <volume>10</volume>
          .18653/v1/
          <year>2022</year>
          .acl- long.247.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>J.</given-names>
            <surname>Devlin</surname>
          </string-name>
          , M.-
          <string-name>
            <given-names>W.</given-names>
            <surname>Chang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Lee</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Toutanova</surname>
          </string-name>
          , BERT:
          <article-title>Pre-training of Deep Bidirectional Transformers for Language Understanding</article-title>
          ,
          <year>2019</year>
          . URL: http://arxiv.org/abs/
          <year>1810</year>
          .04805, arXiv:
          <year>1810</year>
          .04805 [cs].
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>A.</given-names>
            <surname>Radford</surname>
          </string-name>
          ,
          <string-name>
            <surname>J. Wu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Child</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Luan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Amodei</surname>
          </string-name>
          ,
          <string-name>
            <surname>I. Sutskever</surname>
          </string-name>
          , Language Models are Unsupervised Multitask Learners (????)
          <fpage>24</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>J.</given-names>
            <surname>Zhao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Yatskar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Ordonez</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.-W.</given-names>
            <surname>Chang</surname>
          </string-name>
          ,
          <article-title>Gender bias in coreference resolution: Evaluation and debiasing methods</article-title>
          ,
          <source>in: Proceedings of the 2018 Conference of</source>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>