preserve the individuality of different demographic groups.
In contrast, our framework does not need any such metric
and provides a direct method to preserve such individuality
while mitigating bias.
3 Background
Here we give a background on group equivariance, compo-
sitional generalization, and fairness in NLG.
3.1 Group Equivariance
Groups. A set with a binary operator, (G, ·)is called a
group if it satisfies the axioms of a group in appendix § A.1.
The action of a group on a finite set Xis given as Γ : G×
X 7→ X that satisfies the axioms of group action in § A.4.
Group actions are used to formally describe transformations
acting on a set X, e.g. rotations of 90◦s is an action Γon
a set of square images X. A transformation of x∈ X by
group element g∈Gis written as Γ(g, x).
Group equivariance. Let ΓXand ΓYbe the group actions
of Gon sets Xand Yrespectively. A function f:X 7→ Y is
called group equivariant to Gif f(ΓX(g, x)) = ΓY(g, f(x))
for all g∈G, x ∈ X . Hence, if a neural network performing
segmentation is equivariant to the group of 90◦rotations (c4
group), then, if the input is rotated by a multiple of 90◦, the
output also gets rotated by the same angle.
3.2 Compositional Generalization
Compositionality in languages refers to the ability to un-
derstand novel sentences by understanding and algebraically
manipulating their components (Chomsky 2009; Montague
1970). Compositionality is key to excellent human under-
standing of languages, whereas it is hypothesized that neu-
ral networks do not posses such capabilities, leading to their
extreme sample inefficiency in modeling languages (Lake
et al. 2017; Lake and Baroni 2018; Loula, Baroni, and Lake
2018; Dess`
ı and Baroni 2019). E.g., if humans understand
the meanings of “walk”, “jump”, and “jump twice”, then
they can naturally understand the meaning of “walk twice”.
But deep neural networks fail to do so, as shown by tests on
the SCAN dataset (Lake and Baroni 2018).
SCAN is a translation dataset where the inputs are com-
mands such as “Jump Twice” and the outputs consist of cor-
responding actions such as “JUMP JUMP”. There are sev-
eral data splits in SCAN that test different generalization ca-
pabilities of a model. The two of interest to us are the Add
jump task and the Around right task. These two tasks test the
compositional generalization capabilities of models.
The training set of the Add jump task consists of sen-
tences that do not contain any commands containing the
word “Jump” except for the word “Jump” itself. But the
training set contains other sentences with verbs that are sim-
ilar to “Jump”, such as “Walk”, “Run”, “Walk Twice”, “Run
Twice”, etc. The test set on the other hand contains com-
plicated commands using the word “Jump” such as “Jump
Twice”, “Turn Left After Jump Twice”, etc. Thus, for a
model to perform well in the test set, it must infer the mean-
ing of complicated sentences such as “Jump Twice” from
the understanding of “Jump” and “Walk Twice”. Similarly,
in the training set of the Around right task, the command
“Around Right” never appears, but similar commands such
as “Around Left” appear. The test set contains the phrase
“Around Right” and for the model to succeed in this task, it
must infer that “Right” and “Left” are directions and can be
treated in a similar way.
3.3 Fairness: Mitigating Biases in NLG
As discussed in § 2, Sheng et al. (2019) show that lan-
guage models such as GPT2 exhibit biases towards certain
demographic groups in their generated texts. These biases
are often subtle and are not easily detectable using senti-
ment classifiers. Hence, they introduce the concept of re-
gard towards various demographic groups and provide a task
to detect bias in texts generated by models in terms of re-
gards. They consider three sets of demographic groups for
this task: a) [“man”, “woman”], b) [“Black”, “White”], c)
[“gay”, “straight”]. These sets correspond to gender, race,
and sexual orientation, respectively. The task consists of two
types of contexts: respect and occupation. Each type has
five context sentences, and models generate texts for each
of these sentences. The respect task tests the biases in the
model’s respect towards various demographic groups, e.g.
‘The XYZ was known for’, where XYZ is replaced by any
demographic group. The occupation task tests the bias in
model’s description of occupation for different demographic
groups, e.g. ‘The XYZ worked as’, where XYZ is replaced by
any demographic group. Sheng et al. (2019) also develop an
automatic regard classifier using transfer learning on BERT
using a dataset created using human annotations. This classi-
fier labels any generated sentence as negative, neutral, posi-
tive, or other. This classifier is shown to match human labels
of regard for texts with around 80% accuracy. We use this
regard classifier in our experiments for fairness in NLG.
4 Equi-Tuning
We motivate equi-tuning as a method that minimizes a dis-
tance between the features obtained by a pretrained model
and any equivariant model when the dataset contains all
the transformations from a discrete group. We show that
the solution obtained corresponds to the Reynold’s opera-
tor (Sturmfels 2008) applied to the pretrained model, which
directly implies certain universality properties.
Let M:X ⊂ Rn7→ Y ⊂ Rmbe a pretrained model.
Further, let ΓXand ΓYbe group actions of the group G
on Xand Yrespectively. We construct a model MGthat is
equivariant to actions of a finite group Gand also minimizes
the sum of the distances between features M(ΓX(g, x)) and
MG(ΓX(g, x)) for any x, for all g∈G. The idea is that MG
loses little pretrained knowledge from Mwhile also being
equivariant to G. We assume that the group actions are well
defined, which is true for a wide range of cases including all
cases considered in this paper. Formally, for any x∈ X , we
want to solve the following optimization problem.
min
MG(x)X
g∈G
kM(ΓX(g, x)) −MG(ΓX(g, x))k2
2
s.t. MG(ΓX(g, x)) = ΓY(g, MG(x)) for all g∈G.
(1)