Compositional Fairness Constraints for Graph Embeddings

Avishek Joey Bose, William L. Hamilton

Introduction

Learning low-dimensional embeddings of the nodes in a graph is a fundamental technique underlying state-of-the-art approaches to link prediction and recommender systems (Hamilton et al., 2017b). However, in many applications—especially those involving social graphs—it is desirable to exercise control over the information contained within learned node embeddings. For instance, we may want to ensure that recommendations are fair or balanced with respect to certain attributes (e.g., that they do not depend on a user’s race or gender) or we may want to ensure privacy by not exposing certain attributes through learned node representations. In this work we investigate the feasibility of enforcing such invariance constraints on (social) graph embeddings.

While enforcing invariance constraints on general classification models (Chouldechova, 2017; Gajane & Pechenizkiy, 2017; Kamishima et al., 2012) and collaborative filtering algorithms (Yao & Huang, 2017) has received considerable attention in recent years, these techniques have yet to be considered within the context of graph embeddings—a setting that introduces particular challenges due to the non-i.i.d. and non-Euclidean nature of relational, graph data.

Moreover, in the case of social graphs and large-scale recommender systems, it is often the case that there are many possible sensitive attributes that we may want to enforce invariance constraints over. Previous work on enforcing invariance (or “fairness”) in social applications has generally focused on situations that involve one sensitive attribute (e.g., age in the context of credit or loan decisions; Zemel et al. (2013)), but in the context of social graph embeddings there can be an extremely large number of possible sensitive attributes. In fact, in extreme settings we may even want to be fair with respect to the existence of individual edges. For instance, a user on a social networking platform might want that platform’s recommender system to ignore the fact that they are friends with a certain other user, or that they engaged with a particular piece of content.

Our contributions. We introduce an adversarial framework to enforce compositional fairness constraints on graph embeddings for multiple sensitive attributes. The insight behind our approach is that we learn a set of adversarial filters that remove information about particular sensitive attributes. Importantly, each of these learned filters can be optionally applied after training, so the model can flexibly generate embeddings that are invariant with respect to different combinations of sensitive attributes. As the space of possible combinations of sensitive attributes can be combinatorially large, we demonstrate that our compositional strategy can generate invariant embeddings even on unseen combinations at test time. Our contribution is at the intersection of research on (social) graph embedding and algorithmic fairness. We build upon the success of recent adversarial approaches to fairness (Edwards & Storkey, 2015), disentanglement (Mathieu et al., 2016), and transfer learning (Madras et al., 2018)–extending these approaches to the domain of graph representation learning and introducing new algorithmic techniques to accommodate compositional constraints during inference.

Related Work

We now briefly highlight core related work on (social) graph embeddings and algorithmic fairness, which our research builds upon.

At the core of our proposed methodology is the notion of learning low-dimensional embeddings of graph-structured data, especially social data. Graph embedding techniques have a long history in the social sciences, with connections to early research on “sociograms” (small hand-constructed social networks) and latent variable models of social interactions (Faust, 1988; Majone, 1972). In more recent years, the task of embedding graph-structured data has received increasing attention from the machine learning and data mining communities (Cai et al., 2018; Hamilton et al., 2017b). Generally, the goal of these works is to map graph nodes to low-dimensional vector embeddings, such that the original graph can be reconstructed from these embeddings. Traditional approaches to this problem include Laplacian eigenmaps (Belkin & Niyogi, 2002) and matrix factorization techniques (Ng et al., 2001), with recent years witnessing a surge in methods that rely on random-walk based objectives (Grover & Leskovec, 2016; Perozzi et al., 2014), deep autoencoders (Wang et al., 2016), and graph neural networks (Hamilton et al., 2017a; Kipf & Welling, 2016).

Learned graph embeddings can be used for a wide variety of tasks, including node classification, relation prediction, and clustering (Hamilton et al., 2017b). Here, we focus on the relation prediction task, i.e., using the learned representations to predict previously unobserved relationships between the input nodes. The relation prediction task is exceptionally general—for example, it generalizes basic recommender systems, knowledge base completion, and even node classification (ibid.).

