Balancing the Scales: Reinforcement Learning for Fair Classification

Leon Eshuijs
Vrije Universiteit Amsterdam
Amsterdam, the Netherlands
[email protected]
&Shihan Wang
Utrecht University
Utrecht, the Netherlands
[email protected]
&Antske Fokkens
Vrije Universiteit Amsterdam
Amsterdam, the Netherlands
[email protected]
Abstract

Fairness in classification tasks has traditionally focused on bias removal from neural representations, but recent trends favor algorithmic methods that embed fairness into the training process. These methods steer models towards fair performance, preventing potential elimination of valuable information that arises from representation manipulation. Reinforcement Learning (RL), with its capacity for learning through interaction and adjusting reward functions to encourage desired behaviors, emerges as a promising tool in this domain. In this paper, we explore the usage of RL to address bias in imbalanced classification by scaling the reward function to mitigate bias. We employ the contextual multi-armed bandit framework and adapt three popular RL algorithms to suit our objectives, demonstrating a novel approach to mitigating bias. 111Our code is available at https://github.com/watermeleon/RL_for_imbalanced_classification

1 Introduction

In recent years, the issue of bias and fairness in Artificial Intelligence and Natural Language Processing has received significant attention Mehrabi et al. (2021). In decision-making models such as classification algorithms, bias often stems directly from the training data leading to unfair outcomes between protected groups such as gender or race. To address this problem, previous work on fairness has focused on achieving representational fairness, so that the information of the protected groups is lost Ravfogel et al. (2020); Haghighatkhah et al. (2022). However, recent work has demonstrated no meaningful correlation between representational fairness and empirical fairness, i.e. fairness on downstream tasks Shen et al. (2022). To address empirical fairness directly, other work has explored the intersection of bias mitigation and class-imbalanced learning Subramanian et al. (2021). Class-imbalanced learning approaches aim to achieve fair performance by balancing the training data via sampling or reweighing the loss function.

At the same time, Reinforcement Learning (RL) has emerged as a promising alternative to traditional supervised learning methods for various NLP tasks, including syntactic parsing, conversational systems, and machine translation Uc-Cetina et al. (2023). Unlike traditional supervised learning methods, RL is not bound to binary labels and is trained directly on the continuous value of each input, as illustrated in Figure 1. RL agents can learn from sparse reward signals, receiving the rewards for the action they choose, not necessarily the correct one. By exploring the environment and adapting their behavior based on the received rewards, RL agents find optimal actions under varying state values. In the context of classification, RL has been adapted to mitigate class imbalance through a scaling component of the reward function for binary classification Lin et al. (2020). However, implementations considering more complex imbalances have remained largely unexplored.

In this work, we leverage RL to address fairness among protected groups in multi-class classification. First, we propose to frame the fair classification task as a Contextual Multi-Armed Bandit (CMAB) problem, see Figure 1 for an overview of our setup. To mitigate bias, we scale the reward function to counteract imbalances among protected groups within each class. We employ three different types of RL methods, each reflecting a key type of RL approach, and adapt them for our task. Additionally, we integrate the different scaling approaches into a supervised learning baseline to evaluate the effectiveness of our RL-based methods.

Experiments on two fair classification datasets demonstrate that our RL algorithms achieve competitive performance compared to existing baselines and that reward scaling is a powerful tool to mitigate bias in classification. We further investigate how stable reward scaling is under various class and subclass imbalances as well as various degrees of representational fairness. Notably, the deep RL algorithms perform best on the multi-class dataset, while the classical CMAB algorithm excels on the binary dataset. Moreover, our scaled supervised implementation exceeds existing implementations and shows state-of-the-art performance for multi-class classification.

2 Related work

2.1 Bias Mitigation

Research on mitigating bias can be divided in those that tackle the training data Wang et al. (2019), those that attempt to remove bias from representations Ravfogel et al. (2020); Haghighatkhah et al. (2022), and those that adjust the learning process Elazar and Goldberg (2018); Han et al. (2021). Within approaches that adjust the learning processes, we distinguish two main categories: those that add adversarial learners to ignore protected attributes Wadsworth et al. (2018), and more closely to our work, approaches that adjust the loss function to emphasize performance on minority classes.

Prior work that modified the training setup to increase fairness used methods such as down/upsampling Wang et al. (2019) and reweighting the loss function Höfler et al. (2005); Lahoti et al. (2020). Han et al. (2022a) evaluate both down-sampling and loss reweighting on two datasets for fair text classification. Both techniques are applied to align training with different definitions of fairness. Downsampling using the Equal Opportunity fairness metric demonstrated impressive results. In this paper, we take the first step to explore whether reward scaling in reinforcement learning can improve fairness in classification.

Refer to caption
Figure 1: Overview of the classification setup with input vector x𝑥xitalic_x, and output class a𝑎aitalic_a for Reinforcement Learning and Supervised Learning, highlighting the place of the reward scaling matrix 𝒲RSsubscript𝒲𝑅𝑆\mathcal{W}_{RS}caligraphic_W start_POSTSUBSCRIPT italic_R italic_S end_POSTSUBSCRIPT

2.2 Reinforcement Learning for Classification

Literature on RL applications for classification predominantly considers the following two theoretical frameworks: Markov Decision Process (MDP) and the Contextual Multi-Armed Bandit (CMAB).

Early work by Wiering et al. (2011) casts classification as a sequential decision-making task, by introducing a classification variant of the MDP. In their setup agents manipulate memory cells to encode information by applying an action sequence on a single sample. They demonstrated competitive performance, but, remained limited to small tasks due to the computational complexity. Lin et al. (2020) extended this work, by introducing a variant of the classification MDP and applying a Deep Q-learning Network (DQN) to binary classification of images and texts. They focused on mitigating bias arising from class imbalance by scaling the rewards inversely proportional to the class frequency. However, in their setup the sequential component was taken over multiple data points, which assumes sequential dependency among data samples in the classification task.

The RL framework CMAB offers a promising alternative because it considers the input as a sequence of independent states. We formalize our classification task as a CMAB problem, because this is consistent with the independence of data points in the commonly shuffled datasets. Dudík et al. (2014) use CMAB agents by modifying K-class classification as a K-armed bandit problem, where the agent receives a reward of 1 for correct and 0 for incorrect classification. Dimakopoulou et al. (2019) use this framework and modify different CMAB algorithms to balance exploration and exploitation and compare the original and modified agents on 300 classification datasets. However, their analysis focused on datasets with either limited classes, features, or observations. To the best of our knowledge, we are the first to extend reward scaling for fair multi-class classification or to apply reward scaling for classification with CMAB.

3 Methodology

In this section, we describe how we formalize our classification task as a CMAB. We introduce three RL methods and explain how we adapt them for fair classification.222Due to space limitations, we only summarize the key idea of the algorithms and how we adapt them in the paper. Please refer to the Appendix and original papers for more details.

3.1 Contextual Multi-Armed Bandit

We formalize the multi-class classification task as a finite contextual multi-armed bandit (CMAB) problem. In each round t𝑡titalic_t, an agent is presented with a context vector xtdsubscript𝑥𝑡superscript𝑑x_{t}\in\mathbb{R}^{d}italic_x start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT ∈ blackboard_R start_POSTSUPERSCRIPT italic_d end_POSTSUPERSCRIPT. The agent chooses an action atAsubscript𝑎𝑡𝐴a_{t}\in Aitalic_a start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT ∈ italic_A from a fixed set of arms, based on the policy atπ(xt)similar-tosubscript𝑎𝑡𝜋subscript𝑥𝑡a_{t}\sim\pi(x_{t})italic_a start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT ∼ italic_π ( italic_x start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT ). After the action is taken, the environment returns a reward: rtsimilar-tosubscript𝑟𝑡r_{t}\sim\mathcal{R}italic_r start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT ∼ caligraphic_R. In a multi-class classification framework, the action space is the set of all possible classes, while the context vector is a representation of the input, e.g. a contextual text embedding (see Section 4.1 for more information). Within a finite number of rounds, the agent aims to learn the optimal policy to maximize the total reward. In other words, given a set of testing data, we aim to learn the optimal policy to maximize the selection of correct classes.

We extend the CMAB framework for fair classification by constructing a reward function that counters data imbalances. We assign a reward scale for each sensitive state (a,g)𝑎𝑔(a,g)( italic_a , italic_g ), comprising the desired class a𝑎aitalic_a (e.g. occupation) and protected attribute g𝑔gitalic_g (e.g. gender). The total reward for a given prediction is calculated as (a,apred,g)=𝒜cc(a,apred)𝒲(a,g)𝑎subscript𝑎𝑝𝑟𝑒𝑑𝑔𝒜𝑐𝑐𝑎subscript𝑎𝑝𝑟𝑒𝑑𝒲𝑎𝑔\mathcal{R}(a,a_{pred},g)=\mathcal{A}cc(a,a_{pred})\cdot\mathcal{W}(a,g)caligraphic_R ( italic_a , italic_a start_POSTSUBSCRIPT italic_p italic_r italic_e italic_d end_POSTSUBSCRIPT , italic_g ) = caligraphic_A italic_c italic_c ( italic_a , italic_a start_POSTSUBSCRIPT italic_p italic_r italic_e italic_d end_POSTSUBSCRIPT ) ⋅ caligraphic_W ( italic_a , italic_g ). It comprises an accuracy term 𝒜cc𝒜𝑐𝑐\mathcal{A}cccaligraphic_A italic_c italic_c, and a reward scale matrix 𝒲𝒲\mathcal{W}caligraphic_W. Unlike previous work Dudík et al. (2014), which defines the accuracy term as 𝒜cc{0,1}𝒜𝑐𝑐01\mathcal{A}cc\in\{0,1\}caligraphic_A italic_c italic_c ∈ { 0 , 1 }, we define it as 𝒜cc{1,1}𝒜𝑐𝑐11\mathcal{A}cc\in\{-1,1\}caligraphic_A italic_c italic_c ∈ { - 1 , 1 }. Which allows us to scale the reward for both correct (+1) and incorrect classifications (-1). We use the term reward scale to indicate that this approach adjusts the magnitude but not the sign of the reward. Section 3.3 presents various designs of the reward scale.

3.2 Reinforcement Learning Algorithms

We select three different RL algorithms and adapt them to learn optimal policies for fair classification in the formalized CMAB problem. These algorithms include one classical CMAB algorithm that addresses the linear relationship between the expected reward and the context, as well as two popular deep RL algorithms for MDP problems, Deep Q-Network (DQN) and Proximal Policy Optimization (PPO), which allow us to leverage non-linear approximations. The two deep RL algorithms are selected as they are representative of the two key types of deep RL approaches: value-based methods and policy gradient methods. By employing these three algorithms, we aim to investigate the application of diverse RL methods.

3.2.1 LinUCB

