Learning Fair Representations via Rate-Distortion Maximization (2022)

Abstract: Text representations learned by machine learning models often encode undesirable demographic information of the user. Predictive models based on these representations can rely on such information, resulting in biased decisions. We present a novel debiasing technique, Fairness-aware Rate Maximization (FaRM), that removes protected information by making representations of instances belonging to the same protected attribute class uncorrelated, using the rate-distortion function. FaRM is able to debias representations with or without a target task at hand. FaRM can also be adapted to remove information about multiple protected attributes simultaneously. Empirical evaluations show that FaRM achieves state-of-the-art performance on several datasets, and learned representations leak significantly less protected attribute information against an attack by a non-linear probing network.

## introduction democratization of machine learning has led to deployment of predictive models for critical applications like credit approval @xcite and college application reviewing @xcite . therefore, it is important to ensure that decisions made by these models are fair towards different demographic groups @xcite . fairness can be achieved by ensuring that the demographic information does not get encoded in the representations used by these models @xcite @xcite . however, controlling demographic information encoded in a model's representations is a challenging task for textual data. this is because natural language text is highly indicative of an author's demographic attributes even when it is not explicitly mentioned @xcite @xcite @xcite @xcite . in this work, we debias information about a protected attribute (e.g., gender, race) from textual data representations. previous debiasing methods @xcite project representations in a subspace that does not reveal protected attribute information. these methods are only able to guard protected attributes against an attack by a linear function @xcite . other methods @xcite adversarially remove protected information while retaining information about a target attribute. however, they are difficult to train @xcite and require a target task at hand. we present a novel debiasing technique, fairness-aware rate maximization (farm), that removes demographic information by controlling the rate-distortion function of the learned representations. intuitively, in order to remove information about a protected attribute from a set of representations, we want the representations from the same protected attribute class to be uncorrelated to each other. we achieve this by maximizing the number of bits (rate-distortion) required to encode representations with the same protected attribute. figure 1 illustrates the process. the representations are shown as points in a two-dimensional feature space, color-coded according to their protected attribute class. farm learns a function φ(x) such that representations of the same protected class become uncorrelated and similar to other representations, thereby making it difficult to extract the information about the protected attribute from the learned representations. we perform rate-distortion maximization based debiasing in the following setups: (a) unconstrained debiasing-we remove information about a protected attribute g while retaining remaining information as much as possible (e.g., debiasing gender information from word embeddings), and (b) constrained debiasing-we retain information about a target attribute y while removing information pertaining to g (e.g., removing racial information from representations during text classification). in the unconstrained setup, debiased representations can be used for different downstream tasks, whereas for constrained debiasing the user is interested only in the target task. for unconstrained debiasing, we evaluate farm for removing gender information from word embeddings and demographic information from text representations that can then be used for a downstream nlp task (we show their utility for biography and sentiment classification in our experiments). our empirical evaluations show that representations learned using farm in an unconstrained setup leak significantly less protected attribute information compared to prior approaches against an attack by a non-linear probing network. for constrained debiasing, farm achieves state-of-the-art debiasing performance on 3 datasets, and representations are able to guard protected attribute information significantly better than previous approaches. we also perform experiments to show that farm is able to remove multiple protected attributes simultaneously while guarding against intersectional group biases @xcite . to summarize, our main contributions are: ## related work removing sensitive attributes from data representations for fair classification was initially introduced as an optimization task @xcite . subsequent works have used adversarial frameworks @xcite for this task @xcite @xcite @xcite . however, adversarial networks are difficult to train @xcite and cannot function without a target task at hand. unconstrained debiasing frameworks focus on removing a protected attribute from representations, without relying on a target task. @xcite demonstrated that glove embeddings encode gender information, and proposed an unconstrained debiasing framework for identifying gender direction and neutralizing vectors along that direction. building on this approach, @xcite proposed inlp, a robust framework to debias representations by iteratively identifying protected attribute subspaces and projecting representations onto the corresponding nullspaces. however, these approaches fail to guard protected information against an attack by a non-linear probing network. @xcite showcased that nullspace projection approaches can be extended for debiasing in a constrained setup as well. in contrast to prior works, we present a novel debiasing framework based on the principle of rate-distortion maximization. coding rate maximization was introduced as an objective function by @xcite for image segmentation. it has also been used in explaining feature selection by deep networks @xcite . recently, @xcite proposed maximal coding rate (mcr 2 ) based on rate-distortion theory, a representation-level objective function that can serve as an alternative to empirical risk minimization methods. our work is similar to mcr 2 as we learn representations using a rate-distortion framework, but instead of tuning representations for classification we remove protected attribute information from them. ## preliminaries our framework performs debiasing by making representations of the same protected attribute class uncorrelated. to achieve this, we leverage a principled objective function called rate-distortion, to measure the compactness of a set of representations. in this section, we introduce the fundamentals of rate-distortion theory. foot_0 rate-distortion. in lossy data compression @xcite , the compactness of a random distribution is measured by the minimal number of binary bits required to encode it. a lossy coding scheme encodes a finite set of vectors @xmath0, . . . , z n } ∈ r n×d from a distribution p (z), such that the decoded vectors {ẑ i } n @xmath1. the rate-distortion function r(z, ) measures the minimal number of bits per vector required to encode the sequence z. in case the vectors {z i } n @xmath2.i.d. samples from a zero-mean multi-dimensional gaussian distribution n (0, σ), the optimal rate-distortion function is given as: in rate-distortion theory, we need nr(z, ) bits to encode n vectors of z. the optimal codebook also depends on data dimension (d) and requires dr(z, ) bits to encode. therefore, a total of (n + d)r(z, ) is bits required to encode the sequence z. @xcite showed that this provides a tight bound even in cases where the underlying distribution p (z) is degenerate. this enables the use of this loss function for real-world data, where the underlying distribution may not be well defined. in general, a set of compact vectors (low information content) would require a small number of bits to encode, which would correspond to a small value of r(z, ) and vice versa. rate distortion for a mixed distribution. in general, the set of vectors z can be from a mixture distribution (e.g., feature representations for multi-class data). the rate-distortion function can be computed by splitting the data into multiple subsets: @xmath3. . . ∪ z k , based on their distribution. for each subset, we can compute the r(z i , ) (equation 1 ). to facilitate the computation, we define a membership matrix π = {π j } k @xmath4. the membership matrix π j for each subset is a diagonal matrix defined as: ## fairness-aware rate maximization in this section, we describe farm to debias representations in unconstrained and constrained setups. ## experimental setup in this section, we discuss the datasets, experimental setup, and metrics used for evaluating farm. the implementation of farm is publicly available at https://github.com/brcsomnath/farm . ## results: unconstrained debiasing we evaluate farm for unconstrained debiasing in three different setups: word embedding debiasing, and debiasing text representations for biographies and sentiment classification. for the classification tasks, we retrieve text representations from a pre-trained encoder, debias them using farm (without taking the target task into account) and evaluate the debiased representations by probing for y and g. in all settings, we train the feature encoder φ, and evaluate the retrieved representations z @xmath5. all tables mention the expected trend of a metric using ↑ (higher) or ↓ (lower). ## results: constrained debiasing in this section, we present the results of constrained debiasing using farm. for all experiments, we use a bert base model as φ and a 2-layer neural network with relu non-linearity as f (figure 3 ). ## model analysis in this section, we present several analysis experiments to evaluate the functioning of farm. robustness to label corruption. we evaluate the robustness of farm by randomly sub-sampling instances from the dataset and modifying the protected attribute label. in figure 5a , we report the protected attribute leakage (δf1 score) from the debiased word embeddings with varying fractions of training set label corruption. we observe that farm's performance degrades with an increase in label corruption. this is expected as, at high corruption ratios, most of the protected attribute labels are wrong, resulting in poor performance. in the constrained setup (figure 5b ), we observe that farm is able to debias protected attribute information (y-axis scale in figure 5b and 5a are different) even at high corruption ratios. we believe this enhanced performance (compared to unconstrained setup) is due to the additional supervision in the form of target loss, which enables farm to learn robust representations even with corrupted protected attribute labels. ## conclusion we proposed fairness-aware rate maximization (farm), a novel debiasing technique based on the principle of rate-distortion maximization. farm is effective in removing protected information from representations in both unconstrained and constrained debiasing setups. empirical evaluations show that farm outperforms prior works in debiasing representations by a large margin on several datasets. extensive analysis showcase that farm is sample efficient, and robust to label corruptions and minor hyperparameter changes. future works can focus on leveraging farm for achieving fairness in complex tasks like language generation.