2 Algorithmic Fairness

Preliminaries

We consider the general case of embedding a heterogeneous or multi-relational (social) graph G=(V,E)\mathcal{G}=(\mathcal{V},\mathcal{E}), which consists of a set of directed edge triples e=⟨u,r,v⟩∈Ee=\langle u,r,v\rangle\in\mathcal{E}, where u,v∈Vu,v\in\mathcal{V} are nodes and r∈Rr\in\mathcal{R} is a relation type. We further assume that each node is of a particular type, T⊆V\mathcal{T}\subseteq\mathcal{V}, and that relations may have constraints regarding the types of nodes that they can connect.

Relation Prediction. The general relation prediction task on such a graph is as follows. Let Etrain⊂E\mathcal{E}_{\textrm{train}}\subset\mathcal{E} denote a set of observed training edges and let Eˉ={⟨vi,r,vj⟩:vi,vj∈V,r∈R}∖E\bar{\mathcal{E}}=\{\langle v_{i},r,v_{j}\rangle:v_{i},v_{j}\in\mathcal{V},r\in R\}\setminus\mathcal{E} denote the set of negative edges that are not present in the true graph G\mathcal{G}. Given Etrain\mathcal{E}_{\textrm{train}}, we aim to learn a scoring function ss such that

In other words, the learned scoring function should ideally score any true edge higher than any negative edge.

where LedgeL_{\textrm{edge}} is a per-edge loss function and e1−,...,em−∈Eˉe^{-}_{1},...,e^{-}_{m}\in\bar{\mathcal{E}} are “negative samples”, i.e., randomly sampled edges that do not exist in the graph. Loss functions of this form generally attempt to maximize the likelihood of true edges compared to the negative samples.

Fairness. In order to incorporate the notion of fairness into the graph embedding setup, we assume that for exactly one node type T∗\mathcal{T}^{*}, all nodes of this type, i.e. all u∈T∗u\in\mathcal{T}^{*}, have KK categorical sensitive attributes, auk∈Ak,k=1...,Ka^{k}_{u}\in\mathcal{A}_{k},k=1...,K, and for simplicity, we assume that there are no other features or attributes associated with the nodes and edges in the graph.Though this assumption can easily be relaxed. The challenge in enforcing fairness is thus to ensure that the learned node embeddings, zu\mathbf{z}_{u}, are not biased or unfair with respect to these sensitive attributes—a point which we formalize in the next section.

Invariant Graph Embeddings

We first motivate and argue in favor of a particular form of “fairness” (or rather invariance) within the context of graph embeddings. Following this, we outline our compositional and adversarial approach for enforcing these invariance constraints on graph embeddings.

In this paper we consider a simple, user-centric formulation of fairness within the context of social graph embeddings. Using gender as an example of a sensitive attribute and movie recommendation as an example relation prediction task, our approach is guided by the following question: If one gives a user a button that says “Please ignore my gender when recommending movies”, what does a user expect from the system after this button is pressed? Here, we accept it as non-controversial that the expectation from the user is that recommendation does not depend in any way on their gender, i.e., that the recommendation would be the same regardless of their gender. Formally, given a user uu, this expectation amounts to an assumption of independence,

between the recommendation—i.e., the score of the edge, s(e)=s(⟨zu,r,zv⟩)s(e)=s(\langle\mathbf{z}_{u},r,\mathbf{z}_{v}\rangle)—and the sensitive attribute aua_{u}.

One issue in directly enforcing Equation (3) is that there are many (potentially millions) of possible edges that we might want to score for every node u∈T∗u\in\mathcal{T}^{*}, making it intractable to enforce independence on each of these decisions individually. However, if we assume that the score function s(⟨zu,r,zv⟩)s(\langle\mathbf{z}_{u},r,\mathbf{z}_{v}\rangle) depends on uu only through u′su^{\prime}s’s embedding, zu\mathbf{z}_{u}, then we can guarantee the independence in Equation (3) for all edge predictions by enforcing what we call representational invariance:

In other words, we require that the mutual information I(zu,au)I(\mathbf{z}_{u},a_{u}) is .

Generalizing to the setting of multiple sensitive attributes, for a given set of sensitive attributes S⊆{1,...,K}S\subseteq\{1,...,K\}, we would require that

which amounts to the assumption of SS independent invariance constraints on the SS distinct sensitive attributes.Note that this does not necessarily imply “subgroup fairness” on the joint distribution (Kearns et al., 2017). Importantly, we assume that the set SS is not fixed (e.g., different users might request different invariance constraints). In the language of algorithmic fairness, the representational invariance of Equation (5) implies that traditional demographic parity constraints are satisfied on the sensitive attributes and recommendations.

2 Model Definition

In this work, we enforce representational invariance constraints on the node embeddings (Equation 5) by introducing an adversarial loss and a technique to “filter” the embeddings generated by the enc function. Note, again, that a unique challenge here is that SS—the set of sensitive attributes we want to be invariant with respect to—is not fixed across nodes; i.e., we may want to enforce invariance on different sets of sensitive attributes for different nodes.

Note also that the framework presented in this section is quite general and can function with arbitrary combinations of base node embedding functions enc and edge-prediction losses LedgeL_{\textrm{edge}} (see Equation 2). We discuss three concrete instantiations of this framework in Section 5.

Compositional Encoder. The first important insight in our model is generalizing the enc embedding function to optionally “filter” out the information about certain sensitive attributes. In particular, for every sensitive attribute k∈{1,...,K}k\in\{1,...,K\} we define a filter function fk:Rd↦Rdf_{k}:\mathcal{R}^{d}\mapsto\mathcal{R}^{d} that is trained to remove the information about the kkth sensitive attribute. If we want the node embedding to be invariant w.r.t. some set of sensitive attributes S⊆{1,...,K}S\subseteq\{1,...,K\}, we then generate its embedding by “composing” the output of the ∣S∣|S| filtered embeddings using a compositional encoder:

To train \textscc−enc(u,S)\textsc{c-enc}(u,S) we sample a binary mask to determine the set SS at every iteration. In this work, we sample the binary mask as a sequence of kk independent Bernoulli draws with a common fixed probability p=0.5p=0.5; however, other application-specific distributions (e.g., incorporating dependencies between the attributes) could be employed. Sampling random binary masks forces the model to produce invariant embeddings for different combinations of sensitive attributes during training with the hope of generalizing to unseen combinations during inference time — a phenomena that we empirically validate in Section 5.2.

where λ\lambda is a hyperparameter controlling the strength of the adversarial regularization. To optimize this loss in a minibatch setting, we alternate between two types of stochastic gradient descent updates: (1) TT minibatch updates minimizing L(e)L(e) with respect to c-enc (with all the DkD_{k} fixed), and (2) T′T^{\prime} minibatch updates minimizing −L(e)-L(e) with respect to Dk,k=1...,KD_{k},k=1...,K (with c-enc fixed).

Theoretical Considerations. For clarity and simplicity, we consider the case of a single binary sensitive attribute, with the theoretical intuitions naturally generalizing to the multi-attribute and multi-class settings. Assuming a single binary sensitive attribute aka_{k}, by simple application of Proposition 2 in Goodfellow et al. (2014), we have:Theorem 1 holds as a consequence of Proposition 2 in Goodfellow et al. (2014) if we simply replace the task of distinguishing real/fake data by classifying a binary sensitive attribute.

If c-enc and DkD_{k} have enough capacity, T′T^{\prime} is large enough so that DkD_{k} is allowed to reach its optimum on −L(e)-L(e) (with c-enc fixed), and c-enc is optimized according to L(e)L(e) (with DD fixed), then I(zu,au)→0,∀u∈T∗I(\mathbf{z}_{u},a_{u})\rightarrow 0,\forall u\in\mathcal{T}^{*} as λ→∞\lambda\rightarrow\infty.