The classical CMAB algorithm, disjoint Linear UCB (LinUCB) Li et al. (2010) assumes a linear relationship between the context embedding xtsubscript𝑥𝑡x_{t}italic_x start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT and the reward E[rt,a|xt]=xtθa𝐸delimited-[]conditionalsubscript𝑟𝑡𝑎subscript𝑥𝑡superscriptsubscript𝑥𝑡topsubscript𝜃𝑎E[r_{t,a}|x_{t}]=x_{t}^{\top}\theta_{a}italic_E [ italic_r start_POSTSUBSCRIPT italic_t , italic_a end_POSTSUBSCRIPT | italic_x start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT ] = italic_x start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ⊤ end_POSTSUPERSCRIPT italic_θ start_POSTSUBSCRIPT italic_a end_POSTSUBSCRIPT. A benefit of disjoint LinUCB over other CMAB algorithms is that each class has a unique learnable weight vector θasubscript𝜃𝑎\theta_{a}italic_θ start_POSTSUBSCRIPT italic_a end_POSTSUBSCRIPT, which makes it suitable for classification with many classes. In each round, the agent chooses the arm (i.e. class label) with the highest score θ^axt+αxtAa1xtsuperscriptsubscript^𝜃𝑎topsubscript𝑥𝑡𝛼superscriptsubscript𝑥𝑡topsuperscriptsubscript𝐴𝑎1subscript𝑥𝑡\hat{\theta}_{a}^{\top}x_{t}+\alpha\sqrt{x_{t}^{\top}A_{a}^{-1}x_{t}}over^ start_ARG italic_θ end_ARG start_POSTSUBSCRIPT italic_a end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ⊤ end_POSTSUPERSCRIPT italic_x start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT + italic_α square-root start_ARG italic_x start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ⊤ end_POSTSUPERSCRIPT italic_A start_POSTSUBSCRIPT italic_a end_POSTSUBSCRIPT start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT italic_x start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT end_ARG, based on the context vector xtsubscript𝑥𝑡x_{t}italic_x start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT. This is a combination of the mean of the expected payoff, θ^axtsuperscriptsubscript^𝜃𝑎topsubscript𝑥𝑡\hat{\theta}_{a}^{\top}x_{t}over^ start_ARG italic_θ end_ARG start_POSTSUBSCRIPT italic_a end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ⊤ end_POSTSUPERSCRIPT italic_x start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT, and the standard deviation xtAa1xtsuperscriptsubscript𝑥𝑡topsuperscriptsubscript𝐴𝑎1subscript𝑥𝑡\sqrt{x_{t}^{\top}A_{a}^{-1}x_{t}}square-root start_ARG italic_x start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ⊤ end_POSTSUPERSCRIPT italic_A start_POSTSUBSCRIPT italic_a end_POSTSUBSCRIPT start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT italic_x start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT end_ARG, weighted with parameter α𝛼\alphaitalic_α to control the level of exploration. The weight vector of each arm is defined as θ^at=Aat1batsubscript^𝜃subscript𝑎𝑡superscriptsubscript𝐴subscript𝑎𝑡1subscript𝑏subscript𝑎𝑡\hat{\theta}_{a_{t}}=A_{a_{t}}^{-1}b_{a_{t}}over^ start_ARG italic_θ end_ARG start_POSTSUBSCRIPT italic_a start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT end_POSTSUBSCRIPT = italic_A start_POSTSUBSCRIPT italic_a start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT end_POSTSUBSCRIPT start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT italic_b start_POSTSUBSCRIPT italic_a start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT end_POSTSUBSCRIPT. Here the covariant matrix Aatsubscript𝐴subscript𝑎𝑡A_{a_{t}}italic_A start_POSTSUBSCRIPT italic_a start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT end_POSTSUBSCRIPT is calculated with the history of context vectors chosen by that arm, Aa=λId+s=1t1xsxssubscript𝐴𝑎𝜆subscript𝐼𝑑superscriptsubscript𝑠1𝑡1subscript𝑥𝑠superscriptsubscript𝑥𝑠topA_{a}=\lambda I_{d}+\sum_{s=1}^{t-1}x_{s}x_{s}^{\top}italic_A start_POSTSUBSCRIPT italic_a end_POSTSUBSCRIPT = italic_λ italic_I start_POSTSUBSCRIPT italic_d end_POSTSUBSCRIPT + ∑ start_POSTSUBSCRIPT italic_s = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t - 1 end_POSTSUPERSCRIPT italic_x start_POSTSUBSCRIPT italic_s end_POSTSUBSCRIPT italic_x start_POSTSUBSCRIPT italic_s end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ⊤ end_POSTSUPERSCRIPT. The vector basubscript𝑏𝑎b_{a}italic_b start_POSTSUBSCRIPT italic_a end_POSTSUBSCRIPT is the mean context vector of the arm weighted by the obtained rewards, bat=s=1trs,atxs,atsubscript𝑏subscript𝑎𝑡superscriptsubscript𝑠1𝑡subscript𝑟𝑠subscript𝑎𝑡subscript𝑥𝑠subscript𝑎𝑡b_{a_{t}}=\sum_{s=1}^{t}r_{s,a_{t}}x_{s,a_{t}}italic_b start_POSTSUBSCRIPT italic_a start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT end_POSTSUBSCRIPT = ∑ start_POSTSUBSCRIPT italic_s = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT italic_r start_POSTSUBSCRIPT italic_s , italic_a start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT end_POSTSUBSCRIPT italic_x start_POSTSUBSCRIPT italic_s , italic_a start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT end_POSTSUBSCRIPT.

3.2.2 DQNbanditsubscriptDQNbandit\textbf{DQN}_{\textbf{bandit}}DQN start_POSTSUBSCRIPT bandit end_POSTSUBSCRIPT

To adapt the MDP algorithms for a CMAB problem, our CMAB implementation is congruent with a one-step MDP, where each initial state is sampled from the existing set of context s1Xsubscript𝑠1𝑋s_{1}\in Xitalic_s start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ∈ italic_X, and each second state is a terminal state. In DQN Mnih et al. (2015), the agent learns a Q-function, parameterized by ϕitalic-ϕ\phiitalic_ϕ, to estimate the return for each state-action pair. According to the Bellman equation Bellman (1957), the optimal Q-value, Qsuperscript𝑄Q^{*}italic_Q start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT, of two sequential states are linked by:

Q(s,a)=𝔼π[rt+γmaxaQ(st+1,a)]superscript𝑄𝑠𝑎subscript𝔼𝜋delimited-[]subscript𝑟𝑡𝛾subscriptsuperscript𝑎superscript𝑄subscript𝑠𝑡1superscript𝑎Q^{*}(s,a)=\mathbb{E}_{\pi}[r_{t}+\gamma\max_{a^{\prime}}Q^{*}\left(s_{t+1},a^% {\prime}\right)]italic_Q start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT ( italic_s , italic_a ) = blackboard_E start_POSTSUBSCRIPT italic_π end_POSTSUBSCRIPT [ italic_r start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT + italic_γ roman_max start_POSTSUBSCRIPT italic_a start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT italic_Q start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT ( italic_s start_POSTSUBSCRIPT italic_t + 1 end_POSTSUBSCRIPT , italic_a start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) ] (1)

In our case (the one-step MDP), each next state is the terminal state, after which there is no reward, thus we obtain, Qϕ(st+1,)=0subscript𝑄italic-ϕsubscript𝑠𝑡10Q_{\phi}\left(s_{t+1},\cdot\right)=0italic_Q start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT ( italic_s start_POSTSUBSCRIPT italic_t + 1 end_POSTSUBSCRIPT , ⋅ ) = 0, and Gt=rtsubscript𝐺𝑡subscript𝑟𝑡G_{t}=r_{t}italic_G start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT = italic_r start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT. The parameters of ϕitalic-ϕ\phiitalic_ϕ are optimized using the mean-squared error between the current Q-value, Qϕ(st,at)subscript𝑄italic-ϕsubscript𝑠𝑡subscript𝑎𝑡Q_{\phi}(s_{t},a_{t})italic_Q start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT ( italic_s start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT , italic_a start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT ), and the updated value provided in Equation 1. The updated value is computed as rt+γmaxaQϕ(st+1,a)subscript𝑟𝑡𝛾subscriptsuperscript𝑎subscript𝑄italic-ϕsubscript𝑠𝑡1superscript𝑎r_{t}+\gamma\max_{a^{\prime}}Q_{\phi}\left(s_{t+1},a^{\prime}\right)italic_r start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT + italic_γ roman_max start_POSTSUBSCRIPT italic_a start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT italic_Q start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT ( italic_s start_POSTSUBSCRIPT italic_t + 1 end_POSTSUBSCRIPT , italic_a start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ), but since the next state is always the terminal state it reduces to rtsubscript𝑟𝑡r_{t}italic_r start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT. We finalize the adaptation of DQN for the CMAB by casting the states as context vectors, obtaining the loss function:

LDQN(ϕ)=𝔼(xt,at,r)B[(rQϕ(xt,at))2]subscript𝐿𝐷𝑄𝑁italic-ϕsubscript𝔼subscript𝑥𝑡subscript𝑎𝑡𝑟𝐵delimited-[]superscript𝑟subscript𝑄italic-ϕsubscript𝑥𝑡subscript𝑎𝑡2L_{DQN}(\phi)=\mathbb{E}_{(x_{t},a_{t},r)\in B}\left[(r-Q_{\phi}(x_{t},a_{t}))% ^{2}\right]italic_L start_POSTSUBSCRIPT italic_D italic_Q italic_N end_POSTSUBSCRIPT ( italic_ϕ ) = blackboard_E start_POSTSUBSCRIPT ( italic_x start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT , italic_a start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT , italic_r ) ∈ italic_B end_POSTSUBSCRIPT [ ( italic_r - italic_Q start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT ( italic_x start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT , italic_a start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT ) ) start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ]

The network is updated by sampling a minibatch of tuples B𝐵Bitalic_B from the replay buffer. The DQNbandit𝐷𝑄subscript𝑁𝑏𝑎𝑛𝑑𝑖𝑡DQN_{bandit}italic_D italic_Q italic_N start_POSTSUBSCRIPT italic_b italic_a italic_n italic_d italic_i italic_t end_POSTSUBSCRIPT enables exploration using an ϵitalic-ϵ\epsilonitalic_ϵ-greedy policy for selecting actions.

3.2.3 PPObanditsubscriptPPObandit\textbf{PPO}_{\textbf{bandit}}PPO start_POSTSUBSCRIPT bandit end_POSTSUBSCRIPT

Different from DQN, in Proximal Policy Optimization (PPO) Schulman et al. (2017), the policy π𝜋\piitalic_π (parameterized by θ𝜃\thetaitalic_θ) is directly optimized under the objective of selecting the best action. The general objective in policy gradient methods is to maximize: 𝔼τπθ[t=0Tθlogπθ(at|st)At]subscript𝔼similar-to𝜏subscript𝜋𝜃delimited-[]superscriptsubscript𝑡0𝑇subscript𝜃subscript𝜋𝜃conditionalsubscript𝑎𝑡subscript𝑠𝑡subscript𝐴𝑡\mathbb{E}_{\tau\sim\pi_{\theta}}\left[\sum_{t=0}^{T}\nabla_{\theta}\log\pi_{% \theta}(a_{t}|s_{t})\cdot A_{t}\right]blackboard_E start_POSTSUBSCRIPT italic_τ ∼ italic_π start_POSTSUBSCRIPT italic_θ end_POSTSUBSCRIPT end_POSTSUBSCRIPT [ ∑ start_POSTSUBSCRIPT italic_t = 0 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT ∇ start_POSTSUBSCRIPT italic_θ end_POSTSUBSCRIPT roman_log italic_π start_POSTSUBSCRIPT italic_θ end_POSTSUBSCRIPT ( italic_a start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT | italic_s start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT ) ⋅ italic_A start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT ]. The advantage Atsubscript𝐴𝑡A_{t}italic_A start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT is computed as At=Qπ(st,at)Vϕ(st)subscript𝐴𝑡subscript𝑄𝜋subscript𝑠𝑡subscript𝑎𝑡subscript𝑉italic-ϕsubscript𝑠𝑡A_{t}=Q_{\pi}(s_{t},a_{t})-V_{\phi}(s_{t})italic_A start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT = italic_Q start_POSTSUBSCRIPT italic_π end_POSTSUBSCRIPT ( italic_s start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT , italic_a start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT ) - italic_V start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT ( italic_s start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT ), where a critic network Vϕsubscript𝑉italic-ϕV_{\phi}italic_V start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT is used to estimate the state value. PPO ensures the policy does not deviate too far during an update, by scaling the advantage with the probability ratio, rt(θ)subscript𝑟𝑡𝜃r_{t}(\theta)italic_r start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT ( italic_θ ). This ratio is clipped to create a conservative lower bound to control the policy’s change at each step. The actor’s objective function is thus defined as:

Lactor(θ)=𝔼t[min(rt(θ)At,clipϵ(rt(θ))At)]subscript𝐿𝑎𝑐𝑡𝑜𝑟𝜃subscript𝔼𝑡delimited-[]subscript𝑟𝑡𝜃subscript𝐴𝑡subscriptclipitalic-ϵsubscript𝑟𝑡𝜃subscript𝐴𝑡L_{actor}(\theta)=\mathbb{E}_{t}\left[\min(r_{t}(\theta)A_{t},\text{clip}_{% \epsilon}(r_{t}(\theta))A_{t})\right]italic_L start_POSTSUBSCRIPT italic_a italic_c italic_t italic_o italic_r end_POSTSUBSCRIPT ( italic_θ ) = blackboard_E start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT [ roman_min ( italic_r start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT ( italic_θ ) italic_A start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT , clip start_POSTSUBSCRIPT italic_ϵ end_POSTSUBSCRIPT ( italic_r start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT ( italic_θ ) ) italic_A start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT ) ]

To adapt PPO for CMAB, the sequential component is removed and the state stsubscript𝑠𝑡s_{t}italic_s start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT is replaced by the context vector xtsubscript𝑥𝑡x_{t}italic_x start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT. For the actor loss, the advantage changes and is calculated as At=rtVϕ(xt)subscript𝐴𝑡subscript𝑟𝑡subscript𝑉italic-ϕsubscript𝑥𝑡A_{t}=r_{t}-V_{\phi}(x_{t})italic_A start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT = italic_r start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT - italic_V start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT ( italic_x start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT ). The return again reduces to the reward, thereby simplifying the critic loss to:

Lcritic(ϕ)=𝔼t[(Vϕ(xt)rt)2]subscript𝐿𝑐𝑟𝑖𝑡𝑖𝑐italic-ϕsubscript𝔼𝑡delimited-[]superscriptsubscript𝑉italic-ϕsubscript𝑥𝑡subscript𝑟𝑡2L_{critic}(\phi)=\mathbb{E}_{t}\left[(V_{\phi}(x_{t})-r_{t})^{2}\right]italic_L start_POSTSUBSCRIPT italic_c italic_r italic_i italic_t italic_i italic_c end_POSTSUBSCRIPT ( italic_ϕ ) = blackboard_E start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT [ ( italic_V start_POSTSUBSCRIPT italic_ϕ end_POSTSUBSCRIPT ( italic_x start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT ) - italic_r start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT ) start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ]

