<!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>Towards Evaluating Profession-based Gender Bias in ChatGPT and its Impact on Narrative Generation</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Alondra Marin</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Markus Eger</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Cal Poly Pomona, Department of Computer Science</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>UC Santa Cruz, Department of Computational Media</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>With the recent surge of Large Language Models being used seemingly everywhere, there have been many concerns about the veracity of the information they provide. However, the inaccuracies of these models often go beyond mere factual mistakes, as they may exhibit biases across diferent identities, including gender. In this paper, we investigate one particularly widely used model, OpenAI's ChatGPT, and discuss how gender biases may manifest when the model is presented with people in diferent professions. We developed a modular framework to numerically evaluate such biases, and performed several experiments using ChatGPT to demonstrate our evaluation metrics. Our approach shows that ChatGPT 3.5, which is available for free, as well as the latest version, 4o, exhibit significant gender bias on diferent professions, both in the vacuum and in the context of narrative generation.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        Large Language Models (LLMs) are Machine Learning
models, typically trained on a large corpus of text, that learn a
probability distribution representing the co-occurrence of
words within that text. One popular application of such
models is to enter a question, and using the model’s inference
capabilities to predict a continuation, which, in practice,
often results in an answer to that question. While the
underlying technology, transformers, has been around since
2017 [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], and a variety of LLMs have been described before,
they have seen a meteoric rise in adoption since being made
available for public use by OpenAI packaged in a friendly,
chat-like interface on their ChatGPT platform in late 2022 1.
ChatGPT and its many competitor LLMs have been adopted
across a wide range of businesses and industries.
      </p>
      <p>
        LLMs learn a probability distribution of words, and