That is, if we increase the weight of the adversarial regularizer to infinity, the equilibrium of the minimax game in Equation (4.2) occurs when there is zero mutual information between the sensitive attribute and the embeddings. Of course, as λ→∞\lambda\rightarrow\infty trivial solutions to this game exist (e.g., c-enc simply outputting a constant value) and in practice setting λ<∞\lambda<\infty leads to a tradeoff between performance on edge prediction and representational invariance.

Experiments

We investigated the impact of enforcing invariance on graph embeddings using three datasets: Freebase15k-237www.microsoft.com/en-us/download/details.aspx?id=52312, MovieLens-1Mgrouplens.org/datasets/movielens/1m/, and an edge-prediction dataset derived from Reddit.Using data from https://pushshift.io, a previously existing dataset collected by Jason Baumgartner. The authors and their institutions were not involved in the data collection. The dataset statistics are given in Table 5.1. Our experimental setup closely mirrors that of (Madras et al., 2018) where we jointly train the main model with adversaries, but when testing invariance, we train a new classifier (with the same capacity as the discriminator) to predict the senstive attributes from the learned embeddings.

The goal of our experiments was to answer three questions:

The invariance-accuracy tradeoff. What is the tradeoff between enforcing invariance and accuracy on the main edge prediction task?

The impact of compositionality. How does the performance of a compositional approach, which jointly enforces fairness over a set of sensitive attributes, compare to a more traditional model that only enforces fairness on a single attribute?

Invariance on unseen combinations. In settings with many sensitive attributes, is our approach able to enforce invariance even on combinations of sensitive attributes that it never saw during training?

Throughout these experiments, we rely on two baselines: First, we compare against baselines that do not include any invariance constraints, i.e., models with λ=0\lambda=0. Second, we compare against a non-compositional adversarial approach where we separately train KK distinct encoders and KK distinct adversaries for each of the KK sensitive attributes in the data. This non-compositional adversary is essentially an extension of Edwards & Storkey (2015)’s approach to the graph embedding domain.

Before describing our experimental results, we first outline some important properties of the datasets we used, as well as the specific encoders and edge-prediction loss functions used.

In all experiments, we used multi-layer perceptrons (MLPs) with leaky ReLU activation functions (Xu et al., 2015) as the discriminators DkD_{k} and filters fkf_{k}. The Appendix contains details on the exact hyperparameters (e.g., number of layers and sizes) used for all the different experiments, as well as details on the training procedures (e.g., number of epochs and data splits). Code to reproduce our results is available at: https://github.com/joeybose/Flexible-Fairness-Constraints.

Freebase 15k-237 is a standard benchmark used for knowledge base completion (Toutanova et al., 2015). In this work, we use Freebase 15k-237 as a semi-synthetic testbed to evaluate the impact of adversarial regularization. Taking the entity attribute labels from Moon et al. (2017), we used the 33-most common attribute labels (e.g., /award/award_nominee) as “sensitive” attributes. The goal in this dataset is to perform the standard knowledge base completion task, while having the entity embeddings be invariant with respect to these “sensitive” attribute labels. While synthetic, this dataset provides a useful reference point due to its popularity in the graph embedding literature.

For our encoder and edge-prediction loss function, we follow Ji et al. (2015)’s TransD approach, since we found this approach gave significant performance boosts compared to simpler models (e.g., TransE). In this model, the encoding of a node/entity depends on the edge relation being predicted, as well as on whether the entity is the head or tail in a relation (i.e., the edge direction matters). In particular, the embedding of the head node (i.e., the source node) in an edge relation is given by:

Movielens-1M

Our second dataset is derived from the MovieLens-1M recommender system benchmark (Harper & Konstan, 2016). This is a standard recommender system benchmark, where the goal is to predict the rating that users assign movies. However, unlike previous work, in our experiments we treat the user features (age, gender, and occupation) as sensitive attributes (rather than as additional feature information for the recommendation task). Following Berg et al. (2017) we treat this recommendation task as an edge prediction problem between users and movies, viewing the different possible ratings as different edge relations.