Lastly, the final loss of the PPObandit𝑃𝑃subscript𝑂𝑏𝑎𝑛𝑑𝑖𝑡PPO_{bandit}italic_P italic_P italic_O start_POSTSUBSCRIPT italic_b italic_a italic_n italic_d italic_i italic_t end_POSTSUBSCRIPT agent contains a penalty that maximizes the policy’s entropy of the context vector to encourage exploration.

3.3 Reward Scales

Lin et al. (2020) implement reward scaling on an imbalanced binary classification dataset. Inspired by this, we propose different ways of reward scales for multi-class classification with imbalances of protected attributes. For context, we use the profession classification dataset, BiasBios, where reward scaling tackles the sub-class imbalance of the protected attribute gender. To illustrate the influence of various reward scales Figure 2 shows the scales of a balanced (Professor) and an imbalanced (Nurse) class for the protected groups with attribute gender.

For the first method, we extend the implementation of Lin et al. (2020) into the multi-classification setting and reduce the reward for the majority by scaling it with the imbalanced ratio ρimba=|Dmina||Dmaja|subscriptsuperscript𝜌𝑎𝑖𝑚𝑏subscriptsuperscript𝐷𝑎𝑚𝑖𝑛subscriptsuperscript𝐷𝑎𝑚𝑎𝑗\rho^{a}_{imb}=\frac{|D^{a}_{min}|}{|D^{a}_{maj}|}italic_ρ start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i italic_m italic_b end_POSTSUBSCRIPT = divide start_ARG | italic_D start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_m italic_i italic_n end_POSTSUBSCRIPT | end_ARG start_ARG | italic_D start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_m italic_a italic_j end_POSTSUBSCRIPT | end_ARG, which is the ratio between the number of samples of the minority and majority class in class a𝑎aitalic_a.