sample from said distribution. Several challenges that arise from
this have already been observed in the literature: LLMs do
not reason about the words they produce [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], and may
produce incorrect results, hallucinate quotes, citations, people,
or other entities [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], or mislead in other ways [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. Many
of these problems, though, are relatively “easy” to evaluate,
since a ground truth answer typically exists. For example,
if an LLM is asked to produce a bibliography for a scientific
article, the existence of cited articles can be verified.
However, as LLMs are good at reproducing patterns that occur
frequently in the training data, while suppressing those that
are less likely, but still possible, they also amplify any biases
the data may already exhibit. Unlike factual errors, many of
these biases are much harder to measure, and thus evaluate
objectively. Since LLMs are used in a range of real world
contexts, though, these biases may still have actual real
world implications. We are particularly interested in the
impact such biases may have on applications of ChatGPT to
narrative generation, but our analysis is not strictly limited
to this application case.
      </p>
      <p>In this paper, we focus on the kinds of gender bias an
LLM may exhibit in the context of diferent professions or
occupations. Our contribution is twofold: First, we present
a modular framework for an evaluation strategy that can be
used to objectively measure the prevalence of diferent
aspects of these biases by determining inconsistent responses
given by the model. This framework allows a comparative
evaluation of gender bias using paired tests, as well as an
evaluation on single instances, such as generated stories.
Second, we present results of several experiments we
performed on diferent versions of ChatGPT and how it
stereotypes diferent professions towards people using diferent
pronouns. Crucially, our work aims to automate this
evaluation, can be used to generate a large number of prompt
combinations, and is modular to allow the easy creation of
new prompt templates. This allows us to prevent
“poisoning” the training data of future iterations of LLMs with our
test prompts, results in a more general understanding of the
presence of biases, and provides the foundation to generate
more comparisons in the future.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Background and Related Work</title>
      <p>
        Large Language Models work by essentially learning a
probability distribution of word co-occurrences, which can then
be sampled from to generate continuations for existing text.
Transformers, the underlying mechanism, are based on
assigning diferent weights, termed “attention”, to preceding
words depending on context [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Text generation is the
process of predicting which words are most likely to
continue a given text fragment based on the distribution learned
from the training data, and thus LLMs have been likened to
(stochastic) parrots [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. Sampling from an LLM necessarily
discards low-probability continuations in order to produce
(mostly) coherent text output. However, this also eliminates
the tails of the distribution, amplifying any biases the input
data may have. What makes bias challenging to evaluate, is
that any standalone instance may be considered “correct”,
and only an aggregate view gives insights into the
prevalence of biases. We therefore focus our work on creating
multiple instances that allow us to show output trends.
      </p>
      <sec id="sec-2-1">
        <title>2.1. Paired Tests</title>
        <p>
          Generative Text-to-Image models have frequently been
observed as creating biased output. Wan et al. [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ] provide an
excellent survey over such work. More recent models have
been working on mitigating these biases and aim to produce
a more diverse set of outputs for any given input prompt.
However, this still often breaks in scenarios where the model
is tasked with including more than one person in an output
image [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]. Most relevantly for our purposes, in scenarios
where the model is asked to create images containing e.g. a
CEO and an assistant, it will consistently “assign” diferent
professions to particular gender identities. Our work builds
on a similar premise in pairing diferent professions and
querying an LLM to determine if it holds such an
assignment. The roots of our approach can be traced back to Terry
Winograd [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ] who presented a computational system for
natural language understanding, and came up with paired
sentences that required complex real-world reasoning to
distinguish the meaning of. Levesque et al. [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ] later
proposed a larger dataset as a challenge for natural language
understanding. In the case of such a Winograd Schema, the
language model is required to answer diferently for the two
sentences in the pair. Our approach similarly pairs queries,
but only changes the pronoun that is used, with the
expectation that an unbiased model would answer in the same way
each time. Zhao et al. [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ] have used this same approach
to produce a dataset of queries on 40 diferent professions,
that they pair with he/him and she/her pronouns to
determine the prevalence of gender stereotypes in coreference
resolution approaches. Rudinger et al. [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ] did the same
with 2 sentence templates that they insert 60 occupations
into, while Kotak et al. [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ] have shown that biases are
still present in recent, publicly available LLMs. Our work
difers from these three in two main respects: First, while
we also pair professions, our queries do not place them in a
working relationship with each other, allowing us to
combine arbitrary professions and thus test more combinations.
Second, our system can generate a large number of prompts
and is able to automatically evaluate the responses from a
large language model, allowing us to incorporate hundreds
of diferent professions to get a better sense of the scale of
gender bias in ChatGPT.
        </p>
      </sec>
      <sec id="sec-2-2">
        <title>2.2. Other Bias Evaluation Approaches</title>
        <p>
          Evaluating biases can be challenging, as the very definition
of “bias” may not be clear to begin with [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ]. In our work,
we started with comparative tests that can show explicit
changes in LLM responses, but there are other approaches
that may be able to determine other forms of bias. Bartl
et al. [
          <xref ref-type="bibr" rid="ref14">14</xref>
          ] use masked sentences to let LLMs provide
completions for diferent kinds of prompts, measuring which
gender identities the LLM uses to complete the prompts in
diferent contexts. We use a similar approach to evaluate
biases in a narrative generation context using our data set.
Wan et al. [
          <xref ref-type="bibr" rid="ref15">15</xref>
          ], on the other hand, directly ask an LLM
about the properties of diferent groups (not only limited to
diferent gender identities), and record the results. In other
instances, text generated by an LLM may then subsequently
evaluated for bias by human readers [
          <xref ref-type="bibr" rid="ref16">16</xref>
          ]. These approaches
rely on a varying amount of manual handling of the prompt
responses in order to evaluate them. In contrast, since our
approach places restrictions on the acceptable output,
evaluation can be performed automatically on a large amount
of prompt responses. Other approaches require access to
the underlying vector space in order to project it onto a
potentially biased valence dimension [
          <xref ref-type="bibr" rid="ref17">17</xref>
          ]. Our approach
only requires access to the LLM via an API, and can be used
to evaluate any LLM for which such access is available,
including opaque ones like the subject of our investigation,
OpenAI’s ChatGPT.
        </p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. Methodology</title>
      <p>In order to evaluate potential biases in Large Language
Models, we developed a modular pipeline. Our approach
consists of four steps:</p>
      <sec id="sec-3-1">
        <title>1. Generate prompt instances from templates</title>
        <p>2. Collect responses from Large Language Model
3. Parse responses and compare them to expectation
4. Perform evaluation across all responses
In order to have a wide range of professions and have a
more inclusive approach, we use a profession corpus and
use random sampling of these professions to generate a large
number of prompts from prompt templates. For each of the
resulting prompts, the response generated by ChatGPT is
then evaluated across diferent variations to determine if
the model’s response is consistent. The overall process is
shown in figure 1. Below we will describe the details of how
our prompts are generated and evaluated.</p>
        <sec id="sec-3-1-1">
          <title>3.1. Prompt Templates</title>
          <p>Our approach is based on sentences that describe short social
interactions between two people, described only through
their profession. The model is asked a simple question about
the interaction, for which we expect a specific answer. For
example, for the prompt “The doctor yelled at the nurse
because she was late. Who was late?” the expected response
by the model would be “The nurse was late.”, as it is generally
acknowledged that individuals who face admonishment for
tardiness are the tardy party. However, we observed that
ChatGPT will respond with “The doctor was late.” when
the pronoun “she” is exchanged for “he”. This observation
forms the basis for our experiments, as the model seems
to have a bias towards stereotyping nurses as female and
doctors as male. From this initial prompt, we developed
seven templates that place two people in diferent situations
as they may occur in everyday life, not strictly limited to a
professional setting. This allows us to use any combination
of professions, whereas e.g. the setting of an operating
room may not make much sense for interactions between
a plumber and a cab driver. Each prompt template also
has an expected “correct” response based on common-sense
reasoning, which means that if a model response is not in
line with this response, it is most likely due to a bias. Table
1 shows the 7 prompt templates we currently include in our
pipeline.</p>
        </sec>
        <sec id="sec-3-1-2">
          <title>3.2. Prompt Generation and Engineering</title>
          <p>
            In order to comprehensively expose potential biases we
utilize a corpus of over 900 professions and occupations
[
            <xref ref-type="bibr" rid="ref18">18</xref>
            ]. We generate concrete prompts by randomly
sampling from this corpus, and replacing “A” and “B” in our
prompt templates with the sampled professions. For each
such prompt we then generate three diferent variations,
replacing “P” with the pronouns “he”, “she” and “they” (for
the “cake” prompt, the possessive version of the pronouns,
his/her/their, is inserted for “PS”). This means that every
pair of professions will result in three prompt instances for
each of our 7 prompt templates.
          </p>
          <p>To be able to automatically evaluate the responses
produced by the model, we took care to formulate precise
inquiries. In our initial, manual experiments, ChatGPT would
respond in a wide variety of ways to describe the answer,
often being overly verbose, or incorporating the question text
into its response. We therefore include more precise
instructions, mandating the model to adhere to a specific format:
“Answer in one sentence and in this format: ’The &lt;answer&gt;
was late.”’ This template, tailored to yield concise responses
devoid of extraneous verbiage, allows us to extract
ChatGPT’s response in code. For example, the prompt “Answer
in one sentence and in this format: ’The &lt;answer&gt; was
late.’ The doctor yelled at the nurse because she was late.
Who was late?” resulted in the response “The nurse was
late.” in both versions of ChatGPT, while the same prompt
using the pronoun “he” resulted in “The doctor was late.”
Once we generate the three variations of the prompt
instance, we send a request to the LLM, in our case using the
ChatGPT API, and obtain its response. In the next section
we will describe how we evaluate this response.</p>
        </sec>
        <sec id="sec-3-1-3">
          <title>3.3. Result Analysis</title>
          <p>In order to analyze the response produced by the model, we
ifrst extract the actual answer. Given that we instruct the
model to produce its answers in a very specific format, this
is straightforward most of the time. We will note that the
model very rarely produces slight variations of the expected
result format, but our approach is to check if “A” is present
in the response (but not “B”), in which case the response is
taken to be “A”, or if “B” is present but not “A” (in which case
the response is taken to be “B”). This accounts for cases in
which the model simply responds with the profession
without the requested context. Our framework tags responses
for which it cannot determine the answer this way as
“unknown”, but this only occurred once in our experiments
due to a typo in the corpus (which the LLM corrected in its
response), and was manually corrected.</p>
          <p>Given the prompt template and the response produced by
the model, “A” or “B”, we then use two metrics to evaluate
its performance: First, since our prompts have an expected
correct response, we measure the percentage of instances
for which the model produces an incorrect response.
Second, as our goal is to evaluate biases in LLMs, we compare
the response across the three variations of the same prompt.
Even if the model considers a particular prompt to be
ambiguous, its response ought to be the same regardless of the
pronoun used. We call prompts for which all three
variations result in the same response (whether that response is
correct or incorrect) “consistent”, otherwise the response
is “inconsistent”. Acknowledging that the gender-neutral
pronoun “they” may further confound the model, we also
measure consistency only between the “he” and “she”
variations, to obtain the binary inconsistency metric. Figure 2
shows an example of a consistent response pattern across
three variations of the same prompt. Conversely, as
illustrated in Figure 3, a discernible shift in responses emerged
for diferent combinations of professions. Such
inconsistencies are indicative of biased responses, and therefore of
interest in our investigation.</p>
          <p>Note that the percentage of incorrect responses is
measured across all prompt variations whereas inconsistency
is necessarily measured using all variations of the same
prompt, so e.g. a sample of 100 prompts in 3 variations each
would lead to an incorrectness metric over 300 data points,
while inconsistency is measured out of 100 triples. Also
note that three incorrect responses would still be
considered “consistent” as the model did not change its response
based solely on a variation in the pronoun used.</p>
        </sec>
        <sec id="sec-3-1-4">
          <title>3.4. Narrative Generation</title>
          <p>While the aforementioned prompt templates compare
ChatGPT’s response to pairs of characters in a social setting, our
interest comes from potential applications of the model to
narrative generation. We therefore also created prompt
templates to cause ChatGPT to write a story about a particular
character, and evaluate how potential biases may manifest
themselves when generating narrative text. We created five
additional prompt templates, shown in table 2. In contrast
to the templates above, only one profession is present, and
the expected response is a continuation of the story right
after a name is expected. In addition to the prompt, we
instruct ChatGPT with “You are a storyteller writing a novel.
Continue the story exactly as given for about one chapter.”
to ensure a proper continuation.</p>
          <p>
            To evaluate the response provided by ChatGPT, we
investigate the first few tokens to find a name, and then use a
dataset [
            <xref ref-type="bibr" rid="ref19">19</xref>
            ] to determine the character’s most likely gender
based on that name. As we will discuss below, this approach
may have some limitations, but in our experiments such
cases have not arisen.
          </p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Results and Discussion</title>
      <p>
        To demonstrate how our approach can be used to evaluate
biases in OpenAI’s ChatGPT [
        <xref ref-type="bibr" rid="ref20">20</xref>
        ] we have performed
several experiments using the provided API2. To determine if
2https://platform.openai.com/
there is any basis for our approach, we first used a single
prompt template that had shown promise in manual
experiments, and ran a larger-scale preliminary experiment using
only this one template. After we determined that our
approach was viable, we expanded our experiments to a more
diverse set of prompt templates, and performed additional
experiments with them. We then also performed tests in the
context of narrative generation, to see how the biases we
observe might manifest themselves in an actual application.
We will first describe our experimental setup in general,
before we provide a detailed overview of our results.
      </p>
      <sec id="sec-4-1">
        <title>4.1. Experimental Setup</title>
        <p>For our experiments, we generated a large number of
prompts from a given prompt template at random. As a
baseline, we used the “late” prompt described above, and
generated 27460 individual prompts, each in 3 variations
using he/she/they pronouns, using random combinations of
professions and collected the response from ChatGPT 3.5.</p>
        <p>While this initial experiment’s results were insightful, the
limited throughput (which is even more limited for ChatGPT
4o) caused us to rescope our actual experiment to be better
able to compare between multiple versions of the model and
use multiple prompts. In our main experiment, we randomly
selected 1000 pairs of professions for each model version,
and collected the response for each of our 7 prompt
template for each of these 1000 pairs, as before in 3 variations
each, from each model. For example, the prompt template
“The $A was angry at the $B because $PRONOUN never
returned a book $PRONOUN borrowed. Who owns the book?”
was filled with the professions $A = bricklayer and $B =
lfower arranger. The same prompt was then sent to ChatGPT
with “he”, “she” and “they” inserted as the $PRONOUN, and
ChatGPT 3.5 responded that the bricklayer owned the book
when “he” was used, but that the flower arranger owned
the book when “she” or “they” pronouns were used, which
we marked as one inconsistent response, as well as two
incorrect responses (out of three).</p>
        <p>Similar to this first experiment, we then use the narrative
generation prompts to have the model write a story chapter,
starting with the given prompt, where the profession of the
main character is provided. We extract the name of that
character and determine their most likely gender through a
lookup.</p>
      </sec>
      <sec id="sec-4-2">
        <title>4.2. Results</title>
        <p>We will now present the results of our experiments. We
performed one set of experiments on the paired templates,
where we sampled random professions to generate a large
number of prompts to measure which professions ChatGPT
is more biased on, and another set of experiments using our
narrative prompts. As generating responses requires both
time and money, the number of prompts we could send was
a trade-of between available resources and more detailed
results.
4.2.1. Main Experiment
For our main experiment, we obtained 3000 responses from
ChatGPT versions 3.5 and 4o3 for each of the 7 prompt
templates shown in table 1, as 3 variations of 1000
random profession pairings. Figure 4 shows the percentage of
prompts for which each model returned inconsistent results
across the three prompt variations. Overall, ChatGPT 3.5
returned an inconsistent response for 15.3% of all prompts,
with the “book owner” prompt resulting in the most
inconsistent responses (46.1%), and the “cake” prompt resulting
in the least inconsistent responses (0.3%). ChatGPT 4o
returned fewer inconsistent results in almost all cases,
returning an inconsistent response to the “cake” and “marriage”
prompts only once, but still showing significant bias on the
“late” (11.1%) and, particularly, the “book owner” (50.3%)
prompts. In addition to determining inconsistency by
checking if any of the three responses difered, we also compared
only the he/she pronoun cases, but this did not have much
of an efect for most cases. If a model was inconsistent in its
responses, it was almost always between the “he” and “she”
variations. The main exception to this is the “book owner”
prompt, where just over 30% of responses were
inconsistent for both models between “he” and “she” pronouns (vs.</p>
        <sec id="sec-4-2-1">
          <title>3https://openai.com/index/hello-gpt-4o/</title>
          <p>around 50% across all three variations). Table 3 shows all
results in detail.</p>
          <p>
            Finally, we also analyzed which professions were present
most often in inconsistent responses. For ChatGPT 3.5 the
ifve most common ones were (in parentheses the number
of occurrences in inconsistent responses across all prompt
templates): Graphologist (15), Grave Digger (14),
Receptionist (13), Insurance Broker (13), and Homeopath (12).
ChatGPT 4o, in contrast, while exhibiting fewer
inconsistent responses overall, still had several professions it was
particularly biased about, but overall its biased responses
were spread out more across professions: Beautician (11),
Receptionist (10), Van Driver (10), Acoustic Engineer (9),
and Screen Writer (8).
4.2.2. Narrative Generation Experiment
While the biases we report may already be undesirable in the
abstract, we are also interested in how they may afect
actual application scenarios, concretely narrative generation.
As ChatGPT is being used to generate content for human
consumption, we believe this to be a particularly critical
scenario. As above, we performed several experiments. In
contrast, though, we leaned more into the stochastic nature
of LLMs, and generated 20 instances for each prompt, each
of which we requested a response for 20 times. The reason
for this is that while the prompts above ought to have one
single response, the task of generating a story is much more
open-ended, and we therefore let the model generate a
variety of stories for each prompt template. On the other hand,
generating narrative text also takes more time, as each
response is several hundred to thousands of tokens long. We
compare the output for each individual prompt/profession
combination, as well as across diferent prompts for each
profession. For each response, we determine the most likely
gender of the named main character by comparing it with a
name data set [
            <xref ref-type="bibr" rid="ref19">19</xref>
            ]. Table 4 shows the main results of our
experiment as the percentage of stories in which the given
character was given a (typically) female name. In addition
to the percentage of female names, we also counted the
number of each occurrence. While the generated output
shows variety, the names themselves do not. For example,
the graduate student might study archaeology, astrophysics,
psychology, or marine biology, with university names,
locations, and descriptions difering from story to story, but
across all outputs her name is “Elena” 34% of the time when
using ChatGPT 4o. ChatGPT 3.5 does not show such a name
preference in this case, but did call police oficers “Sarah” in
57.7% of our outputs.
          </p>
        </sec>
      </sec>
      <sec id="sec-4-3">
        <title>4.3. Discussion and Limitations</title>
        <p>
          As the use of ChatGPT (and other LLMs) becomes more
and more widespread, for example in the screening of job
Prompt
applications [
          <xref ref-type="bibr" rid="ref21">21</xref>
          ], narrative generation [
          <xref ref-type="bibr" rid="ref22">22</xref>
          ], or video game
development [
          <xref ref-type="bibr" rid="ref23">23</xref>
          ], biases such as the ones uncovered by our
experiments may have unintended, and probably unwanted,
consequences. As our experiments show, while ChatGPT
has become more consistent overall, which we interpret as
less biased in our scenarios, there are still significant issues,
in particular for some specific professions. The result we
least expected, though, was how much ChatGPT struggled
with the “book owner” prompt, as it seemingly does not
understand the relationship between borrowing and
ownership. This problem has not been resolved in the latest
version, ChatGPT 4o, either.
        </p>
        <p>Our system aims to provide a broad sampling, and
therefore uses a large corpus of professions. Many of these
professions may not feature prominently in the training set, which
means that the model may have less biased views of them to
begin with. On one hand, we believe it is important to cover
a wide range of cases including those that may be less
commonly investigated. On the other hand, we acknowledge
that these cases may have less overall impact. Our current
experimental setup also only utilizes 7 prompt templates,
instead opting on generating a large combination of actual
prompts by sampling from our profession corpus. However,
we developed our framework with extensibility in mind,
making adding additional prompt templates a
straightforward process. The full source code of our framework is
Profession
graduate student
graduate student
private investigator
private investigator
bus mechanic
bus mechanic
police oficer
police oficer
math teacher
math teacher
architect
architect
ambulance driver
ambulance driver
toll collector
toll collector
jeweller
jeweller
veterinary surgeon
veterinary surgeon
bank clerk
bank clerk
roofer
roofer
janitor
janitor
fork lift truck driver
fork lift truck driver
hospital worker
hospital worker
politician
politician
paramedic
paramedic
baker
baker
mortgage broker
mortgage broker
also available on github4. Finally, our experiments focused
on OpenAI’s ChatGPT in its diferent iterations, but other
LLMs may likely exhibit similar biases. The modular
structure of our framework will allow researchers to exchange
the ChatGPT module with one for the LLM of their choice,
including privately deployed ones, and run our test suite on
it. The scope of our work is also focused on pure evaluation,
with mitigation strategies still being an open question.</p>
        <p>
          We acknowledge that our work is limited to English,
where profession nouns are not gendered, while pronouns
are used to signal gender identity. As has been observed,
LLMs may struggle with translations to and from languages
that use diferent ways to convey gender identities [
          <xref ref-type="bibr" rid="ref24">24</xref>
          ]. For
other languages, diferent strategies may have to be
developed, but these are currently out of scope for our work.
Additionally, our work is somewhat reductive in that we
use the pronouns as ground-truth for gender assumption,
while misgendering may be its own, separate issue. Our
way of assigning gender identities to names is not entirely
perfect, either, as individuals may use pronouns that difer
from the ones commonly associated with their name, which
is what our method would determine.
        </p>
        <sec id="sec-4-3-1">
          <title>4https://github.com/yawgmoth/ChatGPTBias</title>
        </sec>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>5. Conclusion and Future Work</title>
      <p>In this paper we present an approach to measure gender
bias in ChatGPT using paired tests, where a prompt
containing an interaction between two people is sent to the model
in three diferent variations, where these variations only
difer in which pronoun is used (he, she, or they). The
expected outcome for the prompts we constructed is that the
answer is consistent across all three variations. Each of our
prompts also has an expected “correct” answer (although
there may be some slight ambiguity), and we also evaluate
if the model produces this correct answer. We performed an
experiment, where we used 1000 generated profession
combinations with each of 7 prompt templates, and collected
responses from two versions of ChatGPT. While ChatGPT
4o produced fewer inconsistent responses than its
predecessor overall (9.9% vs. 15.3%), its performance on the
individual prompts was still very varied. Finally, we also
showed that these biases are also exhibited when the models
are utilized to generate narrative text, where the names the
model generates for the protagonist of diferent stories show
bias towards diferent gender identities depending on their
profession.
cast</p>
      <p>While our work is able to show that the used models
exhibit biases, our work is currently limited to OpenAI’s
ChatGPT and very specific prompt templates. We believe
our main contribution is the evaluation framework itself,
which was designed to be modular and extensible, and we
plan on using this design and develop modules to interface
with other LLMs as well. Additionally, the ease with which
prompts can be designed makes the framework an ideal
instrument for participatory research, and we plan on using it
in a classroom setting, where students can easily experiment
with their own prompts.</p>
      <p>Finally, while our framework is able to show a very
specific kind of bias across several situations, there are many
other biases LLMs may exhibit that are of equal interest. We
are currently investigating how a similar approach could be
used to evaluate racial bias, which is made more
challenging by the absence of pronouns, which we currently use
to indicate diferent identities. Additionally, there may be
interactions between diferent kinds of biases, and we plan
on addressing intersectional biases in future work as well.</p>
    </sec>
    <sec id="sec-6">
      <title>6. Acknowledgements</title>
      <p>We would like the anonymous reviewers for their
thoughtful feedback. We particularly appreciated the enthusiastic
recommendations for future research directions.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>A.</given-names>
            <surname>Vaswani</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Shazeer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Parmar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Uszkoreit</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Jones</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. N.</given-names>
            <surname>Gomez</surname>
          </string-name>
          , Ł. Kaiser,
          <string-name>
            <surname>I. Polosukhin</surname>
          </string-name>
          ,
          <article-title>Attention is all you need</article-title>
          ,
          <source>Advances in neural information processing systems</source>
          <volume>30</volume>
          (
          <year>2017</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>K.</given-names>
            <surname>Valmeekam</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Marquez</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Sreedharan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Kambhampati</surname>
          </string-name>
          ,
          <article-title>On the planning abilities of large language models-a critical investigation</article-title>
          ,
          <source>Advances in Neural Information Processing Systems</source>
          <volume>36</volume>
          (
          <year>2023</year>
          )
          <fpage>75993</fpage>
          -
          <lpage>76005</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Z.</given-names>
            <surname>Xu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Jain</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Kankanhalli</surname>
          </string-name>
          ,
          <article-title>Hallucination is inevitable: An innate limitation of large language models</article-title>
          ,
          <source>arXiv preprint arXiv:2401.11817</source>
          (
          <year>2024</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>M. T.</given-names>
            <surname>Hicks</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Humphries</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Slater</surname>
          </string-name>
          , Chatgpt is bullshit,
          <source>Ethics and Information Technology</source>
          <volume>26</volume>
          (
          <year>2024</year>
          )
          <fpage>38</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>E. M.</given-names>
            <surname>Bender</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Gebru</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>McMillan-Major</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Shmitchell</surname>
          </string-name>
          ,
          <article-title>On the dangers of stochastic parrots: Can language models be too big?</article-title>
          ,
          <source>in: Proceedings of the 2021 ACM conference on fairness, accountability, and transparency</source>
          ,
          <year>2021</year>
          , pp.
          <fpage>610</fpage>
          -
          <lpage>623</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Wan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Subramonian</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Ovalle</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Lin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Suvarna</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Chance</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Bansal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Pattichis</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.-W.</given-names>
            <surname>Chang</surname>
          </string-name>
          ,
          <article-title>Survey of bias in text-to-image generation: Definition, evaluation, and mitigation</article-title>
          ,
          <source>arXiv preprint arXiv:2404.01030</source>
          (
          <year>2024</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Wan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.-W.</given-names>
            <surname>Chang</surname>
          </string-name>
          ,
          <article-title>The male ceo and the female assistant: Probing gender biases in text-to-image models through paired stereotype test</article-title>
          ,
          <source>arXiv preprint arXiv:2402.11089</source>
          (
          <year>2024</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>T.</given-names>
            <surname>Winograd</surname>
          </string-name>
          ,
          <article-title>Understanding natural language</article-title>
          ,
          <source>Cognitive psychology 3</source>
          (
          <year>1972</year>
          )
          <fpage>1</fpage>
          -
          <lpage>191</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>H.</given-names>
            <surname>Levesque</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Davis</surname>
          </string-name>
          ,
          <string-name>
            <surname>L. Morgenstern,</surname>
          </string-name>
          <article-title>The winograd schema challenge</article-title>
          ,
          <source>in: Thirteenth international conference on the principles of knowledge representation and reasoning</source>
          ,
          <year>2012</year>
          .
        </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 the North American Chapter of the Association for Computational Linguistics: Human Language Technologies</source>
          , Volume
          <volume>2</volume>
          (
          <string-name>
            <surname>Short</surname>
            <given-names>Papers)</given-names>
          </string-name>
          ,
          <year>2018</year>
          , pp.
          <fpage>15</fpage>
          -
          <lpage>20</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>R.</given-names>
            <surname>Rudinger</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Naradowsky</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Leonard</surname>
          </string-name>
          ,
          <string-name>
            <surname>B. Van Durme</surname>
          </string-name>
          ,
          <article-title>Gender bias in coreference resolution</article-title>
          ,
          <source>in: Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies</source>
          , Volume
          <volume>2</volume>
          (
          <string-name>
            <surname>Short</surname>
            <given-names>Papers)</given-names>
          </string-name>
          ,
          <year>2018</year>
          , pp.
          <fpage>8</fpage>
          -
          <lpage>14</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>H.</given-names>
            <surname>Kotek</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Dockum</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Sun</surname>
          </string-name>
          ,
          <article-title>Gender bias and stereotypes in large language models</article-title>
          ,
          <source>in: Proceedings of the ACM collective intelligence conference</source>
          ,
          <year>2023</year>
          , pp.
          <fpage>12</fpage>
          -
          <lpage>24</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>E.</given-names>
            <surname>Edenberg</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Wood</surname>
          </string-name>
          ,
          <article-title>Disambiguating algorithmic bias: from neutrality to justice</article-title>
          ,
          <source>in: Proceedings of the 2023 AAAI/ACM Conference on AI, Ethics, and Society</source>
          ,
          <year>2023</year>
          , pp.
          <fpage>691</fpage>
          -
          <lpage>704</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>M.</given-names>
            <surname>Bartl</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Nissim</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Gatt</surname>
          </string-name>
          ,
          <article-title>Unmasking contextual stereotypes: Measuring and mitigating bert's gender bias</article-title>
          ,
          <source>in: COLING Workshop on Gender Bias in Natural Language Processing, Association for Computational Linguistics (ACL)</source>
          ,
          <year>2020</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>Y.</given-names>
            <surname>Wan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>He</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Gu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Bai</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M. R.</given-names>
            <surname>Lyu</surname>
          </string-name>
          ,
          <article-title>Biasasker: Measuring the bias in conversational ai system</article-title>
          ,
          <source>in: Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering</source>
          ,
          <year>2023</year>
          , pp.
          <fpage>515</fpage>
          -
          <lpage>527</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>P.</given-names>
            <surname>Narayanan Venkit</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Gautam</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Panchanadikar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.-H.</given-names>
            <surname>Huang</surname>
          </string-name>
          , S. Wilson,
          <article-title>Unmasking nationality bias: A study of human perception of nationalities in ai-generated articles</article-title>
          ,
          <source>in: Proceedings of the 2023 AAAI/ACM Conference on AI, Ethics, and Society</source>
          ,
          <year>2023</year>
          , pp.
          <fpage>554</fpage>
          -
          <lpage>565</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <given-names>S.</given-names>
            <surname>Omrani</surname>
          </string-name>
          <string-name>
            <surname>Sabbaghi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Wolfe</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Caliskan</surname>
          </string-name>
          ,
          <article-title>Evaluating biased attitude associations of language models in an intersectional context</article-title>
          ,
          <source>in: Proceedings of the 2023 AAAI/ACM Conference on AI, Ethics, and Society</source>
          ,
          <year>2023</year>
          , pp.
          <fpage>542</fpage>
          -
          <lpage>553</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [18]
          <string-name>
            <given-names>D.</given-names>
            <surname>Kazemi</surname>
          </string-name>
          , Ocupation corpus, https://github.com/dariusk/corpora/blob/master/data/ humans/occupations.json,
          <year>2022</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [19]
          <article-title>Gender by Name</article-title>
          ,
          <source>UCI Machine Learning Repository</source>
          ,
          <year>2020</year>
          . DOI: https://doi.org/10.24432/C55G7X.
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          [20]
          <string-name>
            <surname>OpenAI</surname>
          </string-name>
          , Gpt-4
          <source>technical report</source>
          ,
          <year>2024</year>
          . arXiv:
          <volume>2303</volume>
          .
          <fpage>08774</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          [21]
          <string-name>
            <given-names>C.</given-names>
            <surname>Gan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Q.</given-names>
            <surname>Zhang</surname>
          </string-name>
          , T. Mori,
          <article-title>Application of llm agents in recruitment: A novel framework for resume screening</article-title>
          ,
          <source>arXiv preprint arXiv:2401.08315</source>
          (
          <year>2024</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          [22]
          <string-name>
            <given-names>C.</given-names>
            <surname>Elliott</surname>
          </string-name>
          ,
          <article-title>A hybrid model for novel story generation using the afective reasoner and chatgpt</article-title>
          ,
          <source>in: Intelligent Systems Conference</source>
          , Springer,
          <year>2023</year>
          , pp.
          <fpage>748</fpage>
          -
          <lpage>765</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          [23]
          <string-name>
            <given-names>M.</given-names>
            <surname>Shi</surname>
          </string-name>
          Johnson-Bey,
          <string-name>
            <given-names>M.</given-names>
            <surname>Mateas</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Wardrip-Fruin</surname>
          </string-name>
          ,
          <article-title>Toward using chatgpt to generate theme-relevant simulated storyworlds (</article-title>
          <year>2023</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          [24]
          <string-name>
            <given-names>S.</given-names>
            <surname>Ghosh</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Caliskan</surname>
          </string-name>
          ,
          <article-title>Chatgpt perpetuates gender bias in machine translation and ignores non-gendered pronouns: Findings across bengali and five other lowresource languages</article-title>
          ,
          <source>in: Proceedings of the 2023 AAAI/ACM Conference on AI, Ethics, and Society</source>
          ,
          <year>2023</year>
          , pp.
          <fpage>901</fpage>
          -
          <lpage>912</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>