where ar,1,ar,1∈Ra_{r,1},a_{r,1}\in\mathcal{R} and P1,P2∈Rd×d\mathbf{P}_{1},\mathbf{P}_{2}\in\mathcal{R}^{d\times d} are trainable parameters. In this case, the loss function is simply the negative of the log-likelihood score.

Reddit

The final dataset we consider is based on the social media website Reddit—a popular, discussion-based website where users can post and comment on content in different topical communities, called “subreddits”. For this dataset, we consider a traditional edge prediction task, where the goal is to predict interactions between users and subreddit communities.

To construct the edge prediction task, we examined all comments from the month of November in 20172017, and we placed an edge between a user and a community if this user commented on that community at least once within this time period. We then took the 1010-core of this graph to remove low-degree nodes, which resulted in a graph with approximately 366366K users, 1818K communities, and 77M edges. Given this graph, the main task is to train an edge-prediction model on 90%90\% of the user-subreddit edges and then predict missing edges in a held-out test set of the remaining edges.

Reddit is a pseudonymous website with no public user attributes. Thus, to define sensitive attributes, we treat certain subreddit nodes as sensitive nodes, and the sensitive attributes for users are whether or not they have an edge connecting to these sensitive nodes. In other words, the fairness objective in this setting is to force the model to be invariant to whether or not a user commented on a particular community. To select the “sensitive” subreddit communities, we randomly sampled 1010 from the top-100 communities by degree.We excluded the top-5 highest-degree outlying communities. Note that this setting represents the extreme case where we want the model to be invariant with respect to the existence of particular edges in the input graph.

As with MovieLens-1M, we use a simple “embedding-lookup” encoder. In this case, there is only a single relation type—indicating whether a Reddit user has commented on a “subreddit” community. Thus, we employ a simple dot-product based scoring function, s(⟨u,r,v⟩)=zu⊤zvs(\langle u,r,v\rangle)=\mathbf{z}_{u}^{\top}\mathbf{z}_{v}, and we use a max-margin loss as in Equation (9).

2 Results

We now address the core experimental questions (Q1-Q3).

In order to quantify the extent to which the learned embeddings are invariant to the sensitive attributes (e.g., after adversarial training), we freeze the trained compositional encoder c-enc and train an new MLP classifier to predict each sensitive attribute from the filtered embeddings (i.e., we train one new classifier per sensitive attribute). We also evaluate the performance of these filtered embeddings on the original prediction tasks. In the best case, a newly trained MLP classifier should have random accuracy when attempting to predict the sensitive attributes from the filtered embeddings, but these embeddings should still provide strong performance on the main edge prediction task. Thus, for binary sensitive attributes, an ideal result is an AUC score of 0.50.5 when attempting to predict the sensitive attributes from the learned embeddings.

Overall, we found that on the more realistic social recommendation datasets—i.e., the MovieLens-1M and Reddit datasets—our approach was able to achieve a reasonable tradeoff, with the near-complete removal of the sensitive information leading to a roughly 10% relative error increase on the edge prediction tasks. In other words, on these two datasets the sensitive attributes were nearly impossible to predict from the filtered embeddings, while the accuracy on the main edge prediction task was roughly 10% worse than a baseline approach that does not include the invariance constraints. Table 5.2 and Figure 2 summarize these results for the MovieLens data, where we can see that the accuracy of classifying the sensitive attributes is on-par with a majority-vote classifier (Table 5.2) while the RMSE degrades from 0.8650.865 to 1.011.01 with the compositional adversary. Figures 5 and 6 illustrate this tradeoff and show how the RMSE for the edge prediction task and ability to predict the sensitive attributes change as we vary the regularization strength, λ\lambda. As expected, increasing λ\lambda does indeed produce more invariant embeddings but leads to higher RMSE values. Figures 3 and 4 similiarly summarize these results on Reddit.