𝒲ρ+(a,g)={1if g is minority in aρimbaif g is majority in asubscript𝒲limit-from𝜌𝑎𝑔cases1if 𝑔 is minority in 𝑎subscriptsuperscript𝜌𝑎𝑖𝑚𝑏if 𝑔 is majority in 𝑎\mathcal{W}_{\rho+}(a,g)=\begin{cases}1&\text{if }g\text{ is minority in }a\\ \rho^{a}_{imb}&\text{if }g\text{ is majority in }a\end{cases}caligraphic_W start_POSTSUBSCRIPT italic_ρ + end_POSTSUBSCRIPT ( italic_a , italic_g ) = { start_ROW start_CELL 1 end_CELL start_CELL if italic_g is minority in italic_a end_CELL end_ROW start_ROW start_CELL italic_ρ start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i italic_m italic_b end_POSTSUBSCRIPT end_CELL start_CELL if italic_g is majority in italic_a end_CELL end_ROW

Figure 2 demonstrates that 𝒲ρ+(x)subscript𝒲limit-from𝜌𝑥\mathcal{W}_{\rho+}(x)caligraphic_W start_POSTSUBSCRIPT italic_ρ + end_POSTSUBSCRIPT ( italic_x ) scales with a reverse of the bias within a class, however, compared to a balanced class, the reward scale of the majority is very low. Therefore, we propose a second design that keeps the scales of the majority group in the imbalanced class equal to the scales of the balanced class. Thus we set the majority value at 1 and only increase the minority value, based on the inversed imbalanced ratio.

𝒲ρ(a,g)={(ρimba)1if g is minority in a1if g is majority in asubscript𝒲limit-from𝜌𝑎𝑔casessuperscriptsubscriptsuperscript𝜌𝑎𝑖𝑚𝑏1if 𝑔 is minority in 𝑎1if 𝑔 is majority in 𝑎\mathcal{W}_{\rho-}(a,g)=\begin{cases}(\rho^{a}_{imb})^{-1}&\text{if }g\text{ % is minority in }a\\ 1&\text{if }g\text{ is majority in }a\end{cases}caligraphic_W start_POSTSUBSCRIPT italic_ρ - end_POSTSUBSCRIPT ( italic_a , italic_g ) = { start_ROW start_CELL ( italic_ρ start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i italic_m italic_b end_POSTSUBSCRIPT ) start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT end_CELL start_CELL if italic_g is minority in italic_a end_CELL end_ROW start_ROW start_CELL 1 end_CELL start_CELL if italic_g is majority in italic_a end_CELL end_ROW

The third implementation adopts the Equal Opportunity (EO) formalization used by Han et al. (2022a). Contrary to the previous two methods it ensures the average weights per class remain equal, providing an improved theoretical fairness among classes. The EO objective is achieved by aggregating the loss per sensitive state and then scaling it. However, our work scales per instance, thus we convert the EO objective to instance-specific weights (see Appendix B.3) and obtain:

𝒲EO(a,g)=121P(g|a)subscript𝒲𝐸𝑂𝑎𝑔121𝑃conditional𝑔𝑎\mathcal{W}_{EO}(a,g)=\frac{1}{2}\frac{1}{P(g|a)}caligraphic_W start_POSTSUBSCRIPT italic_E italic_O end_POSTSUBSCRIPT ( italic_a , italic_g ) = divide start_ARG 1 end_ARG start_ARG 2 end_ARG divide start_ARG 1 end_ARG start_ARG italic_P ( italic_g | italic_a ) end_ARG

Lastly, we also employ the Inverse Probability Weighting (IPW) technique Höfler et al. (2005). Full fairness across classes and protected groups is obtained by scaling with the joint probability, resulting in:

𝒲IPW(a,g)=1P(a,g)superscript𝒲𝐼𝑃𝑊𝑎𝑔1𝑃𝑎𝑔\mathcal{W}^{IPW}(a,g)=\frac{1}{P(a,g)}caligraphic_W start_POSTSUPERSCRIPT italic_I italic_P italic_W end_POSTSUPERSCRIPT ( italic_a , italic_g ) = divide start_ARG 1 end_ARG start_ARG italic_P ( italic_a , italic_g ) end_ARG
Refer to caption
Figure 2: Reward scales for the professions with different gender imbalances Professor (50/50) and Nurse (90/10) using the different scaling functions.

3.4 Supervised Learning: Loss reweighting

Parallel to reward scaling in RL is (instance) reweighing in supervised learning Han et al. (2022a); Lahoti et al. (2020), here loss reweighting for clarity. Loss reweighting has been a popular technique for imbalanced datasets, where the loss of each data sample is scaled to mitigate the class imbalance, traditionally using the IPW Höfler et al. (2005). The weighted cross-entropy loss using the true probability p𝑝pitalic_p, predicted probability q𝑞qitalic_q:

LCE=x,ga𝒲(a,g)p(a|x)logq(a|x)superscript𝐿𝐶𝐸subscript𝑥𝑔subscript𝑎𝒲𝑎𝑔𝑝conditional𝑎𝑥𝑞conditional𝑎𝑥L^{CE}=-\sum_{x,g}\sum_{a}\mathcal{W}(a,g)p(a|x)\log q(a|x)italic_L start_POSTSUPERSCRIPT italic_C italic_E end_POSTSUPERSCRIPT = - ∑ start_POSTSUBSCRIPT italic_x , italic_g end_POSTSUBSCRIPT ∑ start_POSTSUBSCRIPT italic_a end_POSTSUBSCRIPT caligraphic_W ( italic_a , italic_g ) italic_p ( italic_a | italic_x ) roman_log italic_q ( italic_a | italic_x )

We implement supervised learning with loss reweighing to serve as a strong baseline and highlight the connection between loss reweighing and reward scaling.

4 Experiments

4.1 Dataset

The BiasBios De-Arteaga et al. (2019) consists of 393,423 biographies labeled with one of 28 professions, and a binary gender label. Following De-Arteaga et al. (2019), the data is randomly split according to 65% training, 25% testing, and 10% for validating. The dataset contains two imbalances: varying frequencies of the professions and a difference in gender percentage for each class.

Following Ravfogel et al. (2020) and Han et al. (2022a) we also evaluate on the Emoji (Elazar and Goldberg, 2018) sentiment analysis task of Twitter data Blodgett et al. (2016). The task involves binary sentiment classification evaluation with race as the protected attribute, approximated through the provided labels Standard American English (SAE) and African American English (AAE). As per Han et al. (2021), the dataset is composed of Happy (40% AAE, 10% SAE), and Sad: (10% AAE, 40% SAE). We use the same train, dev, and test splits of 100k/8k/8k instances, respectively.

Context Vectors

Each textual data sample is embedded into a context vector via a pretrained encoder, enabling the algorithms for classification. Following Ravfogel et al. (2020) we use the same fixed pretrained encoder for each dataset. For the BiasBios dataset, each biography is encoded using the [CLS] output of the uncased BERT-base model Devlin et al. (2019). For the Emoji dataset, we use the DeepMoji encoder Felbo et al. (2017), which has been demonstrated to capture a diverse range of moods and demographic information.

4.2 Metrics

Following prior work, we evaluate performance using accuracy and fairness using the True Positive Ratio (TPR) gap De-Arteaga et al. (2019); Ravfogel et al. (2020). The TPR gap of a class aA𝑎𝐴a\in Aitalic_a ∈ italic_A is calculated as: TPRgapa=TPRgaTPRga𝑇𝑃superscriptsubscript𝑅𝑔𝑎𝑝𝑎𝑇𝑃superscriptsubscript𝑅𝑔𝑎𝑇𝑃superscriptsubscript𝑅similar-toabsent𝑔𝑎TPR_{gap}^{a}=TPR_{g}^{a}-TPR_{\sim g}^{a}italic_T italic_P italic_R start_POSTSUBSCRIPT italic_g italic_a italic_p end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT = italic_T italic_P italic_R start_POSTSUBSCRIPT italic_g end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT - italic_T italic_P italic_R start_POSTSUBSCRIPT ∼ italic_g end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT, where g𝑔gitalic_g and gsimilar-toabsent𝑔\sim g∼ italic_g represent the two options for the sensitive states. The global TPR metric, GAP, is then calculated as the root mean square of the individual metrics:

GAP=1|A|aA(TPRgapa)2𝐺𝐴𝑃1𝐴subscript𝑎𝐴superscript𝑇𝑃subscriptsuperscript𝑅𝑎𝑔𝑎𝑝2GAP=\sqrt{\frac{1}{|A|}\sum_{a\in A}\left(TPR^{a}_{gap}\right)^{2}}italic_G italic_A italic_P = square-root start_ARG divide start_ARG 1 end_ARG start_ARG | italic_A | end_ARG ∑ start_POSTSUBSCRIPT italic_a ∈ italic_A end_POSTSUBSCRIPT ( italic_T italic_P italic_R start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_g italic_a italic_p end_POSTSUBSCRIPT ) start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_ARG (2)

To quantify performance and fairness as a single metric we use the Distance To the Optimum (DTO) introduced in Han et al. (2022a). DTO combines the metrics (accuracy, 1-GAP) as dimensions of evaluation space and computes the Euclidean distance between the achieved and Utopian point. The smaller the distance to the Utopian point (lower DTO), the better. We report the DTO with the Utopian accuracy and GAP as the best values across all evaluated models.

While accuracy measures the overall performance and GAP the disparity among protected groups within a class, these metrics do not capture imbalance performance across classes. Therefore we also evaluate our algorithms using the macro-averaged F1 metric to detect if minority classes are ignored. All metrics are scaled by 100 for ease of reading and all metrics are represented in the tables as the mean ±plus-or-minus\pm± std over 5 random seeds, except DTO which is taken over the mean.

4.3 Hyperparameters and model selection

Each algorithm uses the same classifier architecture, except LinUCB, which has a custom set of learnable parameters. The classifier has one hidden layer MLP. All models are trained for 10 epochs, except LinUCB, which achieved optimal performance within 2 epochs. All models are evaluated on the validation set after 50k iterations to account for different convergence speeds of models. The best model throughout training and across hyperparameters is selected using DTO. We apply hyperparameter optimization on both datasets for each of the algorithms, for details see Appendix A.3.

PPObandit Sup
Accuracy \uparrow GAP \downarrow Accuracy \uparrow GAP \downarrow
𝒲ρ+subscript𝒲limit-from𝜌\mathcal{W}_{\rho+}caligraphic_W start_POSTSUBSCRIPT italic_ρ + end_POSTSUBSCRIPT 74.6 ±plus-or-minus\pm± 0.7 9.9 ±plus-or-minus\pm± 0.8 79.3 ±plus-or-minus\pm± 0.1 7.9 ±plus-or-minus\pm± 0.3
𝒲ρsubscript𝒲limit-from𝜌\mathcal{W}_{\rho-}caligraphic_W start_POSTSUBSCRIPT italic_ρ - end_POSTSUBSCRIPT 78.8 ±plus-or-minus\pm± 0.1 8.4 ±plus-or-minus\pm± 0.6 79.8 ±plus-or-minus\pm± 0.3 6.9 ±plus-or-minus\pm± 0.2
𝒲EOsubscript𝒲𝐸𝑂\mathcal{W}_{EO}caligraphic_W start_POSTSUBSCRIPT italic_E italic_O end_POSTSUBSCRIPT 79.2 ±plus-or-minus\pm± 0.2 8.5 ±plus-or-minus\pm± 0.2 80.1 ±plus-or-minus\pm± 0.2 7.1 ±plus-or-minus\pm± 0.5
𝒲IPWsubscript𝒲𝐼𝑃𝑊\mathcal{W}_{IPW}caligraphic_W start_POSTSUBSCRIPT italic_I italic_P italic_W end_POSTSUBSCRIPT 45.8 ±plus-or-minus\pm± 6.9 10.5 ±plus-or-minus\pm± 0.9 72.1 ±plus-or-minus\pm± 0.7 6.1 ±plus-or-minus\pm± 0.3
Table 1: Results with different reward scales for Supervised Learning (Sup) and PPO on BiasBios
BiasBios (28 Classes) Emoji (2 Classes)
Algorithm Accuracy \uparrow GAP \downarrow DTO \downarrow F1 \uparrow Zeit \downarrow Accuracy \uparrow GAP \downarrow DTO \downarrow Zeit \downarrow
Sup 81.0 ±plus-or-minus\pm± 0.1 16.4 ±plus-or-minus\pm± 0.5 9.3 73.8 ±plus-or-minus\pm± 0.3 1.0 72.3 ±plus-or-minus\pm± 0.1 38.1 ±plus-or-minus\pm± 0.6 28.3 1.0
INLP 80.2 ±plus-or-minus\pm± 0.6 9.7 ±plus-or-minus\pm± 0.4 2.8 71.7 ±plus-or-minus\pm± 1.4 50.1 63.5 ±plus-or-minus\pm± 3.6 24.1 ±plus-or-minus\pm± 5.4 18.6 3.6
MP 81.1 ±plus-or-minus\pm± 0.1 13.9 ±plus-or-minus\pm± 0.6 6.8 74.0 ±plus-or-minus\pm± 0.2 2.6 71.8 ±plus-or-minus\pm± 0.3 17.1 ±plus-or-minus\pm± 1.0 8.1 2.3
BTEO 79.2 ±plus-or-minus\pm± 0.3 8.4 ±plus-or-minus\pm± 0.6 2.3 68.1 ±plus-or-minus\pm± 0.4 1.7 75.4 ±plus-or-minus\pm± 0.1 10.4 ±plus-or-minus\pm± 1.0 0.4 0.8
DAdv 80.8 ±plus-or-minus\pm± 0.2 8.5 ±plus-or-minus\pm± 0.6 1.4 72.9 ±plus-or-minus\pm± 0.4 4.8 75.6 ±plus-or-minus\pm± 0.3 11.6 ±plus-or-minus\pm± 1.7 1.6 5.7
SupEO 80.1 ±plus-or-minus\pm± 0.2 7.1 ±plus-or-minus\pm± 0.5 1.0 71.7 ±plus-or-minus\pm± 0.5 1.0 75.5 ±plus-or-minus\pm± 0.1 11.4 ±plus-or-minus\pm± 1.1 1.4 1.0
LinUCBEO 74.6 ±plus-or-minus\pm± 0.2 12.2 ±plus-or-minus\pm± 0.5 8.3 59.8 ±plus-or-minus\pm± 1.1 31.9 75.3 ±plus-or-minus\pm± 0.2 10.4 ±plus-or-minus\pm± 0.7 0.5 2.8
DQNbanditEOsuperscriptsubscriptDQN𝑏𝑎𝑛𝑑𝑖𝑡𝐸𝑂\text{DQN}_{bandit}^{{EO}}DQN start_POSTSUBSCRIPT italic_b italic_a italic_n italic_d italic_i italic_t end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_E italic_O end_POSTSUPERSCRIPT 79.2 ±plus-or-minus\pm± 0.1 10.1 ±plus-or-minus\pm± 0.4 3.6 66.4 ±plus-or-minus\pm± 0.2 57.4 70.8 ±plus-or-minus\pm± 0.8 10.0 ±plus-or-minus\pm± 1.0 4.8 30.2
PPObanditEOsuperscriptsubscriptPPO𝑏𝑎𝑛𝑑𝑖𝑡𝐸𝑂\text{PPO}_{bandit}^{{EO}}PPO start_POSTSUBSCRIPT italic_b italic_a italic_n italic_d italic_i italic_t end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_E italic_O end_POSTSUPERSCRIPT 79.2 ±plus-or-minus\pm± 0.2 8.5 ±plus-or-minus\pm± 0.2 2.4 66.0 ±plus-or-minus\pm± 0.8 2.9 75.4 ±plus-or-minus\pm± 0.1 14.4 ±plus-or-minus\pm± 0.6 4.4 3.0
Table 2: Results on the BiasBios and Emojis classification datasets for our own models (in grey) and the baselines. Metrics are provided as mean ±plus-or-minus\pm± std over 5 random seeds, except DTO which is computed over the mean Accuracy, and GAP, and Time which is the relative time compared to the supervised baseline (first row).

4.4 Comparison Models

Besides the supervised implementation in Section 3.4, abbreviated to Sup, we also compare our models against various existing debiasing methods. INLP Ravfogel et al. (2020) debiases embeddings by iteratively training classifiers to predict the protected attribute, it then removes this information from the embedding using a projection of the classifier’s nullspace. MP Haghighatkhah et al. (2022) simplifies the INLP setup by using a single Mean Projection (MP) between the representation of each class’s protected groups. DAdv, Han et al. (2021) removes sensitive information from the embeddings by applying adversarial training using diverse adversaries. Lastly, BTEO Han et al. (2022a) subsamples the dataset to establish equal opportunity. We implement these existing methods with the same training settings for fair comparison. Notably, we highlight how Supervised 𝒲EOsuperscript𝒲𝐸𝑂\mathcal{W}^{EO}caligraphic_W start_POSTSUPERSCRIPT italic_E italic_O end_POSTSUPERSCRIPT is theoretically equal to instance reweighing in Han et al. (2022a), but our implementation achieves significantly higher performance.

5 Results and Analysis

We train each of the RL algorithms with and without reward scaling. As a strong baseline, we also train a supervised learning model in the standard fashion and use loss reweighting with the same reward scale function.

5.1 Different Reward Functions

We first evaluate the effect of the different reward scales discussed in Section 3.3 by providing the results for the implementations of PPO and Sup, see Table 1, for full table see Appendix D.4.

The results presented in the table demonstrate that the imbalance ratio ρ𝜌\rhoitalic_ρ yields substantial gains in fairness and accuracy when applied to increase the reward for the minority class (𝒲ρsubscript𝒲limit-from𝜌\mathcal{W}_{\rho-}caligraphic_W start_POSTSUBSCRIPT italic_ρ - end_POSTSUBSCRIPT) as opposed to decreasing the reward for the majority class (𝒲ρ+subscript𝒲limit-from𝜌\mathcal{W}_{\rho+}caligraphic_W start_POSTSUBSCRIPT italic_ρ + end_POSTSUBSCRIPT). Especially the accuracy of PPO is sensitive to this, suggesting that PPO might not work very well for states with low reward scales.

As hypothesized, scaling with the joint probability of class and protected attribute as in 𝒲IPWsubscript𝒲𝐼𝑃𝑊\mathcal{W}_{IPW}caligraphic_W start_POSTSUBSCRIPT italic_I italic_P italic_W end_POSTSUBSCRIPT proves to be too unstable. It results in the worst accuracy for both algorithms, with a minor improvement in fairness for supervised learning. The overall difference between 𝒲EOsubscript𝒲𝐸𝑂\mathcal{W}_{EO}caligraphic_W start_POSTSUBSCRIPT italic_E italic_O end_POSTSUBSCRIPT and 𝒲ρsubscript𝒲limit-from𝜌\mathcal{W}_{\rho-}caligraphic_W start_POSTSUBSCRIPT italic_ρ - end_POSTSUBSCRIPT is minimal as expected from their similar reward scales depicted in Figure 2. We use EO in our experiments because of its better theoretical foundation.

5.2 Main Results

The main results of our experiments are summarized in Table 2.

On the BiasBios dataset, our DQN and PPO implementations achieve strong results, with PPO outperforming DQN in fairness, as PPO’s lower GAP shows. Our supervised implementation, Sup 𝒲EOsuperscript𝒲𝐸𝑂\mathcal{W}^{EO}caligraphic_W start_POSTSUPERSCRIPT italic_E italic_O end_POSTSUPERSCRIPT, surpasses all other baselines. LinUCB performs significantly worse on this task, obtaining one of the worst DTO scores. In contrast, on the Emoji dataset, LinUCB achieves one of the best performance-fairness trade-offs, as indicated by the low DTO score, and is only surpassed by BTEO, which has a slightly higher accuracy. On the other hand, DQN obtains a lower accuracy and PPO lower fairness compared to other metrics.

These results suggest that the classical CMAB algorithm LinUCB excels on binary datasets, while the deep RL implementations, DQN and PPO, perform better in multi-class settings. Notably, although DQN and PPO obtain competitive results on the BiasBios, their F1 score is considerably lower than the baselines. Further analysis of per class metrics (see Appendix D.2) reveals that while the F1 for most classes was on par with the supervised setup, both deep RL algorithms failed to recall two of the very sparse classes.

Compared to baseline methods such as BTEO and DAdv, our DQN and PPO implementations demonstrate competitive performance on the BiasBios dataset. Table 2 also shows that, contrary to previous work Han et al. (2022a),333The EO scaled supervised implementation of Han et al. (2022a) achieves an Accuracy of 75.7 and GAP of 13.9 loss-scaling for supervised learning (Sup 𝒲EOsuperscript𝒲𝐸𝑂\mathcal{W}^{EO}caligraphic_W start_POSTSUPERSCRIPT italic_E italic_O end_POSTSUPERSCRIPT) achieves superior overall performance to downsampling (BTEO). Downsampling only seems to outperform scaling when enough data is present, as demonstrated by its lower GAP for the Emoji dataset.

Algo + 𝒲EOsuperscript𝒲𝐸𝑂\mathcal{W}^{EO}caligraphic_W start_POSTSUPERSCRIPT italic_E italic_O end_POSTSUPERSCRIPT Accuracy \uparrow GAP \downarrow F1 \uparrow
Sup 81.0 (- 0.9) 16.4 (- 9.3) 73.8 (- 2.1)
LinUCB 78.4 (- 3.8) 15.5 (- 3.3) 67.3 (- 7.5)
DQNbanditsubscriptDQN𝑏𝑎𝑛𝑑𝑖𝑡\text{DQN}_{bandit}DQN start_POSTSUBSCRIPT italic_b italic_a italic_n italic_d italic_i italic_t end_POSTSUBSCRIPT 80.1 (- 0.9) 13.7 (- 3.6) 66.5 (- 0.1)
PPObanditsubscriptPPO𝑏𝑎𝑛𝑑𝑖𝑡\text{PPO}_{bandit}PPO start_POSTSUBSCRIPT italic_b italic_a italic_n italic_d italic_i italic_t end_POSTSUBSCRIPT 79.7 (- 0.5) 14.4 (- 5.9) 67.5 (- 1.5)
Table 3: Results on the Bias dataset without reward scaling, presented as mean and difference from the case without EO, where red (worse), blue (better).

5.3 Reward Scaling Impact

We investigate the influence of reward scaling on our models by training them with and without scaling. Table 3 presents the results on BiasBios as the mean performance without scaling and the change in metrics when EO scaling is applied.

Without reward scaling the three RL algorithms achieve similar accuracy to the supervised approach but at the cost of a lower F1 score. As mentioned above, the RL algorithms fail on two very sparse classes, which explains the drop in GAP and F1. Failing to classify any instances of a class correctly results in a TPR gap of 0 for that class, since the result is "fair" among both genders.

The EO reward scale significantly reduces the GAP of all implementations, at the cost of a slight decrease in Accuracy and F1 for most models. However, on LinUCB the scaling causes a large performance reduction with only a small GAP reduction, suggesting that scaling hinders the performance more than it improves the fairness.

To inspect the weak effect of reward scaling on LinUCB, we analyze the TPR gap per profession against the gender imbalance for both cases in Figure 3. Without scaling, LinUCB’s performance follows a predictable positive correlation with gender imbalance. For instance, in the Nurse class (similar-to\sim 90% women), the model performs better for the majority group (women), resulting in a positive TPR gap. However, after reward scaling this correlation is inverted, causing the model to perform worse for the majority group and better for the minority group. In case of the Nurse class, the model obtains a negative TPR gap. This suggests LinUCB is oversensitive to scaling on the BiasBios dataset, causing it to overcompensate and penalize the majority group.

Refer to caption
Refer to caption
Figure 3: TPR gap plotted against the gender distribution per profession for LinUCB. Left without reward scaling and right with EO reward scaling

5.4 Subclass Imbalance Sensitivity

For a more in-depth analysis of each model’s sensitivity to subclass imbalance, we train them on the Emoji dataset under various stereotyping ratios. A stereotyping ratio represents the proportion of the AAE and SAE samples in each class. For example, a stereotyping ratio of 0.2 means the data is distributed as Happy (20% AAE, 80% SAE), Sad (80% AAE, 20% SAE).

Refer to caption
Figure 4: Performance (Accuracy) and Fairness (GAP) on the Emoji dataset using different stereotyping ratios. All models use the scaling of 𝒲EOsuperscript𝒲𝐸𝑂\mathcal{W}^{EO}caligraphic_W start_POSTSUPERSCRIPT italic_E italic_O end_POSTSUPERSCRIPT.

Figure 4 reveals a strong inverse relationship between LinUCB’s fairness and the stereotyping ratio. Although the stereotypical ratios are symmetric at the value of 0.5 the fairness of LinUCB is asymmetric at this value. Thus there is a residual representation bias in the data that is not addressed by the reward scaling. In contrast, supervised learning maintains a mostly stable fairness, except for the most extreme ratios. Interestingly, LinUCB reveals a reverse pattern in best and worst fairness.

The relatively low accuracy of DQN and poor performance on fairness of PPO are consistent across ratios. However, PPO does have the most constant fairness and performance across stereotyping ratios, indicating good training stability.

5.5 Signal strength vs. Scaling

We now examine how the strength of the protected information affects the efficacy of reward scaling. We focus on two scenarios that modify the gender signal in the representations: 1) adding explicit gender information, thus increasing the gender signal strength 2) debiasing the embeddings using MP, which reduces it. Table 4 presents the mean and relative difference compared to the results without the specified modification.444Full tables in Appendix D.5

Providing the model with gender information increases the overall accuracy. However, the impact on fairness, as indicated by the GAP score varies among algorithms. The GAP score increases for the two algorithms with the lowest GAPs (Sup, PPO) and decreases for the two with the highest GAP (LinUCB, DQN). Only the algorithms that perform less well on fairness benefited from access to protected attribute.

Explicit Gender Info MP-Debiased
Algo+𝒲EOsuperscript𝒲𝐸𝑂\mathcal{W}^{EO}caligraphic_W start_POSTSUPERSCRIPT italic_E italic_O end_POSTSUPERSCRIPT Accuracy \uparrow GAP \downarrow Accuracy \uparrow GAP \downarrow
Sup 80.2 (+ 0.1) 7.2 (+ 0.1) 80.0 (- 0.1) 7.4 (+ 0.3)
LinUCB 74.5 (+ 0.1) 11.7 (- 0.5) 74.3 (- 0.3) 11.5 (- 0.7)
DQNbanditsubscriptDQN𝑏𝑎𝑛𝑑𝑖𝑡\text{DQN}_{bandit}DQN start_POSTSUBSCRIPT italic_b italic_a italic_n italic_d italic_i italic_t end_POSTSUBSCRIPT 79.2 (+ 0.0) 10.0 (- 0.1) 79.0 (- 0.2) 8.6 (- 1.5)
PPObanditsubscriptPPO𝑏𝑎𝑛𝑑𝑖𝑡\text{PPO}_{bandit}PPO start_POSTSUBSCRIPT italic_b italic_a italic_n italic_d italic_i italic_t end_POSTSUBSCRIPT 79.3 (+ 0.1) 8.7 (+ 0.2) 79.2 (+ 0.0) 9.7 (+ 1.2)
Table 4: Results on the BiasBios with added gender info (left) and MP-debiased (right), presented as mean, and difference without change: red (worse), blue (better).

Removing the bias with MP reduces the test accuracy for nearly all algorithms, indicating some useful information is removed. Again, the modification increased relatively low GAP scores, and decreased relatively high scores. As such, changing to a representation with relatively low bias helps LinUCB and DQN, whereas Sup and PPO that already achieved better fairness mainly see their overall performance hindered.

Notably, the differences in Table 4 are relatively small and hardly ever surpass the standard deviation provided in Table 2. This suggests that while the strength of the protected information influences performance and fairness, the impact might be less pronounced than the choice algorithmic design. Moreover, all methods reduced the GAP score compared to only applying MP (which yields a GAP of 13.9, see Table 2).

6 Discussion and Conclusion

This paper introduces a novel approach to fair classification using the Contextual Multi-Armed Bandit (CMAB) framework and explores various Reinforcement Learning (RL) algorithms. Our findings demonstrate the potential of different RL algorithms for this task and the efficacy of reward scaling in mitigating imbalances of protected groups. The results show the MDP-derived deep RL methods perform best on the multi-class dataset, while the classical bandit algorithm, LinUCB, excels on the binary dataset. Moreover, our scaled supervised learning implementation achieved new state-of-the-art results on the complex BiasBios dataset.

Our experiments also revealed two limitations 1) RL algorithms can ignore some very sparse classes, despite performing well under most class imbalances. 2) Reward scaling for LinUCB can impair majority group performance beyond that of the minority group. However, the effect of reward scaling remains robust across varying strengths of the protected information, highlighting its potential as a powerful tool for achieving fair outcomes.