Interestingly, we found that on the Freebase15k-237 dataset it was not possible to completely remove the sensitive information without incurring a significant decrease in accuracy on the original edge prediction task. This result is not entirely surprising, since for this dataset the “sensitive” attributes were synthetically constructed from entity type annotations, which are presumably very relevant to the main edge/relation prediction task. However, it is an interesting point of reference that demonstrates the potential limitations of removing sensitive information from learned graph embeddings.

Q2: The Impact of Compositionality

In all our experiments, we observed that our compositional approach performed favorably compared to an approach that individually enforced fairness on each individual attribute. In fact, on the MovieLens-1M data (and the synthetic Freebase15k-237 data), the compostionally trained adversary outperformed the individually trained adversaries in terms of removing information about the sensitive attributes (Table 5.2). In other words, training a model to jointly remove information about the sensitive attributes using the compositional encoder (Equation 6) removed more information about the sensitive attributes than training separate adversarially regularized embedding models for each sensitive attribute. This result is not entirely surprising, as it essentially indicates that the different sensitive attributes (age, gender, and occupation) are correlated in this dataset. Nonetheless, it is a positive result indicating that the extra flexibility afforded by the compositional approach does not necessarily lead to a decrease in performance. That said, on the Reddit data we observed the opposite trend and found that the compositional approach performed worse in terms of its ability to remove information about the sensitive attributes (Figure 4) as well as a small drop on the performance of the main edge prediction task (Figure 3).

Q3: Invariance on Unseen Combinations

One of the key benefits of the compositional encoder is that it can flexibly generate embeddings that are invariant to any subset of S⊆{1,...,K}S\subseteq\{1,...,K\} of the sensitive attributes in a domain. In other words, at inference time, it is possible to generate 2K2^{K} distinct embeddings for an individual node, depending on the exact set of invariance constraints. However, given this combinatorially large output space, a natural question is whether this approach performs well when generalizing to unseen combinations of sensitive attributes.

We tested this phenomenon on the Reddit dataset, since it has the largest number of sensitive attributes (10, compared to 3 sensitive attributes for the other two datasets). During training we held out 10%10\% of the combinations of sensitive attributes, and we then evaluated the model’s ability to enforce invariance on this held-out set. As we can see in Figure 4, the performance drop for the held-out combinations is very small (0.0250.025), indicating that our compositional approach is capable of effectively generalizing to unseen combinations. The Appendix contains further results demonstrating how this trends scales gracefully when we increase the number of sensitive attributes from 10 to 50.

Quantifying Bias

In all of the above results, we used the ability to classify the sensitive attributes as a proxy for bias being contained within the embeddings. While this is a standard approach, e.g., see Edwards & Storkey (2015), and an intuitive method for evaluating representational invariance—a natural question is whether the adversarial regularization also decreases bias in the edge prediction tasks. Ideally, after filtering the embeddings, we would have that the edge predictions themselves are not biased according to the sensitive attributes.

To quantify this issue, we computed a “prediction bias” score for the MovieLens1M dataset: For each movie, we computed the absolute difference between the average rating predicted for each possible value of a sensitive attribute and we then averaged these scores over all movies. Thus, for example, the bias score for gender corresponds to the average absolute difference in predicted ratings for male vs. female users, across all movies. From the perspective of fairness our adversary imposes a soft demographic parity constraint on the main task. A reduction in prediction bias across the different subgroups represents an empirical measure of achieving demographic parity. Figure 7 highlights these results, which show that adversarial regularization does indeed drastically reduce prediction bias. Interestingly, using a compositional adversary works better than a single adversary for a specific sensitive attribute which we hypothesize is due to correlation between sensitive attributes.

Discussion and Conclusion

Our work sheds light on how fairness can be enforced in graph representation learning—a setting that is highly relevant to large-scale social recommendation and networking platforms. We found that using our proposed compositional adversary allows us to flexibly accomodate unseen combinations of fairness constraints without explicitly training on them. This highlights how fairness could be deployed in a real-word, user-driven setting, where it is necessary to optionally enforce a large number of possible invariance constraints over learned graph representations.

In terms of limitations and directions for future work, one important limitation is that we only consider one type of adversarial loss to enforce fairness. While this adversarial loss is theoretically motivated and known to perform well, there are other recent variations in the literature (e.g., Madras et al. (2018))—as well as related non-adversarial regularizers (e.g., Zemel et al. (2013)). Also, while we considered imposing fairness over sets of attributes, we did not explicitly model subgroup-level fairness (Kearns et al., 2017). Extending and testing our framework with these alternatives is a natural direction for future work.

There are also important questions about how our framework translates to real-world production systems. For instance, in this work we enforced fairness with respect to randomly sampled sets of attributes, but in real-world environments, these sets of attributes would come from user preferences, which may themselves be biased; e.g., it might be more common for female users to request fairness than male users potentially leading to new kinds of demographic inequalities. Understanding how these preference biases could impact our framework is an important direction for future inquiry.

The authors would like to thank the anonymous ICML reviewers for their helpful comments. In addition we would like to thank Koustuv Sinha, Riashat Islam and Andre Cianflone for helpful feedback on earlier drafts of this work. The researchers also thank Jason Baumgartner for his creation and curation of the pushshift.io Reddit data. This research was funded in part by an academic grant from Microsoft Research, as well as a Canada CIFAR Chair in AI, held by Prof. Hamilton.

References

Appendix A Implementation Details

We implement each discriminator and adversarial filter as multi-layer perceptrons (MLPs) with a leaky ReLU non-linearity between layers, and we use the Adam optimizer with default parameters. Unless otherwise specified we use λ=1000\lambda=1000 for all experiments and datasets. For fair comparison our discriminator during training time and subsequent sensitive attribute classifier share the same architecture and capacity. Finally, for every step performed by the main encoding model the Discriminator is updated 55 times. We found that this was necessary to provide a sufficient supervisory signal to the main encoding model.

To generate negative triplets we randomly sample either a head or tail entity during training, with a ratio of 2020 negatives for each positive triplet. The TransD model is trained for 100100 epochs with an embedding dimension of 2020, selected using cross-validation, while the sensitive attribute classifers are trained for 5050 epochs. The discriminators, sensitive attribute classifier and adversarial filters are modelled as MLP’s with 44,44 and 22 layers respectively. Lastly, we use the training, validation and testing splits provided in the datasets.

As with FB15k-237 we use model the discriminators and sensitive attribute classifiers are modelled as MLP’s but 99 layers with dropout with p=0.3p=0.3 between layers while the adversarial filter remains unchanged from FB15k-237. We found that regularization was crucial to the performance of main model and we use BatchNorm after the embedding lookup in the main model which has an embedding dimensionality of 3030. As only user nodes contain sensitive attributes our discriminators do not compute losses using movie nodes. Finally, to train our sensitive attribute classifier we construct a 90%90\% split of all users while the remaining user nodes are used for test. The same ratio of train/test is used for the actual dataset which constains users,movies and corresponding ratings for said movies. Finally, we train the main model and sensitive attribute classifiers for 200200 epochs.

Like FB15k-237 we generate negative triplets by either sampling head or tail entities which are either users or subreddits but unnlike FB15k-237 we keep the ratio of negatives and positives the same. We also inherit the same architectures for discriminator, sensitive attribute classifier and attribute filters used in MovieLens1M. The main model however uses an embedding dimensionality of 5050. Similar to MovieLens1M only user nodes contain sensitive attributes and as such the discriminator and sensitive attribute classifier does not compute losses with respect to subreddit nodes. Also, our training set comprises of a 90%90\% split of all edges while the the remaining 10%10\% is used as a test set. To test compositional generalizability we held out 10%10\% of user nodes. Lastly, we train the main model for 5050 epochs and the sensitive attribute classifier for 100100 epochs.

To the test degree of which invariance is affected by the number of sensitive attributes we report additional results on the Reddit dataset. Specifically, we report results for the Held out set with 20, 30, 40, and 50 sensitive attributes. Overall, these results show no statistically significant degradation in terms of invariance performance or task accuracy.