Despite these challenges, we believe that the proposed framework presents a promising approach to leverage RL algorithms for fair classification, opening up new research avenues. We encourage future work to extend upon our framework by exploiting different RL characteristics , such as model updates for MDP algorithms based on non-differentiable fairness metrics.

Limitations

Important limitations of this work can be divided into two sections: 1) Limitations of the dataset and data requirements of our models 2) Limitations specific to our algorithms and experiments, independent of the data.

Data limitation

Firstly, all datasets considered in this study used English text, which restricts the analysis and might miss other types of biases related to different linguistic and cultural contexts. Secondly, the protected groups evaluated in this study simplified to binary labels, which excludes people who do not fall into this category such as non-binary individuals and the multidimensional nature of ethnicity.

Our reward scaling approach also requires these labels for classification. Although our setup could easily be extended to cases with more labels, it would be interesting to see fair classification with protected attributes as continuous values. But due to lack of good benchmarks restricts the evaluation of such cases.

Algorithmic limitation

Firstly, our paper used two deep RL MDP algorithms and one linear classical CMAB agent. We recognize that while linear agents have a significant focus in the CMAB literature, the fast field of CMAB agents includes options with non-linear algorithms that could also be applied to this task. The choice of LinUCB does not represent the state-of-the-art, but rather a classical high-performance implementation.
Second, the various hyperparameters limit the extent of general statements about each algorithm. We have documented our hyperparameter search and training methods in the appendix, to ensure the interpretability of our experiments, but our results only demonstrate the capabilities of our best implementation. Moreover, the use of DTO to select the best model throughout training fails to account for potential trade-offs between fairness and accuracy at different points in training. For example, on the Emoji dataset, PPO underperformed in Fairness and DQN in accuracy. However, it is possible that at another pointing training with a higher DTO score, the trade-off between fairness and accuracy was reversed.

Ethics Statement

The application of the paper was to improve fairness among protected groups in classification. However, no algorithm is able to obtain perfect fairness and remove the bias perfectly. Therefore applications of the mentioned debiasing methods should always strongly take the mentioned limitations into account. Moreover, the current experiments are limited to specific datasets and real world use cases may be different. Careful evaluation and testing system behavior in the intended setting with input from experts who can judge the consequences of remaining bias is essential.

Acknowledgments

This research was partially funded by the Hybrid Intelligence Center, a 10-year program funded by the Dutch Ministry of Education, Culture and Science through the Netherlands Organisation for Scientific Research, https://hybrid-intelligence-centre.nl.

References

  • Aguirre et al. (2023) Carlos Aguirre, Kuleen Sasse, Isabel Cachola, and Mark Dredze. 2023. Selecting shots for demographic fairness in few-shot learning with large language models. arXiv preprint arXiv:2311.08472.
  • Bellman (1957) Richard Bellman. 1957. Dynamic Programming, 1 edition. Princeton University Press, Princeton, NJ, USA.
  • Blodgett et al. (2016) Su Lin Blodgett, Lisa Green, and Brendan O’Connor. 2016. Demographic Dialectal Variation in Social Media: A Case Study of African-American English. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 1119–1130.
  • De-Arteaga et al. (2019) Maria De-Arteaga, Alexey Romanov, Hanna Wallach, Jennifer Chayes, Christian Borgs, Alexandra Chouldechova, Sahin Geyik, Krishnaram Kenthapadi, and Adam Tauman Kalai. 2019. Bias in bios: A case study of semantic representation bias in a high-stakes setting. In proceedings of the Conference on Fairness, Accountability, and Transparency, pages 120–128.
  • Devlin et al. (2019) Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. Bert: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of NAACL-HLT, pages 4171–4186.
  • Dimakopoulou et al. (2019) Maria Dimakopoulou, Zhengyuan Zhou, Susan Athey, and Guido Imbens. 2019. Balanced linear contextual bandits. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 3445–3453.
  • Dudík et al. (2014) Miroslav Dudík, Dumitru Erhan, John Langford, and Lihong Li. 2014. Doubly robust policy evaluation and optimization. Statistical Science, 29(4):485–511.
  • Elazar and Goldberg (2018) Yanai Elazar and Yoav Goldberg. 2018. Adversarial removal of demographic attributes from text data. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages 11–21.
  • Felbo et al. (2017) Bjarke Felbo, Alan Mislove, Anders Søgaard, Iyad Rahwan, and Sune Lehmann. 2017. Using millions of emoji occurrences to learn any-domain representations for detecting sentiment, emotion and sarcasm. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pages 1615–1625.
  • Haghighatkhah et al. (2022) Pantea Haghighatkhah, Antske Fokkens, Pia Sommerauer, Bettina Speckmann, and Kevin Verbeek. 2022. Better hit the nail on the head than beat around the bush: Removing protected attributes with a single projection. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 8395–8416.
  • Han et al. (2021) Xudong Han, Timothy Baldwin, and Trevor Cohn. 2021. 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, pages 2760–2765.
  • Han et al. (2022a) Xudong Han, Timothy Baldwin, and Trevor Cohn. 2022a. Balancing out bias: Achieving fairness through balanced training. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pages 11335–11350.
  • Han et al. (2022b) Xudong Han, Aili Shen, Yitong Li, Lea Frermann, Timothy Baldwin, and Trevor Cohn. 2022b. Fairlib: A unified framework for assessing and improving fairness. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 60–71.
  • Höfler et al. (2005) Michael Höfler, Hildegard Pfister, Roselind Lieb, and Hans-Ulrich Wittchen. 2005. The use of weights to account for non-response and drop-out. Social psychiatry and psychiatric epidemiology, 40:291–299.
  • Lahoti et al. (2020) Preethi Lahoti, Alex Beutel, Jilin Chen, Kang Lee, Flavien Prost, Nithum Thain, Xuezhi Wang, and Ed Chi. 2020. Fairness without demographics through adversarially reweighted learning. Advances in neural information processing systems, 33:728–740.
  • Li et al. (2010) Lihong Li, Wei Chu, John Langford, and Robert E Schapire. 2010. A contextual-bandit approach to personalized news article recommendation. In Proceedings of the 19th international conference on World wide web, pages 661–670.
  • Lin et al. (2020) Enlu Lin, Qiong Chen, and Xiaoming Qi. 2020. Deep reinforcement learning for imbalanced classification. Applied Intelligence, 50:2488–2502.
  • Mehrabi et al. (2021) Ninareh Mehrabi, Fred Morstatter, Nripsuta Saxena, Kristina Lerman, and Aram Galstyan. 2021. A survey on bias and fairness in machine learning. ACM computing surveys (CSUR), 54(6):1–35.
  • Mnih et al. (2015) Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. 2015. Human-level control through deep reinforcement learning. nature, 518(7540):529–533.
  • Ravfogel et al. (2020) Shauli Ravfogel, Yanai Elazar, Hila Gonen, Michael Twiton, and Yoav Goldberg. 2020. Null it out: Guarding protected attributes by iterative nullspace projection. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 7237–7256.
  • Schulman et al. (2017) John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. 2017. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347.
  • Shen et al. (2022) Aili Shen, Xudong Han, Trevor Cohn, Timothy Baldwin, and Lea Frermann. 2022. Does representational fairness imply empirical fairness? In Findings of the Association for Computational Linguistics: AACL-IJCNLP 2022, pages 81–95.
  • Sherman and Morrison (1950) Jack Sherman and Winifred J Morrison. 1950. Adjustment of an inverse matrix corresponding to a change in one element of a given matrix. The Annals of Mathematical Statistics, 21(1):124–127.
  • Subramanian et al. (2021) Shivashankar Subramanian, Afshin Rahimi, Timothy Baldwin, Trevor Cohn, and Lea Frermann. 2021. Fairness-aware class imbalanced learning. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 2045–2051.
  • Uc-Cetina et al. (2023) Victor Uc-Cetina, Nicolas Navarro-Guerrero, Anabel Martin-Gonzalez, Cornelius Weber, and Stefan Wermter. 2023. Survey on reinforcement learning for language processing. Artificial Intelligence Review, 56(2):1543–1575.
  • Wadsworth et al. (2018) Christina Wadsworth, Francesca Vera, and Chris Piech. 2018. Achieving fairness through adversarial learning: an application to recidivism prediction. In Proceedings of the FAT/ML Workshop.
  • Wang et al. (2019) Tianlu Wang, Jieyu Zhao, Mark Yatskar, Kai-Wei Chang, and Vicente Ordonez. 2019. Balanced datasets are not enough: Estimating and mitigating gender bias in deep image representations. In Proceedings of the IEEE/CVF international conference on computer vision, pages 5310–5319.
  • Wiering et al. (2011) Marco A Wiering, Hado Van Hasselt, Auke-Dirk Pietersma, and Lambert Schomaker. 2011. Reinforcement learning algorithms for solving classification problems. In 2011 IEEE Symposium on Adaptive Dynamic Programming and Reinforcement Learning (ADPRL), pages 91–96. IEEE.

Appendix A Reproducibility

A.1 Data Analysis

Because the BiasBios dataset needs to be scraped online, we provide the full composition of the BiasBios dataset split up in profession and gender in Table 5.

Profession Female Male
Professor 53290 64820
Physician 19579 18986
Attorney 12494 20113
Photographer 8689 15635
Journalist 9873 10077
Nurse 17236 1735
Psychologist 11385 6910
Teacher 9768 6428
Dentist 5153 9326
Surgeon 1972 11301
Architect 2398 7715
Painter 3543 4193
Model 6214 1288
Poet 3441 3570
Filmmaker 2310 4699
Software Engineer 1089 5817
Accountant 2081 3571
Composer 918 4682
Dietitian 3689 289
Comedian 592 2207
Chiropractor 690 1908
Pastor 609 1923
Paralegal 1499 268
Yoga Teacher 1406 257
Dj 211 1274
Interior Designer 1183 280
Personal Trainer 654 778
Rapper 136 1271
rapper 136 1271
Table 5: Class and gender composition of the BiasBios dataset

A.2 Model Selection

Selecting the best model throughout training or across hyperparameters is strongly dependent on the selection metric. To balance fairness and performance we use the proposed method of Han et al. (2022a), and select using DTO. The full equation of DTO is provided below, where the obtained metrics are determined by the point (Acc,(1GAP))𝐴𝑐𝑐1𝐺𝐴𝑃\left(Acc,(1-GAP)\right)( italic_A italic_c italic_c , ( 1 - italic_G italic_A italic_P ) ), and the utopian metrics are (Accutop,(1GAPutop))𝐴𝑐superscript𝑐𝑢𝑡𝑜𝑝1𝐺𝐴superscript𝑃𝑢𝑡𝑜𝑝\left(Acc^{utop},(1-GAP^{utop})\right)( italic_A italic_c italic_c start_POSTSUPERSCRIPT italic_u italic_t italic_o italic_p end_POSTSUPERSCRIPT , ( 1 - italic_G italic_A italic_P start_POSTSUPERSCRIPT italic_u italic_t italic_o italic_p end_POSTSUPERSCRIPT ) ).

DTO=(AccutopAcc)2+((1GAPutop)(1GAP))2𝐷𝑇𝑂superscript𝐴𝑐superscript𝑐𝑢𝑡𝑜𝑝𝐴𝑐𝑐2superscript1𝐺𝐴superscript𝑃𝑢𝑡𝑜𝑝1𝐺𝐴𝑃2DTO=\sqrt{\left(Acc^{utop}-Acc\right)^{2}+\left((1-GAP^{utop})-(1-GAP)\right)^% {2}}italic_D italic_T italic_O = square-root start_ARG ( italic_A italic_c italic_c start_POSTSUPERSCRIPT italic_u italic_t italic_o italic_p end_POSTSUPERSCRIPT - italic_A italic_c italic_c ) start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT + ( ( 1 - italic_G italic_A italic_P start_POSTSUPERSCRIPT italic_u italic_t italic_o italic_p end_POSTSUPERSCRIPT ) - ( 1 - italic_G italic_A italic_P ) ) start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_ARG

The best training timestep according to DTO is determined with utopian values (1,1), and the best hyperparameters setting utopian values as the best metric values during training (i.e. the highest performance and fairness each individually obtained, which do not necessarily belonging to the same algorithm).

The reported DTO values in table X and Y are obtained using the best performance and accuracy method as: [performance, fairness] BiasBios 28C = [0.811, 0.929], BiasBios 8C = [0.868, 0.978], Moji=[0.756, 0.900]

A.3 Hyperparameters

The architecture of the neural network for each algorithm is fixed and consists of 2 layers MLP. For the critic in PPO the architecture is the same except for the output size which is 1. Hyperparameter optimization is applied for each of the parameters of the algorithms using grid search. Table 7 shows the ranges and the best values.

Typ Dimensions
Layer 1 Linear n_features×128𝑛_𝑓𝑒𝑎𝑡𝑢𝑟𝑒𝑠128n\_features\times 128italic_n _ italic_f italic_e italic_a italic_t italic_u italic_r italic_e italic_s × 128
Layer 2 Linear 128×n_actions128𝑛_𝑎𝑐𝑡𝑖𝑜𝑛𝑠128\times n\_actions128 × italic_n _ italic_a italic_c italic_t italic_i italic_o italic_n italic_s
Activation ReLU
Optimizer Adam
Table 6: Neural Network Architecture
Algorithm Parameter Min Max Best
BiasBios Emoji
lr (actor) 3.0×1043.0superscript1043.0\times 10^{-4}3.0 × 10 start_POSTSUPERSCRIPT - 4 end_POSTSUPERSCRIPT 1.0×1061.0superscript1061.0\times 10^{-6}1.0 × 10 start_POSTSUPERSCRIPT - 6 end_POSTSUPERSCRIPT 1.0×1041.0superscript1041.0\times 10^{-4}1.0 × 10 start_POSTSUPERSCRIPT - 4 end_POSTSUPERSCRIPT 3.0×1053.0superscript1053.0\times 10^{-5}3.0 × 10 start_POSTSUPERSCRIPT - 5 end_POSTSUPERSCRIPT
lr (critic) 1.0×1031.0superscript1031.0\times 10^{-3}1.0 × 10 start_POSTSUPERSCRIPT - 3 end_POSTSUPERSCRIPT 1.0×1051.0superscript1051.0\times 10^{-5}1.0 × 10 start_POSTSUPERSCRIPT - 5 end_POSTSUPERSCRIPT 1.0×1031.0superscript1031.0\times 10^{-3}1.0 × 10 start_POSTSUPERSCRIPT - 3 end_POSTSUPERSCRIPT 1.0×1041.0superscript1041.0\times 10^{-4}1.0 × 10 start_POSTSUPERSCRIPT - 4 end_POSTSUPERSCRIPT
PPO Batch size 64 512 512 512
Entropy c2subscript𝑐2c_{2}italic_c start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT 0.01 0.1 0.2 0.1
ϵitalic-ϵ\epsilonitalic_ϵ-clip 0.05 0.3 0.1 0.3
Supervised lr 1.0×1031.0superscript1031.0\times 10^{-3}1.0 × 10 start_POSTSUPERSCRIPT - 3 end_POSTSUPERSCRIPT 1.0×1061.0superscript1061.0\times 10^{-6}1.0 × 10 start_POSTSUPERSCRIPT - 6 end_POSTSUPERSCRIPT 3.0×1043.0superscript1043.0\times 10^{-4}3.0 × 10 start_POSTSUPERSCRIPT - 4 end_POSTSUPERSCRIPT 1.0×1031.0superscript1031.0\times 10^{-3}1.0 × 10 start_POSTSUPERSCRIPT - 3 end_POSTSUPERSCRIPT
Batch size 64 512 128 512
lr 3.0×1043.0superscript1043.0\times 10^{-4}3.0 × 10 start_POSTSUPERSCRIPT - 4 end_POSTSUPERSCRIPT 1.0×1061.0superscript1061.0\times 10^{-6}1.0 × 10 start_POSTSUPERSCRIPT - 6 end_POSTSUPERSCRIPT 3.0×1063.0superscript1063.0\times 10^{-6}3.0 × 10 start_POSTSUPERSCRIPT - 6 end_POSTSUPERSCRIPT 3.0×1043.0superscript1043.0\times 10^{-4}3.0 × 10 start_POSTSUPERSCRIPT - 4 end_POSTSUPERSCRIPT
DQN Batch size 32 256 256 32
Eps_end 0.001 0.1 0.1 0.01
Eps decay 0.5 1.0 0.5 0.5
LinUCB α𝛼\alphaitalic_α 0.1 3.0 1.5 2.5
Table 7: Hyperparameter ranges and best values for different algorithms. For PPO the "Entropy c2subscript𝑐2c_{2}italic_c start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT" refers to the coefficient of the entropy in the loss.
Related work implementations

Following previous work Ravfogel et al. (2020); Han et al. (2022b), we use INLP and MP in a post hoc manner to the features extracted from the last hidden layer of the supervised model and train a logistic classifier for the final classification. For our MP debiasing experiments in section 5.5 we use MP to debias the context vectors before training, instead of poshoc on the hidden layer of the trained network.

Appendix B Algorithms

B.1 Single-Step Markov Decision Process

To formalize how the policy-gradient methods such as PPO relate to the Contextual Multi-Armed Bandit framework, we define below the single-step Markov Decision Process. An MDP is defined by the tuple (S,A,P,R,γ)𝑆𝐴𝑃𝑅𝛾(S,A,P,R,\gamma)( italic_S , italic_A , italic_P , italic_R , italic_γ ), and our single-step variant contains only two states S={s1,s2}𝑆subscript𝑠1subscript𝑠2S=\{s_{1},s_{2}\}italic_S = { italic_s start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_s start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT }. The initial state is sampled each time from the environment and for our classification setup is part of the set of context embeddings, s1{xj}subscript𝑠1subscript𝑥𝑗s_{1}\in\{x_{j}\}italic_s start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ∈ { italic_x start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT }. To ensure data samples are treated independently the second state is always the terminal state s2=sterminalsubscript𝑠2subscript𝑠𝑡𝑒𝑟𝑚𝑖𝑛𝑎𝑙s_{2}=s_{terminal}italic_s start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT = italic_s start_POSTSUBSCRIPT italic_t italic_e italic_r italic_m italic_i italic_n italic_a italic_l end_POSTSUBSCRIPT. The action space is equal to the number of classes: A=C={c1,c2,..,c28}A=C=\{c_{1},c_{2},..,c_{28}\}italic_A = italic_C = { italic_c start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_c start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , . . , italic_c start_POSTSUBSCRIPT 28 end_POSTSUBSCRIPT }. The reward function R𝑅Ritalic_R is equal to that of the CMAB and is defined in section 3.1. Lastly, each trajectory is defined as τ={s1,a1,sterminal}𝜏subscript𝑠1subscript𝑎1subscript𝑠𝑡𝑒𝑟𝑚𝑖𝑛𝑎𝑙\tau=\{s_{1},a_{1},s_{terminal}\}italic_τ = { italic_s start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_a start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_s start_POSTSUBSCRIPT italic_t italic_e italic_r italic_m italic_i italic_n italic_a italic_l end_POSTSUBSCRIPT } and both the transition probability, P𝑃Pitalic_P, and the discount factor γ𝛾\gammaitalic_γ are irrelevant since each action results in the terminal state.

B.2 LinUCB

The full algorithm of LinUCB from Li et al. (2010), used in the paper is shown in Algorithm

Context features xt,asubscript𝑥𝑡𝑎x_{t,a}italic_x start_POSTSUBSCRIPT italic_t , italic_a end_POSTSUBSCRIPT for context at time t𝑡titalic_t and arm a𝒜𝑎𝒜a\in\mathcal{A}italic_a ∈ caligraphic_A, exploration parameter α𝛼\alphaitalic_α.
Initialize Aasubscript𝐴𝑎A_{a}italic_A start_POSTSUBSCRIPT italic_a end_POSTSUBSCRIPT and basubscript𝑏𝑎b_{a}italic_b start_POSTSUBSCRIPT italic_a end_POSTSUBSCRIPT for each arm a𝒜𝑎𝒜a\in\mathcal{A}italic_a ∈ caligraphic_A
for each sample t𝑡titalic_t do
     for each arm a𝑎aitalic_a do
         θ^at=Aat1batsubscript^𝜃subscript𝑎𝑡superscriptsubscript𝐴subscript𝑎𝑡1subscript𝑏subscript𝑎𝑡\hat{\theta}_{a_{t}}=A_{a_{t}}^{-1}b_{a_{t}}over^ start_ARG italic_θ end_ARG start_POSTSUBSCRIPT italic_a start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT end_POSTSUBSCRIPT = italic_A start_POSTSUBSCRIPT italic_a start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT end_POSTSUBSCRIPT start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT italic_b start_POSTSUBSCRIPT italic_a start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT end_POSTSUBSCRIPT
         pt,a=θ^axt,a+αxt,aAa1xt,asubscript𝑝𝑡𝑎superscriptsubscript^𝜃𝑎topsubscript𝑥𝑡𝑎𝛼superscriptsubscript𝑥𝑡𝑎topsuperscriptsubscript𝐴𝑎1subscript𝑥𝑡𝑎p_{t,a}=\hat{\theta}_{a}^{\top}x_{t,a}+\alpha\sqrt{x_{t,a}^{\top}A_{a}^{-1}x_{% t,a}}italic_p start_POSTSUBSCRIPT italic_t , italic_a end_POSTSUBSCRIPT = over^ start_ARG italic_θ end_ARG start_POSTSUBSCRIPT italic_a end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ⊤ end_POSTSUPERSCRIPT italic_x start_POSTSUBSCRIPT italic_t , italic_a end_POSTSUBSCRIPT + italic_α square-root start_ARG italic_x start_POSTSUBSCRIPT italic_t , italic_a end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ⊤ end_POSTSUPERSCRIPT italic_A start_POSTSUBSCRIPT italic_a end_POSTSUBSCRIPT start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT italic_x start_POSTSUBSCRIPT italic_t , italic_a end_POSTSUBSCRIPT end_ARG
     end for
     Choose arm at=argmaxa𝒜(pt,a)subscript𝑎𝑡subscript𝑎𝒜subscript𝑝𝑡𝑎a_{t}=\arg\max_{a\in\mathcal{A}}(p_{t,a})italic_a start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT = roman_arg roman_max start_POSTSUBSCRIPT italic_a ∈ caligraphic_A end_POSTSUBSCRIPT ( italic_p start_POSTSUBSCRIPT italic_t , italic_a end_POSTSUBSCRIPT ) , and observe real-valued payoff rtsubscript𝑟𝑡r_{t}italic_r start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT
     Update AatAat+xt,atxt,atsubscript𝐴subscript𝑎𝑡subscript𝐴subscript𝑎𝑡subscript𝑥𝑡subscript𝑎𝑡superscriptsubscript𝑥𝑡subscript𝑎𝑡topA_{a_{t}}\leftarrow A_{a_{t}}+x_{t,a_{t}}x_{t,a_{t}}^{\top}italic_A start_POSTSUBSCRIPT italic_a start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT end_POSTSUBSCRIPT ← italic_A start_POSTSUBSCRIPT italic_a start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT end_POSTSUBSCRIPT + italic_x start_POSTSUBSCRIPT italic_t , italic_a start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT end_POSTSUBSCRIPT italic_x start_POSTSUBSCRIPT italic_t , italic_a start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ⊤ end_POSTSUPERSCRIPT
     Update batbat+rtxt,atsubscript𝑏subscript𝑎𝑡subscript𝑏subscript𝑎𝑡subscript𝑟𝑡subscript𝑥𝑡subscript𝑎𝑡b_{a_{t}}\leftarrow b_{a_{t}}+r_{t}x_{t,a_{t}}italic_b start_POSTSUBSCRIPT italic_a start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT end_POSTSUBSCRIPT ← italic_b start_POSTSUBSCRIPT italic_a start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT end_POSTSUBSCRIPT + italic_r start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT italic_x start_POSTSUBSCRIPT italic_t , italic_a start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT end_POSTSUBSCRIPT
end for
Algorithm 1 LinUCB Algorithm

B.3 Equal Opportunity Weights

Where Han et al. (2022a) used EO for supervised learning, their implementation achieved this objective by grouping the loss per class and then averaging over them. In this section, we see how we can use this to obtain the weights for each data sample based on the class a𝑎aitalic_a and protected attribute g𝑔gitalic_g. For two protected groups g1subscript𝑔1g_{1}italic_g start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT and g2subscript𝑔2g_{2}italic_g start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT in class a𝑎aitalic_a , let C1subscript𝐶1C_{1}italic_C start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT and C2subscript𝐶2C_{2}italic_C start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT be the number of samples for g1subscript𝑔1g_{1}italic_g start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT and g2subscript𝑔2g_{2}italic_g start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT, and 𝒲1subscript𝒲1\mathcal{W}_{1}caligraphic_W start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT and 𝒲2subscript𝒲2\mathcal{W}_{2}caligraphic_W start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT, be the weights. To get a statement of the weights with EO for each sensitive state, (a,g)𝑎𝑔(a,g)( italic_a , italic_g ), we need two axioms.

Axiom 1. The weight scale ratio between the two protected groups of a class should be inversely proportional to their probability in the dataset:

𝒲1C1=𝒲2C2subscript𝒲1subscript𝐶1subscript𝒲2subscript𝐶2\mathcal{W}_{1}\cdot C_{1}=\mathcal{W}_{2}\cdot C_{2}caligraphic_W start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ⋅ italic_C start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT = caligraphic_W start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ⋅ italic_C start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT

Axiom 2: To ensure fairness across classes, the average weight per profession should be a fixed value B𝐵Bitalic_B so that:

1C1+C2(𝒲1C1+𝒲2C2)=B1subscript𝐶1subscript𝐶2subscript𝒲1subscript𝐶1subscript𝒲2subscript𝐶2𝐵\frac{1}{C_{1}+C_{2}}\left(\mathcal{W}_{1}\cdot C_{1}+\mathcal{W}_{2}\cdot C_{% 2}\right)=Bdivide start_ARG 1 end_ARG start_ARG italic_C start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT + italic_C start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_ARG ( caligraphic_W start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ⋅ italic_C start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT + caligraphic_W start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ⋅ italic_C start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) = italic_B

Combining these two axioms we obtain the formulation:

𝒲2=B2(C1+C2)C2subscript𝒲2𝐵2subscript𝐶1subscript𝐶2subscript𝐶2\mathcal{W}_{2}=\frac{B}{2}\frac{(C_{1}+C_{2})}{C_{2}}caligraphic_W start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT = divide start_ARG italic_B end_ARG start_ARG 2 end_ARG divide start_ARG ( italic_C start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT + italic_C start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) end_ARG start_ARG italic_C start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_ARG
𝒲2=B21P(C2)subscript𝒲2𝐵21𝑃subscript𝐶2\mathcal{W}_{2}=\frac{B}{2}\frac{1}{P(C_{2})}caligraphic_W start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT = divide start_ARG italic_B end_ARG start_ARG 2 end_ARG divide start_ARG 1 end_ARG start_ARG italic_P ( italic_C start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) end_ARG

For the multi-class classification task the average reward scale, B𝐵Bitalic_B, should be 1, and the probability is conditional on the class a𝑎aitalic_a, obtaining the final WEOsubscript𝑊𝐸𝑂W_{EO}italic_W start_POSTSUBSCRIPT italic_E italic_O end_POSTSUBSCRIPT equation:

𝒲EO(g,y)=121P(g|a)subscript𝒲𝐸𝑂𝑔𝑦121𝑃conditional𝑔𝑎\mathcal{W}_{EO}(g,y)=\frac{1}{2}\frac{1}{P(g|a)}caligraphic_W start_POSTSUBSCRIPT italic_E italic_O end_POSTSUBSCRIPT ( italic_g , italic_y ) = divide start_ARG 1 end_ARG start_ARG 2 end_ARG divide start_ARG 1 end_ARG start_ARG italic_P ( italic_g | italic_a ) end_ARG

Appendix C Ablation Experiments

Here we add our experiments that did not make the main paper.

C.1 Analysis: Model and Data Efficiency

An important aspect for evaluation is related to the data and computational of each algorithm. For ease of comparison, all algorithms except LinUCB were trained for 10 epochs. However, DQN and PPO each reuse the seen data in a different way to deal with the data sparsity of standard RL settings. DQN is updated using a replay-buffer from which it samples a minibatch of N triplets (s,a,r)𝑠𝑎𝑟(s,a,r)( italic_s , italic_a , italic_r ) for each iteration. In contrast, PPO collects N samples during the observation phase after which it updates the model with this batch K_epoch𝐾_𝑒𝑝𝑜𝑐K\_epochitalic_K _ italic_e italic_p italic_o italic_c italic_h number of times. Lastly, LinUCB achieves optimal results after 1 epoch but is constrained by the computations of its weight matrices, which require the inverse of a square matrix with dimension n_features𝑛_𝑓𝑒𝑎𝑡𝑢𝑟𝑒𝑠n\_featuresitalic_n _ italic_f italic_e italic_a italic_t italic_u italic_r italic_e italic_s. For computational efficiency, we use the Sherman–Morrison formula which updates the previous computed inverse with a rank one update Sherman and Morrison (1950)

The time complexities in Table 2, demonstrate that PPO is closest to supervised learning and that DQN takes significantly more time since it needs to sample from the buffer at each iteration. Notably, LinUCB is strongly dependent on the number of classes, reducing its relative efficiency from 32 to 3 times that of Supervised Learning. The bottleneck here is that it needs to compute an upper confidence bound for each class.
Another important feature is the sensitivity to hyperparameters. PPO and DQN are sensitive to several hyperparameters that determine the level of its exploration, such as DQN’s mini-batch size or exploration parameter, or PPO’s entropy and clipping coefficients. LinUCB is easiest to implement in this regard and does not require any neural network hyperparameters, but only one exploration parameter α𝛼\alphaitalic_α, see section B.2.

Appendix D Full result for experiments

To distinguish the sensitivity of gender imbalance and data-sparsity we also run experiments with a subset of the data, following Aguirre et al. (2023), and select only the professions that have at least 1000 samples for both genders in the test set, resulting in 8 professions.

D.1 BiasBios: training performance over time

In Reinforcement Learning literature it is common to provide the performance of an algorithm throughout training for evaluation. Therefore we provide the evaluation accuracy of our four algorithms in Figure 5

Refer to caption
Refer to caption
Figure 5: Evaluation accuracy of the different algorithms the full 28 classes and the 8 class subset of the Bias in Bios dataset

D.2 BiasBios: Recall per profession

As a further analysis of the lacking F1 score of the RL algorithms compared to the supervised implementation, we provide the Recall scores as a percentage of the class. Since class 21, Professor appears significantly more often than the most common class after it, we leave it out for clarity.

Refer to caption
Refer to caption
Refer to caption
Refer to caption
Figure 6: Recall of each class on the BiasBios dataset for the four algorithm implementations

D.3 Full tables: BiasBios (28C and 8C)

Some of our results in section 5.3 are presented as the mean only. The full results of our algorithms as the mean and std over the five seeds is provided in the tables here. Table 8 shows the performance of our algorithms with and without reward scaling on the BiasBios dataset with the 28 and 8 classes.

28 Classes 8 Classes
Algorithm Accuracy \uparrow GAP\downarrow DTO   \downarrow F1\uparrow Accuracy \uparrow GAP \downarrow DTO \downarrow F1\uparrow
Sup 81.0 ±plus-or-minus\pm± 0.1 16.4 ±plus-or-minus\pm± 0.5 10.0 73.8 ±plus-or-minus\pm± 0.3 86.8 ±plus-or-minus\pm± 0.1 8.3 ±plus-or-minus\pm± 0.7 6.2 82.7 ±plus-or-minus\pm± 0.1
LinUCB 78.4 ±plus-or-minus\pm± 0.1 15.5 ±plus-or-minus\pm± 0.3 9.6 67.3 ±plus-or-minus\pm± 0.4 85.3 ±plus-or-minus\pm± 0.2 7.6 ±plus-or-minus\pm± 0.3 5.8 80.6 ±plus-or-minus\pm± 0.2
DQNbanditsubscriptDQN𝑏𝑎𝑛𝑑𝑖𝑡\text{DQN}_{bandit}DQN start_POSTSUBSCRIPT italic_b italic_a italic_n italic_d italic_i italic_t end_POSTSUBSCRIPT 80.1 ±plus-or-minus\pm± 0.2 13.7 ±plus-or-minus\pm± 0.3 7.2 66.5 ±plus-or-minus\pm± 1.3 86.5 ±plus-or-minus\pm± 0.2 7.6 ±plus-or-minus\pm± 0.3 5.5 82.2 ±plus-or-minus\pm± 0.2
PPObanditsubscriptPPO𝑏𝑎𝑛𝑑𝑖𝑡\text{PPO}_{bandit}PPO start_POSTSUBSCRIPT italic_b italic_a italic_n italic_d italic_i italic_t end_POSTSUBSCRIPT 79.7 ±plus-or-minus\pm± 0.5 14.4 ±plus-or-minus\pm± 0.7 8.0 67.5 ±plus-or-minus\pm± 2.0 86.0 ±plus-or-minus\pm± 0.2 8.7 ±plus-or-minus\pm± 0.4 6.7 81.6 ±plus-or-minus\pm± 0.2
SupEO 80.1 ±plus-or-minus\pm± 0.2 7.1 ±plus-or-minus\pm± 0.5 1.1 71.7 ±plus-or-minus\pm± 0.5 86.3 ±plus-or-minus\pm± 0.2 2.4 ±plus-or-minus\pm± 0.1 0.6 82.0 ±plus-or-minus\pm± 0.2
LinUCBEO 74.6 ±plus-or-minus\pm± 0.2 12.2 ±plus-or-minus\pm± 0.5 9.6 59.8 ±plus-or-minus\pm±1.1 83.4 ±plus-or-minus\pm± 0.2 7.6 ±plus-or-minus\pm± 0.3 6.8 77.6 ±plus-or-minus\pm± 0.3
DQNbanditEOsuperscriptsubscriptDQN𝑏𝑎𝑛𝑑𝑖𝑡𝐸𝑂\text{DQN}_{bandit}^{{EO}}DQN start_POSTSUBSCRIPT italic_b italic_a italic_n italic_d italic_i italic_t end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_E italic_O end_POSTSUPERSCRIPT 79.2 ±plus-or-minus\pm± 0.1 10.1 ±plus-or-minus\pm± 0.4 3.9 66.4 ±plus-or-minus\pm± 0.2 86.2 ±plus-or-minus\pm± 0.1 2.2 ±plus-or-minus\pm± 0.2 0.7 81.6 ±plus-or-minus\pm± 0.2
PPObanditEOsuperscriptsubscriptPPO𝑏𝑎𝑛𝑑𝑖𝑡𝐸𝑂\text{PPO}_{bandit}^{{}^{EO}}PPO start_POSTSUBSCRIPT italic_b italic_a italic_n italic_d italic_i italic_t end_POSTSUBSCRIPT start_POSTSUPERSCRIPT start_FLOATSUPERSCRIPT italic_E italic_O end_FLOATSUPERSCRIPT end_POSTSUPERSCRIPT 79.2 ±plus-or-minus\pm± 0.2 8.5 ±plus-or-minus\pm± 0.2 2.7 66.0 ±plus-or-minus\pm± 0.8 85.8 ±plus-or-minus\pm± 0.1 2.8 ±plus-or-minus\pm± 0.6 1.3 81.4 ±plus-or-minus\pm± 0.2
Table 8: Results on the BiasBios dataset for the full dataset (28 classes) and a subset of the most common professions (8 classes). The first rows use a constant reward scale, and the last four (in grey) use the EO reward scale

D.4 Full tables: four reward scaling methods

The results from reward scaling using the four described scales and our four algorithms are shown in Table 9.

Algo Accuracy \uparrow GAP \downarrow F1
SUP 𝒲ρ+subscript𝒲limit-from𝜌\mathcal{W}_{\rho+}caligraphic_W start_POSTSUBSCRIPT italic_ρ + end_POSTSUBSCRIPT 79.3 ±plus-or-minus\pm± 0.1 7.9 ±plus-or-minus\pm± 0.3 69.3 ±plus-or-minus\pm± 0.3
𝒲ρsubscript𝒲limit-from𝜌\mathcal{W}_{\rho-}caligraphic_W start_POSTSUBSCRIPT italic_ρ - end_POSTSUBSCRIPT 79.8 ±plus-or-minus\pm± 0.3 6.9 ±plus-or-minus\pm± 0.2 71.8 ±plus-or-minus\pm± 0.6
𝒲EOsubscript𝒲𝐸𝑂\mathcal{W}_{EO}caligraphic_W start_POSTSUBSCRIPT italic_E italic_O end_POSTSUBSCRIPT 80.1 ±plus-or-minus\pm± 0.2 7.1 ±plus-or-minus\pm± 0.5 71.7 ±plus-or-minus\pm± 0.5
𝒲IPWsubscript𝒲𝐼𝑃𝑊\mathcal{W}_{IPW}caligraphic_W start_POSTSUBSCRIPT italic_I italic_P italic_W end_POSTSUBSCRIPT 72.1 ±plus-or-minus\pm± 0.7 6.1 ±plus-or-minus\pm± 0.3 64.8 ±plus-or-minus\pm± 0.8
PPO 𝒲ρ+subscript𝒲limit-from𝜌\mathcal{W}_{\rho+}caligraphic_W start_POSTSUBSCRIPT italic_ρ + end_POSTSUBSCRIPT 74.6 ±plus-or-minus\pm± 0.7 9.9 ±plus-or-minus\pm± 0.8 49.7 ±plus-or-minus\pm± 2.2
𝒲ρsubscript𝒲limit-from𝜌\mathcal{W}_{\rho-}caligraphic_W start_POSTSUBSCRIPT italic_ρ - end_POSTSUBSCRIPT 78.8 ±plus-or-minus\pm± 0.1 8.4 ±plus-or-minus\pm± 0.6 64.7 ±plus-or-minus\pm± 0.8
𝒲EOsubscript𝒲𝐸𝑂\mathcal{W}_{EO}caligraphic_W start_POSTSUBSCRIPT italic_E italic_O end_POSTSUBSCRIPT 79.2 ±plus-or-minus\pm± 0.2 8.5 ±plus-or-minus\pm± 0.2 66.0 ±plus-or-minus\pm± 0.8
𝒲IPWsubscript𝒲𝐼𝑃𝑊\mathcal{W}_{IPW}caligraphic_W start_POSTSUBSCRIPT italic_I italic_P italic_W end_POSTSUBSCRIPT 45.8 ±plus-or-minus\pm± 6.9 10.5 ±plus-or-minus\pm± 0.9 45.3 ±plus-or-minus\pm± 5.8
DQN 𝒲ρ+subscript𝒲limit-from𝜌\mathcal{W}_{\rho+}caligraphic_W start_POSTSUBSCRIPT italic_ρ + end_POSTSUBSCRIPT 76.2 ±plus-or-minus\pm± 1.1 10.4 ±plus-or-minus\pm± 0.7 57.2 ±plus-or-minus\pm± 4.8
𝒲ρsubscript𝒲limit-from𝜌\mathcal{W}_{\rho-}caligraphic_W start_POSTSUBSCRIPT italic_ρ - end_POSTSUBSCRIPT 79.3 ±plus-or-minus\pm± 0.1 11.1 ±plus-or-minus\pm± 0.6 65.8 ±plus-or-minus\pm± 1.4
𝒲EOsubscript𝒲𝐸𝑂\mathcal{W}_{EO}caligraphic_W start_POSTSUBSCRIPT italic_E italic_O end_POSTSUBSCRIPT 79.2 ±plus-or-minus\pm± 0.1 10.1 ±plus-or-minus\pm± 0.4 66.4 ±plus-or-minus\pm± 0.2
𝒲IPWsubscript𝒲𝐼𝑃𝑊\mathcal{W}_{IPW}caligraphic_W start_POSTSUBSCRIPT italic_I italic_P italic_W end_POSTSUBSCRIPT 74.6 ±plus-or-minus\pm± 0.3 12.8 ±plus-or-minus\pm± 0.2 56.6 ±plus-or-minus\pm± 0.3
LinUCB 𝒲ρ+subscript𝒲limit-from𝜌\mathcal{W}_{\rho+}caligraphic_W start_POSTSUBSCRIPT italic_ρ + end_POSTSUBSCRIPT 72.8 ±plus-or-minus\pm± 0.1 12.0 ±plus-or-minus\pm± 0.5 54.6 ±plus-or-minus\pm± 0.9
𝒲ρsubscript𝒲limit-from𝜌\mathcal{W}_{\rho-}caligraphic_W start_POSTSUBSCRIPT italic_ρ - end_POSTSUBSCRIPT 74.1 ±plus-or-minus\pm± 0.4 11.6 ±plus-or-minus\pm± 0.5 59.3 ±plus-or-minus\pm± 1.7
𝒲EOsubscript𝒲𝐸𝑂\mathcal{W}_{EO}caligraphic_W start_POSTSUBSCRIPT italic_E italic_O end_POSTSUBSCRIPT 74.6 ±plus-or-minus\pm± 0.2 12.2 ±plus-or-minus\pm± 0.5 59.8 ±plus-or-minus\pm± 1.1
𝒲IPWsubscript𝒲𝐼𝑃𝑊\mathcal{W}_{IPW}caligraphic_W start_POSTSUBSCRIPT italic_I italic_P italic_W end_POSTSUBSCRIPT 37.3 ±plus-or-minus\pm± 2.5 10.3 ±plus-or-minus\pm± 0.7 35.4 ±plus-or-minus\pm± 1.0
Table 9: Results with different reward scaling on BiasBios for various algorithms

D.5 Full results: Explicit gender information and Ensemble techniques

This section includes the full results of Section 5.5, after adding the gender information explicitely and after removing it with MP. The results are presented as mean and standard deviation over 5 seeds in Table 10 and Table 11

Algo + g Accuracy \uparrow GAP \downarrow F1 \uparrow
SupEOsuperscriptSup𝐸𝑂\text{Sup}^{{EO}}Sup start_POSTSUPERSCRIPT italic_E italic_O end_POSTSUPERSCRIPT 80.2 ±plus-or-minus\pm± 0.2 7.2 ±plus-or-minus\pm± 0.5 71.9 ±plus-or-minus\pm± 0.7
LinUCBEOsuperscriptLinUCB𝐸𝑂\text{LinUCB}^{{EO}}LinUCB start_POSTSUPERSCRIPT italic_E italic_O end_POSTSUPERSCRIPT 74.5 ±plus-or-minus\pm± 0.2 11.7 ±plus-or-minus\pm± 0.5 59.6 ±plus-or-minus\pm± 0.8
DQNbanditEOsuperscriptsubscriptDQN𝑏𝑎𝑛𝑑𝑖𝑡𝐸𝑂\text{DQN}_{bandit}^{{EO}}DQN start_POSTSUBSCRIPT italic_b italic_a italic_n italic_d italic_i italic_t end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_E italic_O end_POSTSUPERSCRIPT 79.2 ±plus-or-minus\pm± 0.2 10.0 ±plus-or-minus\pm± 0.5 66.1 ±plus-or-minus\pm± 0.4
PPObanditEOsuperscriptsubscriptPPO𝑏𝑎𝑛𝑑𝑖𝑡𝐸𝑂\text{PPO}_{bandit}^{{EO}}PPO start_POSTSUBSCRIPT italic_b italic_a italic_n italic_d italic_i italic_t end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_E italic_O end_POSTSUPERSCRIPT 79.3 ±plus-or-minus\pm± 0.1 8.7 ±plus-or-minus\pm± 0.3 66.1 ±plus-or-minus\pm± 0.6
Table 10: Results on the BiasBios dataset with explicit gender information added to the context.
Algo + MP Accuracy \uparrow GAP \downarrow F1 \uparrow
SupEOsuperscriptSup𝐸𝑂\text{Sup}^{{EO}}Sup start_POSTSUPERSCRIPT italic_E italic_O end_POSTSUPERSCRIPT 80.0 ±plus-or-minus\pm± 0.2 7.4 ±plus-or-minus\pm± 0.4 71.9 ±plus-or-minus\pm± 0.3
LinUCBEOsuperscriptLinUCB𝐸𝑂\text{LinUCB}^{{EO}}LinUCB start_POSTSUPERSCRIPT italic_E italic_O end_POSTSUPERSCRIPT 74.3 ±plus-or-minus\pm± 0.4 11.5 ±plus-or-minus\pm± 0.1 59.4 ±plus-or-minus\pm± 1.0
DQNbanditEOsuperscriptsubscriptDQN𝑏𝑎𝑛𝑑𝑖𝑡𝐸𝑂\text{DQN}_{bandit}^{{EO}}DQN start_POSTSUBSCRIPT italic_b italic_a italic_n italic_d italic_i italic_t end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_E italic_O end_POSTSUPERSCRIPT 79.0 ±plus-or-minus\pm± 0.2 8.6 ±plus-or-minus\pm± 0.3 65.8 ±plus-or-minus\pm± 0.6
PPObanditEOsuperscriptsubscriptPPO𝑏𝑎𝑛𝑑𝑖𝑡𝐸𝑂\text{PPO}_{bandit}^{{EO}}PPO start_POSTSUBSCRIPT italic_b italic_a italic_n italic_d italic_i italic_t end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_E italic_O end_POSTSUPERSCRIPT 79.2 ±plus-or-minus\pm± 0.2 9.7 ±plus-or-minus\pm± 0.6 66.8 ±plus-or-minus\pm± 1.4
Table 11: Performance on the BiasBios dataset, using MP debiased embeddings