Towards a Unified Framework for
Learning and Reasoning
Han ZhaoAugust 2020
CMU-ML-20-111

Machine Learning Department
School of Computer Science
Carnegie Mellon University
Pittsburgh, PA

Thesis Committee
Geoffrey J. Gordon, Chair
Ruslan Salakhutdinov
Barnabás Póczos
Tommi S. Jaakkola (Massachusetts Institute of Technology)
Submitted in partial fulfillment of the requirements
for the degree of Doctor of Philosophy.

Copyright c 2020 Han Zhao
This research was supported by the Office of Naval Research under award numbers N000140911052 and N000141512365, theAir Force Research Laboratory award number FA87501720152, a grant from NCS Pearson, Inc., and a Nvidia GPU grant. The
views and conclusions contained in this document are those of the author and should not be interpreted as representing the official
policies, either expressed or implied, of any sponsoring institution, the U.S. government or any other entity.

Keywords: Artificial Intelligence, Machine Learning, Deep Learning, Information Theory, Learning Theory, Probabilistic Graphical Models, Representation Learning, Algorithmic Fairness, Domain
Adaptation, Transfer Learning, Multitask Learning, Sum-Product Networks, Probabilistic Circuits

To my parents, my brother, and my lovely girlfriend.

Abstract
The success of supervised machine learning in recent years crucially hinges on the availability of large-scale and unbiased data, which is often time-consuming and expensive to collect.
Recent advances in deep learning focus on learning rich and invariant representations that havefound abundant applications in domain adaptation, multitask learning, algorithmic fairness,and machine translations, just to name a few. However, it is not clear what price we have to
pay in terms of task utility for such universal representations. On the other hand, learning isonly one of the two most fundamental cognitive abilities of intelligent agents. An intelligent
agent needs to have both the ability to learn from the experience, and the ability to reasonfrom what has been learned. However, classic symbolic reasoning cannot model the inherent
uncertainty that ubiquitously exists, and it is not robust to noisy observations. Perhaps more
fundamentally, reasoning is computationally intractable in general. As a result, learning, which
often takes reasoning as a sub-procedure, is also hard. Building on the fundamental concepts
from information theory and theoretical computer science, this thesis aims to understand theinherent tradeoff between utility and invariance in learning the representations, and to develop
efficient algorithms for learning tractable and exact probabilistic inference machines.
This thesis contains two parts. The first part is devoted to understanding and learning
invariant representations. In particular, we will focus on understanding the costs of existinginvariant representations by characterizing a fundamental tradeoff between invariance andutility. First, we will use domain adaptation as an example to both theoretically and empiricallyshow such tradeoff in achieving small joint generalization error. This result also implies
an inherent tradeoff between demographic parity, a statistical notion of group fairness, andutility in both classification and regression settings. Going beyond, we will further show thatsuch general tradeoff exists in learning with structured data. In particular, we shall derive
an impossibility theorem for universal machine translation by learning language-invariant
representations. Second, we will focus on designing learning algorithms to escape the existing
tradeoff and to utilize the benefits of invariant representations. We will show how the algorithm
can be used to guarantee equalized treatment of individuals between groups, and discuss what
additional problem structure it requires to permit efficient domain adaptation and machinetranslation through learning invariant representations.
The second part of the thesis is devoted to learning tractable and exact circuits forprobabilistic reasoning. It is well-known that exact marginal and conditional inference inclassic probabilistic graphical models (PGMs), including Bayesian Networks (BNs) andMarkov Networks (MNs), is #P-complete. As a result, practitioners usually need to resort
to various approximate inference schemes to ensure computational tractability. Probabilistic
circuits, which include Sum-Product Networks (SPNs) as a special case, have been proposed as
tractable deep models for exact probabilistic inference. They distinguish themselves from othertypes of probabilistic graphical models by the fact that inference can be done exactly in linear
time with respect to the size of the circuit. This has generated a lot of interest since inference
is not only a powerful tool to reason under uncertainty, but also a core task for parameter
estimation and structure learning. In this part, we will concentrate on both theoretical andpractical parts of learning tractable probabilistic circuits. In particular, we will investigate therepresentational power of SPNs, as well as its parameter learning procedures in both online
and offline settings.

Acknowledgments
First and foremost, I am greatly indebted to my advisor, Geoff Gordon, who, throughout
my five-year journey at Carnegie Mellon University, has provided me with constant supports,
insightful discussions, as well as the freedom that allows me to pursue interesting research
problems to fulfill my own curiosity. In addition to being a fantastic researcher, Geoff is also
the kindest and most supportive individual that I have had the pleasure of working with. He
has a great sense of research taste, which also shapes mine to work on important and elegant
questions. I would like to sincerely thank Geoff for his intuitive insights in understanding
complex problems, for sharing with me his broad knowledge in almost every aspect of machinelearning, and for his unwavering faith in me that pushes me to become a better researcher. I
hope that I could become a researcher, an advisor and a person like him in the future.
I am very grateful to Ruslan Salakhutdinov, Barnabás Póczos and Tommi S. Jaakkola for
all the help they have provided during my Ph.D., including serving as my thesis committee
members. Russ has been a brilliant collaborator on a number of research projects during my
Ph.D. He is extremely knowledgeable and understands almost all aspects of deep learning.
I would like to thank him for his tremendous help in research and his countless support in
my career. Barnabás has been a great friend and mentor. He is always willing to listen tome on both research and life, and give me his advice and thoughts. Tommi hosted me fora visit at MIT, the results of which include a research paper on the information-theoretic
characterization of the fundamental limit of invariant representation learning, and another one
on using adversarial learning to defend attribute inference attacks on graphs. During my visit,
his sharpness and deep insights helped me achieve a better and clearer understanding about thetradeoff problem I was working on.
I would also like to thank my master thesis advisor, Pascal Poupart at the University ofWaterloo, who led me to explore this fantastic field of research on tractable probabilistic
reasoning, for his patience and encouragement, and his endless support and guidance. Pascal
has always been a kind mentor and friend, and it is my privilege to be able to continue
collaborating with him after graduating from Waterloo. The results of our collaboration arepresented in Chapter 9.
A huge thanks goes to all of my other collaborators throughout my Ph.D.: Tameem Adel,
Brandon Amos, Jianfeng Chi, Adam Coates, Remi Tachet des Combes, João P. Costeira,
Amanda Coston, Chen Dan, Junjie Hu, Priyank Jaini, Stefanie Jegelka, Nebojsa Jojic, Chen
Liang, Chin-Hui Lee, Peizhao Li, Peiyuan Alex Liao, Hongfu Liu, José M. F. Moura, Renato
Negrinho, Rema Padman, Abdullah Rashwan, Pradeep Ravikumar, Andrej Risteski, Nihar
B. Shah, Jian Shen, Xiaofei Shi, Alexander J. Smola, Otilia Stretcu, Ivan Tashev, Yuan Tian,
Yao-Hung Tsai, Richard E. Turner, Wen Wang, Yu-Xiang Wang, Guanhang Wu, Keyulu
Xu, Yichong Xu, Makoto Yamada, Jianbo Ye, Shuayb Zarar, Kun Zhang, Shanghang Zhang,
Zhenyao Zhu, and Honglei Zhuang. It would not have been as fun or as productive without
their help. Special thanks goes to Andrej Risteski, Nihar B. Shah, Yao-Hung Tsai and Yichong
Xu. It has been my great privilege to be able to work with them, from whom I not only benefit
inspiring discussions, but also countless fun moments in life.
I also want to thank everyone in the Machine Learning Department at Carnegie Mellon
University, who contribute to making it a vibrant and fun place to pursue graduate studies. In
particular, I would like to thank Diane Stidle and other amazing staff in our department for
their endless efforts in making our everyday life in the department easy and enjoyable. Special
thanks to all my friends at CMU: Siddharth Ancha, Ifigeneia Apostolopoulou, Shaojie Bai,Devendra Chaplot, Maria De-Arteaga, Carlton Downey, Simon Du, Avinava Dubey, William
Guss, Ahmed Hefny, Hanzhang Hu, Zhiting Hu, Lisa Lee, Leqi Liu, Yangyi Lu, Yifei Ma,
Ritesh Noothigattu, Anthony Platanios, Mrinmaya Sachan, Wen Sun, Mariya Toneva, Po-Wei
Wang, Yining Wang, Eric Wong, Yifan Wu, Yuexin Wu, Pengtao Xie, Qizhe Xie, Keyang Xu,
Diyi Yang, Fan Yang, Zhilin Yang, Ian En-Hsu Yen, Yaodong Yu, Hongyang Zhang and Xun
Zheng. Hope our friendship will last forever.
Last but most importantly, I would like to thank my parents, Wei Zhao and Yuxia Wang,
my younger brother, Rui Zhao and my lovely girlfriend Lu Sun, for all of your unconditional
love and support during my Ph.D. journey. Needless to say, this thesis would not have beenpossible without your encouragement along the way. This thesis is dedicated to all of you.

viii

Contents
1

Introduction
1.1 Main Contributions of This Thesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2 Overview of Part I: Invariant Representation Learning . . . . . . . . . . . . . . . . . . . .
1.2.1 Learning Domain-Invariant Representations . . . . . . . . . . . . . . . . . . . . .
1.2.2 Learning Fair Representations . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2.3 Learning Multilingual Representations . . . . . . . . . . . . . . . . . . . . . . . .
1.3 Overview of Part II: Tractable Probabilistic Reasoning . . . . . . . . . . . . . . . . . . .
1.3.1 A Unified Framework for Parameter Learning . . . . . . . . . . . . . . . . . . . .
1.3.2 Collapsed Variational Inference . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.3.3 Linear Time Computation of Moments . . . . . . . . . . . . . . . . . . . . . . .
1.4 Bibliographic Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.5 Excluded Research . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1
2
3
4
4
5
5
6
6
7
8
8

2

Preliminaries
2.1 Notation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2 Domain Adaptation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.3 Algorithmic Fairness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.4 Sum-Product Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.5 Geometric and Signomial Programming . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.6 Some Technical Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

11
12
12
13
14
17
18

I

Understanding and Learning Invariant Representations

21

3

Domain Adaptation with Multiple Source Environments
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2 Preliminaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3 Generalization Bound for Multiple Source Domain Adaptation . . . . . . . . . . . . . . .
3.4 Multisource Domain Adaptation with Adversarial Neural Networks . . . . . . . . . . . .
3.5 Experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.5.1 Amazon Reviews . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.5.2 Digits Datasets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.5.3 WebCamT Vehicle Counting Dataset . . . . . . . . . . . . . . . . . . . . . . . .
3.6 Related Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.7 Proofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.7.1 Proof of Corollary 3.3.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

23
24
25
26
27
29
30
30
32
33
35
35

ix

3.7.2 Proof of Theorem 3.3.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.7.3 Proof of Theorem 3.3.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.8 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.A Details on Amazon Reviews Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.B Details on Digit Datasets Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.C Details on WebCamT Vehicle Counting . . . . . . . . . . . . . . . . . . . . . . . . . . .

36
37
40
41
42
43

4

Learning Invariant Representations for Domain Adaptation
4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.2 Preliminaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.2.1 Problem Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.2.2 A Theoretical Model for Domain Adaptation . . . . . . . . . . . . . . . . . . . .
4.3 Related Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.4 Theoretical Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.4.1 Invariant Representation and Small Source Risk are Not Sufficient . . . . . . . . .
4.4.2 A Generalization Upper Bound . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.4.3 An Information-Theoretic Lower Bound . . . . . . . . . . . . . . . . . . . . . . .
4.5 Experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.6 Proofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.7 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

45
46
47
47
47
48
49
50
51
53
55
57
61

5

Domain Adaptation with Conditional Distribution Matching under Generalized Label Shift 63
5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
5.2 Preliminaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
5.3 Main Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
5.3.1 Generalized Label Shift . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
5.3.2 An Error Decomposition Theorem based on GLS . . . . . . . . . . . . . . . . . . 67
5.3.3 Conditions for Generalized Label Shift . . . . . . . . . . . . . . . . . . . . . . . 68
5.3.4 Estimating the Importance Weights w . . . . . . . . . . . . . . . . . . . . . . . . 70
5.3.5 F -IPM for Distributional Alignment . . . . . . . . . . . . . . . . . . . . . . . . . 70
5.4 Practical Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
5.4.1 Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
5.4.2 Experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
5.5 Proofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
5.5.1 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
5.5.2 Consistency of the Weighted Domain Adaptation Loss (5.7) . . . . . . . . . . . . 74
5.5.3 k-class information-theoretic lower bound . . . . . . . . . . . . . . . . . . . . . . 75
5.5.4 Proof of Theorem 5.3.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
5.5.5 Proof of Theorem 5.3.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
5.5.6 Proof of Lemma 5.3.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
5.5.7 Proof of Theorem 5.3.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
5.5.8 Sufficient Conditions for GLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
5.5.9 Proof of Lemma 5.3.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
5.5.10 F -IPM for Distributional Alignment . . . . . . . . . . . . . . . . . . . . . . . . . 85
5.6 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
5.A More Experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
5.A.1 Description of the domain adaptation tasks . . . . . . . . . . . . . . . . . . . . . 87
x

5.A.2 Full results on the domain adaptation tasks . . . . . . . . . . . . . . . . . . . . .
5.A.3 Jensen-Shannon divergence of the original and subsampled domain adaptation
datasets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.A.4 Losses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.A.5 Generation of domain adaptation tasks with varying DJS (DS ( Z ) k D T ( Z )) . . . .
5.A.6 Implementation details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.A.7 Weight Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

87
87
88
90
91
92

6

Learning Fair Representations97
6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
6.2 Preliminaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
6.3 Main Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
6.3.1 Tradeoff between Fairness and Utility . . . . . . . . . . . . . . . . . . . . . . . . 101
6.3.2 Tradeoff in Fair Representation Learning . . . . . . . . . . . . . . . . . . . . . . 102
6.3.3 Fair Representations Lead to Accuracy Parity . . . . . . . . . . . . . . . . . . . . 104
6.4 Empirical Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
6.5 Related Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
6.6 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107

7

Conditional Learning of Fair Representations
109
7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
7.2 Preliminaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
7.3 Algorithm and Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
7.3.1 Conditional Learning of Fair Representations . . . . . . . . . . . . . . . . . . . . 113
7.3.2 The Preservation of Demographic Parity Gap and Small Joint Error . . . . . . . . 114
7.3.3 Conditional Alignment and Balanced Error Rates Lead to Small Error . . . . . . . 115
7.3.4 Practical Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
7.4 Empirical Studies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
7.4.1 Experimental Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
7.4.2 Results and Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
7.5 Related Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
7.6 Proofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
7.6.1 Proof of Proposition 7.3.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
7.6.2 Proof of Proposition 7.3.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
7.6.3 Proof of Lemma 7.3.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
7.6.4 Proof of Theorem 7.3.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
7.6.5 Proof of Theorem 7.3.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
7.6.6 Proof of Theorem 7.3.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
7.7 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
7.A Experimental Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
7.A.1 The Adult Experiment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
7.A.2 The COMPAS Experiment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127

8

Learning Language-Invariant Representations for Universal Machine Translation
129
8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
8.2 An Impossibility Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
8.2.1 Two-to-One Translation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
xi

8.3

8.4
8.5
8.6

8.2.2 Many-to-Many Translation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Sample Complexity under a Generative Model . . . . . . . . . . . . . . . . . . . . . . . . 137
8.3.1 Language Generation Process and Setup . . . . . . . . . . . . . . . . . . . . . . . 137
8.3.2 Main Result: Translation between Arbitrary Pairs of Languages . . . . . . . . . . 139
8.3.3 Proof Sketch of the Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
8.3.4 Extension to Randomized Encoders and Decoders . . . . . . . . . . . . . . . . . 142
Related Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Proofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147

II

Learning Tractable Circuits for Probabilistic Reasoning

149

9

A Unified Framework for Parameter Learning151
9.1 Sum-Product Networks as a Mixture of Trees . . . . . . . . . . . . . . . . . . . . . . . . 152
9.2 Maximum Likelihood Estimation as Signomial Programming . . . . . . . . . . . . . . . . 153
9.3 Difference of Convex Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
9.3.1 Sequential Monomial Approximation . . . . . . . . . . . . . . . . . . . . . . . . 154
9.3.2 Concave-convex Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
9.4 Experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
9.4.1 Experimental Setting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
9.4.2 Parameter Learning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
9.4.3 Fine Tuning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
9.5 Proofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
9.5.1 Structural Properties of SPNs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
9.5.2 MLE as Signomial Programming . . . . . . . . . . . . . . . . . . . . . . . . . . 161
9.5.3 Convergence of CCCP for SPNs . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
9.A Experiment Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
9.A.1 Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
9.A.2 Experimental Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169

10 Collapsed Variational Inference
171
10.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
10.1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
10.2 Collapsed Variational Inference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
10.3 Upper Bound by Logarithmic Transformation . . . . . . . . . . . . . . . . . . . . . . . . 175
10.4 Experiments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
10.4.1 Experimental Setting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
10.4.2 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
10.5 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
11 Linear Time Computation of Moments
181
11.1 Exact Posterior Has Exponentially Many Modes . . . . . . . . . . . . . . . . . . . . . . . 182
11.2 The Hardness of Computing Moments . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
11.3 Linear Time Reduction from Moment Computation to Joint Inference . . . . . . . . . . . 183
11.4 Efficient Polynomial Evaluation by Differentiation . . . . . . . . . . . . . . . . . . . . . 185
11.5 Dynamic Programming: from Quadratic to Linear . . . . . . . . . . . . . . . . . . . . . . 185

xii

11.6 Applications in Online Moment Matching . . . . . . . . . . . . . . . . . . . . . . . . . . 186
11.7 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188

III

Conclusion

189

12 Conclusion and Future Work191
12.1 Information Analysis of Invariant Representation Learning . . . . . . . . . . . . . . . . . 191
12.2 Efficient Structure Learning of Probabilistic Circuits . . . . . . . . . . . . . . . . . . . . 191
12.3 Unified Framework for Learning and Reasoning . . . . . . . . . . . . . . . . . . . . . . . 192
Bibliography

193

xiii

List of Figures
1.1

1.2

2.1

A model of an intelligent agent, which consists of a knowledge base and an inferenceengine. Representation learning serves as a technique to help build our knowledge basethat maps from real-world objects to their algebraic representations. The inference engine
is powered by probabilistic reasoning that allows interactions between the agent and theenvironment. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Overview of my Ph.D. research (blue), ongoing research (mixed blue and gray) andfuture plans (gray) around the theme of representation learning and probabilistic reasoning.
Artificial Intelligence and machine learning are the core disciplines of my research theme.
Topics on the left and right are related to representation learning and probabilistic reasoning,respectively. Topics about the underlying theory and fundamental appear at the bottom.
Applications are at the top. My long term research goal is to develop a unified frameworkthat can combine representation learning and probabilistic reasoning together. . . . . . . .

2

3

An example of a sum-product network over two boolean variables X1 and X2 . . . . . . . . 15

3.1

MDAN Network architecture. Feature extractor, domain classifier, and task learning are
combined in one training process. Hard version: the source that achieves the minimum
domain classification error is backpropagated with gradient reversal; Smooth version: all
the domain classification risks over k source domains are combined and backpropagatedadaptively with gradient reversal. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2 Counting results for target camera A (first row) and B (second row). X-frames; Y-Counts.
3.3 PAD distance over different source domains along with their changes before and after
training MDAN. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.B.1 MDAN network architecture for digit classification . . . . . . . . . . . . . . . . . . . . .
3.C.1 Locations of the source&target camera map. . . . . . . . . . . . . . . . . . . . . . . . . .

28
33
34
43
44

4.1.1 A counterexample where invariant representations lead to large joint error on source andtarget domains. Before transformation of g(·), h∗ ( x ) = 1 iff x ∈ (−1/2, 3/2) achieves
perfect classification on both domains. After transformation, source and target distributions
are perfectly aligned, but no hypothesis can achieve a small joint error. . . . . . . . . . . . 47
4.5.1 The label distributions of MNIST, USPS and SVHN. . . . . . . . . . . . . . . . . . . . . 55
4.5.2 Digit classification on MNIST, USPS and SVHN. The horizontal solid line corresponds
to the target domain test accuracy without adaptation. The green solid line is the target
domain test accuracy under domain adaptation with DANN. We also plot the least squarefit (dashed line) of the DANN adaptation results to emphasize the negative slope. . . . . . 56

xv

5.4.1 Gains of our algorithms versus their base versions for the 100 tasks described in Section 5.4(IWDAN/IWCDAN on the left/right). The x-axis represents DJS (DSY , D TY ), the JSD between label distributions. Lines represent linear fits. The mean improvements over DANN
(resp. CDAN) for IWDAN and IWDAN-O (resp. IWCDAN and IWCDAN-O) are 6.55%
and 8.14% (resp. 2.25% and 2.81%). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
5.A.1Performance in % of our algorithms and their base versions. The x-axis represents
DJS (DSY , D TY ), the Jensen-Shannon distance between label distributions. Lines represent linear fits to the data. For both sets of algorithms, the larger the jsd, the larger the
improvement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
5.A.2Left Accuracy of various algorithms during training. Right Euclidean distance between
the weights estimated using Lemma 5.3.2 and the true weights. Those plots correspond to
averages over 5 seeds. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
7.4.1 The error gap ∆ε , equalized odds gap ∆EO , demographic parity gap ∆DP and joint error
ε 0 + ε 1 on the Adult dataset with λ ∈ {0.1, 1.0, 10.0, 100.0, 1000.0}. . . . . . . . . . . . . 118
7.4.2 The error gap ∆ε , equalized odds gap ∆EO , demographic parity gap ∆DP and joint error
ε 0 + ε 1 on the COMPAS dataset with λ ∈ {0.1, 1.0, 10.0}. . . . . . . . . . . . . . . . . . 118
8.2.1 Proof by picture: Language-invariant representation g induces the same feature distribution
over Z , which leads to the same output distribution over the target language Σ∗L . However,the parallel corpora of the two translation tasks in general have different marginal distributions over the target language, hence a triangle inequality over the output distributions
gives the desired lower bound. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
8.3.1 An encoder-decoder generative model of translation pairs. There is a global distribution
D over representation space Z , from which sentences of language Li are generated via
decoder Di . Similarly, sentences could also be encoded via Ei to Z . . . . . . . . . . . . . 138
8.3.2 A translation graph H over K = 6 languages. The existence of an edge between a pair ofnodes Li and L j means that the learner has been trained on the corresponding language pair.
In this example the diameter of the graph diam( H ) = 4: L3 , L1 , L4 , L5 , L6 . . . . . . . . . . 140
9.1.1 A complete and decomposable SPN is a mixture of induced trees. Double circles indicate
univariate distributions over X1 and X2 . Different colors are used to highlight uniqueinduced trees; each induced tree is a product of univariate distributions over X1 and X2 . . . 153
9.3.1 Information flow about the computation of the gradient of log-network polynomial withrespect to yij (wij ). Each edge yij (wij ) collects the evaluation value from v j in bottom-up
pass and also differentiation value from vi in top-down pass. . . . . . . . . . . . . . . . . 155
9.4.1 Negative log-likelihood values versus number of iterations for PGD, EG, SMA and CCCP. 166∂ f (x|w)
9.5.1 Graphical illustration of ∂ f vS (x|w) . The partial derivative of f S with respect to f vi (in red) isia posynomial that is a product of edge weights lying on the path from root to vi and network
polynomials from nodes that are children of product nodes on the path (highlighted in blue).167
9.5.2 A counterexample of SPN over two binary random variables where the weights w1 , w2 , w3
are symmetric and indistinguishable. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
10.1.1Graphical model representation of SPN S . The box is a plate that represents replication
over D training instances. m = O(|S|) corresponds to the number of sum nodes and n is
the number of observable variables in S . Typically, m  n. W, H, X correspond to global
latent variables, local latent variables and observable variables, respectively. . . . . . . . . 173
xvi

List of Tables
3.1 Sentiment classification accuracy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2 Accuracy on digit classification. T: MNIST; M: MNIST-M, S: SVHN, D: SynthDigits. . .
3.3 Counting error statistics. S is the number of source cameras; T is the target camera id. . . .
3.A.1Network parameters for proposed and baseline methods . . . . . . . . . . . . . . . . . . .
3.A.2 p-values under Wilcoxon test. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

30
31
32
42
42

5.2.1 Common assumptions in the domain adaptation literature. . . . . . . . . . . . . . . . . . .
5.4.1 Average results on the various domains (Digits has 2 tasks, Visda 1, Office-31 6 and OfficeHome 12). The prefix s denotes the experiment where the source domain is subsampled
to increase DJS (DSY , D TY ). Each number is a mean over 5 seeds, the subscript denotes thefraction of times (out of 5 seeds × #tasks) our algorithms outperform their base versions. .
5.4.2 Ablation study on the original and subsampled Digits data. . . . . . . . . . . . . . . . . .
5.5.1 List of IPMs with different F . k · kLip denotes the Lipschitz seminorm and H is a
reproducing kernel Hilbert space (RKHS). . . . . . . . . . . . . . . . . . . . . . . . . . .

65

5.A.1Results on the Digits tasks. M and U stand for MNIST and USPS, the prefix s denotes theexperiment where the source domain is subsampled to increase DJS (DSY , D TY ). . . . . . . .
5.A.2Results on the Visda domain. The prefix s denotes the experiment where the source domain
is subsampled to increase DJS (DSY , D TY ). . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.A.3Results on the Office dataset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.A.4Results on the Subsampled Office dataset. . . . . . . . . . . . . . . . . . . . . . . . . . .
5.A.5Results on the Office-Home dataset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.A.6Results on the subsampled Office-Home dataset. . . . . . . . . . . . . . . . . . . . . . . .
5.A.7Jensen-Shannon divergence between the label distributions of the Digits and Visda tasks. .
5.A.8Jensen-Shannon divergence between the label distributions of the Office-31 tasks. . . . . .
5.A.9Jensen-Shannon divergence between the label distributions of the Office-Home tasks. . . .

73
73
85
88
88
89
89
90
91
92
92
93

6.2.1 List of different f -divergences and their corresponding properties. DKL (P || Q) denotes
the KL-divergence of Q from P and M := (P + Q)/2 is the average distribution of P
and Q. Symm. stands for Symmetric and Tri. stands for Triangle Inequality. . . . . . . . . 101
6.4.1 Adversarial debiasing on demographic parity, joint error across groups, and accuracy parity.107
7.4.1 Statistics about the Adult and COMPAS datasets. . . . . . . . . . . . . . . . . . . . . . . 116
7.A.1Hyperparameters used in the Adult experiment. . . . . . . . . . . . . . . . . . . . . . . . 127
7.A.2Hyperparameters used in the COMPAS experiment. . . . . . . . . . . . . . . . . . . . . . 128
9.3.1 Summary of PGD, EG, SMA and CCCP. Var. means the optimization variables. . . . . . . 157

xvii

9.4.1 Statistics of data sets and models. N is the number of variables modeled by the network,|S| is the size of the network and D is the number of parameters to be estimated in the
network. N × V/D means the ratio of training instances times the number of variables tothe number parameters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
9.4.2 Sizes of SPNs produced by LearnSPN and ID-SPN. . . . . . . . . . . . . . . . . . . . . . 159
9.4.3 Average log-likelihoods on test data. Highest log-likelihoods are highlighted in bold. ↑shows statistically better log-likelihoods than CCCP and ↓ shows statistically worse loglikelihoods than CCCP. The significance is measured based on the Wilcoxon signed-rank
test. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
9.A.1Running time of 4 algorithms on 20 data sets, measured in seconds. . . . . . . . . . . . . 170
10.4.1Statistics of data sets and models. n is the number of observable random variables modeledby the network, |S| is the size of the network and p is the number of parameters to be
estimated. n × D/p means the ratio of training instances times the number of variables tothe number of parameters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
10.4.2Average log-likelihoods on test data. Highest average log-likelihoods are highlighted inbold. ↑ / ↓ are used to represent statistically better/worse results than (O)CVB-SPN
respectively. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179

xviii

Chapter 1

Introduction
The recent decade has witnessed a phenomenal success in artificial intelligence. In particular, deep learning
has gained an unprecedented impact across both research and industry communities by demonstrating
better than human performance on various kinds of real-world competitions, e.g., the ImageNet recognition
task (Krizhevsky et al., 2012), the Stanford question answering competition (Rajpurkar et al., 2016), theboard game Go (Silver et al., 2017), etc. As a result, machine learning tools have been widely adopted tohelp decision making in various real-world scenarios, e.g., face recognition, machine translation, college
admission, etc. While these empirical achievements are exciting, whether the learned model could deliverits promise in real-world scenarios crucially depends on the data used to train the model. However, often,
it is computationally expensive, or sometimes infeasible, to collect labeled data under all the possible
real-world scenarios. As a result, due to this distributional shift between the training and test data, thelearned model may fail dramatically in practice. Perhaps more importantly, in high-stakes settings such asloan approvals, criminal justice and hiring process, if the data used to train the model contain historical bias,
then the learned model, without bias mitigation, can only exacerbate the existing discrimination. Hence,
the ability to learn representations that are invariant to the changes in the environment is crucial and canprovide us the robustness against various noise and nuisance factors in real-world.
On the other hand, learning is only one of the two most fundamental cognitive abilities of intelligent
agents. An intelligent agent needs to have the ability to learn from the experience, as well as the ability toreason from what has been learned. As foreseen by the Turing Award Laureate Prof. Leslie Valiant (Valiant,2018), one of the key challenges for AI in the coming decades is the development of integrated learningand reasoning mechanisms. However, classic symbolic reasoning cannot model the inherent uncertainty
that ubiquitously exists, and it is not robust to noisy observations. Perhaps more fundamentally, inference and reasoning are computationally intractable in general. As a result, learning, which often takes
inference/reasoning as a sub-procedure, is also hard.
This thesis is centered around advancing the frontier of AI in both representation learning and probabilistic reasoning. As shown in Figure 1.1, we believe an intelligent agent should consist of a knowledge
base and an inference engine, and the agent interacts with the environment in loop. In each iteration, theagent receives input from the environment and uses its knowledge base to map the real-world observationsor queries to its internal algebraic representations. The inference engine then carries out probabilistic
reasoning to answer the query or choose an action to execute in the environment. The long-term researchgoal of this thesis is thus to build a unified framework that provides a common semantics for learning andreasoning, by developing invariant representations that generalize across different environments as well as
efficient inference engine that allows exact and tractable probabilistic reasoning.

1Knowledge Base
(Representation Learning)

Observations
Queries

Inference Engine(Probabilistic Reasoning)

Actions
Answers

Environment

Figure 1.1: A model of an intelligent agent, which consists of a knowledge base and an inference engine.
Representation learning serves as a technique to help build our knowledge base that maps from real-world
objects to their algebraic representations. The inference engine is powered by probabilistic reasoning thatallows interactions between the agent and the environment.

1.1

Main Contributions of This Thesis

Within the broad area of artificial intelligence and machine learning, my Ph.D. research primarily spans twothemes: invariant representation learning and tractable probabilistic reasoning. Invariant representation
learning serves as a bridge connecting abstract objects in real-world and their corresponding algebraic
representations that are amenable for computation and allow generalization across different environments.
Tractable probabilistic reasoning aims to provide an inference mechanism for exact and efficient reasoning
under uncertainty. However, it is not well-understood what is the fundamental limit of invariant representations in terms of task utility, and it is well-known that even approximate probabilistic reasoning iscomputationally intractable (Roth, 1996) in the worst case.
Building on the fundamental concepts from information theory and theoretical computer science, mywork aims to understand the inherent tradeoff between utility and invariance in learning the representations,and to develop efficient algorithms for learning tractable and exact probabilistic inference machines. The
key contributions of my thesis research are as follows and summarized in Figure 1.2.
1. Analyzed and proved the fundamental limit of learning invariant representations in terms of task utility. With this result, we also identify and explain the inherent tradeoffs in learning domain-invariant
representations for unsupervised domain adaptation (Chapter 4 and Chapter 5), learning fair representations for algorithmic fairness (Chapter 6), learning representations for privacy-preservation under
attribute-inference attacks (Zhao et al., 2019b), and learning multilingual sentence representations
for universal machine translation (Chapter 8).
2. Developed an algorithm on learning domain-invariant representations for unsupervised domain adaptation under multiple different source environments (Chapter 3) using adversarial neural networks.
To mitigate bias in automated decision making systems, my coauthors and I also proposed an algorithm to learn fair representations that can simultaneously guarantee accuracy parity and equalized
odds (Hardt et al., 2016) among different demographic groups (Chapter 7). Analogously, we also
developed an algorithm by learning invariant representations to filter out sensitive information andprovided guarantees on inference error from malicious adversaries (Zhao et al., 2019b).
3. Established the first equivalence between Sum-Product networks (Poon and Domingos, 2011),
Bayesian networks with algebraic decision diagrams, and mixture models (Zhao et al., 2015b, 2016b)

2

Representation Learning

Probabilistic Reasoning

Multilingual Machine Translation

Reading Comprehension

Language-invariant sentence representation

Sentence representation & inference

Speech Enhancement

Vehicle Counting

Question & Answering

Audio representations

Traffic map representations & inferenceContext inference

Document Modeling

Applications

Statistical Relational Learning

Hierarchical representations of word-phrase-sentence

Invariant Representation Learning
Information analysis between invariance & utility

Core disciplines

Learning• Machine• Artificial Intelligence

Combine uncertainty for relation inference

Sum-Product Networks
Representational power

Fundamentals

Unified Framework:
Learning & Reasoning

Privacy-Preserving Learning
Learning under attribute-inference attack

Domain-Invariant Representations

Structure Learning of Sum-Product Networks

Fundamental limit in domain adaptation

Principled and efficient structure learning

Learning Fair Representations

Multitask Learning

Tradeoff between fairness & utility

Learning feature & task relationships

Ph.D. ResearchParameter Learning of Sum-Product Networks
Offline, online, distributed and Bayesian parameter learning

Ongoing Research

Future Research

Figure 1.2: Overview of my Ph.D. research (blue), ongoing research (mixed blue and gray) and futureplans (gray) around the theme of representation learning and probabilistic reasoning. Artificial Intelligenceand machine learning are the core disciplines of my research theme. Topics on the left and right are related
to representation learning and probabilistic reasoning, respectively. Topics about the underlying theory andfundamental appear at the bottom. Applications are at the top. My long term research goal is to develop aunified framework that can combine representation learning and probabilistic reasoning together.
(Chapter 9). Inspired by our theoretical results, we proposed efficient learning algorithms for SumProduct networks in both offline (Zhao et al., 2016b) (Chapter 9) and online (Rashwan et al., 2016b;
Zhao and Gordon, 2017) (Chapter 11), discrete (Zhao et al., 2016b) and continuous (Jaini et al.,2016) settings, and from both frequentists’ and Bayesian principles (Chapter 10).
Broadly, all the results above enjoy sound theoretical guarantees and provide insights towards better
understanding of learning invariant representations and building tractable inference machines. On thepractical side, I have also devoted much effort to develop software tools for the proposed algorithms andpublicly share them with the community. For instance, MDAN (Zhao et al., 2018b) (for domain adaptation
with multiple sources) has been successfully used as a benchmark algorithm in various follow-up work on
unsupervised domain adaptation for vision (Zhao et al., 2019i) and language (Chen and Cardie, 2018).

1.2

Overview of Part I: Invariant Representation Learning

Many machine learning applications involve learning representations that achieve two competing goals:
To maximize information or accuracy with respect to a subset of features (e.g. for prediction) while
simultaneously maximizing invariance or independence with respect to another, potentially overlapping,subset of features (e.g. for fairness, domain identity, etc.). Typical examples include privacy-preserving
learning, multilingual machine translation, domain adaptation, and algorithmic fairness, just to name a few.
In fact, all of the above problems admit a common minimax game-theoretic formulation, whose equilibrium
represents a fundamental tradeoff between accuracy and invariance.
In this part of the thesis, we provide an information theoretic analysis of this general and important
problem under different applications settings, including domain adaptation, algorithmic fairness, andmultilingual machine translation. In each of the above applications, we analyze the inherent tradeoff3

between accuracy and invariance by providing lower bounds on the error rates that any classifier has toincur when invariance is satisfied. The general principle here could be understood as a kind of uncertainty
principle when learning with invariance constraint: if perfect invariance is attained, then any classifier,even with unbounded computational resources and labeled data, has to incur a large error on at least one
subset of the overall population. Informally, if we instantiate this general principle to domain adaptation,
multilingual machine translation and algorithmic fairness respectively, we immediately obtain the following
implications:
1. In domain adaptation with one source and one target domain, any classifier based on domain-invariant
representations has to incur a large error on at least one of the two domains.
2. In multilingual machine translation with a set of different languages, any decoder based on languageinvariant sentence representations has to incur a large translation error on at least one of the translation
pairs.
3. In a population with two groups, e.g., black and white, if the base rates differ between these two
subgroups, then any fair classifier (in the sense of statistical parity) has to achieve a large error on atleast one of the groups.
To complement our negative results, in this part of the thesis we also discuss what kind of problem
structures could allow us to circumvent the above tradeoffs. In particular, we shall discuss how to design
algorithms that can be used to guarantee equalized treatment of individuals between groups, and discuss
what additional problem structure it requires to permit efficient domain adaptation and machine translation
through learning invariant representations.

1.2.1

Learning Domain-Invariant Representations

The success of machine learning has been partially attributed to rich labeled datasets and powerfulcomputations. Unfortunately, collecting and annotating such large-scale training data is prohibitively
expensive and time-consuming. To solve these limitations, different labeled datasets can be combined tobuild a larger one. However, due to the potential distributional shift between different datasets, models
trained on the combined one still suffer from large generalization error on a target domain different fromthe training domain.
Our work on domain adaptation focuses on understanding the limit of knowledge transfer from a labeled
source environment to an unlabeled target environment by learning domain-invariant representations tobridge the gap (Adel et al., 2017; Zhao et al., 2018b, 2019f). The main idea of domain-invariant learning
is simple and intuitive: we would like to learn representations that are invariant to the difference among
different environments while still contain rich information for the desired task. Theoretically, my researchsheds new light on this problem by proving an information-theoretic lower bound on the joint error of any
domain adaptation algorithm that attempts to learn invariant representations: there is a fundamental tradeoff
between learning domain-invariant representations and achieving small joint error in both environments
when the difference between environments can be used to explain the target task (Zhao et al., 2019e).
Specifically, our result implies that any algorithm based on domain-invariant representations has to incur alarge error on at least one of the environments. This result characterizes the fundamental limit in terms of
the joint utility when learning with domain-invariant representations.

1.2.2

Learning Fair Representations

With the prevalence of machine learning applications in high-stakes domains, e.g., criminal judgement,
medical testing, online advertising, etc., it is crucial to ensure that the automated decision making systems

4

do not propagate existing bias or discrimination that might exist in historical data used to train thesesystems. Among many recent proposals for achieving different notions of algorithmic fairness, learning
fair representations has received increasing attention due to recent advances in learning rich representations
with deep neural networks. At a high level the underlying idea is that if representations from different
groups are similar to each other, then any predictive model on top of them will certainly make decisions
independent of group membership.
On the other hand, while it has long been empirically observed (Calders et al., 2009) that there isan underlying tradeoff between utility and fairness, theoretical understanding is lacking. In my recent
work (Zhao and Gordon, 2019), I provided the first theoretical result that characterizes the inherent
tradeoff between utility and fairness. More precisely, our result shows that any fair algorithm, in the senseof demographic parity, admits an information-theoretic lower bound on the joint error across different
demographic groups. To escape such inherent tradeoff, we also propose an alternative algorithm (Zhao et al.,2019c) to learn conditionally group-invariant representations. The proposed algorithm constructs a classifierthat is no worse than the optimal classifier in terms of demographic parity gap, and can achieve equalized
false positive/negative rates and accuracy parity across different demographic groups simultaneously.

1.2.3

Learning Multilingual Representations

The goal of universal machine translation is to learn to translate between any pair of languages, given a
corpus of paired translated documents for a small subset of all pairs of languages. Despite impressive
empirical results and an increasing interest in massively multilingual models, theoretical analysis ontranslation errors made by such universal machine translation models is only nascent. In this thesis weformally prove certain impossibilities of this endeavour in general, as well as prove positive results inthe presence of additional (but natural) structure of data. For the former, we derive a lower bound on thetranslation error in the many-to-many translation setting, which shows that any algorithm aiming to learn
shared sentence representations among multiple language pairs has to make a large translation error on atleast one of the translation tasks, if no assumption on the structure of the languages is made. For the latter,
we show that if the paired documents in the corpus follow a natural encoder-decoder generative process,we can expect a natural notion of “generalization”: a linear number of language pairs, rather than quadratic,
suffices to learn a good representation. Our theory also explains what kinds of connection graphs between
pairs of languages are better suited: ones with longer paths result in worse sample complexity in terms ofthe total number of documents per language pair needed.

1.3

Overview of Part II: Tractable Probabilistic Reasoning

Exact marginal and conditional inference in classic probabilistic graphical models (PGMs), including
Bayesian Networks (BNs) and Markov Networks (MNs), is #P-complete (Roth, 1996). As a result,practitioners usually need to resort to various approximate inference schemes to ensure computational
tractability. Sum-Product Networks (SPNs) have been proposed as tractable deep models (Poon and
Domingos, 2011) for exact probabilistic inference. They belong to a more general family of unified models
for learning and reasoning, known as probabilistic circuits (Van den Broeck, 2018). SPNs, like othermodels within the family of probabilistic circuits, distinguish themselves from other types of probabilistic
graphical models by the fact that inference can be done exactly in linear time with respect to the size ofthe circuit. This has generated a lot of interest since inference is not only a powerful tool to reason under
uncertainty, but also a core task for parameter estimation and structure learning.
In this part of the thesis, we focus on both theoretical and practical aspects of learning tractable5

probabilistic circuits, including investigating the representational power of SPNs, and the parameter
learning of SPNs from both the frequentist’s and Bayesian’s perspective. In what follows we first briefly
summarize the problems we consider and highlight the results in the rest of this chapter.

1.3.1

A Unified Framework for Parameter Learning

In Chapter 9 we present a unified framework, which treats two of the previous algorithms (Gens andDomingos, 2012; Poon and Domingos, 2011) as special cases, for learning the parameters of SPNs. We
prove that any complete and decomposable SPN is equivalent to a mixture of trees where each treecorresponds to a product of univariate distributions. Based on the mixture model perspective, we canprecisely characterize the functional form of the objective function based on the network structure. We
show that the optimization problem associated with learning the parameters of SPNs based on the MLE
principle can be formulated as a signomial program (SP), where both PGD and exponentiated gradient (EG)can be viewed as first order approximations of the signomial program after suitable transformations of theobjective function. We also show that the signomial program formulation can be equivalently transformed
into a difference of convex functions (DCP) formulation, where the objective function of the program
can be naturally expressed as a difference of two convex functions. The DCP formulation allows us todevelop two efficient optimization algorithms for learning the parameters of SPNs based on sequential
monomial approximations (SMA) and the concave-convex procedure (CCCP), respectively. Both proposed
approaches naturally admit multiplicative updates, hence effectively deal with the positivity constraints of
the optimization. Furthermore, under our unified framework, we also show that CCCP leads to the samealgorithm as EM despite that these two approaches are different from each other in general. Although wemainly focus on MLE based parameter learning, the mixture model interpretation of SPN also helps todevelop a Bayesian learning method for SPNs (Zhao et al., 2016a). PGD, EG, SMA and CCCP can all beviewed as different levels of convex relaxation of the original SP. Hence the framework also provides anintuitive way to compare all four approaches.

1.3.2

Collapsed Variational Inference

In Chapter 10 we propose a collapsed variational inference algorithm for SPNs that is robust to overfitting
and can be naturally extended into a stochastic variant to scale to large data sets. We call our algorithm
CVB-SPN. CVB-SPN is a deterministic approximate Bayesian inference algorithm that is computationallyefficient and easy to implement while at the same time allowing us to incorporate prior information into thedesign. Like other variational techniques, CVB-SPN is based on optimization. Unlike other variational
techniques, the number of parameters to be optimized is only linear in the network size (O(|S|)) and isindependent of the size of the training set, as opposed to O( D |S|) in ordinary VI, where D is the sizeof the training set. It is worth noting that, different from traditional collapsed variational approaches
in the literature that marginalize out global latent variables (Teh et al., 2006, 2007), here we consider acomplementary approach: instead of marginalizing out the global latent variables in order to spread out theinteractions among many local latent variables, CVB-SPN takes advantage of the fast exact inference in
SPNs and marginalizes out the local latent variables in order to maintain a marginal variational posterior
distribution directly on the global latent variables, i.e., the model parameters. The posterior mean of thevariational distribution over model parameters can then be used as a Bayesian estimator. To the best of ourknowledge, this is the first general Bayesian approach to learn the parameters of SPNs efficiently in both
batch and stochastic settings.
At first glance, marginalizing out all the local latent variables in graphical models seems to be a bad idea
for two reasons. First, by marginalizing out local latent variables we naively appear to incur computation
6

exponential in the tree-width of the graph (Jordan et al., 1999; Wainwright and Jordan, 2008). Except forgraphical models with special structures, for example, LDA, Gaussian mixture models, thin junction trees,etc., such exact computation is intractable by itself. Second, marginalization will in general invalidate theconjugacy between the prior distribution and the joint distribution over global and local latent variables,
which further makes the expectation over the variational posterior intractable. Fortunately, the ability of
SPNs to model context-specific independence helps to solve the first problem, and by using a change ofvariables CVB-SPN handles the second problem efficiently. Besides the reduced space complexity, we also
show that the objective of CVB-SPN forms a strictly better lower bound to be optimized than the evidence
lower bound (ELBO) in standard VI. To show the validity of CVB-SPN, we conduct extensive experiments
and compare it with maximum likelihood based methods in both batch and stochastic settings.
To tackle the second problem described above, there is a strand of recent work on extending standard VI
to general nonconjugate settings using stochastic sampling from the variational posterior (Blei et al., 2012;
Kingma and Welling, 2013; Mnih and Gregor, 2014; Ranganath et al., 2014; Titsias and Lázaro-Gredilla,
2014; Titsias, 2015). However, control variates need to be designed in order to reduce the high variance
incurred by insufficient samples. Furthermore, for each such sample from the variational posterior, thosealgorithms need to go through the whole training data set to compute the stochastic gradient, leading to a
total computational cost O( ND |S|), where N is the sample size. This is often prohibitively expensive for
SPNs.

1.3.3

Linear Time Computation of Moments

Most existing batch learning algorithms for SPNs can be straightforwardly adapted to the online setting,where the network updates its parameters after it receives one instance at each time step. This online
learning setting makes SPNs more widely applicable in various real-world scenarios. This includes the casewhere either the data set is too large to store at once, or the network needs to adapt to the change of external
data distributions. Recently Rashwan et al. (2016b) proposed an online Bayesian Moment Matching (BMM)
algorithm to learn the probability distribution of the model parameters of SPNs based on the method of
moments. Later Jaini et al. (2016) extended this algorithm to the continuous case where the leaf nodes in the
network are assumed to be Gaussian distributions. At a high level BMM can be understood as an instance ofthe general assumed density filtering framework (Sorenson and Stubberud, 1968) where the algorithm finds
an approximate posterior distribution within a tractable family of distributions by the method of moments.
Specifically, BMM for SPNs works by matching the first and second order moments of the approximate
tractable posterior distribution to the exact but intractable posterior. An essential sub-routine of the above
two algorithms (Jaini et al., 2016; Rashwan et al., 2016b) is to efficiently compute the exact first and second
order moments of the one-step update posterior distribution (cf. 11.2). Rashwan et al. (2016b) designed arecursive algorithm to achieve this goal in linear time when the underlying network structure is a tree, andthis algorithm is also used by Jaini et al. (2016) in the continuous case. However, the algorithm only works
when the underlying network structure is a tree, and a naive computation of such moments in a DAG will
scale quadratically w.r.t. the network size. Often this quadratic computation is prohibitively expensive evenfor SPNs with moderate sizes.
In Chapter 11 we propose a linear time (and space) algorithm that is able to compute any moments of all
the network parameters simultaneously even when the underlying network structure is a DAG. (Zhao andGordon, 2017) There are three key ingredients in the design and analysis of our algorithm: 1). A linear time
reduction from the moment computation problem to the joint inference problem in SPNs, 2). A succinct
evaluation procedure of polynomial by differentiation without expanding it, and 3). A dynamic programming method to further reduce the quadratic computation to linear. The differential approach (Darwiche,
2003) used for polynomial evaluation can also be applied for exact inference in Bayesian networks. This7

technique has also been implicitly used in the recent development of a concave-convex procedure (CCCP)
for optimizing the weights of SPNs (Zhao et al., 2016b). Essentially, by reducing the moment computation
problem to a joint inference problem in SPNs, we are able to exploit the fact that the network polynomialof an SPN computes a multilinear function in the model parameters, so we can efficiently evaluate thispolynomial by differentiation even if the polynomial may contain exponentially many monomials, provided
that the polynomial admits a tractable circuit complexity. Dynamic programming can be further used to
trade off a constant factor in space complexity (using two additional copies of the network) to reduce
the quadratic time complexity to linear so that all the edge moments can be computed simultaneously in
two passes of the network. To demonstrate the usefulness of our linear time sub-routine for computing
moments, we apply it to design an efficient assumed density filter (Sorenson and Stubberud, 1968) tolearn the parameters of SPNs in an online fashion. ADF runs in linear time and space due to our efficient
sub-routine. As an additional contribution, we also show that ADF and BMM can both be understoodunder a general framework of moment matching, where the only difference lies in the moments chosen to
be matched and how to match the chosen moments.

1.4

Bibliographic Notes

The research presented in this thesis is based on joint work with several co-authors, described below. This
thesis only includes works for which this author was the, or one of the, primary contributors.
Chapter 3 is based on a joint work with Shanghang Zhang, Guanhang Wu, João P. Costeira, José M. F.
Moura and Geoff Gordon. Chapter 4 is based on a joint work with Remi Tachet des Combes, Kun Zhang
and Geoff Gordon. Chapter 5 is based on a joint work with Remi Tachet des Combes, Yu-Xiang Wang andGeoff Gordon. Chapter 6 is based on a joint work with Geoff Gordon. Chapter 7 is based on joint workwith Amanda Coston, Tameem Adel and Geoff Gordon. Chapter 8 is based on a joint work with Junjie Hu
and Andrej Risteski. Chapter 9 is based a joint work with Pascal Poupart and Geoff Gordon. Chapter 10 isbased on a joint work with Tameem Adel, Geoff Gordon and Brandon Amos. Finally, Chapter 11 is basedon a joint work with Geoff Gordon.

1.5

Excluded Research

In order to keep this thesis succinct and coherent, I excluded a significant port of my research works during
my Ph.D. career. In what follows we list the excluded research works.
– Online and Distributed Learning of Sum-Product Networks in both discrete and continuous settings (Jaini et al., 2016; Rashwan et al., 2016b).
– Unsupervised Domain Adaptation (Adel et al., 2017; Zhao et al., 2019f).
– Frank-Wolfe for Symmetric-NMF under Simplicial Constraint (Zhao and Gordon, 2018).
– Convolutional-Recurrent Neural Networks for Speech Enhancement (Zhao et al., 2018a).
– Learning Neural Networks with Adaptive Regularization (Zhao et al., 2019e).
– Multitask Feature and Relationship Learning (Zhao et al., 2017).
– Strategyproof Conference Peer Review (Xu et al., 2018).
– Active learning on graphs (Liang et al., 2018).
– Fair clustering for visual learning (Li et al., 2020).
– Dynamic and interpretable postoperative complication risk scoring (Wang et al., 2020).
8

– Continual Learning with Adaptive Weights (Adel et al., 2019b).
– Adversarial privacy preservation under attribute inference attack (Zhao et al., 2019a).

9Chapter 2

Preliminaries
In this chapter we provide some background knowledge about the learning problems presented in this thesis.
In particular, after introducing the notation used throughout the thesis, we shall give a brief introduction to
the problem of unsupervised domain adaptation, learning with fairness constraint, Sum-Product Networks(SPNs), and signomial programming. More definitions of these concepts will be introduced in detail inthe corresponding chapters when necessary. The purpose of this chapter is to give a brief introductionof the models and preliminaries that we shall use throughout the entire thesis. However, each chapter
is self-contained and has more detailed definitions with variants that are tailored to specific problems
considered in the chapter. This chapter ends with a brief introduction to the technical tools from statisticallearning theory and information theory that will be used in this thesis.

11

2.1

Notation

We now describe some notation that we employ throughout this thesis.
For an integer n ∈ N, we use [n] to abbreviate the notation {1, 2, . . . , n}. We use a capital letter X
to denote a random variable and a bold capital letter X to denote a random vector. Similarly, a lowercase
letter x is used to denote a value taken by X and a bold lowercase letter x denotes a joint value taken by thecorresponding vector X of random variables. Indicator variable I A equals 1 iff the event A is true, otherwise
it takes the default value 0. For boolean variable Xi , we use Ixi to denote IXi =1 and Ix̄i to denote IXi =0 ,respectively. To simplify the notation, we use Pr( x ) to mean Pr( X = x ) and Pr(x) to mean Pr(X = x).
Graphs are often denotes as G . Throughout the thesis, we shall use standard notation R+ to denote the setof nonnegative reals and R++ to mean the set of strictly positive reals.
For typical learning problems, we use X and Y to denote the input and output space, respectively.
Similarly, Z stands for the representation space induced from X by a feature transformation g : X 7→ Z .
Accordingly, we use X, Y, Z to denote the random variables which take values in X , Y , Z , respectively.
Throughout the thesis, we use the words domain and distribution interchangeably. In particular, domain
corresponds to a distribution D on the input space X and a labeling function f : X → [0, 1]. In
the domain adaptation setting, we use hDS , f S i and hD T , f T i to denote the source and target domains,respectively. A hypothesis is a function h : X → {0, 1}. The error of a hypothesis h w.r.t. the labeling
function f under distribution DS is defined as: ε S (h, f ) := Ex∼DS [|h(x) − f (x)|]. When f and h arebinary classification functions, this definition reduces to the probability that h disagrees with f under DS :Ex∼DS [|h(x) − f (x)|] = Ex∼DS [I( f (x) 6= h(x))] = Prx∼DS ( f (x) 6= h(x)). For two functions g and hwith compatible domains and ranges, we use h ◦ g to denote the function composition h( g(·)).
SPNs and BNs are denoted respectively by S and B , respectively. For a directed acyclic graph (DAG)
G and a node v in G , we use Gv to denote the subgraph of G induced by v and all its descendants. Let
V be a subset of the nodes of G , then G|V is a subgraph of G induced by the node set V. Similarly, we
use X| A or x| A to denote the restriction of a vector to a subset A. We will use node and vertex, arc andedge interchangeably when we refer to a graph. Furthermore, |G| is used to denote the size of the graph G ,which is the sum of the number of nodes and the number of edges in G . We also use tw(G) to represent thetree-width (Robertson and Seymour, 1984) of G .

2.2

Domain Adaptation

We first introduce the problem setup of domain adaptation and review a theoretical model for domain
adaptation when there is one source and one target (Ben-David et al., 2007, 2010; Blitzer et al., 2008; Kifer
et al., 2004). The key idea is the H-divergence to measure the discrepancy between two distributions. Other
theoretical models for DA exist (Cortes and Mohri, 2014; Cortes et al., 2008; Mansour et al., 2009a,c); we
choose to work with the above model because this distance measure has a particularly natural interpretationand can be well approximated using samples from both domains.
We define the risk of hypothesis h as the error of h w.r.t. a true labeling function under domain DS , i.e.,ε S (h) := ε S (h, f S ). As common notation in computational learning theory, we use b
ε S (h) to denote theε T (h) to mean the true risk and theempirical risk of h on the source domain. Similarly, we use ε T (h) and b
empirical risk on the target domain. H-divergence is defined as follows:
Definition 2.2.1. Let H be a hypothesis class for instance space X , and AH be the collection of subsets of
X that are the support of some hypothesis in H, i.e., AH := {h−1 ({1}) | h ∈ H}. The distance between
two distributions D and D 0 based on H is: dH (D , D 0 ) := 2 sup A∈AH | PrD ( A) − PrD 0 ( A)|.
When the hypothesis class H contains all the possible measurable functions over X , dH (D , D 0 )12reduces to the familiar total variation. Given a hypothesis class H, we define its symmetric difference
w.r.t. itself as: H ∆H = {h(x) ⊕ h0 (x) | h, h0 ∈ H}, where ⊕ is the XOR operation. Let h∗ be theoptimal hypothesis that achieves the minimum combined risk on both the source and the target domains:h∗ := arg minh∈H ε S (h) + ε T (h), and use λ to denote the combined risk of the optimal hypothesis h∗ :λ := ε S (h∗ ) + ε T (h∗ ). Ben-David et al. (2007) and Blitzer et al. (2008) proved the following generalization
bound on the target risk in terms of the source risk and the discrepancy between the single source domain
and the target domain:b S (Db T ) beTheorem 2.2.1 (Blitzer et al. (2008)). Let H be a hypothesis space of VC-dimension d and D
the empirical distribution induced by sample of size m drawn from DS (D T ). Then w.p.b. at least 1 − δ,∀ h ∈ H,
!
r
1
d
log
(
m/d
)
+
log
(
1/δ
)
bS, D
bT ) + λ + O
ε T (h) ≤ b
ε S ( h ) + dH ∆H ( D
.
(2.1)
2
m
The bound depends on λ, the optimal combined risk that can be achieved by hypothesis in H. The
intuition is if λ is large, we cannot hope for a successful domain adaptation. One notable feature is that theempirical discrepancy distance between two samples can be approximated by a discriminator to distinguishinstances from two domains.

2.3

Algorithmic Fairness

We first introduce various definitions of fairness in the literature under the category of group fairness, where
the group membership is given by the sensitive attribute A, e.g., race, gender, etc. Even in this context
there are many possible definitions of fairness (Narayanan, 2018), and in what follows we provide a brief
review of the ones that are mostly relevant to this thesis. To keep the notation consistent, for a ∈ {0, 1},
we use D a to mean the conditional distribution of D given A = a. For an event E, D( E) denotes theprobability of E under D . In particular, in the literature of fair machine learning, we call D(Y = 1)
the base rate of distribution D and we use ∆BR (D , D 0 ) := |D(Y = 1) − D 0 (Y = 1)| to denote thedifference of the base rates between two distributions D and D 0 over the same sample space. Given a
feature transformation function g : X → Z that maps instances from the input space X to feature space Z ,we define g] D := D ◦ g−1 to be the induced (pushforward) distribution of D under g, i.e., for any event
E0 ⊆ Z , g] D( E0 ) := D( g−1 ( E0 )) = D({ x ∈ X | g( x ) ∈ E0 }).
b
Definition 2.3.1 (Demographic Parity, a.k.a. Statistical parity). Given a joint distribution D , a classifier Ybsatisfies demographic parity if Y is independent of A.
b = 1 ) = D 1 (Yb = 1), i.e., positive outcome
Demographic parity reduces to the requirement that D0 (Yis given to the two groups at the same rate. When exact equality does not hold, we use the absolutedifference between them as an approximate measure:b isDefinition 2.3.2 (DP Gap). Given a joint distribution D , the demographic parity gap of a classifier Yb) := |D0 (Yb = 1 ) − D 1 (Yb = 1)|.
∆DP (Y
Demographic parity is also known as statistical parity, and it has been adopted as definition of fairness
in a series of work (Calders et al., 2009; Edwards and Storkey, 2015; Johndrow et al., 2019; Kamiranand Calders, 2009; Kamishima et al., 2011; Louizos et al., 2015; Madras et al., 2018; Zemel et al., 2013).
However, as we shall quantify precisely in Section 6.3, demographic parity may cripple the utility that wehope to achieve, especially in the common scenario where the base rates differ between two groups, e.g.,
D0 (Y = 1) 6= D1 (Y = 1) (Hardt et al., 2016). In light of this, an alternative definition is accuracy parity:
13

Definition 2.3.3 (Accuracy Parity). Given a joint distribution D , a classifier h satisfies accuracy parity if
ε D0 ( h ) = ε D1 ( h ) .
In the literature, a break of accuracy parity is also known as disparate mistreatment (Zafar et al.,2017). Again, when h is a deterministic binary classifier, accuracy parity reduces to D0 (h( X ) = Y ) =D1 (h( X ) = Y ). Different from demographic parity, the definition of accuracy parity does not eliminate
the perfect predictor when Y = A when the base rates differ between two groups. When costs of different
error types matter, more refined definitions exist:
Definition 2.3.4 (Positive Rate Parity). Given a joint distribution D , a deterministic classifier h satisfies
positive rate parity if D0 (h( X ) = 1 | Y = y) = D1 (h( X ) = 1 | Y = y), ∀y ∈ {0, 1}.
Positive rate parity is also known as equalized odds (Hardt et al., 2016), which essentially requires
equal true positive and false positive rates between different groups. Furthermore, Hardt et al. (2016)
also defined true positive parity, or equal opportunity, to be D0 (h( X ) = 1 | Y = 1) = D1 (h( X ) = 1 |Y = 1) when positive outcome is desirable. Last but not least, predictive rate parity, also known as test
fairness (Chouldechova, 2017), asks for equal chance of positive outcomes across groups given predictions:Definition 2.3.5 (Predictive Rate Parity). Given a joint distribution D , a probabilistic classifier h satisfies
predictive rate parity if D0 (Y = 1 | h( X ) = c) = D1 (Y = 1 | h( X ) = c), ∀c ∈ [0, 1].
When h is a deterministic binary classifier that only takes value in {0, 1}, Chouldechova (2017) showed
an intrinsic tradeoff between predictive rate parity and positive rate parity:
Theorem 2.3.1 (Chouldechova (2017)). Assume D0 (Y = 1) 6= D1 (Y = 1), then for any deterministicclassifier h : X → {0, 1} that is not perfect, i.e., h( X ) 6= Y, positive rate parity and predictive rate parity
cannot hold simultaneously.
Similar tradeoff result for probabilistic classifier has also been observed by Kleinberg et al. (2016),
where the authors showed that for any non-perfect predictors, calibration and positive rate parity cannot
be achieved simultaneously if the base rates are different across groups. Here a classifier h is said to becalibrated if D(Y = 1 | h( X ) = c) = c, ∀c ∈ [0, 1], i.e., if we look at the set of data that receive a
predicted probability of c by h, we would like c-fraction of them to be positive instances according to
Y (Pleiss et al., 2017).

2.4

Sum-Product Networks

A sum-product network (SPN) is a graphical representation of a joint probability distribution over a setof random variables X = { X1 , . . . , Xn }. It is a rooted directed acyclic graph where the interior nodes are
sums or products and the leaves are univariate distributions over Xi . Edges emanating from sum nodes areparameterized with positive weights. Each node in an SPN encodes an unnormalized marginal distribution
over X. An example of SPN is shown in Fig. 2.1. Let x be an instantiation of the random vector X. We
associate an unnormalized probability Vk (x | w) with each node k when the input to the network is x with
network weights set to be w:

I x i ( xi )k is a leaf indicator variable on Xi = 1I (x )
k is a leaf indicator variable on Xi = 0x̄i iVk (x | w) =
(2.2)

V
(
x
|
w
)
k
is
a
product
node
∏

j
j
∈
Ch
(
k
)



∑ j∈Ch(k) wkj Vj (x | w) k is a sum node
where Ch(k ) is the child list of node k in the graph and wkj is the edge weight associated with sum node k
and its child node j. In the example of Fig. 2.1, the root of the graph computes the following polynomial
14

+
10

9

6

×

×

+

4

6
I x1

9

×

+

+

1

6

Ix̄1

I x2

14

+
2

8
Ix̄2

Figure 2.1: An example of a sum-product network over two boolean variables X1 and X2 .
function over (Ix1 , Ix̄1 , Ix2 , Ix̄2 ):Vroot (x | w) =10(6Ix1 + 4Ix̄1 ) × (6Ix2 + 14Ix̄2 )+ 6(6Ix1 + 4Ix̄1 ) × (2Ix2 + 8Ix̄2 )+ 9(9Ix1 + 1Ix̄1 ) × (2Ix2 + 8Ix̄2 )=594Ix1 Ix2 + 1776Ix1 Ix̄2 + 306Ix̄1 Ix2 + 824Ix̄1 Ix̄2

(2.3)

Given an SPN S , we first define the notion of network polynomial, which plays an important role throughout
this thesis:
Definition 2.4.1 (Network Polynomial). Let f (·) ≥ 0 be an unnormalized probability distribution over a
Boolean random vector X[n] . The network polynomial of f (·) is a multilinear function ∑x f (x) ∏in=1 Ixi ofindicator variables, where the summation is over all possible instantiations of the Boolean random vector
X[ n ] .
Note that the network polynomial as defined above is a function over 2n indicator variables. Intuitively,
the network polynomial is a Boolean expansion (Boole, 1847) of the unnormalized probability distributionf (·). For example, the network polynomial of a BN X1 → X2 is Pr( x1 , x2 )Ix1 Ix2 + Pr( x1 , x̄2 )Ix1 Ix̄2 +Pr( x̄1 , x2 )Ix̄1 Ix2 + Pr( x̄1 , x̄2 )Ix̄1 Ix̄2 . Similarly, the network polynomial of an SPN is given by Vroot (x | w).
To simplify the notation, for any partial assignment y of a subset of random variables Y ⊆ X, weslightly abuse the notation Vroot (y | w) to actually mean the value of the network where we set all theindicators w.r.t. X ∈ X\Y to be 1 and for X ∈ Y we set the value of indicator variable according to theassignment y. For instance, in the SPN given in Fig. 2.1, we use Vroot ( X2 = 1 | w) to mean the value ofthe network with inputs (Ix1 , Ix̄1 , Ix2 , Ix̄2 ) = (1, 1, 1, 0).
We now proceed to give a formal definition of sum-product network over binary random variables
X[n] . In later we will also extend the following definition over binary random variables to arbitrary discrete
distributions and continuous distributions.
Definition 2.4.2 (Sum-Product Network (Poon and Domingos, 2011)). A Sum-Product Network (SPN)
over Boolean variables X[n] is a rooted DAG whose leaves are the indicators Ix1 , . . . , Ixn and Ix̄1 , . . . , Ix̄n
and whose internal nodes are sums and products. Each edge (vk , v j ) emanating from a sum node k has apositive weight wkj . The value of a product node k is Vk := ∏ j∈Ch(k) Vj and the value of a sum node k is15

Vk := ∑v j ∈Ch(vk ) wkj Vj . The value of an SPN is defined to be the value of its root: Vroot (· | w).
By definition, it is clear that each internal node of SPN also defines a polynomial function over a subsetof X[n] . We use S to denote the set of sum nodes in an SPN and P to denote the set of product nodes in an
SPN. We now introduce a concept, scope, to formally describe the domain of the function computed by aninternal node. The definition is recursive:
Definition 2.4.3 (Scope). For an SPN S over X[n] , the scope of a node k is defined as follows:
1. scope(k ) = {i } if k is a leaf indicator variable over Xi .
S
2. scope(k ) := j∈Ch(k) scope( j).
Two more structural properties about SPN can be further defined based on the notion of scope:
Definition 2.4.4 (Complete). An SPN is complete iff ∀k ∈ S, ∀ j ∈ Ch(k), scope(k ) = scope( j).
Definition 2.4.5 (Decomposable). An SPN is decomposable iff ∀k ∈ P, ∀ j1 , j2 ∈ Ch(k ), j1 6= j2 ,Tscope( j1 ) scope( j2 ) = ∅.
In other words, completeness requires that for each sum node in an SPN, the scope of this sum nodeis the same as the scope of any of its child. On the other hand, decomposability ensures that for any
product node, the scopes of any pair of its children are disjoint. It has been shown that every complete
and decomposable SPN defines a proper probability distribution (Poon and Domingos, 2011), and this is asufficient but not necessary condition. In this thesis, we focus only on complete and decomposable SPNs
as we are interested in their associated probabilistic semantics. For a complete and decomposable SPN S ,each node v in S defines a network polynomial f v (·) which corresponds to the sub-SPN rooted at v. The
network polynomial defined by the root of the SPN can then be computed recursively by taking a weighted
sum of the network polynomials defined by the sub-SPNs rooted at the children of each sum node and a
product of the network polynomials defined by the sub-SPNs rooted at the children of each product node.
The joint distribution encoded by an SPN is defined by the graphical structure and the weights. For
example, to make the polynomial in Eq. (2.3) a well-defined probability distribution, it suffices to normalize
it by dividing the sum of all its coefficients. In the example given in Fig. 2.1, the normalization constantcan be computed by 594 + 1776 + 306 + 824 = Vroot (1 | w), where we simply set all the leaf indicatorvariables to be 1 and the output of the network gives the desired normalization constant.
Formally, the probability/density of a joint assignment X = x in an SPN S is defined to be proportional
to the value at the root of the SPN with input x divided by a normalization constant Vroot (1 | w):
Pr(x) =S

Vroot (x | w)
Vroot (1 | w)

(2.4)

Intuitively, setting all the input leaf indicator variables to be 1 corresponds to integrating/marginalizing out
the random vector X, which will ensure Eq. (2.4) defines a proper probability distribution. Eq. (2.4) can
also be used to compute the marginal probability of a partial assignment Y = y: simply set all the leaf
indicator variables whose corresponding random variable is not in Y to be 1 and other leaf nodes basedon the assignment Y = y. Equivalently, this corresponds to integrating out variables outside of the partial
assignment. We can compute conditional probabilities by evaluating two partial assignments:
Pr(Y = y | Z = z) =S

PrS (Y = y, Z = z)
Vroot (y, z | w)=
PrS (Z = z)
Vroot (z | w)

Since joint, marginal and conditional queries can all be computed by two network passes, exact inference
takes linear time with respect to the network size:
Theorem 2.4.1 (Linear time exact inference (Poon and Domingos, 2011)). Let S be a complete andTdecomposable SPN over boolean random vector X[n] , then ∀Y, Z ⊆ X[n] , Y Z = ∅, PrS (Y | Z) can becomputed in O(|S|).
16

Thm. 2.4.1 is perhaps the most interesting property about SPN that distinguishes it from classicalprobabilistic graphical models, including Bayesian networks, Markov random fields, factor graphs andjunction trees. It is well known that exact inference in those models is computationally hard. Moreprecisely, for a Bayesian network B , the complexity for exact inference in B is given by O(2tw(B) ), but
it is NPC to determine whether a given graph B has tree-width at most a given number t (Arnborg et al.,1987). Hence practitioners often have to resort to various approximate inference schemes, e.g., loopy belief
propagation (Murphy et al., 1999), Markov chain Monte Carlo (MCMC) sampling (Neal, 1993), variational
relaxation (Sontag et al., 2011), to name a few. On the other hand, despite the fact that marginal inferenceis exact and intractable in SPNs, the maximum-a-posteriori (MAP) inference is still NP-hard (Choi andDarwiche, 2017; Mei et al., 2017; Peharz, 2015).
It has been recently shown that any complete and decomposable SPN S over X[n] is equivalent to a
BN with O(n|S|) size (Zhao et al., 2015b), if we are allowed to use a more compact data structure, e.g.,
the algebraic decision diagram (ADD) (Bahar et al., 1997) instead of the usual conditional probability
table, to represent the conditional probability distribution at each node of the BN. The insight behind theconstruction is that each internal sum node in S corresponds to a latent variable in the constructed BN, andthe BN will be a bipartite graph with one layer of local latent variables pointing to one layer of observablevariables X. An observable variable is a child of a local latent variable if and only if the observable variableappears as a descendant of the latent variable (sum node) in the original SPN. Equivalently, this shows that
the SPN S can be interpreted as a BN where the number of latent variables per instance is O(|S|). ThisBN perspective provides an interesting connection between the two models, and later we shall reply on thisequivalence to develop Bayesian variational inference method for learning the parameters of SPNs.

2.5

Geometric and Signomial Programming

Before we introduce signomial programming (SP), we shall first introduce geometric programming(GP), which is a strict subclass of SP. A monomial is defined as a function h : Rn++ 7→ R: h(x) =dx1a1 x2a2 · · · xnan , where the domain is restricted to be the positive orthant (Rn++ ), the coefficient d is positive
and the exponents ai ∈ R, ∀i. A posynomial is a sum of monomials: g(x) = ∑kK=1 dk x1a1k x2a2k · · · xnank . Oneof the key properties of posynomials is positivity, which allows us to transform any posynomial into the log
domain. A GP in standard form is defined to be an optimization problem where both the objective function
and the inequality constraints are posynomials and the equality constraints are monomials. There is also an
implicit constraint that x ∈ Rn++ .
minimizesubject to

K0

n

k =1
Ki

t =1

k =1
n

t =1

a

∑ d0k ∏ xt 0kt
na∑ dik ∏ xt ikt ≤ 1,ad j ∏ xt jt = 1,t =1i ∈ [ p](2.5)

j ∈ [q]In its standard form GP is not a convex program since posynomials are not convex functions in general.
However, we can effectively transform it into a convex problem by using the logarithmic transformation
trick on x, the multiplicative coefficients of each monomial and also each objective/constraint function (Boydet al., 2007; Chiang, 2005). We make the following change: let y = log(x), cik = log(dik ), ∀i, k and take17

log(·) of each function in ((2.5)). Then the standard GP form is equivalent to the following formulation:!
minimize

log

K0∑ exp(a0kT y + c0k )k =1

subject to

log

Ki

∑ exp(aikT y + cik )k =1
Ta j y + c j = 0,

!

≤ 0,

i ∈ [ p](2.6)

j ∈ [q]which is a convex program since the log-sum-exp function is convex in its argument and aT y + c is affine
in y. Furthermore, in the convex formulation of GP we have y ∈ Rn , i.e., we naturally remove the positive
constraint on x by taking the log transformation.
An SP has the same form as GP except that the multiplicative constant d inside each monomial is not
restricted to be positive, i.e., d can take any real value. Although the difference seems to be small, there isa huge difference between GP and SP from the computational perspective. The negative multiplicative
constant in monomials invalidates the logarithmic transformation trick frequently used in GP. As a result,
SPs cannot be reduced to convex programs and are believed to be hard to solve in general (Boyd et al.,2007).

2.6

Some Technical Tools

We first introduce the concept of Rademacher complexity, which will be frequently used in the following
chapters to prove data-dependent generalization bounds.
Definition 2.6.1 (Empirical Rademacher Complexity). Let H be a family of functions mapping from X
to [ a, b] and S = {xi }in=1 a fixed sample of size n with elements in X . Then, the empirical Rademacher
complexity of H with respect to the sample X is defined as
1 n
RadS (H) := Eσ sup ∑ σi h(xi ) ,h∈H n i =1

where σ = {σi }in=1 and σi are i.i.d. uniform random variables taking values in {+1, −1}.
Roughly speaking, the Rademacher complexity measures the ability of a hypothesis class to fit uniformly
random noise, hence it could be understood as a measure of the richness of hypothesis classes. The following
lemma is particularly useful to provide data-dependent guarantees in terms of the empirical Rademacher
complexity:
Lemma 2.6.1 (Bartlett and Mendelson (2002)). Let H ⊆ [0, 1]X , then for ∀δ > 0, w.p.b. at least 1 − δ,
the following inequality holds for ∀h ∈ H:r
1 nlog(2/δ)E[h(x)] ≤ ∑ h(xi ) + 2RadS (H) + 3(2.7)
n i =1
2n
Ledoux-Talagrand’s contraction lemma is a useful technique in upper bounding the Rademacher
complexity of function compositions:Lemma 2.6.2 (Ledoux-Talagrand’s contraction lemma). Let φ : R 7→ R be a Lipschitz function withparameter L, i.e., ∀ a, b ∈ R, |φ( a) − φ(b)| ≤ L| a − b|. Then,




1 n
1 n
RadS (φ ◦ H) = Eσ sup ∑ σi φ(h(xi )) ≤ L Eσ sup ∑ σi h(xi ) = L RadS (H),h∈H n i =1h∈H n i =118

where φ ◦ H := {φ ◦ h | h ∈ H} is the class of composite functions.
Throughout the thesis, we will frequently use information-theoretic concepts and tools to understandvarious phenomenons in learning representations. Here we give a brief introduction to the ones that we use
in the rest of the chapters.
For two distributions D and D 0 , the Jensen-Shannon (JS) divergence DJS (D k D 0 ) is defined as:
DJS (D k D 0 ) :=1
1
DKL (D k D M ) + DKL (D 0 k D M ),22

where DKL (· k ·) is the Kullback–Leibler (KL) divergence and D M := (D + D 0 )/2. The JS divergencecan be viewed as a symmetrized and smoothed version of the KL divergence, and it is closely related to theL1 distance between two distributions through Lin’s lemma (Lin, 1991).
Unlike the KL divergence, the JS divergence is bounded: 0 ≤ DJS (D k D 0 ) ≤ 1. Additionally, fromthe JS divergence, we can define a distance metric between two distributions as well, known as the JS
distance (Endres and Schindelin, 2003):
q
dJS (D , D 0 ) := DJS (D k D 0 ).
Lin’s lemma gives an upper bound of the JS divergence between two distributions via the L1 distance (total
variation distance).
Lemma 2.6.3 (Theorem. 3, (Lin, 1991)). Let D and D 0 be two distributions, then DJS (D , D 0 ) ≤ 12 kD −D 0 k1 .
The following inequality is the celebrated data-processing inequality:
Lemma 2.6.4 (Data processing inequality). Let X → Z → Y be a Markov chain, then I ( X; Z ) ≥ I ( X; Y ),where I (·; ·) is the mutual information.
The following inequality is a special case of the Fubini’s theorem:
R∞
Theorem 2.6.1 (Fubini’s Theorem). Let X be a nonnegative random variable, then E[ X ] = 0 Pr( X ≥t) dt.
Finally, the following Hoeffding’s bound will be a powerful tool to give concentration arguments:
Theorem 2.6.2 (Hoeffding’s inequality). Let { Xt }nt=1 be a sequence of independent random variables
such that ∀t ∈ [n], E[ Xt ] = 0 and Xt ∈ [ at , bt ] almost surely. Then the following inequality holds:
!


1 n
2n2 e2Pr.
Xt ≥ e ≤ 2 exp − nn t∑∑ t = 1 ( bt − a t ) 2=1
Other concentration inequalities will be introduced in the corresponding chapters when necessary.

19

Part I

Understanding and Learning Invariant
Representations

21

Chapter 3

Domain Adaptation with Multiple Source
Environments
While domain adaptation has been actively researched, most algorithms focus on the single-source-singletarget adaptation setting. In this chapter we propose new generalization bounds and algorithms under bothclassification and regression settings for unsupervised multiple source domain adaptation. Our theoreticalanalysis naturally leads to an efficient learning strategy using adversarial neural networks: we show how
to interpret it as learning feature representations that are invariant to the multiple domain shifts whilestill being discriminative for the learning task. To this end, we propose multisource domain adversarial
networks (MDAN) that approach domain adaptation by optimizing task-adaptive generalization bounds. To
demonstrate the effectiveness of MDAN, we conduct extensive experiments showing superior adaptation
performance on both classification and regression problems: sentiment analysis, digit classification, andvehicle counting.

23

3.1

Introduction

The success of machine learning has been partially attributed to rich datasets with abundant annotations (Russakovsky et al., 2015). Unfortunately, collecting and annotating such large-scale training data isprohibitively expensive and time-consuming. To solve these limitations, different labeled datasets can be
combined to build a larger one, or synthetic training data can be generated with explicit yet inexpensive
annotations (Shrivastava et al., 2016). However, due to the possible shift between training and test samples,learning algorithms based on these cheaper datasets still suffer from high generalization error. Domain adaptation (DA) focuses on such problems by establishing knowledge transfer from a labeled source domain toan unlabeled target domain, and by exploring domain-invariant structures and representations to bridge thegap (Pan and Yang, 2010). Both theoretical results (Ben-David et al., 2010; Gopalan et al., 2014; Mansour
and Schain, 2012; Mansour et al., 2009a; Xu and Mannor, 2012) and algorithms (Adel et al., 2017; Ajakan
et al., 2014; Becker et al., 2013; Ghifary et al., 2015; Glorot et al., 2011; Hoffman et al., 2012, 2017b; Jhuo
et al., 2012; Long et al., 2015; Pei et al., 2018) for DA have been proposed. Most theoretical results andalgorithms with respect to DA focus on the single-source-single-target setting (Ganin et al., 2016; Louizos
et al., 2015; Shu et al., 2018; Tzeng et al., 2015, 2017). However, in many application scenarios, the labeleddata available may come from multiple domains with different distributions. As a result, naive applicationof the single-source-single-target DA algorithms may lead to suboptimal solutions. Such problem calls foran efficient technique for multiple source domain adaptation. Some existing multisource DA methods (Ganet al., 2016; Hoffman et al., 2012, 2017a; Sun et al., 2011; Zhang et al., 2015a) cannot lead to effective
deep learning based algorithms, leaving much space to be improved for their performance.
In this chapter we analyze the multiple source domain adaptation problem and propose an adversarial
learning strategy based on our theoretical results. Specifically, we give new generalization bounds for bothclassification and regression problems under domain adaptation when there are multiple source domains
with labeled instances and one target domain with unlabeled instances. Our theoretical results build on
the seminal theoretical model for domain adaptation introduced by Blitzer et al. (2008) and Ben-Davidet al. (2010), where a divergence measure, known as the H-divergence, was proposed to measure thedistance between two distributions based on a given hypothesis space H. Our new result generalizes
the bound (Ben-David et al., 2010, Thm. 2) to the case when there are multiple source√ domains, and toregression problems as well. The new bounds achieve a finite sample error rate of Õ( 1/km), where k is
the number of source domains and m is the number of labeled training instances from each domain.
Interestingly, our bounds also lead to an efficient algorithm using adversarial neural networks. Thisalgorithm learns both domain invariant and task discriminative features under multiple domains. Specifically, we propose a novel MDAN model by using neural networks as rich function approximators to
instantiate the generalization bound we derive (Fig. 3.1). MDAN can be viewed as computationally efficientapproximations to optimize the parameters of the networks in order to minimize the bounds. We introduce
two versions of MDAN: The hard version optimizes directly a simple worst-case generalization bound,while the soft version leads to a more data-efficient model and optimizes an average case and task-adaptive
bound. The optimization of MDAN is a minimax saddle point problem, which can be interpreted as a
zero-sum game with two participants competing against each other to learn invariant features. MDAN
combine feature extraction, domain classification, and task learning in one training process. We propose touse stochastic optimization with simultaneous updates to optimize the parameters in each iteration.
Contributions Our contributions in this chapter are three-fold:
1. Theoretically, we provide average case generalization bounds for both classification and regression
problems under the multisource domain adaptation setting.

24

2. Inspired by our theoretical results, we also propose efficient algorithms that tackle multisource
domain adaptation problems using adversarial learning strategy.
3. Empirically, to demonstrate the effectiveness of MDAN as well as the relevance of our theoreticalresults, we conduct extensive experiments on real-world datasets, including both natural language
and vision tasks, classification and regression problems. We achieve consistently superior adaptation
performances on all the tasks, validating the effectiveness of our models.

3.2

Preliminaries

We first introduce the problem setup of domain adaptation and review a theoretical model for domain
adaptation when there is one source and one target (Ben-David et al., 2007, 2010; Blitzer et al., 2008; Kifer
et al., 2004). The key idea is the H-divergence to measure the discrepancy between two distributions. Other
theoretical models for DA exist (Cortes and Mohri, 2014; Cortes et al., 2008; Mansour et al., 2009a,c); we
choose to work with the above model because this distance measure has a particularly natural interpretationand can be well approximated using samples from both domains.
Problem Setup We use domain to represent a distribution D on input space X and a labeling function
f : X → [0, 1]. In the setting of one source one target domain adaptation, we use hDS , f S i and hD T , f T i
to denote the source and target, respectively. A hypothesis is a function h : X → [0, 1]. The error of ahypothesis h w.r.t. a labeling function f under distribution DS is defined as: ε S (h, f ) := Ex∼DS [|h(x) −f (x)|]. When f and h are binary classification functions, this definition reduces to the probability that hdisagrees with f under DS : Ex∼DS [|h(x) − f (x)|] = Ex∼DS [I( f (x) 6= h(x))] = Prx∼DS ( f (x) 6= h(x)).
We define the risk of hypothesis h as the error of h w.r.t. a true labeling function under domain DS , i.e.,ε S (h) := ε S (h, f S ). As common notation in computational learning theory, we use b
ε S (h) to denote theempirical risk of h on the source domain. Similarly, we use ε T (h) and b
ε T (h) to mean the true risk and theempirical risk on the target domain. H-divergence is defined as follows:
Definition 3.2.1. Let H be a hypothesis class for instance space X , and AH be the collection of subsets of
X that are the support of some hypothesis in H, i.e., AH := {h−1 ({1}) | h ∈ H}. The distance between
two distributions D and D 0 based on H is: dH (D , D 0 ) := 2 sup A∈AH | PrD ( A) − PrD 0 ( A)|.
When the hypothesis class H contains all the possible measurable functions over X , dH (D , D 0 )reduces to the familiar total variation. Given a hypothesis class H, we define its symmetric difference
w.r.t. itself as: H ∆H = {h(x) ⊕ h0 (x) | h, h0 ∈ H}, where ⊕ is the XOR operation. Let h∗ be theoptimal hypothesis that achieves the minimum combined risk on both the source and the target domains:h∗ := arg minh∈H ε S (h) + ε T (h), and use λ to denote the combined risk of the optimal hypothesis h∗ :λ := ε S (h∗ ) + ε T (h∗ ). Ben-David et al. (2007) and Blitzer et al. (2008) proved the following generalization
bound on the target risk in terms of the source risk and the discrepancy between the single source domain
and the target domain:b S (Db T ) beTheorem 3.2.1 (Blitzer et al. (2008)). Let H be a hypothesis space of VC-dimension d and D
the empirical distribution induced by sample of size m drawn from DS (D T ). Then w.p.b. at least 1 − δ,∀ h ∈ H,
!
r
1
d
log
(
m/d
)
+
log
(
1/δ
)
bS, D
bT ) + λ + O
ε T (h) ≤ b
ε S ( h ) + dH ∆H ( D
.
(3.1)
2
m
The bound depends on λ, the optimal combined risk that can be achieved by hypothesis in H. The
intuition is if λ is large, we cannot hope for a successful domain adaptation. One notable feature is that the25empirical discrepancy distance between two samples can be approximated by a discriminator to distinguishinstances from two domains.

3.3

Generalization Bound for Multiple Source Domain Adaptation

In this section we discuss two approaches to obtain generalization guarantees for multiple source domain
adaptation in both classification and regression settings, one by a union bound argument and one using
reduction from multiple source domains to single source domain. We conclude this section with a discussion
and comparison of our bounds with existing generalization bounds for multisource domain adaptation (BenDavid et al., 2010; Mansour et al., 2009c). We defer the detailed proof in Sec. 3.7 and we mainly focus on
discussing the interpretations and implications of the theorems.
Let {DSi }ik=1 and D T be k source domains and the target domain, respectively. One idea to obtain ageneralization bound for multiple source domains is to apply Thm. 3.2.1 repeatedly k times, followed by aunion bound to combine them. Following this idea, we first obtain the following bound as a corollary ofThm. 3.2.1 in the setting of multiple source domains, serving as a baseline model:
Corollary 3.3.1 (Worst case classification bound). Let H be a hypothesis class with VCdim(H) = d. If
b T and {Db S }k are the empirical distributions generated with m i.i.d. samples from each domain, then,D
i i =1for 0 < δ < 1, with probability at least 1 − δ, for all h ∈ H, we have:
s 
!


k
m
1
1
bT ; Db S ) + λi + O
log + d log,(3.2)
ε T (h) ≤ max b
ε Si ( h ) + d H ∆ H ( D
i
2
m
δ
d
i ∈[k ]
where λi is the combined risk of the optimal hypothesis on domains Si and T.
Remark This bound is quite pessimistic, as it essentially is a worst case bound, where the generalizationon the target only depends on the worst source domain. However, in many real-world scenarios, when thenumber of related source domains is large, a single irrelevant source domain may not hurt the generalization
too much. Furthermore, in the case of multiple source domains, despite the possible discrepancy between
the source domains and the target domain, effectively √we have a labeled sample of size km, while theasymptotic convergence rate in Corollary. 3.3.1 is of Õ( 1/m). Hence naturally√ one interesting question
to ask is: is it possible to have a generalization bound of finite sample√ rate Õ( 1/km)? In what follows
we present a strategy to achieve a generalization bound of rate Õ( 1/km). The idea of this strategy is areduction using convex combination from multiple domains to single domain by combining all the labeledinstances from k domains to one.
Theorem 3.3.1 (Average case classification bound). Let H be a hypothesis class with VCdim(H) = d.
b S }k are the empirical distributions generated with m i.i.d. samples from each domain, and DbT
If {Di i =1is the empirical distribution on the target domain generated from mk samples without labels, then, ∀α ∈Rk+ , ∑i∈[k] αi = 1, and for 0 < δ < 1, w.p.b. at least 1 − δ, for all h ∈ H, we have:


1
b
b
ε T ( h ) ≤ ∑ αi bε Si ( h ) + d H ∆ H ( D T ; D Si ) + λ α + O
2i ∈[k ]

s

1
km



1
km
log + d log
δ
d

!

,

(3.3)

where λα is the risk of the optimal hypothesis on the mixture source domain ∑i∈[k] αi Si and T.
Different from Corollary 3.3.1, Thm. 3.3.1 requires mk unlabeled instances from the target domain.
This is a mild requirement since unlabeled data is cheap to collect. Roughly, the bound in Thm. 3.3.1
can be understood as an average case bound if we choose αi = 1/k, ∀i ∈ [k ]. Note that a simple convex
26

√
combination by applying Thm.
√ 3.2.1 k times can only achieve finite sample rate of Õ( 1/m), while
the one in (3.3) achieves Õ( 1/km). On the other hand, the constants maxi∈[k] λi (in Corollary 3.3.1)
and λα (in Thm. 3.3.1) are generally not comparable. As a final note, although the proof works for any
convex combination αi , in the next section we will describe a practical method so that we do not need to
explicitly choose it. Thm. 3.3.1 upper bounds the generalization error for classification problems. Next
we also provide generalization guarantee for regression problem, where instead of VC dimension, we use
pseudo-dimension to characterize the structural complexity of the hypothesis class.
Theorem 3.3.2 (Average case regression bound). Let H be a set of real-valued functions from X to [0, 1]1b S }k are the empirical distributions generated with m i.i.d. samples from eachwith Pdim(H) = d. If {Di i =1b T is the empirical distribution on the target domain generated from mk samples without
domain, and Dlabels, then, ∀α ∈ Rk+ , ∑i∈[k] αi = 1, and for 0 < δ < 1, with probability at least 1 − δ, for all h ∈ H, we
have:
s



!
1
1
km
1
bT ; Db S ) + λα + O
ε T ( h ) ≤ ∑ αi bε Si (h) + dH̄ (Dlog + d log
,
(3.4)
i
2
km
δ
d
i ∈[k ]
where λα is the risk of the optimal hypothesis on the mixture source domain ∑i∈[k] αi Si and T, andH̄ := {I|h(x)−h0 (x)|>t : h, h0 ∈ H, 0 ≤ t ≤ 1} is the set of threshold functions induced from H.
Comparison with Existing Bounds First, it is easy to see that, the bounds in both (3.2) and (3.3) reduceto the one in Thm. 3.2.1 when there is only one source domain (k = 1). Blitzer et al. (2008) give ageneralization bound for semi-supervised classification with multiple sources where, besides labeledinstances from multiple source domains, the algorithm also has access to a fraction of labeled instancesfrom the target domain. Although in general our bound and the one in (Blitzer et al., 2008, Thm. 3) are
incomparable, it is instructive to see the connections and differences between them: our bound works
in the unsupervised domain adaptation setting where we do not have any labeled data from the target.
As a comparison, their bound in (Blitzer et al., 2008, Thm. 3) is a bound for semi-supervised domain
adaptation. As a result, because of the access to labeled instances from the target domain, their bound isexpressed relative to the optimal error on the target, while ours is in terms of the empirical error on thesource domains, hence theirs is more informative. To the best of our knowledge, our bound in Thm. 3.3.2
is the first one using the idea of H-divergence for regression problems. The proof of this theorem relies
on a reduction from regression to classification. Mansour et al. (2009b) give a generalization bound for
multisource domain adaptation under the assumption that the target distribution is a mixture of the k sources
and the target hypothesis can be represented as a convex combination of the source hypotheses. Also, theirgeneralized discrepancy measure can be applied for other loss functions.

3.4

Multisource Domain Adaptation with Adversarial Neural Networks

Motivated by the bounds given in the last section, in this section we propose our model, multisource domain
adversarial networks (MDAN), with two versions: Hard version (as a baseline) and Soft version. Suppose
we are given samples drawn from k source domains {DSi }, each of which contains m instance-label pairs.
Additionally, we also have access to unlabeled instances sampled from the target domain D T . Once we fix
our hypothesis class H, the last two terms in the generalization bounds (3.2) and (3.3) will be fixed; hence
we can only hope to minimize the bound by minimizing the first two terms, i.e., the source training error
1 This is just for the simplicity of presentation, the range can easily be generalized to any bounded set.

27

Figure 3.1: MDAN Network architecture. Feature extractor, domain classifier, and task learning are
combined in one training process. Hard version: the source that achieves the minimum domain classification
error is backpropagated with gradient reversal; Smooth version: all the domain classification risks over ksource domains are combined and backpropagated adaptively with gradient reversal.
and the discrepancy between source domains and target domain. The idea is to train a neural network tolearn a representation with the following two properties:
1. Indistinguishable between the k source domains and the target domain;
2. Informative enough for our desired task to succeed.
Note that both requirements are necessary: without the second property, a neural network can learn trivial
random noise representations for all the domains, and such representations cannot be distinguished by any
discriminator; without the first property, the learned representation does not necessarily generalize to theunseen target domain.
bT ; Db S ) from Ben-David et al.
One key observation that leads to a practical approximation of dH∆H (Di(2007) is that computing the discrepancy measure is closely related to learning a classifier that is able todistinguish samples from different domains. Let b
ε T,Si (h) be the empirical risk of hypothesis h in the domain
discriminating task. Ignoring the constant terms that do not affect the upper bound, we can minimize theworst case upper bound in (3.2) by solving the following optimization problem:0Hard version: minimize max b
ε Si (h) − 0 min b
ε T,Si (h )(3.5)
i ∈[k ]h ∈H ∆H

The two terms in (3.5) exactly correspond to the two criteria we just proposed: the first term asks for an
informative feature representation for our desired task to succeed, while the second term captures the notionof invariant feature representations between different domains. Inspired by Ganin et al. (2016), we use
the gradient reversal layer to effectively implement (3.5) by backpropagation. The network architectureis shown in Fig. 3.1. As discussed in the last section, one notable drawback of the hard version isthat the algorithm may spend too much computational resources in optimizing the worst source domain.
Furthermore, in each iteration the algorithm only updates its parameter based on the gradient from one of
the k domains. This is data inefficient and can waste our computational resources in the forward process.
To avoid both of the problems, we propose the MDAN Soft version that optimizes an upper bound of
the convex combination bound given in (3.3). To this end, define b
ε i (h) := bε Si (h) − minh0 ∈H∆H b
ε T,Si (h0 )and let γ > 0 be a constant. We formulate the following optimization problem:
1Soft version: minimize
ε T,Si (h0 ))(3.6)
log ∑ exp γ(bε Si (h) − 0 min bγh ∈H ∆Hi ∈[k ]At the first glance, it may not be clear what the above objective function corresponds to. To understand this,28

Algorithm 1 Multiple Source Domain Adaptation
1: for t = 1 to ∞ do
2:
3:
4:

(t)
b T , each of size mb S }k and D
Sample {Si }ik=1 and T (t) from {Di i =1for i = 1 to k do(t)bεi ← bε S(t) (h) − minh0 ∈H∆H b
ε T (t) ,S(t) (h0 )
i

5:
6:
7:
8:

(t)

(t)

i

Compute wi := exp(bεi )end for(t)εiSelect i(t) := arg maxi∈[k] b// Hard version(t)
Backpropagate gradient of b
ε i (t)for i = 1 to k do
(t)
(t)
(t)
10:
Normalize wi ← wi / ∑i0 ∈[k] wi0
11:
end for(t) (t)12:
Backpropagate gradient of ∑i∈[k] wi bεi13: end for
9:// Soft version

if we define αi = exp(bε i (h))/ ∑ j∈[k] exp(bε j (h)), then the following inequality holds:!
ε i (h))∑i∈[k] exp2 (b∑ αibε i (h) ≤ log Eα [exp(bε i (h))] = log ∑ exp(bε i (h)) ≤ log ∑ exp(bε i (h)).
i ∈[k ]i ∈[k ]i ∈[k]
In other words, the objective function in (3.6) is in fact an upper bound of the convex combination boundgiven in (3.3), with the combination weight α defined above. Compared with the one in (3.3), one advantageof the objective function in (3.6) is that we do not need to explicitly choose the value of α. Instead, it
adaptively corresponds to the loss b
ε i (h), and the larger the loss, the heavier the weight.
Alternatively, from the algorithmic perspective, during the optimization (3.6) naturally provides anadaptive weighting scheme for the k source domains depending on their relative error. Use θ to denote all
the model parameters:


∂ 1
∂b
ε i (h)exp γbε i (h)0log ∑ exp γ(bε Si (h) − 0 min b
ε T,Si (h )) = ∑
.
(3.7)
∂θ γ
exp γbε i0 (h) ∂θh ∈H ∆H0i ∈[k ]i ∈[k ] ∑i ∈[k ]Compared with (3.5), the log-sum-exp trick not only smooths the objective, but also provides a principled
and adaptive way to combine all the gradients from the k source domains. In words, (3.7) says that thegradient of MDAN is a convex combination of the gradients from all the domains. The larger the error
from one domain, the larger the combination weight in the ensemble. As we will see in Sec. 3.5, theoptimization problem (3.6) often leads to better generalizations in practice, which may partly be explainedby the ensemble effect of multiple sources implied by the upper bound. Pseudocode of both algorithms islisted in Alg. 1.

3.5

Experiments

We evaluate both hard and soft MDAN and compare them with state-of-the-art methods on three real-world
datasets: the Amazon benchmark dataset (Chen et al., 2012) for sentiment analysis, a digit classification
task that includes 4 datasets: MNIST (LeCun et al., 1998b), MNIST-M (Ganin et al., 2016), SVHN (Netzer
et al., 2011), and SynthDigits (Ganin et al., 2016), and a public, large-scale image dataset on vehicle
counting from multiple city cameras (Zhang et al., 2017a).
29

3.5.1

Amazon Reviews

Domains within the dataset consist of reviews on a specific kind of product (Books, DVDs, Electronics, andKitchen appliances). Reviews are encoded as 5000 dimensional feature vectors of unigrams and bigrams,with binary labels indicating sentiment. We conduct 4 experiments: for each of them, we pick one productas target domain and the rest as source domains. Each source domain has 2000 labeled examples, andthe target test set has 3000 to 6000 examples. During training, we randomly sample the same number of
unlabeled target examples as the source examples in each mini-batch. We implement both the Hard-Max
and Soft-Max methods, and compare them with three baselines: MLPNet, marginalized stacked denoising
autoencoders (mSDA) (Chen et al., 2012), and DANN (Ganin et al., 2016). DANN cannot be directly
applied in multiple source domains setting. In order to make a comparison, we use two protocols. The firstone is to combine all the source domains into a single one and train it using DANN, which we denote as
C-DANN. The second protocol is to train multiple DANNs separately, where each one corresponds to asource-target pair. Among all the DANNs, we report the one achieving the best performance on the target
domain. We denote this experiment as B-DANN. For fair comparison, all these models are built on thesame basic network structure with one input layer (5000 units) and three hidden layers (1000, 500, 100
units).
Table 3.1: Sentiment classification accuracy.
Train/Test

MLPNetmSDA

B-DANNC-DANN

D+E+K/B
B+E+K/D
B+D+K/E
B+D+E/K

0.76550.75880.84600.85450.76980.78610.81980.8426

0.76500.77320.83810.84330.77890.7886
0.84910.8639MDAN
Hard-Max Soft-Max
0.78450.77970.84830.85800.78630.80650.85340.8626

Results and Analysis We show the accuracy of different methods in Table 3.1. Clearly, Soft-Max
significantly outperforms all other methods in most settings. When Kitchen is the target domain, C-DANN
performs slightly better than Soft-Max, and all the methods perform close to each other. Hard-Max istypically slightly worse than Soft-Max. This is mainly due to the low data-efficiency of the Hard-Max
model (Section 3.4, Eq. 3.5, Eq. 3.6). We observe that with more training iterations, the performanceof Hard-Max can be further improved. These results verify the effectiveness of MDAN for multisource
domain adaptation. To validate the statistical significance of the results, we also run a non-parametric
Wilcoxon signed-ranked test for each task to compare Soft-Max with the other competitors (see more details
in appendix). From the statistical test, we see that Soft-Max is convincingly better than other methods.

3.5.2

Digits Datasets

Following the setting in (Ganin et al., 2016), we combine four digits datasets (MNIST, MNIST-M, SVHN,
SynthDigits) to build the multisource domain dataset. We take each of MNIST-M, SVHN, and MNIST
as target domain in turn, and the rest as sources. Each source domain has 20, 000 labeled images and thetarget test set has 9, 000 examples.
Baselines We compare Hard-Max and Soft-Max of MDAN with 10 baselines: i). B-Source. A basic
network trained on each source domain (20, 000 images) without domain adaptation and tested on the30

Table 3.2: Accuracy on digit classification. T: MNIST; M: MNIST-M, S: SVHN, D: SynthDigits.
MethodS+M+D/T

T+S+D/M

M+T+D/S

MethodS+M+D/T

T+S+D/M

M+T+D/S

B-Source
B-DANN
B-ADDA
B-MTAE

0.964
0.967
0.968
0.862

0.519
0.591
0.657
0.534

0.814
0.818
0.800
0.703

C-Source
C-DANNC-ADDAC-MTAE

0.938
0.925
0.927
0.821

0.561
0.651
0.682
0.596

0.771
0.776
0.804
0.701

Hard-Max

0.976

0.663

0.802

Soft-Max

0.979

0.687

0.816

MDAC

0.755

0.563

0.604

Target

0.987

0.901

0.898

target domain. Among the three models, we report the one achieves the best performance on the test set. ii).
C-Source. A basic network trained on a combination of three source domains (20, 000 images for each)without domain adaptation and tested on the target domain. iii). B-DANN. We train DANNs (Ganin et al.,2016) on each source-target domain pair (20, 000 images for each source) and test it on target. Again, we
report the best score among the three. iv). C-DANN. We train a single DANN on a combination of threesource domains (20, 000 images for each). v). B-ADDA. We train ADDA (Tzeng et al., 2017) on eachsource-target domain pair (20, 000 images for each source) and test it on the target domain. We report thebest accuracy among the three. vi).C-ADDA. We train ADDA on a combination of three source domains(20, 000 images for each). vii). B-MTAE. We train MTAE (Ghifary et al., 2015) on each source-target
domain pair (20, 000 images for each source) and test it on the target domain. We report the best accuracy
among the three. viii). C-MTAE. We train MTAE on a combination of three source domains (20, 000 images
for each). ix). MDAC. MDAC (Zhang et al., 2015a) is a multiple source domain adaptation algorithm
that explores causal models to represent the relationship between the features X and class label Y. We
directly train MDAC on a combination of three source domains. x). Target. It is the basic network trained
and tested on the target data. It serves as an upper bound of DA algorithms. All the MDAN and baseline
methods are built on the same basic network structure to put them on a equal footing.
Results and Analysis The classification accuracy is shown in Table 3.2. The results show that MDAN
outperforms all the baselines in the first two experiments and is comparable with Best-Single-DANN in thethird experiment. For the combined sources, MDAN always perform better than the source-only baseline(MDAN vs. Combine-Source). However, a naive combination of different training datasets can sometimes
even decrease the performance of the baseline methods. This conclusion comes from three observations:First, directly training DANN on a combination of multiple sources leads to worse results than the sourceonly baseline (Combine-DANN vs. Combine-Source); Second, The performance of Combine-DANN
can be even worse than the Best-Single-DANN (the first and third experiments); Third, directly training
DANN on a combination of multiple sources always has lower accuracy compared with our approach(Combine-DANN vs. MDAN). We have similar observations for ADDA and MTAE. Such observations
verify that the domain adaptation methods designed for single source lead to suboptimal solutions whenapplied to multiple sources. It also verifies the necessity and superiority of MDAN for multiple source
adaptation. Furthermore, we observe that adaptation to the SVHN dataset (the third experiment) is hard. In
this case, increasing the number of source domains does not help. We conjecture this is due to the large
dissimilarity between the SVHN data to the others. Surprisingly, using a single domain (best-Single DANN)
in this case achieves the best result. This indicates that in domain adaptation the quality of data (how close
to the target data) is much more important than the quantity (how many source domains). As a conclusion,

31

Table 3.3: Counting error statistics. S is the number of source cameras; T is the target camera id.
S

T

2
3
4
5
6
7

A
A
A
A
A
A

MDAN
Hard-Max Soft-Max

DANN

FCN

T

1.71401.2363
1.1965
1.1942
1.28771.2984

1.94901.36831.55201.41562.02981.54261.9094
1.5545
1.54991.79251.75051.7646

B
B
B
B
B
B

1.8101
1.32761.38681.40211.43591.4381MDAN
Hard-Max Soft-Max

DANN

FCN

2.34381.86801.84871.60161.46441.51262.52182.01222.18561.72281.5484
1.53972.65282.43192.23512.05042.2832
1.73242.50591.90921.73751.77581.5912
1.5989this experiment further demonstrates the effectiveness of MDAN when there are multiple source domains
available, where a naive combination of multiple sources using DANN may hurt generalization.

3.5.3

WebCamT Vehicle Counting Dataset

WebCamT is a public dataset for vehicle counting from large-scale city camera videos, which has low
resolution (352 × 240), low frame rate (1 frame/second), and high occlusion. It has 60, 000 frames
annotated with vehicle bounding box and count, divided into training and testing sets, with 42, 200 and
17, 800 frames, respectively. Here we demonstrate the effectiveness of MDAN to count vehicles from an
unlabeled target camera by adapting from multiple labeled source cameras: we select 8 cameras locatedin different intersections of the city with different scenes, and each has more than 2, 000 labeled images
for our evaluations. Among these 8 cameras, we randomly pick two cameras and take each camera as thetarget camera, with the other 7 cameras as sources. We compute the proxy A-distance (PAD) (Ben-Davidet al., 2007) between each source camera and the target camera to approximate the divergence between
them. We then rank the source cameras by the PAD from low to high and choose the first k cameras to form
the k source domains. Thus the proposed methods and baselines can be evaluated on different numbersof sources (from 2 to 7). We implement the Hard-Max and Soft-Max MDAN, based on the basic vehicle
counting network FCN (Zhang et al., 2017a). We compare our method with two baselines: FCN (Zhang
et al., 2017a), a basic network without domain adaptation, and DANN (Ganin et al., 2016), implemented
on top of the same basic network. We record mean absolute error (MAE) between true count and estimatedcount.
Results and Analysis The counting error of different methods is compared in Table 3.3. The Hard-Max
version achieves lower error than DANN and FCN in most settings for both target cameras. The SoftMax approximation outperforms all the baselines and the Hard-Max in most settings, demonstrating theeffectiveness of the smooth and adaptative approximation. The lowest MAE achieved by Soft-Max is
1.1942. Such MAE means that there is only around one vehicle miscount for each frame (the average
number of vehicles in one frame is around 20). Fig. 3.2 shows the counting results of Soft-Max for the twotarget cameras under the 5 source cameras setting. We can see that the proposed method accurately counts
the vehicles of each target camera for long time sequences. Does adding more source cameras always
help improve the performance on the target camera? To answer this question, we analyze the counting
error when we vary the number of source cameras as shown in Fig. 3.3a, where the x-axis refers to numberof source cameras and the y-axis includes both the MAE curve on the target camera as well as the PAD
distance (bar chart) between the pair of source and target cameras. From the curves, we see the counting
error goes down with more source cameras at the beginning, while it goes up when more sources are added
32

Figure 3.2: Counting results for target camera A (first row) and B (second row). X-frames; Y-Counts.
at the end. This phenomenon shows that the performance on the target domain also depends on the its
distance to the added source domain, i.e., it is not always beneficial to naively incorporate more source
domains into training. To illustrate this better, we also show the PAD of the newly added camera in thebar chart of Fig. 3.3a. By observing the PAD and the counting error, we see the performance on the target
can degrade when the newly added source camera has large divergence from the target camera. To showthat MDAN can indeed decrease the divergences between target domain and multiple source domains, inFig. 3.3b we plot the PAD distances between the target domains and the corresponding source domains.
We can see that MDAN consistently decrease the PAD distances between all pairs of target and source
domains, for both camera A and camera B. From this experiment we conclude that our proposed MDAN
models are effective in multiple source domain adaptation.

3.6

Related WorkA number of adaptation approaches have been studied in recent years. From the theoretical aspect, several
theoretical results have been derived in the form of upper bounds on the generalization target error bylearning from the source data. A keypoint of the theoretical frameworks is estimating the distribution
shift between source and target. Kifer et al. (2004) proposed the H-divergence to measure the similarity
between two domains and derived a generalization bound on the target domain using empirical error on thesource domain and the H-divergence between the source and the target. This idea has later been extended
to multisource domain adaptation (Blitzer et al., 2008) and the corresponding generalization bound has
been developed as well. Ben-David et al. (2010) provide a generalization bound for domain adaptation on
the target risk which generalizes the standard bound on the source risk. This work formalizes a natural
intuition of DA: reducing the two distributions while ensuring a low error on the source domain and justifies
many DA algorithms. Based on this work, Mansour et al. (2009a) introduce a new divergence measure:discrepancy distance, whose empirical estimate is based on the Rademacher complexity (Koltchinskii,2001) (rather than the VC-dim). Other theoretical works have also been studied such as (Mansour andSchain, 2012) that derives the generalization bounds on the target error by taking use of the robustness
properties introduced in (Xu and Mannor, 2012). See (Cortes et al., 2008; Mansour et al., 2009c) for moredetails.
Following the theoretical developments, many DA algorithms have been proposed, such as instancebased methods (Tsuboi et al., 2009); feature-based methods (Becker et al., 2013); and parameter-based
methods (Evgeniou and Pontil, 2004). The general approach for domain adaptation starts from algorithms

33

(a) Counting error and PAD over different source numbers.

(b) PAD distance before and after training MDAN.

Figure 3.3: PAD distance over different source domains along with their changes before and after training
MDAN.
that focus on linear hypothesis class (Cortes and Mohri, 2014; Germain et al., 2013). The linear assumption
can be relaxed and extended to the non-linear setting using the kernel trick, leading to a reweighting
scheme that can be efficiently solved via quadratic programming (Gong et al., 2013). Recently, due to theavailability of rich data and powerful computational resources, non-linear representations and hypothesis
classes have been increasingly explored (Ajakan et al., 2014; Baktashmotlagh et al., 2013; Chen et al.,2012; Ganin et al., 2016; Glorot et al., 2011). This line of work focuses on building common and robustfeature representations among multiple domains using either supervised neural networks (Glorot et al.,2011), or unsupervised pretraining using denoising auto-encoders (Vincent et al., 2008, 2010).
Recent studies have shown that deep neural networks can learn more transferable features for DA (Donahue et al., 2014; Glorot et al., 2011; Yosinski et al., 2014). Bousmalis et al. (2016) develop domain
separation networks to extract image representations that are partitioned into two subspaces: domain privatecomponent and cross-domain shared component. The partitioned representation is utilized to reconstruct
the images from both domains, improving the DA performance. Reference (Long et al., 2015) enables
classifier adaptation by learning the residual function with reference to the target classifier. The main-taskof this work is limited to the classification problem. Ganin et al. (2016) propose a domain-adversarial neural34

network to learn the domain indiscriminate but main-task discriminative features. Although these works
generally outperform non-deep learning based methods, they only focus on the single-source-single-target
DA problem, and much work is rather empirical design without statistical guarantees. Hoffman et al. (2012)
present a domain transform mixture model for multisource DA, which is based on non-deep architecturesand is difficult to scale up.
Adversarial training techniques that aim to build feature representations that are indistinguishable
between source and target domains have been proposed in the last few years (Ajakan et al., 2014; Ganin
et al., 2016). Specifically, one of the central ideas is to use neural networks, which are powerful function
approximators, to approximate a distance measure known as the H-divergence between two domains (BenDavid et al., 2007, 2010; Kifer et al., 2004). The overall algorithm can be viewed as a zero-sum two-player
game: one network tries to learn feature representations that can fool the other network, whose goal is
to distinguish representations generated from the source domain between those generated from the target
domain. The goal of the algorithm is to find a Nash-equilibrium of the game, or the stationary point of
the min-max saddle point problem. Ideally, at such equilibrium state, feature representations from thesource domain will share the same distributions as those from the target domain, and, as a result, better
generalization on the target domain can be expected by training models using only labeled instances fromthe source domain.

3.7

ProofsIn this section we provide all the missing proofs in Sec. 3.3. To make it easier to follow, in each part weshall first restate the corresponding theorems in Sec. 3.3 and then provide the proofs.

3.7.1

Proof of Corollary 3.3.1

Corollary 3.3.1 (Worst case classification bound). Let H be a hypothesis class with VCdim(H) = d. If
b T and {Db S }k are the empirical distributions generated with m i.i.d. samples from each domain, then,D
i i =1for 0 < δ < 1, with probability at least 1 − δ, for all h ∈ H, we have:
s 

!

k
m
1
1
bT ; Db S ) + λi + O
log + d log,(3.2)
ε T (h) ≤ max b
ε Si ( h ) + d H ∆ H ( D
i
2
m
δ
d
i ∈[k ]
where λi is the combined risk of the optimal hypothesis on domains Si and T.
Proof. For each one of the k source domain, from Thm. 4.2.1, for ∀δ > 0, w.p.b ≥ 1 − δ/k, we have thefollowing inequality hold:
!
r
1
d
log
(
m/d
)
+
log
(
k/δ
)
bS , Db T ) + λi + O
ε T (h) ≤ b
ε Si ( h ) + d H ∆ H ( D
i
2
m

35

Using a union bound argument, we have:
s 


!!
1
1
k
m
bT ; Db S ) + λi + O
Pr ε T (h) > max b
log + d log
ε Si ( h ) + d H ∆ H ( D
i
2
m
δ
d
i ∈[k ]


s 
!

_
1
1
k
m
bT ; Db S ) + λi + Oε T (h) > b
ε Si ( h ) + d H ∆ H ( D≤ Pr 
log + d log
i
2
m
δ
d
i ∈[k ]
s 
!!
1
1
k
m
bT ; Db S ) + λi + O≤ ∑ Pr ε T (h) > bε Si (h) + dH∆H (Dlog + d log
i
2
m
δ
d
i ∈[k ]≤ ∑ δ/k = δi ∈[k ]



which completes the proof.

3.7.2

Proof of Theorem 3.3.1

Theorem 3.3.1 (Average case classification bound). Let H be a hypothesis class with VCdim(H) = d.
b S }k are the empirical distributions generated with m i.i.d. samples from each domain, and DbT
If {Di i =1is the empirical distribution on the target domain generated from mk samples without labels, then, ∀α ∈Rk+ , ∑i∈[k] αi = 1, and for 0 < δ < 1, w.p.b. at least 1 − δ, for all h ∈ H, we have:
1bT ; Db S ) + λα + O
ε T ( h ) ≤ ∑ αi bε Si ( h ) + d H ∆ H ( Di2i ∈[k ]

s

1
km



1
km
log + d log
δ
d

!

,

(3.3)

where λα is the risk of the optimal hypothesis on the mixture source domain ∑i∈[k] αi Si and T.
Proof. Consider a mixture distribution of the k source domains where the mixture weight is given by α.
Denote it as DS̃ := ∑i∈[k] αi DSi . Let S̃ be the combined samples from k domains, then equivalently S̃ canbe seen as a sample of size km sampled i.i.d. from DS̃ . Apply Thm. 3.2.1 using D T as the target domain
and DS̃ as the source domain, we know that for 0 < δ < 1, w.p.b. at least 1 − δ,
!
r
1
d
log
(
km/d
)
+
log
(
1/δ
)
b ,D
b T ) + λα + O
ε T (h) ≤ b
ε S̃ (h) + dH∆H (D
.
(3.8)
S̃
2
km
On the other hand, for ∀h ∈ H, we have:b
ε S̃ (h) = ∑ αib
ε Si ( h ) ,i ∈[k ]36

b ,Db T ) as follows:
and we can upper bound dH∆H (DS̃b ,Db T ) = 2 sup | Pr( A) − Pr( A)|dH ∆H ( DS̃bA∈AH∆H DS̃bTD= 2 sup | ∑ αi ( Pr ( A) − Pr( A))|A∈AH∆H i ∈[k ]

bS
D
i

bT
D

A∈AH∆H i ∈[k]SiT( A) − Pr( A)|∑ αi | DPrbbD≤ 2 sup≤ 2 ∑ αi sup | Pr ( A) − Pr( A)|i ∈[k ]bS
A∈AH∆H DibTDb T ),bS , D= ∑ αi d H ∆H ( Dii ∈[k]

where the first inequality is due to the triangle inequality and the second inequality is by the subb ,DbT )ε S̃ (h) with ∑i∈[k] αibε Si (h) and upper bound dH∆H (Dadditivity of the sup function. Replace b
S̃bS , Db T ) in (3.8) completes the proof.
by ∑i∈[k] αi dH∆H (D

i

3.7.3

Proof of Theorem 3.3.2

Before we give a full proof, we first describe the proof strategy at a high level. Roughly, the proof
contains three parts. The first part contains a reduction from regression to classification by relating thepseudo-dimension of the hypothesis class H and its corresponding threshold binary classifiers. The second
part uses H-divergence to relate the source and target domains when they differ. The last part uses standard
generalization analysis with pseudo-dimension for regression, when the source and target domains coincide.
First Part of the Proof
To begin with, let H = { h : X → [0, 1]} be a set of bounded real-valued functions from the input space X
to [0, 1]. We use Pdim(H) to denote the pseudo-dimension of H, and let Pdim(H) = d. We first prove
the following lemma that will be used in proving the main theorem:
Lemma 3.7.1. For h, h0 ∈ H := {h : X → [0, 1]}, where Pdim(H) = d, and for any distribution DS ,DT over X ,1|ε S (h, h0 ) − ε T (h, h0 )| ≤ dH̄ (DS , DT )20
where H̄ := {I|h(x)−h0 (x)|>t : h, h ∈ H, 0 ≤ t ≤ 1}.
Proof. By definition, for ∀h, h0 ∈ H, we have:|ε S (h, h0 ) − ε T (h, h0 )| ≤ sup |ε S (h, h0 ) − ε T (h, h0 )|h,h0 ∈H= sup Ex∼S [|h(x) − h0 (x)|] − Ex∼T [|h(x) − h0 (x)|] .

(3.9)

h,h0 ∈H

Since k hk∞ ≤ 1, ∀h ∈ H, then 0 ≤ |h(x) − h0 (x)| ≤ 1, ∀x ∈ X , h, h0 ∈ H. We now use Fubini’s

37

theorem to bound Ex∼S [|h(x) − h0 (x)|] − Ex∼T [|h(x) − h0 (x)|] :Ex∼S [|h(x) − h0 (x)|]−Ex∼T [|h(x) − h0 (x)|]

Z 1
0
0
=
Pr(|h(x) − h (x)| > t) − Pr(|h(x) − h (x)| > t) dt

≤

0

T

S

0

Z 1

Pr(|h(x) − h0 (x)| > t) − Pr(|h(x) − h0 (x)| > t) dt
TS≤ sup Pr(|h(x) − h (x)| > t) − Pr(|h(x) − h0 (x)| > t) .
t∈[0,1]0

S

T

Now in view of (4.6) and H̄, we have:sup sup Pr(|h(x) − h0 (x)| > t) − Pr(|h(x) − h0 (x)| > t)h,h0 ∈H t∈[0,1]TS= sup | Pr(h̄(x) = 1) − Pr(h̄(x) = 1)|
h̄∈H̄

T

S

= sup | Pr( A) − Pr( A)|
A∈AH̄

S

T

1
= dH̄ (DS , DT ).
2
Combining all the inequalities above finishes the proof.

Next we bound Pdim(|H − H|):
Lemma 3.7.2. If Pdim(H) = d, then Pdim(|H − H|) ≤ 2d.
Proof. By the definition of pseudo-dimension, we immediately have VCdim(H̄) = Pdim(|H − H|).
Next observe that each function g ∈ H̄ could be represented as a two layer linear threshold neural network,with two hidden units, one bias input unit and one output unit. Specifically, since|h(x) − h0 (x)| > t ⇐⇒ max{h(x) − h0 (x) − t, h0 (x) − h(x) − t} > 0,
which is also equivalent tosgn(h(x) − h0 (x) − t) + sgn(h0 (x) − h(x) − t) > 0.

(3.10)

The above expression can then be implemented by a two layer one output linear threshold neural network.
Hence from (Anthony and Bartlett, 2009, Chapter 6, 8), the VC dimension of H̄ is at most twice of thepseudo-dimension of H, completing the proof.
Second Part of the Proof
One technical lemma we will frequently use is the triangular inequality w.r.t. ε D (h), ∀h ∈ H:
Lemma 3.7.3. For any hypothesis class H and any distribution D on X , the following triangular inequality
holds:∀h, h0 , f ∈ H, ε D (h, h0 ) ≤ ε D (h, f ) + ε D ( f , h0 ),38

Proof.
ε D (h, h0 ) = Ex∼D [|h(x) − h0 (x)|] ≤ Ex∼D [|h(x) − f (x)| + | f (x) − f (x)|] = ε D (h, f ) + ε D ( f , h0 ).


Now we prove the following lemma in the regression setting when there is only one source domain and
one target domain.
Lemma 3.7.4. Let H be a set of real-valued function from X to [0, 1], and DS , D T be the source andtarget distributions, respectively. Define H̄ := {I|h(x)−h0 (x)|>t : h, h0 ∈ H, 0 ≤ t ≤ 1}. Then ∀h ∈ H,
the following inequality holds:
1
ε T (h) ≤ ε S (h) + dH̄ (D T ; DS ) + λ,2where λ := infh0 ∈H ε S (h0 ) + ε T (h0 ).
Proof. Let h∗ := arg minh0 ∈H ε S (h0 ) + ε T (h0 ). For ∀h ∈ H:
ε T (h) ≤ ε T (h∗ ) + ε T (h, h∗ )= ε T (h∗ ) + ε T (h, h∗ ) − ε S (h, h∗ ) + ε S (h, h∗ )≤ ε T (h∗ ) + |ε T (h, h∗ ) − ε S (h, h∗ )| + ε S (h, h∗ )1
≤ ε T (h∗ ) + ε S (h, h∗ ) + dH̄ (DT , DS )2
1∗
≤ ε T (h ) + ε S (h) + ε S (h∗ ) + dH̄ (DT , DS )2
1
= ε S (h) + dH̄ (DT ; DS ) + λ.
2

The first and fourth inequalities are by the triangle inequality, and the third one is from Lemma. 3.7.1. 
Third Part of the Proof
In this part of the proof, we use concentration inequalities to bound the source domain error ε S (h) and thedivergence dH̄ (D T ; DS ) in Lemma 3.7.4.
We first introduce the following generalization theorem in the regression setting when the source andtarget distributions are the same:
Lemma 3.7.5 (Thm. 10.6, (Mohri et al., 2012)). Let H be a family of real-valued functions from X to[0, 1]. Assume that Pdim(H) = d. Then, for ∀δ > 0, w.p.b. at least 1 − δ over the choice of a sample ofsize m, the following inequality holds for all h ∈ H:
s 
!
1
1
m
ε(h) ≤ bε(h) + O
log + d log.
mδdThe next lemma bounds the H-divergence between the population distribution and its corresponding
empirical distribution:

39

Lemma 3.7.6. Let DS and D T be the source and target distribution over X , respectively. Let H be a classof real-valued functions from X to [0, 1], with Pdim(H) = d. Define H̄ := {I|h(x)−h0 (x)|>t : h, h0 ∈H, 0 ≤ t ≤ 1}. If S and T are the empirical distributions of DS and DT generated with m i.i.d. samples
from each domain, then, for 0 < δ < 1, w.p.b. at least 1 − δ, we have:
s 
!
1
1
m
.
dH̄ (DS ; D T ) ≤ dH̄ (S; T ) + O
log + d logmδdProof. By the definition of pseudo-dimension, we have VCdim(H̄) = Pdim(|H − H|). Now from
Lemma 3.7.2, Pdim(|H − H|) ≤ 2Pdim(H) = 2d, so VCdim(H̄) ≤ 2d. The lemma then follows
from Ben-David et al. (2010, Lemma 1) using standard concentration inequality.

Proof of the Generalization Bound under Regression Setting
We prove the following generalization bound for regression problem when there is only one source domain
and one target domain. The extension to multiple source domains follows exactly as the proof of Thm. 3.3.1,
hence we omit here.
b S (DbT )Theorem 3.7.1. Let H be a set of real-valued function from X to [0, 1] with Pdim(H) = d. Let D
be the empirical distribution induced by sample of size m drawn from DS (D T ). Then w.p.b. at least 1 − δ,∀ h ∈ H,
!
r
1
d
log
(
m/d
)
+
log
(
1/δ
)
bS, D
bT ) + λ + O
ε T (h) ≤ b
ε S (h) + dH̄ (D(3.11)
2m
where λ = infh0 ∈H ε S (h0 ) + ε T (h0 ) and H̄ := {I|h(x)−h0 (x)|>t : h, h0 ∈ H, 0 ≤ t ≤ 1}.
Proof. Combine Lemma 3.7.4, Lemma 3.7.5 and Lemma 3.7.6 using union bound finishes the proof.

3.8

Conclusion

In this chapter we theoretically analyze generalization bounds for DA under the setting of multiple source
domains with labeled instances and one target domain with unlabeled instances. Specifically, we propose
average case generalization bounds for both classification and regression problems. The new bounds haveinteresting interpretations and the one for classification reduces to an existing bound when there is only one
source domain. Following our theoretical results, we propose two MDAN to learn feature representations
that are invariant under multiple domain shifts while at the same time being discriminative for the learning
task. Both hard and soft versions of MDAN are generalizations of the popular DANN to the case when
multiple source domains are available. Empirically, MDAN outperforms the state-of-the-art DA methods on
three real-world datasets, including a sentiment analysis task, a digit classification task, and a visual vehicle
counting task, demonstrating its effectiveness in multisource domain adaptation for both classification andregression problems.

40

Appendix
In this section we describe more details about the datasets and the experimental settings. We extensively
evaluate the proposed methods on three datasets:
1. We first evaluate our methods on Amazon Reviews dataset (Chen et al., 2012) for sentiment analysis.
2. We evaluate the proposed methods on the digits classification datasets including MNIST (LeCunet al., 1998b), MNIST-M (Ganin et al., 2016), SVHN (Netzer et al., 2011), and SynthDigits (Ganin
et al., 2016).
3. We further evaluate the proposed methods on the public dataset WebCamT (Zhang et al., 2017a) for
vehicle counting. It contains 60,000 labeled images from 12 city cameras with different distributions.
Due to the substantial difference between these datasets and their corresponding learning tasks, wewill introduce more detailed dataset description, network architecture, and training parameters foreach dataset respectively in the following subsections.

3.A

Details on Amazon Reviews Evaluation

Amazon reviews dataset includes four domains, each one composed of reviews on a specific kind of product(Books, DVDs, Electronics, and Kitchen appliances). Reviews are encoded as 5000 dimensional feature
vectors of unigrams and bigrams. The labels are binary: 0 if the product is ranked up to 3 stars, and 1 if the
product is ranked 4 or 5 stars.
We take one product domain as target and the other three as source domains. Each source domain has
2000 labeled examples and the target test set has 3000 to 6000 examples. We implement the Hard-Max
and Soft-Max methods based on a basic network with one input layer (5000 units) and three hidden layers(1000, 500, 100 units). The network is trained for 50 epochs with dropout rate 0.7. We compare Hard-Max
and Soft-Max with three baselines: Baseline 1: MLPNet. It is the basic network of our methods (one input
layer and three hidden layers), trained for 50 epochs with dropout rate 0.01. Baseline 2: Marginalized
Stacked Denoising Autoencoders (mSDA) (Chen et al., 2012). It takes the unlabeled parts of both source
and target samples to learn a feature map from input space to a new representation space. As a denoising
autoencoder algorithm, it finds a feature representation from which one can (approximately) reconstruct theoriginal features of an example from its noisy counterpart. Baseline 3: DANN. We implement DANN basedon the algorithm described in (Ganin et al., 2016) with the same basic network as our methods. Hyperparameters of the proposed and baseline methods are selected by cross validation. Table 3.A.1 summarizes
the network architecture and some hyper parameters.
To validate the statistical significance of the results, we run a non-parametric Wilcoxon signed-ranked
test for each task to compare Soft-Max with the other competitors, as shown in Table 3.A.2. Each cellcorresponds to the p-value of a Wilcoxon test between Soft-Max and one of the other methods, under thenull hypothesis that the two paired samples have the same mean. From these p-values, we see Soft-Max isconvincingly better than other methods.
41

Table 3.A.1: Network parameters for proposed and baseline methods
MethodInput layer

Hidden layers

EpochsDropout

Domains

Adaptation weightfl

MLPNet
DANN
MDAN

5000
5000
5000

(1000, 500, 100)
(1000, 500, 100)
(1000, 500, 100)

50
50
50

0.01
0.01
0.7

N/A
1
3

N/A
0.01
0.1

N/A
N/A
10

Table 3.A.2: p-values under Wilcoxon test.

B
D
E
K

3.B

MLPNetmSDA

Best-Single-DANN

Combine-DANN

Hard-Max

Soft-Max

Soft-Max

Soft-Max

Soft-Max

Soft-Max

0.550
0.000
0.066
0.306

0.101
0.072
0.000
0.001

0.521
0.000
0.097
0.001

0.013
0.051
0.150
0.239

0.946
0.000
0.022
0.008

Details on Digit Datasets Evaluation

We evaluate the proposed methods on the digits classification problem. Following the experiments in(Ganin et al., 2016), we combine four popular digits datasets-MNIST, MNIST-M, SVHN, and SynthDigits
to build the multi-source domain dataset. MNIST is a handwritten digits database with 60, 000 training
examples, and 10, 000 testing examples. The digits have been size-normalized and centered in a 28 × 28
image. MNIST-M is generated by blending digits from the original MNIST set over patches randomly
extracted from color photos from BSDS500 (Arbelaez et al., 2011; Ganin et al., 2016). It has 59, 001
training images and 9, 001 testing images with 32 × 32 resolution. An output sample is produced by taking
a patch from a photo and inverting its pixels at positions corresponding to the pixels of a digit. For DA
problems, this domain is quite distinct from MNIST, for the background and the strokes are no longer
constant. SVHN is a real-world house number dataset with 73, 257 training images and 26, 032 testing
images. It can be seen as similar to MNIST, but comes from a significantly harder, unsolved, real world
problem. SynthDigits consists of 500; 000 digit images generated by Ganin et al. (2016) from WindowsTM
fonts by varying the text, positioning, orientation, background and stroke colors, and the amount of blur.
The degrees of variation were chosen to simulate SVHN, but the two datasets are still rather distinct, withthe biggest difference being the structured clutter in the background of SVHN images.
We take MNIST-M, SVHN, and MNIST as target domain in turn, and the remaining three as sources.
We implement the Hard-Max and Soft-Max versions according to Alg. 1 based on a basic network, asshown in Fig. 3.B.1. The baseline methods are also built on the same basic network structure to put themon a equal footing. The network structure and parameters of MDAN are illustrated in Fig. 3.B.1. The
learning rate is initialized by 0.01 and adjusted by the first and second order momentum in the training
process. The domain adaptation parameter of MDAN is selected by cross validation. In each mini-batch of
MDAN training process, we randomly sample the same number of unlabeled target images as the numberof the source images.

42Figure 3.B.1: MDAN network architecture for digit classification

3.C

Details on WebCamT Vehicle Counting

WebCamT is a public dataset for large-scale city camera videos, which have low resolution (352 × 240),
low frame rate (1 frame/second), and high occlusion. WebCamT has 60, 000 frames annotated with richinformation: bounding box, vehicle type, vehicle orientation, vehicle count, vehicle re-identification, andweather condition. The dataset is divided into training and testing sets, with 42,200 and 17,800 frames,
respectively, covering multiple cameras and different weather conditions. WebCamT is an appropriate
dataset to evaluate domain adaptation methods, for it covers multiple city cameras and each camera islocated in different intersection of the city with different perspectives and scenes. Thus, each camera
data has different distribution from others. The dataset is quite challenging and in high demand of
domain adaptation solutions, as it has 6, 000, 000 unlabeled images from 200 cameras with only 60, 000
labeled images from 12 cameras. The experiments on WebCamT provide an interesting application of our
proposed MDAN: when dealing with spatially and temporally large-scale dataset with much variations, it isprohibitively expensive and time-consuming to label large amount of instances covering all the variations.
As a result, only a limited portion of the dataset can be annotated, which can not cover all the data domains
in the dataset. MDAN provide an effective solution for this kind of application by adapting the deep modelfrom multiple source domains to the unlabeled target domain.
We evaluate the proposed methods on different numbers of source cameras. Each source camera
provides 2000 labeled images for training and the test set has 2000 images from the target camera. In eachmini-batch, we randomly sample the same number of unlabeled target images as the source images. We
implement the Hard-Max and Soft-Max version of MDAN according to Alg. 1, based on the basic vehicle
counting network FCN described in (Zhang et al., 2017a). Please refer to (Zhang et al., 2017a) for detailed
network architecture and parameters. The learning rate is initialized by 0.01 and adjusted by the first andsecond order momentum in the training process. The domain adaptation parameter is selected by crossvalidation. We compare our method with two baselines: Baseline 1: FCN. It is our basic network without
domain adaptation as introduced in work (Zhang et al., 2017a). Baseline 2: DANN. We implement DANN
on top of the same basic network following the algorithm introduced in work (Ganin et al., 2016).

43

Figure 3.C.1: Locations of the source&target camera map.

44

Chapter 4

Learning Invariant Representations for
Domain Adaptation
Due to the ability of deep neural nets to learn rich representations, recent advances in unsupervised domain
adaptation have focused on learning domain-invariant features that achieve a small error on the source
domain. The hope is that the learnt representation, together with the hypothesis learnt from the source
domain, can generalize to the target domain. In this chapter, we first construct a simple counterexample
showing that, contrary to common belief, the above conditions are not sufficient to guarantee successfuldomain adaptation. In particular, the counterexample exhibits conditional shift: the class-conditional
distributions of input features change between source and target domains. To give a sufficient condition
for domain adaptation, we propose a natural and interpretable generalization upper bound that explicitly
takes into account the aforementioned shift. Moreover, we shed new light on the problem by proving an
information-theoretic lower bound on the joint error of any domain adaptation method that attempts tolearn invariant representations. Our result characterizes a fundamental tradeoff between learning invariant
representations and achieving small joint error on both domains when the marginal label distributions
differ from source to target. Finally, we conduct experiments on real-world datasets that corroborate ourtheoretical findings.

45

4.1

Introduction

The recent successes of supervised deep learning methods have been partially attributed to rich datasets
and increasing computational power. However, in many critical applications, e.g., self-driving cars or
personal healthcare, it is often prohibitively expensive and time-consuming to collect large-scale supervised
training data. Unsupervised domain adaptation (DA) focuses on such limitations by trying to transfer
knowledge from a labeled source domain to an unlabeled target domain, and a large body of work tries toachieve this by exploring domain-invariant structures and representations to bridge the gap. Theoreticalresults (Ben-David et al., 2010; Mansour and Schain, 2012; Mansour et al., 2009a) and algorithms (Adelet al., 2017; Ajakan et al., 2014; Becker et al., 2013; Glorot et al., 2011; Pei et al., 2018) under this setting
are abundant.
Due to the ability of deep neural nets to learn rich feature representations, recent advances in domain
adaptation have focused on using these networks to learn invariant representations, i.e., intermediate
features whose distribution is the same in source and target domains, while at the same time achieving
small error on the source domain. The hope is that the learnt intermediate representation, together withthe hypothesis learnt using labeled data from the source domain, can generalize to the target domain.
Nevertheless, from a theoretical standpoint, it is not at all clear whether aligned representations and small
source error are sufficient to guarantee good generalization on the target domain. In fact, despite being
successfully applied in various applications (Hoffman et al., 2017b; Zhang et al., 2017b), it has also
been reported that such methods fail to generalize in certain closely related source/target pairs, e.g., digitclassification from MNIST to SVHN (Ganin et al., 2016).
Given the wide application of domain adaptation methods based on learning invariant representations,
we attempt in this chapter to answer the following important and intriguing question:
Is finding invariant representations while at the same time achieving a small source error
sufficient to guarantee a small target error? If not, under what conditions is it?
Contrary to common belief, we give a negative answer to the above question by constructing a simple
example showing that these two conditions are not sufficient to guarantee target generalization, even in
the case of perfectly aligned representations between the source and target domains. In fact, our example
shows that the objective of learning invariant representations while minimizing the source error can actually
be hurtful, in the sense that the better the objective, the larger the target error. At a colloquial level, thishappens because learning invariant representations can break the originally favorable underlying problem
structure, i.e., close labeling functions and conditional distributions. To understand when such methods
work, we propose a generalization upper bound as a sufficient condition that explicitly takes into accountthe conditional shift between source and target domains. The proposed upper bound admits a naturalinterpretation and decomposition in domain adaptation; we show that it is tighter than existing results incertain cases.
Simultaneously, to understand what the necessary conditions for representation based approaches
to work are, we prove an information-theoretic lower bound on the joint error of both domains for any
algorithm based on learning invariant representations. Our result complements the above upper bound andalso extends the constructed example to more general settings. The lower bound sheds new light on thisproblem by characterizing a fundamental tradeoff between learning invariant representations and achieving
small joint error on both domains when the marginal label distributions differ from source to target. Ourlower bound directly implies that minimizing source error while achieving invariant representation will only
increase the target error. We conduct experiments on real-world datasets that corroborate this theoretical
implication. Together with the generalization upper bound, our results suggest that adaptation should bedesigned to align the label distribution as well when learning an invariant representation (c.f. Sec. 4.4.3).
46

g(x) = Ix0 (x) · (x + 1)

target domain+ Ix>0 (x) · (x<latexit sha1_base64="Hk7gK9ZvHZgvlaE6B/70QQwbEHM=">AAADE3icbZHNbtNAEMc35quYj6Zw5LIiapWqIrILUnsBVXCBWxFNUymOovV6kqyyH2Z3TRwsPwZvwFsgLogrD8CZK7wDm9SoicNIK/01v//s7szEKWfGBsHPhnft+o2bt7Zu+3fu3ru/3dx5cG5Upil0qeJKX8TEAGcSupZZDhepBiJiDr14+mrBex9AG6bkmZ2nMBBkLNmIUWJdatjs+eN2vo/3nuNIEDuJ4+JNOSzyiMN7HJQORTRRFrdzfIDDfRxF/t7BuhW/qBmfOKM/bLaCTrAMvCnCSrRQFafDncbnKFE0EyAt5cSYfhikdlAQbRnlUPpRZiAldErG0HdSEgFmUCwnUOJdl0nwSGl3pMXL7GpFQYQxcxE75+Lvps4Wyf+xfmZHx4OCyTSzIOnlQ6OMY6vwYpw4YRqo5XMnCNXM/RXTCdGEWjd0fxevvrO4PSUf1XovgkxBKyVcL0RS4I5KmFElBJFJETGZlMXVwGt0Bmw8sf8Mo2JWN+T5Fczr0KSyopTw4t0mthpgxXFWlm6vYX2Lm+L8sBM+7Ry+fdY6eVlteAs9Qo9RG4XoCJ2g1+gUdRFFX9Ev9Bv98T55X7xv3vdLq9eoah6itfB+/AVVif6u</latexit>

y=1

y=0

target domain

1)

y=1

y=0

x
1

0.5
0
y=0
y=1

0.5

1

1.5

x

2

1

0.5

0

0.5
y=0

source domain

1

1.5

2

y=1

source domain

Figure 4.1.1: A counterexample where invariant representations lead to large joint error on source and target
domains. Before transformation of g(·), h∗ ( x ) = 1 iff x ∈ (−1/2, 3/2) achieves perfect classification on
both domains. After transformation, source and target distributions are perfectly aligned, but no hypothesis
can achieve a small joint error.
We believe these insights will be helpful to guide the future design of domain adaptation and representation
learning algorithms.

4.2

Preliminaries

We first review a theoretical model for domain adaptation (DA) (Ben-David et al., 2007, 2010; Blitzer et al.,2008; Kifer et al., 2004).

4.2.1

Problem Setup

We consider the unsupervised domain adaptation problem where the learning algorithm has access toa set of n labeled points {(xi , yi )}in=1 ∈ (X × Y )n sampled i.i.d. from the source domain and a set ofm sampled i.i.d. from the target domain. At a colloquial level, the goal
unlabeled points {x j }m
j =1 ∈ X
of an unsupervised domain adaptation algorithm is to generalize well on the target domain by learningfrom labeled samples from the source domain as well as unlabeled samples from the target domain.
Formally, let the risk of hypothesis h be the error of h w.r.t. the true labeling function under domain DS ,i.e., ε S (h) := ε S (h, f S ). As commonly used in computational learning theory, we denote by bε S (h) theempirical risk of h on the source domain. Similarly, we use ε T (h) and b
ε T (h) to mean the true risk and theempirical risk on the target domain. The problem of domain adaptation considered in this chapter can bestated as: under what conditions and by what algorithms can we guarantee that a small training error b
ε S (h)implies a small test error ε T (h)? Clearly, this goal is not always possible if the source and target domains
are far away from each other.

4.2.2

A Theoretical Model for Domain Adaptation

To measure the similarity between two domains, it is crucial to define a discrepancy measure between
them. To this end, Ben-David et al. (2010) proposed the H-divergence to measure the distance between
two distributions:Definition 4.2.1 (H-divergence). Let H be a hypothesis class on input space X , and AH be the collectionof subsets of X that are the support of some hypothesis in H, i.e., AH := { h−1 (1) | h ∈ H}. The distance
between two distributions D and D 0 based on H is: dH (D , D 0 ) := sup A∈AH | PrD ( A) − PrD 0 ( A)|. 1
1 To be precise, Ben-David et al. (2007)’s original definition of H-divergence has a factor of 2, we choose the current definition

as the constant factor is inessential.

47

H-divergence is particularly favorable in the analysis of domain adaptation with binary classification
problems, and it had also been generalized to the discrepancy distance (Cortes and Mohri, 2014; Cortes
et al., 2008; Mansour et al., 2009a,c) for general loss functions, including the one for regression problems.
Both H-divergence and the discrepancy distance can be estimated using finite unlabeled samples from both
domains when H has a finite VC-dimension.
One flexibility of the H-divergence is that its power on measuring the distance between two distributions
can be controlled by the richness of the hypothesis class H. To see this, first consider the situation where
H is very restrictive so that it only contains the constant functions h ≡ 0 and h ≡ 1. In this case, it canbe readily verified by the definition that dH (D , D 0 ) = 0, ∀ D , D 0 . On the other extreme, if H contains
all the measurable binary functions, then dH (D , D 0 ) = 0 iff D(·) = D 0 (·) almost surely. In this case theH-divergence reduces to the total variation, or equivalently the L1 distance, between the two distributions.
Given a hypothesis class H, we define its symmetric difference w.r.t. itself as: H ∆H = { h(x) ⊕ h0 (x) |h, h0 ∈ H}, where ⊕ is the xor operation. Let h∗ be the optimal hypothesis that achieves the minimum
joint risk on both the source and target domains: h∗ := arg minh∈H ε S (h) + ε T (h), and let λ∗ denotethe joint risk of the optimal hypothesis h∗ : λ∗ := ε S (h∗ ) + ε T (h∗ ). Ben-David et al. (2007) proved thefollowing generalization bound on the target risk in terms of the empirical source risk and the discrepancy
between the source and target domains:b S (resp.
Theorem 4.2.1 (Ben-David et al. (2007)). Let H be a hypothesis space of VC-dimension d and Db T ) be the empirical distribution induced by a sample of size n drawn from DS (resp. D T ). Then w.p. atDleast 1 − δ, ∀h ∈ H,
!
r
1
d
log
n
+
log
(
1/δ
)
bS, D
b T ) + λ∗ + O
ε T (h) ≤ b
ε S ( h ) + dH ∆H ( D
.
(4.1)
2
n
The bound depends on λ∗ , the optimal joint risk that can be achieved by the hypotheses in H. The
intuition is the following: if λ∗ is large, we cannot hope for a successful domain adaptation. Later inSec. 4.4.3, we shall get back to this term to show an information-theoretic lower bound on it for any
approach based on learning invariant representations.
Theorem 4.2.1 is the foundation of many recent works on unsupervised domain adaptation via learning
invariant representations (Ajakan et al., 2014; Ganin et al., 2016; Pei et al., 2018; Zhao et al., 2018b,c).
It has also inspired various applications of domain adaptation with adversarial learning, e.g., video
analysis (Hoffman et al., 2016, 2017b; Shrivastava et al., 2016; Tzeng et al., 2017), natural language
understanding (Fu et al., 2017; Zhang et al., 2017b), speech recognition (Hosseini-Asl et al., 2018; Zhao
et al., 2019g), to name a few.
At a high level, the key idea is to learn a rich and parametrized feature transformation g : X 7→ Z suchthat the induced source and target distributions (on Z ) are close, as measured by the H-divergence. Weggggcall g an invariant representation w.r.t. H if dH (DS , D T ) = 0, where DS /D T is the induced source/target
distribution. At the same time, these algorithms also try to find new hypothesis (on the representation spaceZ ) to achieve a small empirical error on the source domain. As a whole algorithm, these two procedures
corresponds to simultaneously finding invariant representations and hypothesis to minimize the first two
terms in the generalization upper bound of Theorem 4.2.1.

4.3

Related WorkA number of adaptation approaches based on learning invariant representations have been proposed inrecent years. Although in this chapter we mainly focus on using the H-divergence to characterize the48

discrepancy between two distributions, other distance measures can be used as well, e.g., the maximum
mean discrepancy (MMD) (Long et al., 2014, 2015, 2016), the Wasserstein distance (Courty et al., 2017a,b;
Lee and Raginsky, 2018; Shen et al., 2018), etc.
Under the theoretical framework of the H-divergence, Ganin et al. (2016) propose a domain adversarial
neural network (DANN) to learn the domain invariant features. Adversarial training techniques that aim
to build feature representations that are indistinguishable between source and target domains have been
proposed in the last few years (Ajakan et al., 2014; Ganin et al., 2016). Specifically, one of the central ideas
is to use neural networks, which are powerful function approximators, to approximate the H-divergence
between two domains (Ben-David et al., 2007, 2010; Kifer et al., 2004). The overall algorithm can beviewed as a zero-sum two-player game: one network tries to learn feature representations that can fool
the other network, whose goal is to distinguish the representations generated on the source domain fromthose generated on the target domain. In a concurrent work, Johansson et al. (2019) also identified theinsufficiency of learning domain-invariant representation for successful adaptation. They further analyzed
the information loss of non-invertible transformations, and proposed a generalization upper bound that
directly takes it into account. In our work, by showing an information-theoretic lower bound on the
joint error of these methods, we show that although invariant representations can be achieved, it does notnecessarily translate to good generalization on the target domain, in particular when the label distributionsof the two domains differ significantly.
Causal approaches based on conditional and label shifts for domain adaptation also exist (Azizzadenesheli et al., 2018; Gong et al., 2016; Lipton et al., 2018; Zhang et al., 2013). One typical assumption
made to simplify the analysis in this line of work is that the source and target domains share the samegenerative distribution and only differ at the marginal label distributions. It is worth noting that Zhang et al.
(2013) and Gong et al. (2016) showed that both label and conditional shift can be successfully corrected
when the changes in the generative distribution follow some parametric families. In this chapter we focus
on representation learning and do not make such explicit assumptions.

4.4

Theoretical Analysis

Is finding invariant representations alone a sufficient condition for the success of domain adaptation?
Clearly it is not. Consider the following simple counterexample: let gc : X 7→ Z be a constant function,
where ∀x ∈ X , gc (x) = c ∈ Z . Then for any discrepancy distance d(·, ·) over two distributions, including
the H-divergence, MMD, and the Wasserstein distance, and for any distributions DS , D T over the inputgggg
space X , we have d(DSc , D Tc ) = 0, where we use DSc (resp. D Tc ) to mean the induced source (resp.
target) distribution by the transformation gc over the representation space Z . Furthermore, it is fairly
easy to construct source and target domains hDS , f S i, hD T , f T i, such that for any hypothesis h : Z 7→ Y ,ε T (h ◦ gc ) ≥ 1/2, while there exists a classification function f : X → Y that achieves small error, e.g.,
the labeling function.
One may argue, with good reason, that in the counterexample above, the empirical source errorbε S (h ◦ gc ) is also large with high probability. Intuitively, this is because the simple constant transformation
function gc fails to retain the discriminative information about the classification task at hand, despite thefact that it can construct invariant representations.
Is finding invariant representations and achieving a small source error sufficient to guarantee small
target error? In this section we first give a negative answer to this question by constructing a counterexample
where there exists a nontrivial transformation function g : X 7→ Z and hypothesis h : Z 7→ Y suchggthat both ε S (h ◦ g) and dH∆H (DS , D T ) are small, while at the same time the target error ε T (h ◦ g) islarge. Motivated by this negative result, we proceed to prove a generalization upper bound that explicitly
49characterizes a sufficient condition for the success of domain adaptation. We then complement the upperbound by showing an information-theoretic lower bound on the joint error of any domain adaptation
approach based on learning invariant representations.

4.4.1

Invariant Representation and Small Source Risk are Not Sufficient

In this section, we shall construct a simple 1-dimensional example where there exists a function h∗ : R 7→
{0, 1} that achieves zero error on both source and target domains. Simultaneously, we show that there
exists a transformation function g : R 7→ R under which the induced source and target distributions are
perfectly aligned, but every hypothesis h : R 7→ {0, 1} incurs a large joint error on the induced source andtarget domains. The latter further implies that if we find a hypothesis that achieves small error on the source
domain, then it has to incur a large error on the target domain. We illustrate this example in Fig. 4.1.1.
Let X = Z = R and Y = {0, 1}. For a ≤ b, we use U ( a, b) to denote the uniform distribution over[ a, b]. Consider the following source and target domains:(
0, x ≤ −1/2
DS = U (−1, 0),
f S (x) =1, x > −1/2(0, x ≥ 3/2
DT = U (1, 2),
f T (x) =1, x < 3/2
In the above example, it is easy to verify that the interval hypothesis h∗ ( x ) = 1 iff x ∈ (−1/2, 3/2)
achieves perfect classification on both domains.
Now consider the following transformation:g ( x ) = I x ≤0 ( x ) · ( x + 1 ) + I x >0 ( x ) · ( x − 1 ).
Since g(·) is a piecewise linear function, it follows that DSZ = D TZ = U (0, 1), and for any distance metricd(·, ·) over distributions, we have d(DSZ , D TZ ) = 0. But now for any hypothesis h : R 7→ {0, 1}, and∀ x ∈ [0, 1], h( x ) will make an error in exactly one of the domains, hence∀h : R 7→ {0, 1},ε S (h ◦ g) + ε T (h ◦ g) = 1.

In other words, under the above invariant transformation g, the smaller the source error, the larger the target
error.
One may argue that this example seems to contradict the generalization upper bound from Theorem 4.2.1, where the first two terms correspond exactly to a small source error and an invariant representation. The key to explain this apparent contradiction lies in the third term of the upper bound, λ∗ , i.e., theoptimal joint error achievable on both domains. In our example, when there is no transformation applied tothe input space, we show that h∗ achieves 0 error on both domains, hence λ∗ = minh∈H ε S (h) + ε T (h) = 0.
However, when the transformation g is applied to the original input space, we prove that every hypothesis
has joint error 1 on the representation space, hence λ∗g = 1. Since we usually do not have access to the
optimal hypothesis on both domains, although the generalization bound still holds on the representation
space, it becomes vacuous in our example.
An alternative way to interpret the failure of the constructed example is that the labeling functions (orconditional distributions in the stochastic setting) of source and target domains are far away from eachother in the representation space. Specifically, in the induced representation space, the optimal labeling50

function on the source and target domains are:(0, x ≤ 1/2
0
f S (x) =,1, x > 1/2(
f T0 ( x ) =0,1,

x > 1/2,
x ≤ 1/2

and we have k f S0 − f T0 k1 = Ex∼U (0,1) [| f S0 ( x ) − f T0 ( x )|] = 1.

4.4.2

A Generalization Upper Bound

For most of the practical hypothesis spaces H, e.g., half spaces, it is usually intractable to compute theoptimal joint error λ∗ from Theorem 4.2.1. Furthermore, the fact that λ∗ contains errors from both domains
makes the bound very conservative and loose in many cases. In this section, inspired by the constructed
example from Sec. 4.4.1, we aim to provide a general, intuitive, and interpretable generalization upperbound for domain adaptation that is free of the pessimistic λ∗ term. Ideally, the bound should also explicitly
characterize how the shift between labeling functions of both domains affects domain adaptation.
Because of its flexibility in choosing the witness function class H and its natural interpretation as
adversarial binary classification, we still adopt the H-divergence to measure the discrepancy between two
distributions. For any hypothesis space H, it can be readily verified that dH (·, ·) satisfies the triangle
inequality:dH (D , D 0 ) ≤ dH (D , D 00 ) + dH (D 00 , D 0 ),where D , D 0 , D 00 are any distributions over the same space. We now introduce a technical lemma that will
be helpful in proving results related to the H-divergence:
Lemma 4.4.1. Let H ⊆ [0, 1]X and D , D 0 be two distributions over X . Then ∀h, h0 ∈ H, |ε D (h, h0 ) −ε D 0 (h, h0 )| ≤ dH̃ (D , D 0 ), where H̃ := {sgn(|h(x) − h0 (x)| − t) | h, h0 ∈ H, 0 ≤ t ≤ 1}.
As a matter of fact, the above lemma also holds for any function class H (not necessarily a hypothesis
space) where there exists a constant M > 0, such that k hk∞ ≤ M for all h ∈ H. Another useful lemma is
the following triangle inequality:
Lemma 4.4.2. Let H ⊆ [0, 1]X and D be any distribution over X . For any h, h0 , h00 ∈ H, we haveε D (h, h0 ) ≤ ε D (h, h00 ) + ε D (h00 , h0 ).
Let f S : X → [0, 1] and f T : X → [0, 1] be the optimal labeling functions on the source and target
domains, respectively. In the stochastic setting, f S (x) = PrS (y = 1 | x) corresponds to the optimal Bayesclassifier. With these notations, the following theorem holds:
Theorem 4.4.1. Let hDS , f S i and hD T , f T i be the source and target domains, respectively. For any function
class H ⊆ [0, 1]X , and ∀h ∈ H, the following inequality holds:
ε T (h) ≤ ε S (h) + dH̃ (DS , D T ) + min{EDS [| f S − f T |], EDT [| f S − f T |]}.

Remark The three terms in the upper bound have natural interpretations: the first term is the source error,
the second one corresponds to the discrepancy between the marginal distributions, and the third measuresthe distance between the labeling functions from the source and target domains. Altogether, they form asufficient condition for the success of domain adaptation: besides a small source error, not only do themarginal distributions need to be close, but so do the labeling functions.

51

Comparison with Theorem 4.2.1 It is instructive to compare the bound in Theorem 4.4.1 with theone in Theorem 4.2.1. The main difference lies in the λ∗ in Theorem 4.2.1 and the min{EDS [| f S −f T |], EDT [| f S − f T |]} in Theorem 4.4.1. λ∗ depends on the choice of the hypothesis class H, while ourterm does not. In fact, our quantity reflects the underlying structure of the problem, i.e., the conditional
shift. Finally, consider the example given in the left panel of Fig. 4.1.1. It is easy to verify that we havemin{EDS [| f S − f T |], EDT [| f S − f T |]} = 1/2 in this case, while for a natural class of hypotheses, i.e.,
H := {h( x ) = 0 ⇔ a ≤ x ≤ b | a < b}, we have λ∗ = 1. In that case, our bound is tighter than the one
in Theorem 4.2.1.
In the covariate shift setting, where we assume the conditional distributions of Y | X between the source
and target domains are the same, the third term in the upper bound vanishes. In that case the above theorem
says that to guarantee successful domain adaptation, it suffices to match the marginal distributions whileachieving small error on the source domain. In general settings where the optimal labeling functions of thesource and target domains differ, the above bound says that it is not sufficient to simply match the marginal
distributions and achieve small error on the source domain. At the same time, we should also guarantee thatthe optimal labeling functions (or the conditional distributions of both domains) are not too far away fromeach other. As a side note, it is easy to see that EDS [| f S − f T |] = ε S ( f T ) and EDT [| f S − f T |] = ε T ( f S ). In
other words, they are essentially the cross-domain errors. When the cross-domain error is small, it implies
that the optimal source (resp. target) labeling function generalizes well on the target (resp. source) domain.
Both the error term ε S (h) and the divergence d H̃ (DS , D T ) in Theorem 4.4.1 are with respect to thetrue underlying distributions DS and D T , which are not available to us during training. In the following,
we shall use the Rademacher complexity to provide for both terms a data-dependent bound from empiricalsamples from DS and D T .
Definition 4.4.1 (Empirical Rademacher Complexity). Let H be a family of functions mapping from X
to [ a, b] and S = {xi }in=1 a fixed sample of size n with elements in X . Then, the empirical Rademacher
complexity of H with respect to the sample X is defined as
1 n
RadS (H) := Eσ sup ∑ σi h(xi ) ,h∈H n i =1
where σ = {σi }in=1 and σi are i.i.d. uniform random variables taking values in {+1, −1}.
With the empirical Rademacher complexity, we can show that w.h.p., the empirical source error b
ε S (h)cannot be too far away from the population error ε S (h) for all h ∈ H:
Lemma 4.4.3. Let H ⊆ [0, 1]X , then for all p
δ > 0, w.p. at least 1 − δ, the following inequality holds for
all h ∈ H: ε S (h) ≤ b
ε S (h) + 2RadS (H) + 3 log(2/δ)/2n.
b be its empirical distribution from sample S ∼ D n of
Similarly, for any distribution D over X , let D
size n. Then for any two distributions D and D 0 , we can also use the empirical Rademacher complexity tob, Db 0 ):
provide a data-dependent bound for the perturbation between dH (D , D 0 ) and dH (Db be defined above, then for all δ > 0, w.p. at least 1 − δ, the following
Lemma 4.4.4. Let H̃, D and Dpinequality holds for all h ∈ H̃: ED [Ih ] ≤ EDb [Ih ] + 2RadS (H̃) + 3 log(2/δ)/2n.
Since H̃ is a hypothesis class, by definition we have:b = sup | Pr( A) − Pr( A)|dH̃ (D , D)
A∈AH̃

D

b
D

= sup |ED [Ih ] − EDb [Ih ]|.
h∈H̃Hence combining the above identity with Lemma 4.4.4, we immediately have w.p. at least 1 − δ:qbdH̃ (D , D) ≤ 2RadS (H̃) + 3 log(2/δ)/2n.
52

(4.2)

Now use a union bound and the fact that dH̃ (·, ·) satisfies the triangle inequality, we have:b, Db 0 be defined above, then for ∀δ > 0, w.p. at least 1 − δ, for ∀h ∈ H̃:Lemma 4.4.5. Let H̃, D , D 0 and D
q
0
0
b
b
dH̃ (D , D ) ≤ dH̃ (D , D ) + 4RadS (H̃) + 6 log(4/δ)/2n.
Combine Lemma 4.4.3, Lemma 4.4.5 and Theorem 4.4.1 with a union bound argument, we get thefollowing main theorem that characterizes an upper bound for domain adaptation:bS, Db T be theTheorem 4.4.2. Let hDS , f S i and hD T , f T i be the source and target domains, and let D
empirical source and target distributions constructed from sample S = {SS , ST }, each of size n. Then for
any H ⊆ [0, 1]X and ∀h ∈ H:bS, Db T ) + 2RadS (H) + 4RadS (H̃)ε T (h) ≤ b
ε S (h) + dH̃ (D+ min{EDS [| f S − f T |], EDT [| f S − f T |]}q+Olog(1/δ)/n ,where H̃ := {sgn(|h(x) − h0 (x)| − t)|h, h0 ∈ H, t ∈ [0, 1]}.
Essentially, the generalization upper bound can be decomposed into three parts: the first part comesfrom the domain adaptation setting, including the empirical source error, the empirical H-divergence, andthe shift between labeling functions. The second part corresponds to complexity measures of our hypothesis
space H and H̃, and the last part describes the error caused by finite samples.

4.4.3

An Information-Theoretic Lower BoundIn Sec. 4.4.1, we constructed an example to demonstrate that learning invariant representations could leadto a feature space where the joint error on both domains is large. In this section, we extend the example
by showing that a similar result holds in more general settings. Specifically, we shall prove that for any
approach based on learning invariant representations, there is an intrinsic lower bound on the joint error ofsource and target domains, due to the discrepancy between their marginal label distributions. Our result
hence highlights the need to take into account task related information when designing domain adaptation
algorithms based on learning invariant representations.
Before we proceed to the lower bound, we first define several information-theoretic concepts that will
be used in the analysis. For two distributions D and D 0 , the Jensen-Shannon (JS) divergence DJS (D k D 0 )is defined as:
1
1
DJS (D k D 0 ) := DKL (D k D M ) + DKL (D 0 k D M ),22
where DKL (· k ·) is the Kullback–Leibler (KL) divergence and D M := (D + D 0 )/2. The JS divergencecan be viewed as a symmetrized and smoothed version of the KL divergence, and it is closely related to theL1 distance between two distributions through Lin’s lemma (Lin, 1991).
Unlike the KL divergence, the JS divergence is bounded: 0 ≤ DJS (D k D 0 ) ≤ 1. Additionally, fromthe JS divergence, we can define a distance metric between two distributions as well, known as the JS
distance (Endres and Schindelin, 2003):
q
dJS (D , D 0 ) := DJS (D k D 0 ).
With respect to the JS distance and for any (stochastic) mapping h : Z 7→ Y , we can prove the following
lemma via the celebrated data processing inequality:
53

Lemma 4.4.6. Let DSZ and D TZ be two distributions over Z and let DSY and D TY be the induced distributions
over Y by function h : Z 7→ Y , thendJS (DSY , D TY ) ≤ dJS (DSZ , D TZ ).

(4.3)

For methods that aim to learn invariant representations for domain adaptation, an intermediate representation space Z is found through feature transformation g, based on which a common hypothesis
h : Z 7→ Y is shared between both domains (Ganin et al., 2016; Tzeng et al., 2017; Zhao et al., 2018b).
Through this process, the following Markov chain holds:ghX −→ Z −→ Ŷ,(4.4)

where Ŷ = h( g( X )) is the predicted random variable of interest. Hence for any distribution D over X ,this Markov chain also induces a distribution D Z over Z and D Ŷ over Y . By Lemma 4.4.6, we know thatdJS (DSŶ , D TŶ ) ≤ dJS (DSZ , D TZ ). With these notations, noting that the JS distance is a metric, the following
inequality holds:
dJS (DSY , D TY ) ≤ dJS (DSY , DSŶ ) + dJS (DSŶ , D TŶ ) + dJS (D TŶ , D TY ).
Combining the above inequality with Lemma 4.4.6, we immediately have:dJS (DSY , D TY ) ≤ dJS (DSZ , D TZ )+ dJS (DSY , DSŶ ) + dJS (DTY , DTŶ ).

(4.5)

Intuitively, dJS (DSY , DSŶ ) and dJS (D TY , D TŶ ) measure the distance between the predicted label distribution
and the ground truth label distribution on the source and target domain, respectively. Formally, the following
result establishes a relationship between dJS (D Y , D Ŷ ) and the accuracy of the prediction function h:
Lemma 4.4.7. Let Y = f ( X ) ∈ {0, 1} where f (·) is the labeling function and Ŷ = h( g( X )) ∈ {0, 1}p
be the prediction function, then dJS (D Y , D Ŷ ) ≤ ε(h ◦ g).
We are now ready to present the key lemma of the section:ghLemma 4.4.8. Suppose the Markov chain X −→ Z −→ Ŷ holds, thenqqdJS (DSY , D TY ) ≤ dJS (DSZ , D TZ ) + ε S (h ◦ g) + ε T (h ◦ g).
Remark This lemma shows that if the marginal label distributions are significantly different between
the source and target domains, then in order to achieve a small joint error, the induced distributions overZ from source and target domains have to be significantly different as well. Put another way, if we areable to find an invariant representation such that dJS (DSZ , D TZ ) = 0, then the joint error of the composition
function h ◦ g has to be large:
Theorem 4.4.3. Suppose the condition in Lemma 4.4.8 holds and dJS (DSY , D TY ) ≥ dJS (DSZ , D TZ ), then:21
ε S (h ◦ g) + ε T (h ◦ g) ≥dJS (DSY , D TY ) − dJS (DSZ , D TZ ) .
2
Remark The lower bound gives us a necessary condition on the success of any domain adaptation
approach based on learning invariant representations: if the marginal label distributions are significantly
different between source and target domains, then minimizing dJS (DSZ , D TZ ) and the source error ε S (h ◦ g)will only increase the target error. In fact, Theorem 8.2.1 can be extended to hold in the setting where
different transformation functions are applied in source and target domains:54

Corollary 4.4.1. Let gS , gT be the source and target transformation functions from X to Z . Suppose thecondition in Lemma 4.4.8 holds and dJS (DSY , D TY ) ≥ dJS (DSZ , D TZ ), then:ε S ( h ◦ gS ) + ε T ( h ◦ g T ) ≥21
dJS (DSY , D TY ) − dJS (DSZ , D TZ ) .
2

Recent work has also explored using different transformation functions to achieve invariant representations (Bousmalis et al., 2016; Tzeng et al., 2017), but Corollary 4.4.1 shows that this is not going to help if
the marginal label distributions differ between two domains.
We conclude this section by noting that our bound on the joint error of both domains is not necessarily
the tightest one. This can be seen from the example in Sec. 4.4.1, where dJS (DSZ , D TZ ) = dJS (DSY , D TY ) = 0,
and we have ε S (h ◦ g) + ε T (h ◦ g) = 1, but in this case our result gives a trivial lower bound of 0.
Nevertheless, our result still sheds new light on the importance of matching marginal label distributions inlearning invariant representation for domain adaptation, which we believe to be a promising direction forthe design of better adaptation algorithms.

4.5

Experiments

Our theoretical results on the lower bound of the joint error imply that over-training the feature transformation function and the discriminator may hurt generalization on the target domain. In this section, we
conduct experiments on real-world datasets to verify our theoretical findings. The task is digit classificationon three datasets of 10 classes: MNIST, USPS and SVHN. MNIST contains 60,000/10,000 train/test
instances; USPS contains 7,291/2,007 train/test instances, and SVHN contains 73,257/26,032 train/test
instances. We show the label distribution of these three datasets in Fig. 4.5.1.

Figure 4.5.1: The label distributions of MNIST, USPS and SVHN.
Before training, we preprocess all the samples into gray scale single-channel images of size 16 × 16,
so they can be used by the same network. In our experiments, to ensure a fair comparison, we use thesame network structure for all the experiments: 2 convolutional layers, one fully connected hidden layer,
followed by a softmax output layer with 10 units. The convolution kernels in both layers are of size 5 × 5,
with 10 and 20 channels, respectively. The hidden layer has 1280 units connected to 100 units before
classification. For domain adaptation, we use the original DANN (Ganin et al., 2016) with gradient reversal

55

(a) USPS → MNIST(b) USPS → SVHN(c) SVHN → MNIST(d) SVHN → USPS

Figure 4.5.2: Digit classification on MNIST, USPS and SVHN. The horizontal solid line corresponds to thetarget domain test accuracy without adaptation. The green solid line is the target domain test accuracy underdomain adaptation with DANN. We also plot the least square fit (dashed line) of the DANN adaptation
results to emphasize the negative slope.
implementation. The discriminator in DANN takes the output of convolutional layers as its feature input,
followed by a 500 × 100 fully connected layer, and a one-unit binary classification output.
We plot four adaptation trajectories in Fig. 4.5.2. Among the four adaptation tasks, we can observe twophases in the adaptation accuracy. In the first phase, the test set accuracy rapidly grows, in less than 10
iterations. In the second phase, it gradually decreases after reaching its peak, despite the fact that the source
training accuracy keeps increasing smoothly. Those phase transitions can be verified from the negative
slopes of the least squares fit of the adaptation curves (dashed lines in Fig. 4.5.2). We observe similar
phenomenons on additional experiments using artificially unbalanced datasets trained on more powerful
networks as well. The above experimental results imply that over-training the feature transformation anddiscriminator does not help generalization on the target domain, but can instead hurt it when the label
distributions differ (as shown in Fig. 4.5.1). These experimental results are consistent with our theoreticalfindings.

56

4.6

ProofsIn this section we provide all the missing proofs in Sec. 4.4. Again, we will first restate the corresponding
statements and then provide proofs for each of them.
Lemma 4.4.1. Let H ⊆ [0, 1]X and D , D 0 be two distributions over X . Then ∀h, h0 ∈ H, |ε D (h, h0 ) −ε D 0 (h, h0 )| ≤ dH̃ (D , D 0 ), where H̃ := {sgn(|h(x) − h0 (x)| − t) | h, h0 ∈ H, 0 ≤ t ≤ 1}.
Proof. By definition, for ∀h, h0 ∈ H, we have:|ε S (h, h0 ) − ε T (h, h0 )| ≤ sup |ε S (h, h0 ) − ε T (h, h0 )|h,h0 ∈H= sup Ex∼S [|h(x) − h0 (x)|] − Ex∼T [|h(x) − h0 (x)|](4.6)

h,h0 ∈H

Since k hk∞ ≤ 1, ∀h ∈ H, then 0 ≤ |h(x) − h0 (x)| ≤ 1, ∀x ∈ X , h, h0 ∈ H. We now use Fubini’s
theorem to bound Ex∼S [|h(x) − h0 (x)|] − Ex∼T [|h(x) − h0 (x)|] :Ex∼S [|h(x) − h0 (x)|]−Ex∼T [|h(x) − h0 (x)|]

Z 1
0
0
=
Pr(|h(x) − h (x)| > t) − Pr(|h(x) − h (x)| > t) dt

≤

0

T

S

0

Z 1

Pr(|h(x) − h0 (x)| > t) − Pr(|h(x) − h0 (x)| > t) dt
TS≤ sup Pr(|h(x) − h (x)| > t) − Pr(|h(x) − h0 (x)| > t)t∈[0,1]0

S

T

Now in view of (4.6) and the definition of H̃, we have:sup sup Pr(|h(x) − h0 (x)| > t) − Pr(|h(x) − h0 (x)| > t)h,h0 ∈H t∈[0,1]TS= sup | Pr(h̃(x) = 1) − Pr(h̃(x) = 1)|
h̃∈H̃

T

S

= sup | Pr( A) − Pr( A)|
A∈AH̃

S

T

= dH̃ (DS , DT )Combining all the inequalities above finishes the proof.

Lemma 4.4.2. Let H ⊆ [0, 1]X and D be any distribution over X . For any h, h0 , h00 ∈ H, we haveε D (h, h0 ) ≤ ε D (h, h00 ) + ε D (h00 , h0 ).
Proof.
ε D (h, h0 ) = Ex∼D [|h(x) − h0 (x)|] = Ex∼D [|h(x) − h00 (x) + h00 (x) − h0 (x)|]≤ Ex∼D [|h(x) − h00 (x)| + |h00 (x) − h0 (x)|] = ε D (h, h00 ) + ε D (h00 , h0 )
Theorem 4.4.1. Let hDS , f S i and hD T , f T i be the source and target domains, respectively. For any function
class H ⊆ [0, 1]X , and ∀h ∈ H, the following inequality holds:
ε T (h) ≤ ε S (h) + dH̃ (DS , D T ) + min{EDS [| f S − f T |], EDT [| f S − f T |]}.
57

Proof. On one hand, with Lemma 8.2.1 and Lemma 4.4.2, we have ∀h ∈ H:

ε T (h) = ε T (h, f T ) ≤ ε S (h, f T ) + d H̃ (DS , D T ) ≤ ε S (h) + ε S ( f S , f T ) + d H̃ (DS , D T ).

On the other hand, by changing the order of two triangle inequalities, we also have:
ε T (h) = ε T (h, f T ) ≤ ε T (h, f S ) + ε T ( f S , f T ) ≤ ε S (h) + ε T ( f S , f T ) + d H̃ (DS , D T ).

Realize that by definition ε S ( f S , f T ) = EDS [| f S − f T |] and ε T ( f S , f T ) = EDT [| f S − f T |]. Combining theabove two inequalities completes the proof.
δ > 0, w.p. at least 1 − δ, the following inequality holds forLemma 4.4.3. Let H ⊆ [0, 1]X , then for all p
all h ∈ H: ε S (h) ≤ b
ε S (h) + 2RadS (H) + 3 log(2/δ)/2n.
Proof. Consider the source domain DS . For ∀h ∈ H, define the loss function ` : X → [0, 1] as`(x) := |h(x) − f S (x)|. First, we know that RadS (H − f S ) = RadS (H) where we slightly abuse thenotation H − f S to mean the family of functions { h − f S | ∀h ∈ H}:




1 n
1 n
0
RadS (H − f S ) = Eσ
sup
=
E
sup
σ
h
(
x
)
σ
(
h
(
x
)
−
f
(
x
))
σ
S i
∑ i i
∑ i i
h0 ∈H− f S n i =1h∈H n i =1

 n


1
1 n
σi f S (xi )= Eσ sup ∑ σi h(xi ) + Eσn i∑h∈H n i =1
=1

= RadS (H)Observe that the function φ : t → |t| is 1-Lipschitz continuous, then by Ledoux-Talagrand’s contraction
lemma, we can conclude thatRadS (φ ◦ (H − f S )) ≤ RadS (H − f S ) = RadS (H)Using Lemma 2.6.1 with the above arguments and realize that ε S (h) = Ex∼DS [|h(x) − f S (x)|] finishes
the proof.
b be defined above, then for all δ > 0, w.p. at least 1 − δ, the following
Lemma 4.4.4. Let H̃, D and Dpinequality holds for all h ∈ H̃: ED [Ih ] ≤ EDb [Ih ] + 2RadS (H̃) + 3 log(2/δ)/2n.
Proof. Note that Ih ∈ {0, 1}, hence this lemma directly follows Lemma 2.6.1.

b, Db 0 be defined above, then for ∀δ > 0, w.p. at least 1 − δ, for ∀h ∈ H̃:Lemma 4.4.5. Let H̃, D , D 0 and Dqb, Db 0 ) + 4RadS (H̃) + 6 log(4/δ)/2n.
dH̃ (D , D 0 ) ≤ dH̃ (DProof. By the triangular inequality of dH̃ (·, ·), we have:b + d (Db, Db 0 ) + d (Db 0 , D 0 ).
dH̃ (D , D 0 ) ≤ dH̃ (D , D)H̃H̃Now with Lemma 4.4.4, we know that with probability ≥ 1 − δ/2, we have:qbdH̃ (D , D) ≤ 2RadS (H̃) + 3 log(4/δ)/2n.
Similarly, with probability ≥ 1 − δ/2, the following inequality also holds:qb 0 ) ≤ 2RadS (H̃) + 3 log(4/δ)/2n.
dH̃ (D 0 , D

A union bound to combine the above two inequalities then finishes the proof.
58bS, Db T be theTheorem 4.4.2. Let hDS , f S i and hD T , f T i be the source and target domains, and let D
empirical source and target distributions constructed from sample S = {SS , ST }, each of size n. Then for
any H ⊆ [0, 1]X and ∀h ∈ H:bS, Db T ) + 2RadS (H) + 4RadS (H̃)ε T (h) ≤ b
ε S (h) + dH̃ (D+ min{EDS [| f S − f T |], EDT [| f S − f T |]}q+Olog(1/δ)/n ,where H̃ := {sgn(|h(x) − h0 (x)| − t)|h, h0 ∈ H, t ∈ [0, 1]}.
Proof. By Theorem 4.4.1, the following inequality holds:
ε T (h) ≤ ε S (h) + dH̃ (DS , D T ) + min{EDS [| f S − f T |], EDT [| f S − f T |]}.
To get probabilistic bounds for both ε S (h) and dH̃ (DS , D T ), we apply Lemma 4.4.3 and Lemma 4.4.5,
respectively. The final step, again, is to use a union bound to combine all the inequalities above, which
completes the proof.
Lemma 4.4.6. Let DSZ and D TZ be two distributions over Z and let DSY and D TY be the induced distributions
over Y by function h : Z 7→ Y , thendJS (DSY , D TY ) ≤ dJS (DSZ , D TZ ).

(4.3)

Proof. Let B be a uniform random variable taking value in {0, 1} and let the random variable YB with
distribution D YB (resp. ZB with distribution D BZ ) be the mixture of DSY and D TY (resp. DSZ and D TZ ) according
to B. We know that:
DJS (DSZ k D TZ ) = I ( B; ZB ),and

DJS (DSY k D TY ) = I ( B; YB ).

(4.7)

Since DSY (resp. D TY ) is induced by the function h : Z 7→ Y from DSZ (resp. D TZ ), by linearity, we also
have D YB is induced by h from D BZ . Hence YB = h( ZB ) and the following Markov chain holds:
B → ZB → YB .
Apply the data processing inequality (Lemma 2.6.4), we have
DJS (DSZ k D TZ ) = I ( B; ZB ) ≥ I ( B; YB ) = DJS (DSY k D TY ).
Taking square root on both sides of the above inequality completes the proof.

Lemma 4.4.7. Let Y = f ( X ) ∈ {0, 1} where f (·) is the labeling function and Ŷ = h( g( X )) ∈ {0, 1}p
be the prediction function, then dJS (D Y , D Ŷ ) ≤ ε(h ◦ g).

59

Proof.
dJS (D Y , D Ŷ ) =

≤
=
=

q
q
q
q

=

q

≤

q

=

q

DJS (D Y , D Ŷ )kD Y − D Ŷ k1 /2(Lemma 2.6.3)

| Pr(Y = 0) − Pr(Ŷ = 0)| + | Pr(Y = 1) − Pr(Ŷ = 1)| /2| Pr(Y = 1) − Pr(Ŷ = 1)||EX [ f ( X )] − EX [h( g( X ))]|
EX [| f ( X ) − h( g( X ))|]ε(h ◦ g)ghLemma 4.4.8. Suppose the Markov chain X −→ Z −→ Ŷ holds, thenqqdJS (DSY , D TY ) ≤ dJS (DSZ , D TZ ) + ε S (h ◦ g) + ε T (h ◦ g).
gh

Proof. Since X −→ Z −→ Ŷ forms a Markov chain, by Lemma 4.4.6, the following inequality holds:
dJS (DSŶ , D TŶ ) ≤ dJS (DSZ , D TZ ).
On the other hand, since dJS (·, ·) is a distance metric, we also have:dJS (DSY , D TY ) ≤ dJS (DSY , DSŶ ) + dJS (DSŶ , D TŶ ) + dJS (D TŶ , D TY ) ≤ dJS (DSY , DSŶ ) + dJS (DSZ , D TZ ) + dJS (D TŶ , D TY ).
Applying Lemma 4.4.7 to both dJS (DSY , DSŶ ) and dJS (D TŶ , D TY ) then finishes the proof.



Theorem 5.2.1. Suppose the condition in Lemma 4.4.8 holds and dJS (DSY , D TY ) ≥ dJS (DSZ , D TZ ), then:ε S (h ◦ g) + ε T (h ◦ g) ≥

2
1dJS (DSY , D TY ) − dJS (DSZ , D TZ ) .
2

Proof. In view of the result in Theorem 4.4.8, applying the AM-GM inequality, we have:qqq
ε S (h ◦ g) + ε T (h ◦ g) ≤ 2 (ε S (h ◦ g) + ε T (h ◦ g)).
Now since dJS (DSY , D TY ) ≥ dJS (DSZ , D TZ ), simple algebra shows
ε S (h ◦ g) + ε T (h ◦ g) ≥

2
1dJS (DSY , D TY ) − dJS (DSZ , D TZ ) .
2



60

4.7

Conclusion

In this chapter we theoretically and empirically study the important problem of learning invariant representations for domain adaptation. We show that learning an invariant representation and achieving a small
source error is not enough to guarantee target generalization. We then prove both upper and lower bounds
for the target and joint errors, which directly translate to sufficient and necessary conditions for the successof adaptation. We believe our results take an important step towards understanding deep domain adaptation,
and also stimulate future work on the design of stronger deep domain adaptation algorithms that alignconditional distributions. Another interesting direction for future work is to characterize what properties
the feature transformation function should have in order to decrease the conditional shift. It is also worth
investigating under which conditions the label distributions can be aligned without explicit labeled datafrom the target domain.

61

Chapter 5

Domain Adaptation with Conditional
Distribution Matching under Generalized
Label Shift
In this chapter, we extend a recent upper-bound on the performance of adversarial domain adaptation tomulti-class classification and more general discriminators. We then propose generalized label shift (GLS)
as a way to improve robustness against mismatched label distributions. GLS states that, conditioned on
the label, there exists a representation of the input that is invariant between the source and target domains.
Under GLS, we provide theoretical guarantees on the transfer performance of any classifier. We also devise
necessary and sufficient conditions for GLS to hold. The conditions are based on the estimation of therelative class weights between domains and on an appropriate reweighting of samples. Guided by ourtheoretical insights, we modify three widely used algorithms, JAN, DANN and CDAN and evaluate theirperformance on standard domain adaptation tasks where our method outperforms the base versions. We
also demonstrate significant gains on artificially created tasks with large divergences between their source
and target label distributions.

63

5.1

Introduction

In spite of impressive successes, most deep learning models (Goodfellow et al., 2017) rely on huge amountsof labelled data and their features have proven brittle to distribution shifts (McCoy et al., 2019; Yosinski
et al., 2014). Building more robust models, that learn from fewer samples and/or generalize better out-ofdistribution is the focus of many recent works (Arjovsky et al., 2019; Bachman et al., 2019; Yaghoobzadeh
et al., 2019). The research direction of interest to this paper is that of domain adaptation, which aims at
learning features that transfer well between domains.
We focus in particular on the unsupervised domain adaptation setting (UDA), where the algorithm hasaccess to labelled samples from a source domain and unlabelled data from a target domain. Its objective
is to train a model that generalizes well to the target domain. Building on advances in adversarial learning (Goodfellow et al., 2014), adversarial domain adaptation (ADA) leverages the use of a discriminator tolearn an intermediate representation that is invariant between the source and target domains. Simultaneously,
the representation is paired with a classifier, trained to perform well on the source domain (Ganin et al.,2016; Liu et al., 2019; Tzeng et al., 2017; Zhao et al., 2018b). ADA is rather successful on a variety of tasks,
however, recent work has proven an upper bound on the performance of existing algorithms when source
and target domains have mismatched label distributions (Zhao et al., 2019h). Label, or prior probability,
shift is a property of two domains for which the marginal label distributions differ, but the conditional
distributions of input given label stay the same across domains (Storkey, 2009; Zhang et al., 2015b).
In this chapter, we study domain adaptation under mismatched label distributions and design methods
that are robust in that setting. Our contributions are the following. First, we extend the upper bound by Zhao
et al. (2019h) to k-class classification and to conditional domain adversarial networks, a recently introduced
domain adaptation algorithm (Long et al., 2018). Second, we introduce generalized label shift (GLS), a
broader version of the standard label shift where conditional invariance between source and target domains
is placed in representation rather than input space. Third, we derive performance guarantees for algorithms
that seek to enforce GLS via learnt feature transformations, in the form of upper bounds on the error
gap and the joint error of the classifier on the source and target domains. Those performance guarantees
suggest principled modifications to ADA to improve its robustness to mismatched label distributions. The
modifications rely on estimating the class ratios between source and target domains and use those asimportance weights in the adversarial and classification objectives. The importance weights estimation is
performed using a method from Lipton et al. (2018). Following the theoretical insights, we devise three
new algorithms, based on DANNs (Ganin et al., 2016), JANs (Long et al., 2017) and CDANs (Long et al.,2018). We apply our variants to artificial UDA tasks with large divergences between label distributions, anddemonstrate significant performance gains compared to the algorithms’ base versions. Finally, we evaluate
them on standard domain adaptation tasks (for which the divergence between label distribution is rather
limited) and show improved performance as well.

5.2

Preliminaries

Notation and Setup In this chapter we focus on the general k-class classification problem. We use
X and Y to denote the input and output space, respectively. Similarly, Z stands for the representation
space induced from X by a feature transformation g : X 7→ Z . Accordingly, we use X, Y, Z to denoterandom variables which take values in X , Y , Z . In this work, domain corresponds to a distribution on the
input space X and output space Y , and we use DS (resp. D T ) to denote the source (resp. target) domain.
Noticeably, this corresponds to a stochastic setting, which is stronger than the deterministic one studied
in Ben-David et al. (2007, 2010); Zhao et al. (2019h). A hypothesis is a function h : X → [k ]. The error
64

of a hypothesis h under distribution DS is defined as: ε S (h) := PrDS (h( X ) 6= Y ), i.e., the probability thath disagrees with Y under DS .
Domain Adaptation via Invariant Representations For source (DS ) and target (D T ) domains, we use
DSX , DTX , DSY and DTY to denote the marginal data and label distributions. In UDA, the algorithm has
m sampled
access to n labeled points {(xi , yi )}in=1 ∈ (X × Y )n and m unlabeled points {x j }m
j =1 ∈ X
i.i.d. from the source and target domains. Inspired by Ben-David et al. (2010), a common approach is tolearn representations invariant to the domain shift. Letting g : X 7→ Z be a feature transformation andh : Z 7→ Y a hypothesis on the feature space, the goal of domain invariant representations (Ganin et al.,2016; Tzeng et al., 2017; Zhao et al., 2018c) is to find a function g that induces similar distributions on DS
and D T . Simultaneously, g is required to preserve rich information about the target task so that ε S (h ◦ g) issmall. The above process results in the following Markov chain:gh b
X −→ Z −→ Y,(5.1)

b = h( g( X )). We let D Z , D Z , D Y and D Y denote the pushforwards of DS and D T by g and h ◦ g.
with YTTSS
Invariance in feature space is defined as minimizing a distance or divergence between the source and target
feature distributions.
bb

Table 5.2.1: Common assumptions in the domain adaptation literature.
Covariate ShiftLabel ShiftDSX 6= DTX∀ x ∈ X , D S (Y | X = x ) = D T (Y | X = x )DSY 6= DTY∀y ∈ Y , DS ( X | Y = y) = D T ( X | Y = y)Adversarial Domain Adaptation Invariance is often attained by training a discriminator d : Z 7→ [0, 1]
to predict whether a representation z is from the source or target domain. g is then trained both to maximize
the discriminator loss and to minimize the classification loss of h ◦ g on the source domain (h is also trainedwith the latter objective).
This leads in particular to domain-adversarial neural networks (Ganin et al., 2016, DANN), where g, hand d are parameterized with neural networks: gθ , hφ and dψ . dψ outputs the probability to be from thesource domain, while hφ outputs the probability to belong to each class. The discriminator loss L DA andclassification loss LC are simply cross-entropies. dψ , resp. gθ , are then trained to minimize, resp. maximize
L DA , while hφ and gθ minimize LC (see Algo. 2 and Appendix 5.A.4 for details).
Building on DANN, conditional domain adversarial networks (Long et al., 2018, CDAN) use the same
adversarial paradigm. However, the discriminator now takes as input the outer product, for a given x,
between the predictions of the network h( g( x )) and its representation g( x ). In other words, d acts on theouter product:h ⊗ g( x ) := (h1 ( g( x )) · g( x ), . . . , hk ( g( x )) · g( x ))rather than on g( x ) (where hi denotes the i-th element of vector h). We now highlight a limitation of
DANNs and CDANs.

65

An Information-Theoretic Lower Bound Let DJS denote the Jensen-Shanon divergence between twob ⊗ Z (fore correspond to Z (for DANN) or to Y
distributions (see Appendix 5.5.1 for details), and let Z
CDAN). The following theorem gives a lower bound on the joint error of the classifier on the source andtarget domains:ee
Theorem 5.2.1. Suppose that the Markov chain in (5.1) holds, and that DJS (DSY k D TY ) ≥ DJS (DSZ k D TZ ),
then:
2
q
q
1
e
e
Y
Y
Z
Z
ε S (h ◦ g) + ε T (h ◦ g) ≥DJS (DS k D T ) − DJS (DS k D T ) .
2
Remark Remarkably, the above lower bound is algorithm-independent. It is also a population-level
result and holds asymptotically with increasing data; large data does not help. Zhao et al. (2019h) provee = Z, i.e., for DANN on binary classification. We extend it to CDAN andthe theorem for k = 2 and Z
arbitrary k (see Appendix 5.5.3 for the proof). Assuming that label distributions differ between source andtarget domains, the lower bound in Theorem 5.2.1 says that:For both DANN and CDAN, the better the alignment of marginal feature distributions, theworse the sum of errors on source and target domains.
Notably, for an invariant representation (DJS (DSZ̃ , D TZ̃ ) = 0) with no source error, the target error
will be larger than DJS (DSY , D TY )/2. Put another way, algorithms learning invariant representations andminimizing the source empirical risk are fundamentally flawed when marginal label distributions differ
between source and target domains.
Intuitively, CDAN also suffers from an intrinsic lower bound because while its discriminator d takes
b is still a function of X 1 . All the information available
into account the predicted output distribution, Y
to the discriminator comes from X. From an information-theoretic perspective, to circumvent the above
tradeoff between distribution alignment and target error minimization, it is necessary to incorporate theground-truth label distributions (DSY and D TY ) into the discriminator.
Common Assumptions to Tackle Domain Adaptation Domain adaptation requires assumptions about
the data to be possible. Two common ones are covariate shift and label shift. They correspond to different
ways of decomposing the joint distribution over X × Y, as detailed in Table 5.2.1. From the perspective ofrepresentation learning, it has been demonstrated that covariate shift is not robust to feature transformation,and can lead to an effect called negative transfer (Zhao et al., 2019h). At the same time, label shift clearly
fails in most practical applications. Consider, for instance, transferring knowledge from synthetic to real
images (Visda, 2017): the supports of the input distributions are actually disjoint. In this chapter, we focus
on label shift and propose a solution to the above problem.

5.3

Main Results

In light of the limitations of existing assumptions, (e.g. covariate shift and label shift), we propose
generalized label shift (GLS), a relaxation of label shift that substantially improves its applicability. We
first discuss some of its properties and explain why the assumption is favorable in domain adaptation basedon representation learning. Motivated by GLS, we then present a novel error decomposition theorem that
directly suggests a bound minimization framework for domain adaptation. The framework is naturallycompatible with F -integral probability metrics (Müller, 1997, F -IPM) and generates a family of domain
1 Thm.5.2.1 actually holds for any Z̃ s.t. Y
b = h̃( Z̃ ), see Appendix 5.5.3.

66

adaptation algorithms by choosing various function classes F . In a nutshell, the proposed framework
applies Lipton et al. (2018)’s method-of-moments to estimate the importance weight w of the marginallabel distributions by solving a quadratic program (QP), and then uses w to align the weighted source
feature distribution with the target feature distribution.

5.3.1

Generalized Label Shift

Definition 5.3.1 (Generalized Label Shift, GLS). A representation Z = g( X ) satisfies GLS if

D S ( Z | Y = y ) = D T ( Z | Y = y ), ∀ y ∈ Y .

(5.2)

First, we note that when g is the identity map, i.e. Z = X, the above definition of GLS reduces tothe original label shift assumption. Next, GLS is always achievable for any distribution pair (DS , D T ):any constant function g ≡ c ∈ R satisfies the above definition. The most important property of GLS isarguably that, unlike label shift, the above definition is compatible with a perfect classifier in the noiselesscase. More specifically, suppose there exists a ground-truth labeling function h∗ such that Y = h∗ ( X ); thenh∗ satisfies GLS. As a comparison, without conditioning on Y = y, the optimal labeling function does notsatisfy DS (h∗ ( X )) = D T (h∗ ( X )) if the marginal label distributions are different across domains. Thisobservation is also consistent with the lower bound in Theorem 5.2.1, which holds for arbitrary marginallabel distributions.
GLS imposes label shift in the feature space Z instead of the original input space X . Conceptually,
although samples from the same classes in the source and target domain can be dramatically different,
the hope is to find an intermediate representation for both domains in which samples from a given classlook similar to one another. Taking digit classification as an example and assuming the feature variable Z
corresponds to the contour of a digit, it is possible that by using different contour extractors for e.g. MNISTand USPS, those contours look roughly the same in both domains. Technically, GLS can be facilitated byhaving separate representation extractors gS and gT for source and target2 (Bousmalis et al., 2016; Tzeng
et al., 2017).

5.3.2

An Error Decomposition Theorem based on GLS

Before delving into practical ways to enforce GLS, we provide performance guarantees for models thatsatisfy it, in the form of upper bounds on the error gap and on the joint error between source and target
domains. The bound requires the following two concepts:
b on domain DS is:
Definition 5.3.2 (Balanced Error Rate). The balanced error rate (BER) of predictor Y
b k Y ) := max DS (Yb 6 = Y | Y = j ).
BERDS (Yj∈[k ](5.3)

Definition 5.3.3 (Conditional Error Gap). Given a joint distribution D , the conditional error gap of ab is ∆CE (Yb) := maxy6=y0 ∈Y 2 |DS (Yb = y 0 | Y = y ) − D T (Yb = y0 | Y = y)|.
classifier Y
When GLS and the Markov chain in (5.1) hold, the conditional error gap is equal to 0. The next
theorem gives an upper bound on the error gap between source and target; it can also be used to obtain ageneralization upper bound on the target risk.
b = (h ◦ g)( X ),Theorem 5.3.1. (Error Decomposition Theorem) For any classifier Y
b k Y ) + 2(k − 1)∆CE (Yb ),|ε S (h ◦ g) − ε T (h ◦ g)| ≤ kDSY − DTY k1 · BERDS (Ywhere kDSY − D TY k1 := ∑ik=1 |DS (Y = i ) − D T (Y = i )| is the L1 distance between DSY and D TY .
2 For x ∈ D

S (resp. x ∈ D T ), z = gS (x) (resp. z = gT (x)).

67Remark The upper bound in Theorem 5.3.1 provides a way to decompose the error gap between source
and target domains. Additionally, with such a bound, we can immediately obtain a generalization boundof the target risk ε T (h). The upper bound contains two terms. The first one, kDSY − D TY k1 , measures the
distance between the marginal label distributions across domains, and is a constant that only depends on
the adaptation problem itself. It also contains BER, a reweighted classification performance on the sourceb), by definition, measures the distance between the family of conditional
domain. The second term, ∆CE (Yb | Y. In other words, the above upper bound is oblivious to the optimal labeling functions in
distributions Y
feature space. This is in sharp contrast with upper bounds from previous work (Ben-David et al., 2010,
Theorem 2), (Zhao et al., 2019h, Theorem 4.1), which essentially decompose the error gap in terms ofthe distance between the marginal feature distributions (DSZ , D TZ ) and the optimal labeling functions ( f SZ ,f TZ ). Because the optimal labeling function in feature space depends on Z and is unknown in practice,such decomposition is not very informative. As a comparison, Theorem 5.3.1 provides a decomposition
orthogonal to previous results and does not require knowledge about unknown optimal labeling functions
in feature space.
b k Y ), only depends on samples from the source domain,
Notably, the balanced error rate, BERDS (Yhence we can seek to minimize it in order to minimize the upper bound. Furthermore, using a datab), can be minimized by aligning the conditional
processing argument, the conditional error gap ∆CE (Yfeature distributions across domains. Putting everything together, the upper bound on the error difference
between source and target domains suggests that, in order to minimize the error gap, it suffices to align theconditional distributions Z | Y = y while simultaneously minimizing the balanced error rate. In fact, under
the assumption that the conditional distributions are perfectly aligned (i.e., under GLS), we can prove astronger result, guaranteeing that the joint error is small:b = h( Z ) be theTheorem 5.3.2. If Z = g( X ) satisfies GLS, then for any h : Z → Y and letting Yb ) + ε T (Yb) ≤ 2BERD (Yb k Y ).
predictor, we have ε S (YS
Remark Theorems 5.3.1 and 5.3.2 imply that if the conditional feature distributions are aligned, thenb k Y ). This suggests seeking models thatboth the source and target error will be bounded by BERDS (Yb k Y ). Since the balanced error rate only depends on
simultaneously verify GLS and minimize BERDS (Ythe source domain, using labeled samples from the source domain is sufficient to minimize it.

5.3.3

Conditions for Generalized Label Shift

The main difficulty in applying a bound minimization algorithm inspired by Theorem 5.3.1 is that we do
not have access to labels from the target domain in UDA3 , so we cannot directly align the conditional label
distributions. Below, we provide a necessary condition for GLS that avoids the need to explicitly align theconditional feature distributions.
Definition 5.3.4. Assuming DS (Y = y) > 0, ∀y ∈ Y , we let w ∈ Rk denote the importance weights ofthe target and source label distributions:wy : =D T (Y = y ),D S (Y = y )∀y ∈ Y .

(5.4)

Given the importance weights vector, a necessary condition implied by GLS is expressed in thefollowing lemma.
Lemma 5.3.1. Assuming Z = g( X ) satisfies GLS, then D T ( Z ) = ∑y∈Y wy · DS ( Z, Y = y) =: DSw ( Z ).
3 Though it could be used directly if we have a few target labels.

68Compared to previous work that attempts to align D T ( Z ) with DS ( Z ) using adversarial discriminators (Ganin et al., 2016) or maximum mean discrepancy (MMD) (Long et al., 2015), Lemma 5.3.1 suggeststhat we should instead align D T ( Z ) with the reweighted marginal distribution DSw ( Z ).
Reciprocally, one may be interested to know when perfectly aligned target feature distribution andreweighted source feature distribution imply GLS. The following theorem gives a sufficient condition toanswer this question:
Theorem 5.3.3. (Clustering structure implies sufficiency) Let Z = g( X ) such that D T ( Z ) = DSw ( Z ).
Assume D T (Y = y) > 0, ∀y ∈ Y . If there exists a partition of Z = ∪y∈Y Zy such that ∀y ∈ Y ,DS ( Z ∈ Zy | Y = y) = DT ( Z ∈ Zy | Y = y) = 1, then Z = g( X ) satisfies GLS.
Remark Theorem 5.3.3 shows that if there exists a partition of the feature space such that instanceswith the same label are within the same component, then aligning the target feature distribution with thereweighted source feature distribution implies GLS. While this clustering assumption may seem strong, it
is consistent with the goal of reducing classification error: if such a clustering exists, then there also exists
a perfect predictor based on the feature Z = g( X ), i.e., the cluster index.
We now consider CDAN, an algorithm particularly well-suited for conditional alignment. As describedb ⊗ Z ) with D T (Yb ⊗ Z ). This objective
in Section 5.2, the CDAN discriminator seeks to match DS (Yb is a perfect classifier on both
is very aligned with GLS: let us first assume for argument’s sake that Y
domains. For any sample ( x, y), ŷ ⊗ z is thus a matrix of 0s except on the y-th row, which contains
z. When label distributions match, the effect of fooling the discriminator will result in representationsb ⊗ Z are equal on the source and target domains. In other words, the modelsuch that the matrices Y
is such that Z | Y match: it verifies GLS (see Thm. 5.3.4 below with w = 1). On the other hand, if
the label distributions differ, fooling the discriminator actually requires mislabelling certain samples (afact quantified in Thm. 5.2.1). We now provide a sufficient condition for GLS under a modified CDAN
objective (see proofs in Appendix 5.5.8).
b = h( Z ), γ := miny∈Y D T (Y = y) and w M := max wy . For Z̃ = Ŷ ⊗ Z, we
Theorem 5.3.4. Let Y
y∈Y

have:

max dTV (DS ( Z | Y = y), D T ( Z | Y = y)) ≤
y∈Y


q
1
w
b
b
w M ε S (Y ) + ε T (Y ) + 2DJS (DS ( Z̃ ), D T ( Z̃ )) .
γb ⊗ Z ) with D T (Yb ⊗ Z ) to make them robust
Theorem 5.3.4 suggests that CDANs should match DSw (Yto mismatched label distributions. In fact, the above upper bound not only applies to CDAN, but also to
any algorithm that aims at learning domain-invariant representations4 .
Theorem 5.3.5. With the same notation as Thm. 5.3.4:
max dTV (DS ( Z | Y = y), D T ( Z | Y = y)) ≤
y∈Y
 

 q
1
w
b
b
× inf w M ε S (Y ) + ε T (Y ) + 8DJS (DS ( Z ), DT ( Z )) .
γb
Y
Remark It is worth pointing out that Theorem 5.3.5 extends Theorem 5.3.3 by incorporating the clustering
assumption as the optimal joint error that is achievable by any classifier based on the representations. InŶ.

4 Thm. 5.3.4 does not stem from Thm. 5.3.5 since the LHS of Thm. 5.3.4 applies to Z, not to Z̃, and in its RHS, Z̃ depends on

69

particular, if the clustering structure assumption holds in Theorem 5.3.3, then the optimal joint error is0, which means that the first term on the R.H.S of Thm 5.3.5 becomes 0, hence in this case aligning thereweighted feature distributions also implies GLS.

5.3.4

Estimating the Importance Weights w

Inspired by the moment matching technique to estimate w under label shift (Lipton et al., 2018), we
propose a method to get w under GLS by solving a quadratic program (QP).
Definition 5.3.5. We let C ∈ R|Y |×|Y | denote the confusion matrix of the classifier on the source domain
and µ ∈ R|Y | the distribution of predictions on the target one, ∀y, y0 ∈ Y :b = y, Y = y0 ),Cy,y0 := DS (Yb = y ).
µ y : = D T (YThe following lemma is adapted from Lipton et al. (2018) to give a consistent estimate of w under
GLS; its proof can be found in Appendix 5.5.9.
Lemma 5.3.2. If GLS is verified, and if the confusion matrix C is invertible, then w = C−1 µ.
The key insight from Lemma 5.3.2 is that, in order to estimate the importance vector w under GLS,
we do not need access to labels from the target domain. It is however well-known that matrix inversion isnumerically unstable, especially with finite sample estimates Ĉ and µ̂ of C and µy 5 . We propose to solve
instead the following QP (written as QP(Ĉ, µ̂)), whose solution will be consistent if Ĉ → C and µ̂ → µ:1kµ̂ − Ĉwk22
2
subject to w ≥ 0, wT DS (Y ) = 1.
minimizew(5.5)

The above QP can be efficiently solved in time O(|Y |3 ), with |Y | small and constant. Furthermore, byconstruction, the solution of the above QP is element-wise non-negative, even with limited amounts of data
to estimate C and µy .

5.3.5

F -IPM for Distributional Alignment

In order to align the target feature distribution and the reweighted source feature distribution as suggested
by Lemma 5.3.1, we now provide a general framework using the integral probability metric (Müller, 1997,
IPM).
Definition 5.3.6. Let F be a family of real-value functions. The F -IPM between two distributions D and
D 0 isdF (D , D 0 ) := sup |EX ∼D [ f ( X )] − EX ∼D 0 [ f ( X )]|.
(5.6)
f ∈F

By approximating any function class F using parametrized models, e.g., neural networks, we obtaina general framework for domain adaptation by aligning reweighted source feature distribution and target
feature distribution, i.e. by minimizing dF (D T ( Z̃ ), DSw ( Z̃ )). In particular, by choosing F = { f :k f k∞ ≤ 1}, dF reduces to total variation and the definition (5.6) of IPM becomes the negative sumof Type-I and Type-II errors (up to a constant) in distinguishing between D and D 0 . This leads to ourfirst algorithm IWDAN (cf. Section 5.4.1), an improved variant DANN algorithm that also takes into
account the difference between label distributions. Similarly, by instantiating F to be the set of bounded
norm functions in a RKHS H (Gretton et al., 2012), we obtain maximum mean discrepancy methods,
leading to IWJAN (cf. Section 5.4.1), a variant of JAN (Long et al., 2017) for UDA. Below, we provide acomprehensive empirical evaluation of these variants.
5 In fact, ŵ = Ĉ−1 µ̂ is not even necessarily non-negative.

70

Algorithm 2 Importance-Weighted Domain Adaptation
1: Input: source data ( xS , yS ), target data x T , representation gθ , classifier hφ and discriminator dψ
2: Input: epochs E, batches per epoch B, batch size s
3: Initialize w1 = 1

4: for t = 1 to E do

Initialize Ĉ = 0, µ̂ = 0
for b = 1 to B do
Sample batches ( xSi , yiS ) and ( xiT )wt
wtt
Maximize Lw
DA w.r.t. θ, minimize L DA w.r.t. ψ and minimize LC w.r.t. θ and φfor i = 1 to s doĈ·yi ← Ĉ·yi + hφ ( gθ ( xSi )) (yiS -th column)

5:
6:
7:
8:
9:
10:

S

S

µ̂ ← µ̂ + hφ ( gθ ( xiT ))12:
end for13:
end for14:Ĉ ← Ĉ/sB and µ̂ ← µ̂/sB
15:wt+1 = λ · QP(Ĉ, µ̂) + (1 − λ)wt
16: end for
11:

5.4

Practical Implementation

5.4.1

Algorithms

In the sections above, we have shown a way to estimate the reweighting vector w and defined necessary
and sufficient conditions on the source and target feature distributions for GLS to hold. Together, theysuggest simple algorithms based on representation learning:
1. Estimate w on the fly during training,
2. Align the feature distributions Z̃ of the target domain with the reweighted feature distribution of thesource domain and,3. Minimize the balanced error rate.
Computing w requires building estimators Ĉ and µ̂ from finite samples of C and µ. We do so by averaging
during each successive epochs the predictions of the classifier on the source and target data. This stepcorresponds to the inner-most loop of Algorithm 2 (lines 9 to 12) and leads to estimations of Ĉ and µ̂. At
the end of each epoch, the reweighting vector w is updated, and the estimators reset to 0. We have foundempirically that using an exponential moving average of w performs better (line 15 in Alg. 2). The resultsof our experiments all use a factor λ = 0.5.
With the importance weights w in hand, we can now define our first algorithm, Importance-Weighted
Domain Adversarial Network (IWDAN), that seeks to enforce the necessary condition in Lemma 5.3.1 (i.e.
to align DSw ( Z ) and D T ( Z )) using a discriminator. All it requires is to modify the DANN losses L DA and
LC . For batches ( xSi , yiS ) and ( xiT ) of size s, the weighted domain adaptation loss of IWDAN is:iii
Lw
DA ( xS , yS , x T ; θ, ψ ) = −1 s
wyi log(dψ ( gθ ( xSi ))) + log(1 − dψ ( gθ ( xiT ))).
S
s i∑
=1

(5.7)

We verify in the Appendix, Lemma 5.5.1, that the standard adversarial domain adaptation framework tow
Lw
DA indeed minimizes the JSD between DS ( Z ) and D T ( Z ). Our second algorithm, Importance-Weighted
Joint Adaptation Networks (IWJAN) is based on JAN (Long et al., 2017) and follows the reweighting
71

17.5

% improvement

15.0

IWDAN
IWDAN fit
IWDAN-O
IWDAN-O fit

10% improvement

20.0

12.5
10.0
7.5
5.0

8

IWCDANIWCDAN fit
IWCDAN-OIWCDAN-O fit

6
4
2

2.5
0

0.0
0.02

0.04

jsd

0.06

0.08

0.02

0.04

jsd

0.06

0.08

Figure 5.4.1: Gains of our algorithms versus their base versions for the 100 tasks described in Section 5.4(IWDAN/IWCDAN on the left/right). The x-axis represents DJS (DSY , D TY ), the JSD between label distributions. Lines represent linear fits. The mean improvements over DANN (resp. CDAN) for IWDAN andIWDAN-O (resp. IWCDAN and IWCDAN-O) are 6.55% and 8.14% (resp. 2.25% and 2.81%).
principle described in Section 5.3.5 with F a learnt RKHS (the exact JAN and IWJAN losses are specified
in Appendix 5.A.4). Finally, our third algorithm, based on CDAN, is Importance-Weighted Conditional
Domain Adversarial Network (IWCDAN). It follows Thm. 5.3.4, which suggests matching DSw (Ŷ ⊗ Z )with D T (Ŷ ⊗ Z ). This can be done by replacing the standard adversarial loss in CDAN with the one on
Eq. 5.7, where dψ takes as input (hφ ◦ gθ ) ⊗ gθ instead of gθ . The classifier loss for our three variants is:iiLw
C ( xS , yS ; θ, φ ) = −1 s1log(hφ ( gθ ( xSi ))yi ).
∑S
s i = 1 k D S (Y = y )(5.8)

This reweighting is suggested by our theoretical analysis from Section 5.3, where we seek to minimize theb k Y ). We also define oracle versions, IWDAN-O, IWJAN-O and IWCDAN-O
balanced error rate BERD (Ywhere the weights w used in the losses are not estimated but computed using the true target label distribution.
It gives an idealistic version of the reweighting method, and allows to assess the soundness of GLS. IWDAN,
IWJAN and IWCDAN correspond to Alg. 2 with their respective loss functions on line 8, the oracle versions
simply use the true weights w instead of wt .

5.4.2

Experiments

We apply our three base algorithms, their importance weighted versions, and the associated oracles
to domain adaptation problems from the following datasets: Digits (MNIST ↔ USPS (Dheeru andKarra Taniskidou, 2017; LeCun and Cortes, 2010)), Visda (2017), Office-31 (Saenko et al., 2010) and
Office-Home (Venkateswara et al., 2017)6 . All values are averages over 5 runs.
Performance vs DJS First, we artificially generate a family of tasks from MNIST and USPS by considering various random subsets of the classes in either the source or target domain (see Appendix 5.A.5 fordetails). This results in 100 domain adaptation tasks, with Jensen-Shannon divergences varying between 0
and 0.1. Applying IWDAN and IWCDAN results in Figure 5.4.1. We see a clear correlation between the
6 Except for JAN, which is not available on Digits.

72

Table 5.4.1: Average results on the various domains (Digits has 2 tasks, Visda 1, Office-31 6 and OfficeHome 12). The prefix s denotes the experiment where the source domain is subsampled to increase
DJS (DSY , D TY ). Each number is a mean over 5 seeds, the subscript denotes the fraction of times (out of
5 seeds × #tasks) our algorithms outperform their base versions.
MethodDigitssDigits

Visda

sVisda

O-31

sO-31

O-H

sO-H

No DA

77.17

75.67

48.39

49.02

77.81

75.72

56.39

51.34

DANN
IWDAN
IWDAN-O

93.15
83.24
61.88
52.85
82.74
76.17
59.62
51.83
94.90100% 92.54100% 63.52100% 60.18100% 83.9087% 82.60100% 62.2797% 57.61100%
95.27100% 94.46100% 64.19100% 62.10100% 85.3397% 84.41100% 64.68100% 60.87100%

CDAN
95.72
88.23
65.60
60.19
87.23
81.62
64.59
56.25
IWCDAN
95.9080% 93.22100% 66.4960% 65.83100% 87.3073% 83.88100% 65.6670% 61.24100%
IWCDAN-O 95.8590% 94.81100% 68.15100% 66.85100% 88.1490% 85.47100% 67.6498% 63.73100%
JAN
IWJAN
IWJAN-O

N/A
N/A
N/A

N/A
N/A
N/A

56.98
50.64
85.13
78.21
59.59
53.94
57.56100% 57.12100% 85.3260% 82.6197% 59.7863% 55.89100%
61.48100% 61.30100% 87.14100% 86.24100% 60.7392% 57.36100%

Table 5.4.2: Ablation study on the original and subsampled Digits data.

M ETHODD IGITSS D IGITSDANNDANN + Lw
C
DANN + Lw
DA
IWDAN-O

93.15
93.27
95.31
95.27

83.24
84.52
94.41
94.46

CDAN
CDAN + Lw
C
CDAN + Lw
DA
IWCDAN-O

95.72
95.65
95.42
95.85

88.23
91.01
93.18
94.81

improvements provided by our algorithms and DJS (DSY , D TY ), which is well aligned with Theorem 5.2.1.
Moreover, IWDAN outperforms DANN on the 100 tasks and IWCDAN bests CDAN on 94. Even on small
divergences, our algorithms do not suffer compared to their base versions.
Original Datasets Average results on each dataset are shown in Table 5.4.1 ( (see Tables in Appendix 5.A.2 for the per-task breakdown). Our weighted version IWDAN outperforms the basic algorithm
DANN by 1.75%, 1.64%, 1.16% and 2.65% on the Digits, Visda, Office-31 and Office-Home tasks respectively. Gains for IWCDAN are more limited, but still present: 0.18%, 0.89%, 0.07% and 1.07%
respectively. This can be explained by the fact that, as mentioned above, CDAN already enforces a weakform of GLS. Gains for JAN are 0.58%, 0.19% and 0.19%. Beyond mean performance, we show thefraction of times (over all seeds and tasks) our variants outperform the original algorithms7 . Even if gains
are small, our variants provide consistent improvements. Additionally, the oracle versions show larger
7 On the original datasets, the variance between seeds is larger than the difference between algorithms, making it uninformative.

73

improvements, which strongly supports enforcing GLS.
Subsampled datasets The original datasets have fairly balanced classes, making the JSD between source
and target label distributions DJS (DSY k D TY ) rather small. To evaluate our algorithms on larger divergences,
we arbitrarily modify the source domains on all the tasks above by considering only 30% of the samples
coming from the first half of the classes. This results in much larger divergences. Performance is shown in
Table 5.4.1. For IWDAN, we see gains of 9.3%, 7.33%, 6.43% and 5.58% on the digits, Visda, Office-31
and Office-Home datasets respectively. For IWCDAN, improvements are 4.99%, 5.64%, 2.26% and 4.99%,
and IWJAN shows gains of 6.48%, 4.40% and 1.95%. Moreover, on all seeds and tasks but one, our variants
outperform their base versions. Here as well, the oracles perform even better.
Ablation Study Our algorithms have two components, a weighted adversarial loss Lw
DA and a weightedclassification loss Lw
.
In
Table
5.4.2,
weaugment
DANN
and
CDAN
using
those
lossesseparately (withC
the true weights). We observe that DANN benefits essentially from the reweighting of its adversarial loss
Lw
DA , the classification loss has little effect. For CDAN, gains are essentially seen on the subsampleddatasets. Both losses help, with a +2% extra gain for Lw
DA .

5.5

ProofsIn this section, we provide the theoretical material that completes the main text.

5.5.1

Definition

Definition 5.5.1. Let us recall that for two distributions D and D 0 , the Jensen-Shannon (JSD) divergence
DJS (D k D 0 ) is defined as:
DJS (D k D 0 ) :=1
1
DKL (D k D M ) + DKL (D 0 k D M ),22

where DKL (· k ·) is the Kullback–Leibler (KL) divergence and D M := (D + D 0 )/2.

5.5.2

Consistency of the Weighted Domain Adaptation Loss (5.7)

For the sake of conciseness, we verify here that the domain adaptation training objective does lead tominimizing the Jensen-Shannon divergence between the weighted feature distribution of the source domain
and the feature distribution of the target domain.
Lemma
R 5.5.1. Let p( x, y) and q( x ) beRtwo density distributions, and w(y) be a positive function suchthat p(y)w(y)dy = 1. Let pw ( x ) = p( x, y)w(y)dy denote the w-reweighted marginal distributionof x under p. The minimum value ofI (d) := E(x,y)∼ p,x0 ∼q [−w(y) log(d( x )) − log(1 − d( x 0 ))]pw ( x )is log(4) − 2DJS ( pw ( x ) k q( x )), and is attained for d∗ ( x ) = pw (x)+q(x) .

74

Proof. We see that:
I (d) = −

=−
=−

ZZZ
Z Z

[

Z

[w(y) log(d( x )) + log(1 − d( x 0 ))] p( x, y)q( x 0 )dxdx 0 dy

(5.9)w(y) p( x, y)dy] log(d( x )) + q( x ) log(1 − d( x ))dx

(5.10)

pw ( x ) log(d( x )) + q( x ) log(1 − d( x ))dx.

(5.11)

From the last line, we follow the exact method from Goodfellow et al. (2014) to see that point-wise in x thepw ( x )minimum is attained for d∗ ( x ) = pw (x)+q(x) and that I (d∗ ) = log(4) − 2DJS ( pw ( x ) k q( x )).

Applying Lemma 5.5.1 to DS ( Z, Y ) and D T ( Z ) proves that the domain adaptation objective leads tominimizing DJS (DSw ( Z ) k D T ( Z )).

5.5.3

k-class information-theoretic lower boundIn this section, we prove Theorem 5.2.1 that extends previous result to the general k-class classification
problem.
ee
Theorem 5.2.1. Suppose that the Markov chain in (5.1) holds, and that DJS (DSY k D TY ) ≥ DJS (DSZ k D TZ ),
then:
q
2
q
1
e
e
Y
Y
Z
Z
ε S (h ◦ g) + ε T (h ◦ g) ≥DJS (DS k D T ) − DJS (DS k D T ) .
2
Proof. We essentially follow the proof from Zhao et al. (2019h), except for Lemmas 4.6 that needs to beadapted to the CDAN framework and Lemma 4.7 to k-class classification.
bbLemma 4.6 from Zhao et al. (2019h) states that DJS (DSY , D TY ) ≤ DJS (DSZ , D TZ ), which covers the casee = Z.
Zb to be a one-hot prediction ofb ⊗ Z, let us first recall that we assume h or equivalently Y
e=Y
When Z
the class. We have the following Markov chain:
g

h̃

l

b
e −→ Y,X −→ Z −→ Z
where h̃(z) = h(z) ⊗ z and l : Y ⊗ Z → Y returns the index of the non-zero block in h̃(z). There is only
one such block since h is a one-hot, and its index corresponds to the class predicted by h. We can now
apply the same proof than in Zhao et al. (2019h) to conclude that:
DJS (DSY , D TY ) ≤ DJS (DSZ , D TZ ).
b

b

e

e

(5.12)

It essentially boils down to a data-processing argument: the discrimination distance between two distributions cannot increase after the same (possibly stochastic) channel (kernel) is applied to both. Here, thechannel corresponds to the (potentially randomized) function l.
b = l (Ze ) for a
Remark Additionally, we note that the above inequality holds for any Z̃ such that Y(potentially randomized) function l. This covers any and all potential combinations of representations atbvarious layers of the deep net, including the last layer (which corresponds to its predictions Y).

75

Let us move to the second part of the proof. We wish to show that DJS (D Y , D Y ) ≤ ε(h ◦ g), where D
can be either DS or D T :b

2DJS (D Y , D Y ) ≤ kD Y − D Y k1
b

(Lin, 1991)bkb = i ) − D(Y = i )|= ∑ |D(Yi =1kkb = i |Y = j)D(Y = j) − D(Y = i )|= ∑ | ∑ D(Yi =1 j =1k

b = i |Y = i )D(Y = i ) − D(Y = i ) + ∑D(Yb = i |Y = j)D(Y = j)|= ∑ |D(Yi =1

j 6 =ikk

i =1

i =1 j 6 = i

b = i |Y = i ) − 1|D(Y = i ) + ∑ ∑D(Yb = i |Y = j)D(Y = j)
≤ ∑ |D(Ykkb 6= Y |Y = i )D(Y = i ) + ∑ ∑D(Yb = i |Y = j)D(Y = j)
= ∑ D(Yi =1

j = 1i 6 = jkb 6= Y |Y = i )D(Y = i ) = 2D(Yb 6= Y ) = 2ε(h ◦ g).
= 2 ∑ D(Y(5.13)

i =1√
We can now apply the triangular inequality to DJS , which is a distance metric (Endres and Schindelin,2003), called the Jensen-Shannon distance. This gives us:
q
q
q
q
b
b
b
b
Y
Y
Y
Y
Y
Y
DJS (DS , D T ) ≤ DJS (DS , DS ) + DJS (DS , D T ) + DJS (D TY , D TY )
q
q
q
b
e
e
Y
Y
Z
Z
≤ DJS (DS , DS ) + DJS (DS , DT ) + DJS (DTYb , DTY )qqq≤ ε S (h ◦ g) + DJS (DSZe , DTZe ) + ε T (h ◦ g).
where we used Equation (5.12) for the second inequality and (5.13) for the third.
eeFinally, assuming that DJS (DSY , D TY ) ≥ DJS (DSZ , D TZ ), we get:q

DJS (DSY , D TY ) −qee
DJS (DSZ , D TZ )

2

≤

q

ε S (h ◦ g) +q

ε T (h ◦ g)

≤ 2 (ε S (h ◦ g) + ε T (h ◦ g)) .
which concludes the proof.

5.5.4

2

Proof of Theorem 5.3.1b) as follows:
To simplify the notation, we define the error gap ∆ε (Yb ) : = | ε S (Yb ) − ε T (Yb)|.
∆ ε (Y
Also, in this case we use D a , a ∈ {S, T } to mean the source and target distributions respectively. Before
we give the proof of Theorem 5.3.1, we first prove the following two lemmas that will be used in the proof.

76Lemma 5.5.2. Define γa,j := D a (Y = j), ∀ a ∈ {S, T }, ∀ j ∈ [k ], then ∀α j , β j ≥ 0 such that α j + β j = 1,and ∀i 6= j, the following upper bound holds:
b = i | Y = j) − γT,j D T (Yb = i | Y = j)| ≤|γS,j DS (Yb = i | Y = j ) + β j D T (Yb = i | Y = j) + γS,j β j ∆CE (Yb) + γT,j α j ∆CE (Yb ).
|γS,j − γT,j | · α j DS (Yb = i ) : = α j D S (Yb = i | Y = j ) + β j D T (Yb=i|
Proof. To make the derivation uncluttered, define D j (Yb = i given Y = j, where the mixture weight is given
Y = j) to be the mixture conditional probability of Y
by α j and β j . Then in order to prove the upper bound in the lemma, it suffices if we give the desired upperbound for the following termb = i | Y = j) − γT,j D T (Yb = i | Y = j)| − |(γS,j − γT,j )D j (Yb = i )|
|γS,j DS (Yb = i | Y = j) − γT,j D T (Yb = i | Y = j) − (γS,j − γT,j )D j (Yb = i)≤ γS,j DS (Yb = i | Y = j ) − D j (Yb = i )) − γT,j (D T (Yb = i | Y = j ) − D j (Yb = i )) ,= γS,j (DS (Yfollowing which we will have:b = i | Y = j) − γT,j D T (Yb = i | Y = j)| ≤ |(γS,j − γT,j )D j (Yb = i )|
|γS,j DS (Yb = i | Y = j ) − D j (Yb = i )) − γT,j (D T (Yb = i | Y = j ) − D j (Yb = i ))
+ γS,j (DS (Yb = i | Y = j ) + β j D T (Yb = i | Y = j)
≤ |γS,j − γT,j | α j DS (Yb = i | Y = j ) − D j (Yb = i ) + γT,j D T (Yb = i | Y = j ) − D j (Yb = i) .
+ γS,j DS (Yb = i | Y = j ) − D j (Yb = i ). By definition of D j (Yb = i) =To proceed, let us first simplify DS (Yb = i | Y = j ) + β j D T (Yb = i | Y = j), we know that:α j D S (Yb = i | Y = j ) − D j (Yb = i)D S (Yb = i | Y = j ) − α j D S (Yb = i | Y = j ) + β j D T (Yb = i | Y = j)
= D S (Yb = i | Y = j ) − α j D S (Yb = i | Y = j ) − β j D T (Yb = i | Y = j)
= D S (Yb = i | Y = j ) − D T (Yb = i | Y = j) .
= β j D S (Yb = i | Y = j ) − D j (Yb = i ), we can show that:
Similarly, for the second term D T (Y
b = i | Y = j ) − D j (Yb = i ) = α j D T (Yb = i | Y = j ) − D S (Yb = i | Y = j) .
D T (Y
Plugging these two identities into the above, we can continue the analysis withb = i | Y = j ) − D j (Yb = i )) − γT,j (D T (Yb = i | Y = j ) − D j (Yb = i ))
γS,j (DS (Yb = i | Y = j ) − D T (Yb = i | Y = j)) − γT,j α j (D T (Yb = i | Y = j ) − D S (Yb = i | Y = j))= γS,j β(DS (Yb = i | Y = j ) − D T (Yb = i | Y = j)) + γT,j α j (D T (Yb = i | Y = j ) − D S (Yb = i | Y = j))≤ γS,j β j (DS (Yb) + γT,j α j ∆CE (Yb ).
≤ γS,j β j ∆CE (YThe first inequality holds by the triangle inequality and the second by the definition of the conditional error
gap. Combining all the inequalities above completes the proof.
77

We are now ready to prove the theorem:b = (h ◦ g)( X ),Theorem 5.3.1. (Error Decomposition Theorem) For any classifier Y

b k Y ) + 2(k − 1)∆CE (Yb ),|ε S (h ◦ g) − ε T (h ◦ g)| ≤ kDSY − DTY k1 · BERDS (Ywhere kDSY − D TY k1 := ∑ik=1 |DS (Y = i ) − D T (Y = i )| is the L1 distance between DSY and D TY .
Proof of Theorem 5.3.1. First, by the law of total probability, it is easy to verify that following identity
holds for a ∈ {S, T }:b 6 = Y ) = ∑ D a (Yb = i, Y = j) = ∑ γa,j D a (Yb = i | Y = j ).
D a (Y
i6= j

i6= j

Using this identity, to bound the error gap, we have:b ) − D T (Y 6 = Yb)||DS (Y 6= Y
b = i | Y = j) − ∑ γT,j D T (Yb = i | Y = j)= ∑ γS,j DS (Y
i6= j

i6= j

b = i | Y = j) − γT,j D T (Yb = i | Y = j) .
≤ ∑ γS,j DS (Yi6= j

Invoking Lemma 7.6.1 to bound the above terms, and since ∀ j ∈ [k ], γS,j , γT,j ∈ [0, 1], α j + β j = 1, we
get:b ) − D T (Y 6 = Yb)||DS (Y 6= Y
b = i | Y = j) − γT,j D T (Yb = i | Y = j)≤ ∑ γS,j DS (Y
i6= j



b = i | Y = j ) + β j D T (Yb = i | Y = j) + γS,j β j ∆CE (Yb) + γT,j α j ∆CE (Yb)≤ ∑ |γS,j − γT,j | · α j DS (Y
i6= j



b = i | Y = j ) + β j D T (Yb = i | Y = j) + γS,j ∆CE (Yb) + γT,j ∆CE (Yb)≤ ∑ |γS,j − γT,j | · α j DS (Y
i6= j



k
b = i | Y = j ) + β j D T (Yb = i | Y = j) + ∑ ∑ γS,j ∆CE (Yb) + γT,j ∆CE (Yb)= ∑ |γS,j − γT,j | · α j DS (Y
i6= j





i =1 j 6 = i

b = i | Y = j ) + β j D T (Yb = i | Y = j) + 2(k − 1)∆CE (Yb ).
= ∑ |γS,j − γT,j | · α j DS (Yi6= jNote that the above holds ∀α j , β j ≥ 0 such that α j + β j = 1. By choosing α j = 1, ∀ j ∈ [k ] andβ j = 0, ∀ j ∈ [k ], we have:b = i | Y = j) + 2(k − 1)∆CE (Yb)= ∑ |γS,j − γT,j | · DS (Yi6= jk= ∑ |γS,j − γT,j | ·
j =1
k

k

∑ DS (Yb = i | Y = j)i =1,i 6= j!
b)
+ 2(k − 1)∆CE (Yb 6= Y | Y = j) + 2(k − 1)∆CE (Yb)= ∑ |γS,j − γT,j | · DS (Yj =1

b k Y ) + 2(k − 1)∆CE (Yb ),≤ kDSY − DTY k1 · BERDS (Ywhere the last line is due to Holder’s inequality, completing the proof.
78

5.5.5

Proof of Theorem 5.3.2

b = h( Z ) be theTheorem 5.3.2. If Z = g( X ) satisfies GLS, then for any h : Z → Y and letting Ybbb
predictor, we have ε S (Y ) + ε T (Y ) ≤ 2BERDS (Y k Y ).
Proof. First, by the law of total probability, we have:b ) + ε T (Yb ) = D S (Y 6 = Yb ) + D T (Y 6 = Yb)ε S (Ykb = i |Y = j)DS (Y = j) + D T (Yb = i |Y = j)D T (Y = j).
= ∑ ∑ D S (Yj = 1i 6 = j

b = (h ◦ g)( X ) = h( Z ), Y
b is a function of Z. Given the generalized label shift assumption,
Now, since Y
this guarantees that:∀y, y0 ∈ Y ,b = y 0 | Y = y ) = D T (Yb = y 0 | Y = y ).
D S (YThus:kb ) + ε T (Yb ) = ∑ ∑ D S (Yb = i |Y = j)(DS (Y = j) + D T (Y = j))ε S (Yj = 1i 6 = j

b 6= Y | Y = j) · (DS (Y = j) + D T (Y = j))= ∑ D S (Yj∈[k ]

b 6 = Y | Y = j ) · ∑ D S (Y = j ) + D T (Y = j )≤ max DS (Yj∈[k]j∈[k ]b k Y ).
= 2BERDS (Y

5.5.6



Proof of Lemma 5.3.1

Lemma 5.3.1. Assuming Z = g( X ) satisfies GLS, then D T ( Z ) = ∑y∈Y wy · DS ( Z, Y = y) =: DSw ( Z ).
Proof. Using (5.2) and (5.4) on the second line:

D T ( Z ) = ∑ D T (Y = y ) · D T ( Z | Y = y )y∈Y= ∑ w y · D S (Y = y ) · D S ( Z | Y = y )y∈Y= ∑ wy · DS ( Z, Y = y).



y∈Y

5.5.7

Proof of Theorem 5.3.3

Theorem 5.3.3. (Clustering structure implies sufficiency) Let Z = g( X ) such that D T ( Z ) = DSw ( Z ).
Assume D T (Y = y) > 0, ∀y ∈ Y . If there exists a partition of Z = ∪y∈Y Zy such that ∀y ∈ Y ,DS ( Z ∈ Zy | Y = y) = DT ( Z ∈ Zy | Y = y) = 1, then Z = g( X ) satisfies GLS.

79

Proof. Follow the condition that D T ( Z ) = DSw ( Z ), by definition of DSw ( Z ), we have:

D T (Y = y )D ( Z, Y = y) ⇐⇒ DT ( Z ) = ∑ DT (Y = y)DS ( Z | Y = y)
D S (Y = y ) Sy∈Yy∈Y

DT (Z) = ∑⇐⇒∑ DT (Y = y)DT (Z | Y = y) = ∑ DT (Y = y)DS (Z | Y = y).

y∈Y

y∈Y

Note that the above equation holds for all measurable subsets of Z . Now by the assumption that Z =∪y∈Y Zy is a partition of Z , consider Zy0 :∑ DT (Y = y)DT (Z ∈ Zy0 | Y = y) = ∑ DT (Y = y)DS (Z ∈ Zy0 | Y = y).

y∈Y

y∈Y

Due to the assumption DS ( Z ∈ Zy | Y = y) = D T ( Z ∈ Zy | Y = y) = 1, we know that ∀y0 6= y,
DT ( Z ∈ Zy0 | Y = y) = DS ( Z ∈ Zy0 | Y = y) = 0. This shows that both the supports ofDS ( Z | Y = y) and DT ( Z | Y = y) are contained in Zy . Now consider an arbitrary measurable set
E ⊆ Zy , since ∪y∈Y Zy is a partition of Z , we know that

DS ( Z ∈ E | Y = y0 ) = DT ( Z ∈ E | Y = y0 ) = 0,∀y0 6= y.

Plug Z ∈ E into the following identity:∑ DT (Y = y)DT (Z ∈ E | Y = y) = ∑ DT (Y = y)DS (Z ∈ E | Y = y)

y∈Y

y∈Y

=⇒ DT (Y = y)DT ( Z ∈ E | Y = y) = DT (Y = y)DS ( Z ∈ E | Y = y)=⇒ DT ( Z ∈ E | Y = y) = DS ( Z ∈ E | Y = y),where the last line holds because D T (Y = y) 6= 0. Realize that the choice of E is arbitrary, this shows that
DS ( Z | Y = y) = DT ( Z | Y = y), which completes the proof.


5.5.8

Sufficient Conditions for GLS

b = h( Z ), γ := miny∈Y D T (Y = y) and w M := max wy . For Z̃ = Ŷ ⊗ Z, we
Theorem 5.3.4. Let Y
y∈Y

have:

max dTV (DS ( Z | Y = y), D T ( Z | Y = y)) ≤
y∈Y


q
1
w
b
b
w M ε S (Y ) + ε T (Y ) + 2DJS (DS ( Z̃ ), D T ( Z̃ )) .
γ
Proof. For a given class y, we let Ry denote the y-th row of Ŷ ⊗ Z. Ry is a random variable that lives in
Z . Let us consider a measurable set E ⊆ Z . Two options exist:• 0 ∈ E, in which case: { Ry ∈ E} = ({ Z ∈ E} ∩ {Ŷ = y}) ∪ {Ŷ 6= y},• 0∈/ E, in which case: { Ry ∈ E} = { Z ∈ E} ∩ {Ŷ = y}.

80

This allows us to write:

DSw ( Ry ∈ E) = DSw ( Z ∈ E, Ŷ = y) + 1{0∈E} DSw (Ŷ 6= y)(5.14)= ∑DS ( Z ∈ E, Ŷ = y, Y = y0 )wy0 + 1{0∈E}y0DT ( Ry ∈ E) = DT ( Z ∈ E, Ŷ = y) + 1{0∈E} DT (Ŷ 6= y)= ∑DT ( Z ∈ E, Ŷ = y, Y = y ) + 1{0∈E}0y0∑ DS (Ŷ = y00 , Y = y0 )wy0

y0 ,y00 6=y(5.15)∑ DT (Ŷ = y , Y = y ).
000

y0 ,y00 6=y

We are interested in the quantity|DS ( Z ∈ E | Y = y) − DT ( Z ∈ E | Y = y)| =1|D ( Z ∈ E, Y = y)wy − DT ( Z ∈ E, Y = y)|,D T (Y = y ) S

which we bound below:|DS ( Z ∈ E, Y = y)wy − DT ( Z ∈ E, Y = y)|= |DS ( Z ∈ E, Y = y)wy − DSw ( Ry ∈ E) + DSw ( Ry ∈ E) − DT ( Ry ∈ E)
+ DT ( Ry ∈ E) − DT ( Z ∈ E, Y = y)|= |DS ( Z ∈ E, Y = y)wy − DSw ( Z ∈ E, Ŷ = y) − 1{0∈E} DSw (Ŷ 6= y) + DSw ( Ry ∈ E) − DT ( Ry ∈ E)
+ 1{0∈E} DT (Ŷ 6= y) + DT ( Z ∈ E, Ŷ = y) − DT ( Z ∈ E, Y = y)|≤ |DS ( Z ∈ E, Y = y)wy − DSw ( Z ∈ E, Ŷ = y)| + 1{0∈E} |DSw (Ŷ 6= y) − DT (Ŷ 6= y)|+ |DSw ( Ry ∈ E) − DT ( Ry ∈ E)| + |DT ( Z ∈ E, Ŷ = y) − DT ( Z ∈ E, Y = y)|≤ |DS ( Z ∈ E, Y = y)wy − DSw ( Z ∈ E, Ŷ = y)| + |DSw (Ŷ 6= y) − DT (Ŷ 6= y)|+ DTV (DSw ( Ry ), DT ( Ry )) + |DT ( Z ∈ E, Ŷ = y) − DT ( Z ∈ E, Y = y)|, (5.16)

where we used Eqs.5.14 and 5.15 on the third line, the triangle inequality on the fourth and supE |DSw ( Ry ∈E) − D T ( Ry ∈ E)| = DTV (DSw ( Ry ), D T ( Ry )) on the last. Let us start by upper-bounding the first term:|DS ( Z ∈ E, Y = y)wy − DSw ( Z ∈ E, Ŷ = y)|= |∑DS ( Z ∈ E, Ŷ = y, Y = y0 )wy0 − ∑DS ( Z ∈ E, Ŷ = y0 , Y = y)wy |y0y0≤ | ∑ DS ( Z ∈ E, Ŷ = y, Y = y0 )wy0 − DS ( Z ∈ E, Ŷ = y0 , Y = y)wy |y0 6=y≤ w M ∑ DS ( Z ∈ E, Ŷ = y, Y = y0 ) + DS ( Z ∈ E, Ŷ = y0 , Y = y)y0 6=yb ).
≤ w M DS ( Z ∈ E, Ŷ 6= Y ) ≤ w M ε S (Yb) which bounds the third term
Similarly, we can prove that: |DT ( Ry ∈ E) − D T ( Z ∈ E, Y = y)| ≤ ε T (Y81

of 5.16. As far as the second term is concerned:|DSw (Ŷ 6= y) − DT (Ŷ 6= y)| =|DS (Ŷ = y00 , Y = y0 )wy0 − ∑ DT (Ŷ = y00 , Y = y0 )|
∑
0 00
0 00

y ,y 6=yy ,y 6=y≤|∑DS (Y = y )wy0 − ∑DT (Y = y0 )|
0

y0

y0

+ | ∑ DS (Ŷ = y, Y = y0 )wy0 − ∑ DT (Ŷ = y, Y = y0 )y0 6=yy0 6=y+ DS (Ŷ = y, Y = y)wy − DT (Ŷ = y, Y = y)|≤| ∑ DS (Ŷ = y, Y = y0 )wy0 − ∑ DT (Ŷ = y, Y = y0 )y0 6=yy0 6=y+ DS (Y = y)wy − DS (Ŷ 6= y, Y = y)wy
− DT (Y = y) + DT (Ŷ 6= y, Y = y)|≤ ∑ DS (Ŷ = y, Y = y0 )wy0 + DS (Ŷ 6= y, Y = y)wy
y0 6=y+ ∑ DT (Ŷ = y, Y = y0 ) + DT (Ŷ 6= y, Y = y)y0 6=yb ) + ε T (Yb)
≤ w M ε S (Ywhere the first term of the first inequality disappeared because ∀y0 ∈ Y , DS (Y = y0 )wy0 = D T (Y = y0 )(we also used that property in the second line of the second inequality). Combining these in Eq.5.16, thisguarantees that for any measurable set E:b) + DTV (DSw ( Ry ), D T ( Ry )) + 2ε T (Yb ).
|DS ( Z ∈ E, Y = y)wy − DT ( Z ∈ E, Y = y)| ≤ 2w M ε S (YFinally, we have DTV (DSw ( Ry ), D T ( Ry )) ≤ DTV (DSw (Ŷ ⊗ Z ) k D T (Ŷ ⊗ Z )) and from Briët andq
Harremoës (2009)), DTV (DSw (Ŷ ⊗ Z ) k D T (Ŷ ⊗ Z )) ≤ 8DJS (DSw (Ŷ ⊗ Z ) k D T (Ŷ ⊗ Z )) (the total
variation and Jensen-Shannon distance are equivalent), which gives us straightforwardly:
1|D ( Z ∈ E, Y = y)wy − DT ( Z ∈ E, Y = y)|
D T (Y = y ) S1b) + DTV (DSw ( Ry ), D T ( Ry )) + 2ε T (Yb)≤
2w M ε S (YD T (Y = y )


q
1
w
b) + 8DJS (D ( Z̃ ) k D T ( Z̃ )) + 2ε T (Yb) .
≤2w M ε S (YS
D T (Y = y )|DS ( Z ∈ E | Y = y) − DT ( Z ∈ E | Y = y)| =Using the fact that DTV (DS ( Z | Y = y), D T ( Z | Y = y)) = sup|DS ( Z ∈ E | Y = y) − D T ( Z ∈ E |E

Y = y)| gives:



q
2
w
b
b
w M ε S (Y ) + 2DJS (DS ( Z̃ ) k D T ( Z̃ )) + ε T (Y )DTV (DS ( Z | Y = y), D T ( Z | Y = y)) ≤D T (Y = y )q2b) + 2DJS (D w ( Z̃ ) k D T ( Z̃ )) + ε T (Yb) .
≤w M ε S (YSγTaking the maximum over y on the left-hand side concludes the proof.
82

Theorem 5.3.5. With the same notation as Thm. 5.3.4:
max dTV (DS ( Z | Y = y), D T ( Z | Y = y)) ≤
y∈Y
 

 q
1
w
b
b
× inf w M ε S (Y ) + ε T (Y ) + 8DJS (DS ( Z ), DT ( Z )) .
γbYb = h( Z ) for some
Proof. To prove the above upper bound, let us first fix a y ∈ Y and fix a classifier Y
h : Z → Y . Now consider any measurable subset E ⊆ Z , we would like to upper bound the following
quantity:1· |DS ( Z ∈ E, Y = y)wy − DT ( Z ∈ E, Y = y)|
D T (Y = y )1≤ · |DS ( Z ∈ E, Y = y)wy − DT ( Z ∈ E, Y = y)|.
γ|DS ( Z ∈ E | Y = y) − DT ( Z ∈ E | Y = y)| =Hence it suffices if we can upper bound |DS ( Z ∈ E, Y = y)wy − D T ( Z ∈ E, Y = y)|. To do so, consider
the following decomposition:b = y)|DT ( Z ∈ E, Y = y) − DS ( Z ∈ E, Y = y)wy | = |DT ( Z ∈ E, Y = y) − DT ( Z ∈ E, Y
b = y) − DSw ( Z ∈ E, Y
b = y)+ DT ( Z ∈ E, Y

b = y) − DS ( Z ∈ E, Y = y)wy |+ DSw ( Z ∈ E, Y
b = y)|≤ |DT ( Z ∈ E, Y = y) − DT ( Z ∈ E, Y

b = y) − DSw ( Z ∈ E, Y
b = y)|+ |DT ( Z ∈ E, Y
b = y) − DS ( Z ∈ E, Y = y)wy |.
+ |DSw ( Z ∈ E, Y

b = y)|:
We bound the above three terms in turn. First, consider |DT ( Z ∈ E, Y = y) − D T ( Z ∈ E, Y
b = y)| = | ∑ D T ( Z ∈ E, Y = y, Yb = y0 ) − ∑ D T ( Z ∈ E, Y
b = y, Y = y0 )||DT ( Z ∈ E, Y = y) − DT ( Z ∈ E, Yy0y0

b = y0 ) − D T ( Z ∈ E, Y
b = y, Y = y0 )|≤ ∑ |DT ( Z ∈ E, Y = y, Y
y0 6=yb = y0 ) + D T ( Z ∈ E, Y
b = y, Y = y0 )≤ ∑ DT ( Z ∈ E, Y = y, Y
y0 6=yb = y 0 ) + D T (Yb = y, Y = y0 )≤ ∑ DT (Y = y, Y
y0 6=yb)≤ D T (Y 6 = Yb ),= ε T (Ywhere the last inequality is due to the fact that the definition of error rate corresponds to the sum of all theoff-diagonal elements in the confusion matrix while the sum here only corresponds to the sum of all the83elements in two slices. Similarly, we can bound the third term as follows:b = y) − DS ( Z ∈ E, Y = y)wy ||DSw ( Z ∈ E, Y
b = y, Y = y0 )wy0 − ∑DS ( Z ∈ E, Y
b = y 0 , Y = y )wy |= |∑DS ( Z ∈ E, Yy0y0

b = y, Y = y0 )wy0 − DS ( Z ∈ E, Y
b = y 0 , Y = y )wy |≤ | ∑ DS ( Z ∈ E, Y
y0 6=yb = y, Y = y0 ) + DS ( Z ∈ E, Y
b = y0 , Y = y)
≤ w M ∑ DS ( Z ∈ E, Y
y0 6=yb 6= Y )≤ w M DS ( Z ∈ E, Yb ).
≤ w M ε S (YNow we bound the last term. Recall the definition of total variation, we have:b = y) − DSw ( Z ∈ E, Y
b = y)| = |DT ( Z ∈ E ∧ Z ∈ Y
b−1 (y)) − DSw ( Z ∈ E ∧ Z ∈ Y
b−1 (y))||DT ( Z ∈ E, Y≤
sup|DT ( Z ∈ E0 ) − DSw ( Z ∈ E0 )|E0 is measurable= dTV (DT ( Z ), DSw ( Z )).
Combining the above three parts yields|DS ( Z ∈ E | Y = y) − DT ( Z ∈ E | Y = y)| ≤
1 b ) + ε T (Yb) + dTV (DSw ( Z ), D T ( Z )) .
· w M ε S (Yγ

Now realizing that the choice of y ∈ Y and the measurable subset E on the LHS is arbitrary, this leads tomax sup |DS ( Z ∈ E | Y = y) − D T ( Z ∈ E | Y = y)| ≤
y∈Y

E


1 
b ) + ε T (Yb) + dTV (DSw ( Z ), D T ( Z )) .
· w M ε S (Yγb = h( Z ), hence we have
Furthermore, notice that the above upper bound holds for any classifier Y
max dTV (DS ( Z ∈ E | Y = y), D T ( Z ∈ E | Y = y)) ≤
y∈Y



1
b ) + ε T (Yb) + dTV (DSw ( Z ), D T ( Z )) ,· inf w M ε S (Yγ Ybwhich completes the proof.

5.5.9

Proof of Lemma 5.3.2

Lemma 5.3.2. If GLS is verified, and if the confusion matrix C is invertible, then w = C−1 µ.
b = h( Z ) over both source and target domains, it is
Proof. Given (5.2), and with the joint hypothesis Y
straightforward to see that the induced conditional distributions over predicted labels match between thesource and target domains, i.e.:b = h( Z ) | Y = y) =D S (Yb = h ( Z ) | Y = y ), ∀ y ∈ Y .
D T (Y84(5.17)

This allows us to compute µy , ∀y ∈ Y asb = y) =D T (Y=b = y | Y = y 0 ) · D T (Y = y 0 )D T (Y∑0y ∈Y

b = y | Y = y 0 ) · D T (Y = y 0 )D S (Y
∑
0

y ∈Y

=

D T (Y = y 0 )b = y, Y = y0 ) ·D S (Y∑D S (Y = y 0 )
0

y ∈Y

=

∑ Cy,y0 · wy0 .

y0 ∈Ywhere we used (5.17) for the second line. We thus have µ = Cw which concludes the proof.

5.5.10F -IPM for Distributional Alignment

In Table 5.5.1, we list different instances of IPM with different choices of the function class F in theabove definition, including the total variation distance, Wasserstein-1 distance and the Maximum mean
discrepancy (Gretton et al., 2012).
Table 5.5.1: List of IPMs with different F . k · kLip denotes the Lipschitz seminorm and H is a reproducing
kernel Hilbert space (RKHS).
dF

F{ f : k f k ∞ ≤ 1}
{ f : k f kLip ≤ 1}
{ f : k f k H ≤ 1}

5.6

Total Variation
Wasserstein-1 distance
Maximum mean discrepancy

Conclusion

We have introduced the generalized label shift assumption and theoretically-grounded variations of existingalgorithms to handle mismatched label distributions. On (rather) balanced tasks from classic benchmarks,
our algorithms outperform (by small margins) their base versions. On unbalanced datasets, the gain
becomes significant and, as expected theoretically, correlates well with the JSD between label distributions.
We now discuss potential improvements.
Improved importance weights estimation All the results above were obtained with λ = 0.5; wefavored simplicity of the algorithm over raw performance. We notice however, that the oracle sometimes
shows substantial improvements over the estimated weights algorithm. It suggests that w is not perfectly
estimated and that e.g. fine-tuning λ or updating w more or less often could lead to better performance.
One can also think of settings (e.g. semi-supervised learning) where estimations of D TY can be obtained via
other means.

85Extensions The framework we define relies on appropriately reweighting the domain adversarial losses.
It can be straightforwardly applied to settings where multiple source and/or target domains are used, bysimply maintaining one importance weights vector w for each source/target pair (Peng et al., 2019; Zhao
et al., 2018c). In particular, label shift could explain the observation from Zhao et al. (2018c) that too manysource domains sometimes hurt performance, and our framework might alleviate the issue.

86Appendix
5.A

More Experiments

5.A.1

Description of the domain adaptation tasks

Digits We follow a widely used evaluation protocol (Hoffman et al., 2017b; Long et al., 2018). For thedigits datasets MNIST (M, LeCun and Cortes (2010)) and USPS (U, Dheeru and Karra Taniskidou (2017)),
we consider the DA tasks: M → U and U → M. Performance is evaluated on the 10,000/2,007 examplesof the MNIST/USPS test sets.
Visda (2017) is a sim-to-real domain adaptation task. The synthetic domain contains 2D renderingof 3D models captured at different angles and lighting conditions. The real domain is made of natural
images. Overall, the training, validation and test domains contain 152,397, 55,388 and 5,534 images, from
12 different classes.
Office-31 (Saenko et al., 2010) is one of the most popular dataset for domain adaptation . It contains
4,652 images from 31 classes. The samples come from three domains: Amazon (A), DSLR (D) and
Webcam (W), which generate six possible transfer tasks, A → D, A → W, D → A, D → W, W → A andW → D, which we all evaluate.
Office-Home (Venkateswara et al., 2017) is a more complex dataset than Office-31. It consists of
15,500 images from 65 classes depicting objects in office and home environments. The images form four
different domains: Artistic (A), Clipart (C), Product (P), and Real-World images (R). We evaluate the 12
possible domain adaptation tasks.

5.A.2

Full results on the domain adaptation tasks

Tables 5.A.1, 5.A.2, 5.A.3, 5.A.4, 5.A.5 and 5.A.6 show the detailed results of all the algorithms on eachtask of the domains described above. The subscript denotes the fraction of seeds for which our variant
outperforms the base algorithm. More precisely, by outperform, we mean that for a given seed (which fixes
the network initialization as well as the data being fed to the model) the variant has a larger accuracy on thetest set than its base version. Doing so allows to assess specifically the effect of the algorithm, all else kept
constant.

5.A.3

Jensen-Shannon divergence of the original and subsampled domain adaptation datasets

Tables 5.A.7, 5.A.8 and 5.A.9 show DJS (DS ( Z )||D T ( Z )) for our four datasets and their subsampled
versions, rows correspond to the source domain, and columns to the target one. We recall that subsampling
simply consists in taking 30% of the first half of the classes in the source domain (which explains why
DJS (DS ( Z )||D T ( Z )) is not symmetric for the subsampled datasets).

87Table 5.A.1: Results on the Digits tasks. M and U stand for MNIST and USPS, the prefix s denotes theexperiment where the source domain is subsampled to increase DJS (DSY , D TY ).
M ETHOD

M→U

U→M

AVG .

SM → USU → MAVG .

NO AD.

79.04

75.30

77.17

76.02

75.32

75.67

DANN
IWDAN
IWDAN-O

90.65
93.28100%
93.73100%95.66
96.52100%
96.81100%

93.15
94.90100%
95.27100%

79.03
91.77100%
92.50100%

87.46
93.32100%
96.42100%

83.24
92.54100%
94.46100%

CDAN
IWCDANIWCDAN-O

94.16
94.3660%
94.3480%

97.29
97.45100%
97.35100%95.72
95.9080%
95.8590%

84.91
93.42100%
93.37100%

91.55
93.03100%
96.26100%88.23
93.22100%
94.81100%

Table 5.A.2: Results on the Visda domain. The prefix s denotes the experiment where the source domain issubsampled to increase DJS (DSY , D TY ).

5.A.4

M ETHODV ISDAS V ISDANO AD.

48.39

49.02

DANN
IWDAN
IWDAN-O

61.88
63.52100%64.19100%52.85
60.18100%
62.10100%

CDAN
IWCDANIWCDAN-O

65.60
66.4960%
68.15100%

60.19
65.83100%
66.85100%

JAN
IWJAN
IWJAN-O

56.98100%
57.56100%
61.48100%

50.64100%
57.12100%61.30100%

LossesFor batches of data ( xSi , yiS ) and ( xiT ) of size s, the DANN losses are:1 slog(dψ ( gθ ( xSi ))) + log(1 − dψ ( gθ ( xiT ))),s i∑
=1

(5.18)1 slog(hφ ( gθ ( xSi )yi )).
S
s i∑
=1

(5.19)

L DA ( xSi , yiS , xiT ; θ, ψ) = −LC ( xSi , yiS ; θ, φ) = −
Similarly, the CDAN losses are:

L DA ( xSi , yiS , xiT ; θ, ψ) = −LC ( xSi , yiS ; θ, φ) = −1 slog(dψ (hφ ( gθ ( xSi )) ⊗ gθ ( xSi ))) + log(1 − dψ (hφ ( gθ ( xiT )) ⊗ gθ ( xiT ))),s i∑
=1
(5.20)1 slog(hφ ( gθ ( xSi )yi )),
S
s i∑
=1

(5.21)

where hφ ( gθ ( xSi )) ⊗ gθ ( xSi ) := (h1 ( g( xSi )) g( xSi ), . . . , hk ( g( xSi )) g( xSi )) and h1 ( g( xSi )) is the i-th element of vector h( g( xSi )).
88Table 5.A.3: Results on the Office dataset.

M ETHOD

A→D

A→W

D→A

D→W

W→A

W→D

AVG .

N O DA

79.60

73.18

59.33

96.30

58.75

99.68

77.81

DANN
IWDAN
IWDAN-O

84.06
84.3060%
87.23100%

85.41
86.42100%
88.88100%

64.67
68.38100%
69.92100%

96.08
97.13100%
98.09100%

66.77
67.1660%
67.9680%99.44
100.0100%
99.92100%

82.74
83.9087%
85.3397%

CDAN
IWCDANIWCDAN-O

89.56
88.9160%
90.0860%

93.01
93.2360%
94.52100%

71.25
71.9080%
73.11100%99.24
99.3080%
99.3080%70.32
70.4360%
71.83100%100.0
100.0100%
100.0100%

87.23
87.3073%
88.1490%

JAN
IWJAN
IWJAN-O

85.94
87.68100%
89.68100%

85.66
84.860%89.18100%

70.50
70.3660%
71.96100%

97.48
98.98100%
99.02100%71.5
70.060%73.0100%

99.72
100.0100%
100.0100%85.13
85.3260%
87.14100%

Table 5.A.4: Results on the Subsampled Office dataset.

M ETHOD

SA → DSA → W

SD → ASD → W

SW → A

SW → DAVG .

N O DA

75.82

70.69

56.82

95.32

58.35

97.31

75.72

DANN
IWDAN
IWDAN-O

75.46
81.61100%
84.94100%

77.66
88.43100%
91.17100%

56.58
65.00100%
68.44100%

93.76
96.98100%97.74100%

57.51
64.86100%
64.57100%

96.02
98.72100%
99.60100%76.17
82.60100%
84.41100%

CDAN
IWCDANIWCDAN-O

82.45
86.59100%
87.39100%

84.60
87.30100%
91.47100%62.54
66.45100%
69.69100%

96.83
97.69100%
97.91100%65.01
66.34100%
67.50100%

98.31
98.92100%
98.88100%

81.62
83.88100%
85.47100%

JAN
IWJAN
IWJAN-O

77.74
84.62100%
88.42100%

77.64
83.28100%
89.44100%64.48
65.3080%
72.06100%

91.68
96.30100%
97.26100%

92.60
98.80100%
98.96100%65.10
67.38100%
71.30100%78.21
82.6197%86.24100%

The JAN losses (Long et al., 2017) are :
1 s
1 s
2 s
j
j
j
L DA ( xSi , yiS , xiT ; θ, ψ) = − 2 ∑ k( xSi , xS ) − 2 ∑ k( xiT , xT ) + 2 ∑ k( xSi , xT )s i,j=1
s i,j=1
s i,j=1(5.22)1 slog(hφ ( gθ ( xSi )yi )),
S
s i∑
=1

(5.23)LC ( xSi , yiS ; θ, φ) = −where k corresponds to the kernel of the RKHS H used to measure the discrepancy between distributions.
j
Exactly as in Long et al. (2017), it is the product of kernels on various layers of the network k ( xSi , xS ) =j∏l ∈L kl ( xSi , xS ). Each individual kernel kl is computed as the dot-product between two transformationsjjof the representation: kl ( xSi , xS ) = hdlψ ( gθl ( xSi )), dlψ ( gθl ( xS ))i (in this case, dlψ outputs vectors in ahigh-dimensional space). See Section 5.A.6 for more details.

89

Table 5.A.5: Results on the Office-Home dataset.

M ETHOD

A→C

A→P

A→R

C→A

C→P

C→R

N O DA

41.02

62.97

71.26

48.66

58.86

60.91

DANN
IWDAN
IWDAN-O

46.03
48.65100%
50.19100%

62.23
69.19100%
70.53100%

70.57
73.60100%
75.44100%49.06
53.59100%
56.69100%

63.05
66.25100%
67.40100%64.14
66.09100%
67.98100%

CDAN
IWCDANIWCDAN-O

49.00
49.81100%52.31100%69.23
73.41100%
74.54100%

74.55
77.56100%
78.46100%54.46
56.5100%
60.33100%68.23
69.6480%
70.78100%68.9
70.33100%
71.47100%

JAN
IWJAN
IWJAN-O

41.64
41.120%41.8880%

67.20
67.5680%68.72100%73.12
73.1460%
73.62100%

51.02
51.70100%53.04100%

62.52
63.42100%
63.88100%64.46
65.22100%
66.48100%

M ETHOD

P→A

P→C

P→R

R→A

R→C

R→P

AVG .

N O DA

47.1

35.94

68.27

61.79

44.42

75.5

56.39

DANN
IWDAN
IWDAN-O

48.29
52.81100%
59.33100%44.06
46.2480%
48.28100%

72.62
73.97100%
76.37100%

63.81
64.90100%
69.42100%53.93
54.0280%
56.09100%

77.64
77.96100%78.45100%

59.62
62.2797%
64.68100%

CDAN
IWCDANIWCDAN-O

56.77
58.99100%
62.60100%48.8
48.410%50.73100%

76.83
77.94100%
78.88100%71.27
69.480%72.44100%55.72
54.730%57.79100%

81.27
81.0760%
81.3180%

64.59
65.6670%
67.6498%

JAN
IWJAN
IWJAN-O

54.5
55.2680%
57.78100%40.36
40.3860%
41.32100%73.10
73.0880%
73.66100%64.54
64.4060%
65.40100%45.98
45.680%46.68100%76.58
76.3640%
76.3620%59.59
59.7863%
60.7392%

The IWJAN losses are:
1 s
2 s
1 s
j
j
j
i
i
i
i
i
Lw
(
x
,
y
,
x
;
θ,
ψ
)
=
−
)
+
w
w
k
(
x
,
x
)
−
k
(
x
,
x
wyi k ( xSi , x T ) (5.24)
i
j
∑
∑
∑
T T
DA S S T
S S
yS y
2
2
2
S
s i,j=1
s i,j=1
s i,j=1
Sii
Lw
C ( xS , yS ; θ, φ ) = −

5.A.5

1 s
1
log(hφ ( gθ ( xSi ))yi ).
∑S
s i = 1 k D S (Y = y )Generation of domain adaptation tasks with varying DJS (DS ( Z ) k D T ( Z ))(5.25)

We consider the MNIST → USPS task and generate a set V of 50 vectors in [0.1, 1]10 . Each vector
corresponds to the fraction of each class to be trained on, either in the source or the target domain (to assess
the impact of both). The left bound is chosen as 0.1 to ensure that classes all contain some samples.
This methodology creates 100 domain adaptation tasks, 50 for subsampled-MNIST → USPS and 50
for MNIST → subsampled-USPS, with Jensen-Shannon divergences varying from 6.1e−3 to 9.53e−28 .
They are then used to evaluate our algorithms, see Section 5.4 and Figures 5.4.1 and 5.A.1. Fig 5.A.1 shows
the absolute performance of the 6 algorithms we consider here. We see the sharp decrease in performanceof the base versions DANN and CDAN. Comparatively, our importance-weighted algorithms maintain
good performance even for large divergences between the marginal label distributions.
8 We manually rejected some samples to guarantee a rather uniform set of divergences.

90

Table 5.A.6: Results on the subsampled Office-Home dataset.

M ETHOD

A→C

A→P

A→R

C→A

C→P

C→R

N O DA

35.70

54.72

62.61

43.71

52.54

56.62

DANN
IWDAN
IWDAN-O

36.14
39.81100%
42.79100%54.16
63.01100%66.22100%61.72
68.67100%
71.40100%44.33
47.39100%
53.39100%

52.56
61.05100%61.47100%56.37
60.44100%
64.97100%

CDAN
IWCDANIWCDAN-O

38.90
42.96100%
45.76100%

56.80
65.01100%
68.61100%

64.77
71.34100%73.18100%48.02
52.89100%
56.88100%60.07
64.65100%
66.61100%61.17
66.48100%
68.48100%

JAN
IWJAN
IWJAN-O

34.52
36.24100%
37.46100%

56.86
61.00100%62.68100%64.54
66.34100%
66.88100%46.18
48.66100%
49.82100%

56.84
59.92100%60.22100%59.06
61.88100%
62.54100%

M ETHOD

P→A

P→C

P→R

R→A

R→C

R→P

N O DA

44.29

33.05

65.20

57.12

40.46

70.0

DANN
IWDAN
IWDAN-O

44.58
50.44100%56.05100%37.14
41.63100%
43.39100%65.21
72.46100%
74.87100%

56.70
61.00100%
66.73100%43.16
49.40100%
51.72100%

69.86
76.07100%
77.46100%

51.83
57.61100%
60.87100%

CDAN
IWCDANIWCDAN-O

49.65
54.87100%
59.63100%41.36
44.80100%
46.98100%

70.24
75.91100%
77.54100%

62.35
67.02100%
69.24100%

46.98
50.45100%
53.77100%

74.69
78.55100%78.11100%56.25
61.24100%63.73100%

JAN
IWJAN
IWJAN-O

50.64
52.92100%
56.54100%37.24
37.68100%
39.66100%

69.98
70.88100%
71.78100%58.72
60.32100%62.36100%

40.64
41.54100%
44.56100%

72.00
73.26100%73.76100%

53.94
55.89100%
57.36100%

5.A.6

AVG .

Implementation details

For MNIST and USPS, the architecture is akin to LeNet (LeCun et al., 1998a), with two convolutional
layers, ReLU and MaxPooling, followed by two fully connected layers. The representation is also taken as
the last hidden layer, and has 500 neurons. The optimizer for those tasks is SGD with a learning rate of
0.02, annealed by 0.5 every five training epochs for M → U and 6 for U → M. The weight decay is also5e−4 and the momentum 0.9.
For the Office and Visda experiments with IWDAN and IWCDAN, we train a ResNet-50, optimized
using SGD with momentum. The weight decay is also 5e−4 and the momentum 0.9. The learning rate is3e−4 for the Office-31 tasks A → D and D → W, 1e−3 otherwise (default learning rates from the CDAN
implementation9 ).
For the IWJAN experiments, we use the default implementation of Xlearn codebase10 and simply
add the weigths estimation and reweighted objectives to it, as described in Section 5.A.4. Parameters,
configuration and networks remain the same.
Finally, for the Office experiments, we update the importance weights w every 15 passes on the dataset(in order to improve their estimation on small datasets). On Digits and Visda, the importance weights are
updated every pass on the source dataset. Here too, fine-tuning that value might lead to a better estimation
9 https://github.com/thuml/CDAN/tree/master/pytorch
10 https://github.com/thuml/Xlearn/tree/master/pytorch

91

Table 5.A.7: Jensen-Shannon divergence between the label distributions of the Digits and Visda tasks.
(a) Full Dataset

MNIST
USPS
S YNTH .

(b) Subsampled

MNIST

USPS

R EAL

0
6.64e−3-

6.64e−30-2.61e−2

MNIST
USPS
S YNTH .

MNIST

USPS

R EAL

0
2.75e−2-

6.52e−20-6.81e−2

Table 5.A.8: Jensen-Shannon divergence between the label distributions of the Office-31 tasks.
(a) Full Dataset

A MAZONDSLR
W EBCAMA MAZONDSLR

W EBCAM01.76e−2
9.52e−3

1.76e−202.11e−2

9.52e−3
2.11e−2
0

A MAZONDSLR

W EBCAM05.44e−2
5.15e−2

6.25e−207.05e−2

4.61e−2
5.67e−20(b) Subsampled

A MAZONDSLR
W EBCAMof w and help bridge the gap with the oracle versions of the algorithms.
We use the cvxopt package11 to solve the quadratic program 5.5.

5.A.7

Weight Estimation

We estimate importance weights using Lemma 5.3.2, which relies on the GLS assumption. However, there
is no guarantee that GLS is verified at any point during training, so the exact dynamics of w are unclear.
Below we discuss those dynamics and provide some intuition about them.
In Fig. 5.A.2b, we plot the Euclidean distance between the moving average of weights estimated using
the equation w = C−1 µ and the true weights (note that this can be done for any algorithm). As can be seenin the figure, the distance between the estimated and true weights is highly correlated with the performanceof the algorithm (see Fig.5.A.2a). In particular, we see that the estimations for IWDAN is more accurate
than for DANN. The estimation for DANN exhibits an interesting shape, improving at first, and thengetting worse. At the same time, the estimation for IWDAN improves monotonously. The weights for
IWDAN-O get very close to the true weights which is in line with our theoretical results: IWDAN-O getsclose to zero error on the target error, Thm. 5.3.4 thus guarantees that GLS is verified, which in turns
implies that the weight estimation is accurate (Lemma 5.3.2). Finally, without domain adaptation, theestimation is very poor. The following two lemmas shed some light on the phenomena observed for DANN
and IWDAN:
Lemma 5.A.1. If the source error ε S (h ◦ g) is zero and the source and target marginals verify DJS (DSw̃ ( Z ), D T ( Z )) =0, then the estimated weight vector w is equal to w̃.
11 http://cvxopt.org/

92

Table 5.A.9: Jensen-Shannon divergence between the label distributions of the Office-Home tasks.
(a) Full Dataset

A RT
C LIPARTP RODUCTR EAL W ORLDA RT
C LIPARTP RODUCTR EAL W ORLDA RT

C LIPARTP RODUCTR EAL W ORLD

03.85e−2
4.49e−22.40e−2

3.85e−202.33e−2
2.14e−2

4.49e−2
2.33e−201.61e−22.40e−2
2.14e−2
1.61e−20

A RT

C LIPARTP RODUCTR EAL W ORLD

0
7.07e−2
7.85e−2
6.09e−2

8.41e−206.24e−2
6.52e−2

8.86e−2
5.86e−205.77e−2

6.69e−2
5.68e−2
5.33e−20(b) Subsampled

Proof. If ε S (h ◦ g) = 0, then the confusion matrix C is diagonal and its y-th line is DS (Y = y).
Additionally, if DJS (DSw̃ ( Z ), D T ( Z )) = 0, then from a straightforward extension of Eq. 5.12, we have
DJS (DSw̃ (Ŷ ), D T (Ŷ )) = 0. In other words, the distribution of predictions on the source and target domains
match, i.e. µy = D T (Ŷ = y) = ∑w̃y0 DS (Ŷ = y, Y = y0 ) = w̃y DS (Y = y), ∀y (where the last equalityy0

comes from ε S (h ◦ g) = 0). Finally, we get that w = C−1 µ = w̃.

In particular, applying this lemma to DANN (i.e. with w̃y0 = 1) suggests that at convergence, theestimated weights should tend to 1. Empirically, Fig. 5.A.2b shows that as the marginals get matched,
the estimation for DANN does get closer to 1 (1 corresponds to a distance of 2.16)12 . We now attempt toprovide some intuition on the behavior of IWDAN, with the following lemma:
Lemma 5.A.2. If ε S (h ◦ g) = 0 and if for a given y:min(w̃y DS (Y = y), D T (Y = y)) ≤ µy ≤ max(w̃y DS (Y = y), D T (Y = y)),(5.26)

then, letting w = C−1 µ be the estimated weight:|wy − w∗y | ≤ |w̃y − w∗y |.
Applying this lemma to w̃y = wt , and assuming that (5.26) holds for all the classes y (we discuss what
the assumption implies below), we get that:kwt+1 − w∗y k ≤ kwt − w∗y k,(5.27)or in other words, the estimation improves monotonously. Combining this with Lemma 5.A.2 suggests an
explanation for the shape of the IWDAN estimated weights on Fig. 5.A.2b: the monotonous improvementof the estimation is counter-balanced by the matching of weighted marginals which, when reached, makes
wt constant (Lemma 5.A.1 applied to w̃ = wt ). However, we wish to emphasize that the exact dynamics
12 It does not reach it as the learning rate is decayed to 0.

93

96

95
90

performance in %performance in %

94

85
80
75

IWDAN
IWDAN fit
IWDAN-O
IWDAN-O fit
DANN
DANN fit
0.02

92
90
88
86
84
82

0.04

jsd

0.06

80

0.08

(a) Performance of DANN, IWDAN and IWDAN-O.

IWCDANIWCDAN fit
IWCDAN-OIWCDAN-O fit
CDAN
CDAN fit
0.02

0.04

jsd

0.06

0.08

(b) Performance of CDAN, CDAN and IWCDAN.

Figure 5.A.1: Performance in % of our algorithms and their base versions. The x-axis represents
DJS (DSY , D TY ), the Jensen-Shannon distance between label distributions. Lines represent linear fits tothe data. For both sets of algorithms, the larger the jsd, the larger the improvement.
of w are complex, and we do not claim understand them fully. In all likelihood, they are the by-productof regularity in the data, properties of deep neural networks and their interaction with stochastic gradientdescent. Additionally, the dynamics are also inherently linked to the success of domain adaptation, whichto this day remains an open problem.
As a matter of fact assumption (5.26) itself relates to successful domain adaptation. Setting aside w̃,which simply corresponds to a class reweighting of the source domain, (5.26) states that predictions on thetarget domain fall between a successful prediction (corresponding to D T (Y = y)) and the prediction of amodel with matched marginals (corresponding to DS (Y = y)). In other words, we assume that the modelis naturally in between successful domain adaptation and successful marginal matching. Empirically, weobserved that it holds true for most classes (with w̃ = w̃t for IWDAN and with w̃ = 1 for DANN), but
not all early in training13 .
To conclude this section, we prove Lemma 5.A.2.
Proof. From ε S (h ◦ g) = 0, we know that C is diagonal and that its y-th line is DS (Y = y). This gives us:µwy = (C−1 µ)y = D (Yy=y) . Hence:Smin(w̃y DS (Y = y), D T (Y = y)) ≤ µy ≤ max(w̃y DS (Y = y), D T (Y = y))

⇐⇒
⇐⇒

⇐⇒

min(w̃y DS (Y = y), D T (Y = y))µymax(w̃y DS (Y = y), D T (Y = y))≤≤
D S (Y = y )D S (Y = y )D S (Y = y )min(w̃y , w∗y ) ≤ wy ≤ max(w̃y , w∗y )min(w̃y , w∗y ) − w∗y ≤ wy − w∗y ≤ max(w̃y , w∗y ) − w∗y⇐⇒ |wy − w∗y | ≤ |w̃y − w∗y |,

which concludes the proof.
13 In particular at initialization, one class usually dominates the others.

94

DANN
IWDAN
IWDAN-O
No DA

2.5

80
60
40
DANN
IWDAN
IWDAN-O
No DA

20
0

10

20
30
training epoch

distance to true weights

accuracy on target domain

100

2.0
1.5
1.0
0.5

40

0

(a) Transfer accuracy during training.

10

20
30
training epoch40(b) Distance to true weights during training.

Figure 5.A.2: Left Accuracy of various algorithms during training. Right Euclidean distance between theweights estimated using Lemma 5.3.2 and the true weights. Those plots correspond to averages over 5
seeds.

95

Chapter 6

Learning Fair Representations
In this chapter, through the lens of information theory, we provide the first result that quantitatively
characterizes the tradeoff between demographic parity and the joint utility across different populationgroups. Specifically, when the base rates differ between groups, we show that any method aiming to learn
fair representations admits an information-theoretic lower bound on the joint error across these groups.
To complement our negative results, we also prove that if the optimal decision functions across different
groups are close, then learning fair representations leads to an alternative notion of fairness, known as theaccuracy parity, which states that the error rates are close between groups. Finally, our theoretical findings
are also confirmed empirically on real-world datasets.

97

6.1

Introduction

With the prevalence of machine learning applications in high-stakes domains, e.g., criminal judgement,
medical testing, online advertising, etc., it is crucial to ensure that the automated decision making systems
do not propagate existing bias or discrimination that might exist in historical data (Barocas and Selbst,
2016; Berk et al., 2018; of the President, 2016). Among many recent proposals for achieving different
notions of algorithmic fairness (Dwork et al., 2012; Hardt et al., 2016; Zafar et al., 2015, 2017; Zemel et al.,2013), learning fair representations has received increasing attention due to recent advances in learning richrepresentations with deep neural networks (Beutel et al., 2017; Edwards and Storkey, 2015; Louizos et al.,2015; Madras et al., 2018; Song et al., 2019; Zhang et al., 2018). In fact, a line of work has proposed tolearn group-invariant representations with adversarial learning techniques in order to achieve statisticalparity, also known as the demographic parity in the literature. This line of work dates at least back to Zemel
et al. (2013) where the authors proposed to learn predictive models that are independent of the groupmembership attribute. At a high level, the underlying idea is that if representations of instances fromdifferent groups are similar to each other, then any predictive model on top of them will certainly makedecisions independent of group membership.
On the other hand, it has long been observed that there is an underlying tradeoff between utility anddemographic parity:“All methods have in common that to some extent accuracy must be traded-off for lowering
the dependency.” (Calders et al., 2009)
In particular, it is easy to see that in an extreme case where the group membership coincides with thetarget task, a call for exact demographic parity will inevitably remove the perfect predictor (Hardt et al.,2016). Empirically, it has also been observed that a tradeoff exists between accuracy and fairness in binaryclassification (Zliobaite, 2015). Clearly, methods based on learning fair representations are also bound bysuch inherent tradeoff between utility and fairness. But how does the fairness constraint trade for utility?
Will learning fair representations help to achieve other notions of fairness besides the demographic parity?
If yes, what is the fundamental limit of utility that we can hope to achieve under such constraint?
To answer the above questions, through the lens of information theory, in this chapter we provide
the first result that quantitatively characterizes the tradeoff between demographic parity and the joint
utility across different population groups. Specifically, when the base rates differ between groups, we
provide a tight information-theoretic lower bound on the joint error across these groups. Our lower boundis algorithm-independent so it holds for all methods aiming to learn fair representations. When only
approximate demographic parity is achieved, we also present a family of lower bounds to quantify thetradeoff of utility introduced by such approximate constraint. As a side contribution, our proof technique
is simple but general, and we expect it to have broader applications in other learning problems using
adversarial techniques, e.g., unsupervised domain adaptation (Ganin et al., 2016; Zhao et al., 2019e),
privacy-preservation under attribute inference attacks (Hamm, 2017; Zhao et al., 2019a) and multilingualmachine translation (Johnson et al., 2017).
To complement our negative results, we show that if the optimal decision functions across different
groups are close, then learning fair representations helps to achieve an alternative notion of fairness, i.e.,
the accuracy parity, which states that the error rates are close between groups. Empirically, we conduct
experiments on a real-world dataset that corroborate both our positive and negative results. We believe ourtheoretical insights contribute to better understanding of the tradeoff between utility and different notionsof fairness, and they are also helpful in guiding the future design of representation learning algorithms toachieve algorithmic fairness.

98

6.2

Preliminaries

We first introduce the notation used throughout the chapter and formally describe the problem setup. We
then briefly discuss some information-theoretic concepts that will be used in our analysis.
Notation We use X ⊆ Rd and Y = {0, 1} to denote the input and output space. Accordingly, we use X
and Y to denote the random variables which take values in X and Y , respectively. Lower case letters x andy are used to denote the instantiation of X and Y. To simplify the presentation, we use A ∈ {0, 1} as thesensitive attribute, e.g., race, gender, etc. 1 Let H be the hypothesis class of classifiers. In other words,
for h ∈ H, h : X → Y is the predictor that outputs a prediction. Note that even if the predictor does not
explicitly take the sensitive attribute A as input, this fairness through blindness mechanism can still bebiased due to the potential correlations between X and A. In this chapter we study the stochastic setting
where there is a joint distribution D over X, Y and A from which the data are sampled. To keep the notationconsistent, for a ∈ {0, 1}, we use D a to mean the conditional distribution of D given A = a. For an event
E, D( E) denotes the probability of E under D . In particular, in the literature of fair machine learning, wecall D(Y = 1) the base rate of distribution D and we use ∆BR (D , D 0 ) := |D(Y = 1) − D 0 (Y = 1)| todenote the difference of the base rates between two distributions D and D 0 over the same sample space.
Given a feature transformation function g : X → Z that maps instances from the input space X to feature
space Z , we define g] D := D ◦ g−1 to be the induced (pushforward) distribution of D under g, i.e., forany event E0 ⊆ Z , g] D( E0 ) := D( g−1 ( E0 )) = D({ x ∈ X | g( x ) ∈ E0 }).
Problem Setup Given a joint distribution D , the error of a predictor h under D is defined as ε D (h) :=ED [|Y − h( X )|]. Note that for binary classification problems, when h( X ) ∈ {0, 1}, ε D (h) reduces
to the true error rate of binary classification. To make the notation more compact, we may drop thesubscript D when it is clear from the context. In this chapter we focus on group fairness where the groupmembership is given by the sensitive attribute A. Even in this context there are many possible definitionsof fairness (Narayanan, 2018), and in what follows we provide a brief review of the ones that are mostly
relevant to this chapter.
b satisfies demographic
Definition 6.2.1 (Demographic Parity). Given a joint distribution D , a classifier Ybparity if Y is independent of A.
b = 1 ) = D 1 (Yb = 1), i.e., positive outcome
Demographic parity reduces to the requirement that D0 (Yis given to the two groups at the same rate. When exact equality does not hold, we use the absolutedifference between them as an approximate measure:b isDefinition 6.2.2 (DP Gap). Given a joint distribution D , the demographic parity gap of a classifier Yb) := |D0 (Yb = 1 ) − D 1 (Yb = 1)|.
∆DP (Y
Demographic parity is also known as statistical parity, and it has been adopted as definition of fairness
in a series of work (Calders et al., 2009; Edwards and Storkey, 2015; Johndrow et al., 2019; Kamiranand Calders, 2009; Kamishima et al., 2011; Louizos et al., 2015; Madras et al., 2018; Zemel et al., 2013).
However, as we shall quantify precisely in Section 6.3, demographic parity may cripple the utility that wehope to achieve, especially in the common scenario where the base rates differ between two groups, e.g.,
D0 (Y = 1) 6= D1 (Y = 1) (Hardt et al., 2016). In light of this, an alternative definition is accuracy parity:
Definition 6.2.3 (Accuracy Parity). Given a joint distribution D , a classifier h satisfies accuracy parity if
ε D0 ( h ) = ε D1 ( h ) .
In the literature, a break of accuracy parity is also known as disparate mistreatment (Zafar et al.,2017). Again, when h is a deterministic binary classifier, accuracy parity reduces to D0 (h( X ) = Y ) =1 Our main results could also be straightforwardly extended to the setting where A is a categorical variable.

99D1 (h( X ) = Y ). Different from demographic parity, the definition of accuracy parity does not eliminate
the perfect predictor when Y = A when the base rates differ between two groups. When costs of different
error types matter, more refined definitions exist:
Definition 6.2.4 (Positive Rate Parity). Given a joint distribution D , a deterministic classifier h satisfies
positive rate parity if D0 (h( X ) = 1 | Y = y) = D1 (h( X ) = 1 | Y = y), ∀y ∈ {0, 1}.
Positive rate parity is also known as equalized odds (Hardt et al., 2016), which essentially requires
equal true positive and false positive rates between different groups. Furthermore, Hardt et al. (2016)
also defined true positive parity, or equal opportunity, to be D0 (h( X ) = 1 | Y = 1) = D1 (h( X ) = 1 |Y = 1) when positive outcome is desirable. Last but not least, predictive rate parity, also known as test
fairness (Chouldechova, 2017), asks for equal chance of positive outcomes across groups given predictions:Definition 6.2.5 (Predictive Rate Parity). Given a joint distribution D , a probabilistic classifier h satisfies
predictive rate parity if D0 (Y = 1 | h( X ) = c) = D1 (Y = 1 | h( X ) = c), ∀c ∈ [0, 1].
When h is a deterministic binary classifier that only takes value in {0, 1}, Chouldechova (2017) showed
an intrinsic tradeoff between predictive rate parity and positive rate parity:
Theorem 6.2.1 (Chouldechova (2017)). Assume D0 (Y = 1) 6= D1 (Y = 1), then for any deterministicclassifier h : X → {0, 1} that is not perfect, i.e., h( X ) 6= Y, positive rate parity and predictive rate parity
cannot hold simultaneously.
Similar tradeoff result for probabilistic classifier has also been observed by Kleinberg et al. (2016),
where the authors showed that for any non-perfect predictors, calibration and positive rate parity cannot
be achieved simultaneously if the base rates are different across groups. Here a classifier h is said to becalibrated if D(Y = 1 | h( X ) = c) = c, ∀c ∈ [0, 1], i.e., if we look at the set of data that receive a
predicted probability of c by h, we would like c-fraction of them to be positive instances according to
Y (Pleiss et al., 2017).
f -divergence Introduced by Ali and Silvey (1966) and Csiszár (1964, 1967), f -divergence, also known
as the Ali-Silvey distance, is a general class of statistical divergences to measure the difference between
two probability distributions P and Q over the same measurable space.
Definition 6.2.6 ( f -divergence). Let P and Q be two probability distributions over the same space andassume P is absolutely continuous w.r.t. Q. Then for any convex function f : (0, ∞) → R that is strictly
convex at 1 and f (1) = 0, the f -divergence of Q from P is defined as
 

dP
D f (P k Q) := EQ f
.
(6.1)
dQ
The function f is called the generator function of D f (· k ·).
Different choices of the generator function f recover popular statistical divergence as special cases, e.g.,
the KL-divergence. From Jensen’s inequality it is easy to verify that D f (P k Q) ≥ 0 and D f (P k Q) = 0
iff P = Q almost surely. Note that f -divergence does not necessarily leads to a distance metric, and it is
not symmetric in general, i.e., D f (P k Q) 6= D f (Q k P ) provided that P ∼ Q. We list some common
choices of the generator function f and their corresponding properties in Table 6.2.1. Notably, Khosravifard
et al. (2007) proved that total variation is the only f -divergence that serves as a metric, i.e., satisfying thetriangle inequality.

100Table 6.2.1: List of different f -divergences and their corresponding properties. DKL (P || Q) denotes the
KL-divergence of Q from P and M := (P + Q)/2 is the average distribution of P and Q. Symm. stands
for Symmetric and Tri. stands for Triangle Inequality.

Name

D f (P k Q)

Generator f (t)Symm. Tri.

Kullback-Leibler DKL (P k Q)
t log t7
Reverse-KL
DKL (Q k P )− log t7
t +1+
D(QkM))
t
log
t
−
(
t
+
1
)
log
(
)
3
Jensen-Shannon DJS (P , Q) := 12R( D√KL (P kM)
KL
2√√
Squared Hellinger H 2 (P , Q) := 21 ( dP − dQ)2
(1 − t)2 /2
3
Total VariationdTV (P , Q) := supE |P ( E) − Q( E)||t − 1|/2
3

6.3

7
7
7
7
3

Main Results

As we briefly mentioned in Section 6.2, it is impossible to have imperfect predictor that is both calibrated
and preserves positive rate parity when the base rates differ between two groups. Similar impossibility
result also holds between positive rate parity and predictive rate parity. On the other hand, while it has long
been observed that demographic parity may eliminate perfect predictor (Hardt et al., 2016), and previous
work has empirically verified that tradeoff exists between accuracy and demographic parity (Calders et al.,2009; Kamiran and Calders, 2009; Zliobaite, 2015) on various datasets, so far a quantitative characterizationon the exact tradeoff between accuracy and various notions of parity is still missing. In what follows weshall prove a family of information theoretic lower bounds on the accuracy that hold for all algorithms.

6.3.1

Tradeoff between Fairness and Utilitygh b
Essentially, every prediction function induces a Markov chain: X −→ Z −→ Y,
where g is the featureb is the predicted target variable bytransformation, h is the classifier on feature space, Z is the feature and Yh ◦ g. Note that simple models, e.g., linear classifiers, are also included by specifying g to be the identity
map. With this notation, we first state the following theorem that quantifies an inherent tradeoff between
fairness and utility.
b = h( g( X )) be the predictor. If Y
b satisfies demographic parity, then ε D (h ◦ g) +Theorem 6.3.1. Let Y
0ε D1 (h ◦ g) ≥ ∆BR (D0 , D1 ).

Remark First of all, ∆BR (D0 , D1 ) is the difference of base rates across groups, and it achieves its
maximum value of 1 iff Y = A almost surely, i.e., Y indicates group membership. On the other hand, if
Y is independent of A, then ∆BR (D0 , D1 ) = 0 so the lower bound does not make any constraint on the
joint error. Second, Theorem 6.3.1 applies to all possible feature transformation g and predictor h. In
particular, if we choose g to be the identity map, then Theorem 6.3.1 says that when the base rates differ,no algorithm can achieve a small joint error on both groups, and it also recovers the previous observationthat demographic parity can eliminate the perfect predictor (Hardt et al., 2016). Third, the lower bound in
Theorem 6.3.1 is insensitive to the marginal distribution of A, i.e., it treats the errors from both groups
equally. As a comparison, let α := D( A = 1), then ε D (h ◦ g) = (1 − α)ε D0 (h ◦ g) + αε D1 (h ◦ g). In
this case ε D (h ◦ g) could still be small even if the minority group suffers a large error.
Furthermore, by the pigeonhole principle, the following corollary holds:
b = h( g( X )) satisfies demographic parity, then max{ε D (h ◦ g), ε D (h ◦Corollary 6.3.1. If the predictor Y01g)} ≥ ∆BR (D0 , D1 )/2.
101

In words, this means that for fair predictors in the demographic parity sense, at least one of thesubgroups has to incur an error of at least ∆BR (D0 , D1 )/2 which could be large in settings like criminal
justice where ∆BR (D0 , D1 ) is large.
Before we give the proof, we first present a useful lemma that lower bounds the prediction error by the
total variation distance.
b = h( g( X )) be the predictor, then for a ∈ {0, 1}, dTV (D a (Y ), D a (Yb)) ≤ ε D (h ◦ g).
Lemma 6.3.1. Let Ya
Proof. For a ∈ {0, 1}, we have:b)) = |D a (Y = 1) − D a (h( g( X )) = 1)| = |ED [Y ] − ED [h( g( X ))]|dTV (D a (Y ), D a (Yaa

≤ EDa [|Y − h( g( X ))|] = ε Da (h ◦ g).



Now we are ready to prove Theorem 6.3.1:
b = h( g( X )) satisfies demographic parity, then:
Proof of Theorem 6.3.1. First of all, we show that if Yb ) , D 1 (Yb)) = max |D0 (Yb = 0 ) − D 1 (Yb = 0)|, |D0 (Yb = 1 ) − D 1 (Yb = 1)|dTV (D0 (Yb = 1 ) − D 1 (Yb = 1)|= |D0 (Yb = 1 | A = 0) − D(Yb = 1 | A = 1)| = 0,
= |D(Y

where the last equality follows from the definition of demographic parity. Now from Table 6.2.1, dTV (·, ·)is symmetric and satisfies the triangle inequality, we have:b)) + dTV (D0 (Yb ) , D 1 (Yb)) + dTV (D1 (Yb), D1 (Y ))dTV (D0 (Y ), D1 (Y )) ≤ dTV (D0 (Y ), D0 (Yb)) + dTV (D1 (Yb), D1 (Y )).
= dTV (D0 (Y ), D0 (Y(6.2)b)) in terms of ε D (h ◦ g) for a ∈ {0, 1} using Lemma 6.3.1:
The last step is to bound dTV (D a (Y ), D a (Yab)) ≤ ε D (h ◦ g),dTV (D0 (Y ), D0 (Y0b)) ≤ ε D (h ◦ g).
dTV (D1 (Y ), D1 (Y1Combining the above two inequalities and (6.2) completes the proof.

It is not hard to show that our lower bound in Theorem 8.2.1 is tight. To see this, consider the case
A = Y, where the lower bound achieves its maximum value of 1. Now consider a constant predictorb ≡ 1 or Yb ≡ 0, which clearly satisfies demographic parity by definition. But in this case eitherY
ε D0 (h ◦ g) = 1, ε D1 (h ◦ g) = 0 or ε D0 (h ◦ g) = 0, ε D1 (h ◦ g) = 1, hence ε D0 (h ◦ g) + ε D1 (h ◦ g) ≡ 1,
achieving the lower bound.
To conclude this section, we point out that the choice of total variation in the lower bound is not unique.
As we will see shortly in Section 6.3.2, similar lower bounds could be attained using specific choices of thegeneral f -divergence with some desired properties.

6.3.2

Tradeoff in Fair Representation Learning

In the last section we show that there is an inherent tradeoff between fairness and utility when a predictor
exactly satisfies demographic parity. In practice we may not be able to achieve demographic parity exactly.
Instead, most algorithms (Adel et al., 2019a; Beutel et al., 2017; Edwards and Storkey, 2015; Louizos
et al., 2015) build an adversarial discriminator that takes as input the feature vector Z = g( X ), and thegoal is to learn fair representations such that it is hard for the adversarial discriminator to infer the group102

membership from Z. In this sense due to the limit on the capacity of the adversarial discriminator, only
approximate demographic parity can be achieved in the equilibrium. Hence it is natural to ask what is thetradeoff between fair representations and accuracy in this scenario? In this section we shall answer thisquestion by generalizing our previous analysis with f -divergence to prove a family of lower bounds on the
joint target prediction error. Our results also show how approximate DP helps to reconcile but not remove
the tradeoff between fairness and utility. Before we state and prove the main results in this section, we
first introduce the following lemma by Liese and Vajda (2006) as a generalization of the data processing
inequality for f -divergence:
Lemma 6.3.2 (Liese and Vajda (2006)). Let µ(Z ) be the space of all probability distributions over Z .
Then for any f -divergence D f (· || ·), any stochastic kernel κ : X → µ(Z ), and any distributions P and
Q over X , D f (κ P || κ Q) ≤ D f (P || Q).
Roughly speaking,pLemma 6.3.2 says that data processing
cannot increase discriminating information.
p
Define dJS (P , Q) := DJS (P , Q) and H (P , Q) := H 2 (P , Q). It is well-known in information theory that both dJS (·, ·) and H (·, ·) form a bounded distance metric over the space of probability distributions.
Realize that dTV (·, ·), H 2 (·, ·) and DJS (·, ·) are all f -divergence. The following corollary holds:
Corollary 6.3.2. Let h : Z → Y be any hypothesis, and g] D a be the pushforward distribution of D a by g,b = h( g( X )) be the predictor, then all the following inequalities hold:∀ a ∈ {0, 1}. Let Ybb)) ≤ dTV ( g] D0 , g] D1 )1. dTV (D0 (Y ), D1 (Yb ) , D 1 (Yb)) ≤ H ( g] D0 , g] D1 )2. H (D0 (Yb ) , D 1 (Yb)) ≤ dJS ( g] D0 , g] D1 )3. dJS (D0 (YNow we are ready to present the following main theorem of this section:b = h( g( X )) be the predictor. Assume dJS ( g] D0 , g] D1 ) ≤ dJS (D0 (Y ), D1 (Y )) andTheorem 6.3.2. Let Y
H ( g] D0 , g] D1 ) ≤ H (D0 (Y ), D1 (Y )), then the following three inequalities hold:1. Total variation lower bound:ε D0 (h ◦ g) + ε D1 (h ◦ g) ≥ dTV (D0 (Y ), D1 (Y )) − dTV ( g] D0 , g] D1 ).
2. Jensen-Shannon lower bound:2
ε D0 (h ◦ g) + ε D1 (h ◦ g) ≥ dJS (D0 (Y ), D1 (Y )) − dJS ( g] D0 , g] D1 ) /2.
3. Hellinger lower bound:2
ε D0 (h ◦ g) + ε D1 (h ◦ g) ≥ H (D0 (Y ), D1 (Y )) − H ( g] D0 , g] D1 ) /2.
Remark All the three lower bounds in Theorem 6.3.2 imply a tradeoff between the joint error acrossdemographic subgroups and learning group-invariant feature representations. In a nutshell:
For fair representations, it is not possible to construct a predictor that simultaneously minimizes
the errors on both demographic subgroups.
b ) = D 1 (Yb), all three lower bounds get larger, in this case
When g] D0 = g] D1 , which also implies D0 (Ywe have
1 2
1 2
max dTV (D0 (Y ), D1 (Y )), dJS (D0 (Y ), D1 (Y )), H (D0 (Y ), D1 (Y )) = dTV (D0 (Y ), D1 (Y ))22= ∆BR (D0 , D1 ),and this reduces to Theorem 6.3.1. Now we give a sketch of the proof for Theorem 6.3.2:
103

Proof Sketch of Theorem 6.3.2. We prove the three inequalities respectively. The total variation lowerb ) , D 1 (Yb)) ≤bound follows the same idea as the proof of Theorem 8.2.1 and the inequality dTV (D0 (YdTV ( g] D0 , g] D1 ) from Corollary 6.3.2. To prove the Jensen-Shannon lower bound, realize that dJS (·, ·)b ) , D 1 (Yb)) ≤is a distance metric over probability distributions. Combining with the inequality dJS (D0 (YdJS ( g] D0 , g] D1 ) from Corollary 6.3.2, we have:b)) + dJS ( g] D0 , g] D1 ) + dJS (D1 (Yb), D1 (Y )).
dJS (D0 (Y ), D1 (Y )) ≤ dJS (D0 (Y ), D0 (YNow by Lin’s lemma (Lin, 1991, Theorem 3), for any two distributions P and Q, we have d2JS (P , Q) ≤dTV (P , Q). Combine Lin’s lemma with Lemma 6.3.1, we get the following lower bound:qq
ε D0 (h ◦ g) + ε D1 (h ◦ g) ≥ dJS (D0 (Y ), D1 (Y )) − dJS ( g] D0 , g] D1 ).
Apply the AM-GM inequality, we can further bound the L.H.S. byqq
 q
2 ε D0 ( h ◦ g ) + ε D1 ( h ◦ g ) ≥ ε D0 ( h ◦ g ) + ε D1 ( h ◦ g ) .
Under the assumption that dJS ( g] D0 , g] D1 ) ≤ dJS (D0 (Y ), D1 (Y )), taking a square at both sides thencompletes the proof for the second inequality. The proof for Hellinger’s lower bound follows exactly as theone for Jensen-Shannon’s lower√ bound, except that instead of Lin’s lemma, we need to use the fact that2
H (P , Q) ≤ dTV (P , Q) ≤ 2H (P , Q), ∀P , Q.
As a simple corollary of Theorem 6.3.2, the following result shows how approximate DP (in terms of the
DP gap) helps to reconcile the tradeoff between fairness and utility:b = h( g( X )) be the predictor, then ε D (h ◦ g) + ε D (h ◦ g) ≥ ∆BR (D0 , D1 ) −Corollary 6.3.3. Let Y01b∆DP (Y ).
In a sense Corollary 6.3.3 means that in order to lower the joint error, the DP gap of the predictor
cannot be too small. Of course, since the above inequality is a lower bound, it only serves as a necessary
condition for small joint error. Hence an interesting question would be to ask whether it is possible to havea sufficient condition that guarantees a small joint error such that the DP gap of the predictor is no larger
than that of the perfect predictor, i.e., ∆BR (D0 , D1 ). We leave this as a future work.

6.3.3

Fair Representations Lead to Accuracy Parity

In the previous sections we prove a family of information-theoretic lower bounds that demonstrate aninherent tradeoff between fair representations and joint error across groups. A natural question to ask then,is, what kind of parity can fair representations bring us? To complement our negative results, in this section
we show that learning group-invariant representations help to reduce discrepancy of errors (utilities) acrossgroups.
First of all, since we work under the stochastic setting where D a is a joint distribution over X and Y
conditioned on A = a, then any function mapping h : X → Y will inevitably incur an error due to thenoise existed in the distribution D a . Formally, for a ∈ {0, 1}, define the optimal function h∗a : X → Y
under the absolute error to be h∗a ( X ) := mDa (Y | X ), where mDa (Y | X ) denotes the median of Y given
X under distribution D a . Now define the noise of distribution D a to be nDa := EDa [|Y − h∗a ( X )|]. With
these notations, we are now ready to present the following theorem:

104

Theorem 6.3.3 (Error Decomposition Theorem). For any hypothesis H 3 h : X → Y , the following
inequality holds:|ε D0 (h) − ε D1 (h)| ≤ |nD0 − nD1 | + dTV (D0 ( X ), D1 ( X ))+ min {ED0 [|h0∗ − h1∗ |], ED1 [|h0∗ − h1∗ |]} .

Remark Theorem 6.3.3 upper bounds the discrepancy of accuracy across groups by three terms: thenoise difference, the distance of representations across groups and the discrepancy of optimal decisionfunctions. In an ideal setting where both distributions are noiseless, i.e., same people in the same group arealways treated equally, the upper bound simplifies to the latter two terms:|ε D0 (h) − ε D1 (h)| ≤ dTV (D0 ( X ), D1 ( X )) + min {ED0 [|h0∗ − h1∗ |], ED1 [|h0∗ − h1∗ |]} .
If we further require that the optimal decision functions h0∗ and h1∗ are close to each other, i.e., optimal
decisions are insensitive to the group membership, then Theorem 6.3.3 implies that a sufficient condition toguarantee accuracy parity is to find group-invariant representation that minimizes dTV (D0 ( X ), D1 ( X )).
We now present the proof for Theorem 6.3.3:
Proof of Theorem 6.3.3. First, we show that for a ∈ {0, 1}, ε Da (h) cannot be too large if h is close to h∗a :|ε Da (h) − EDa [|h( X ) − h∗a ( X )|]| = |EDa [|h( X ) − Y |] − EDa [|h( X ) − h∗a ( X )|]|≤ EDa [ |h( X ) − Y | − |h( X ) − h∗a ( X )| ]≤ EDa [|Y − h∗a ( X )|] = nDa ,where both inequalities are due to the triangle inequality. Next, we bound |ε D0 (h) − ε D1 (h)| by:|ε D0 (h) − ε D1 (h)| ≤ |nD0 − nD1 | + ED0 [|h( X ) − h0∗ ( X )|] − ED1 [|h( X ) − h1∗ ( X )|] .
In order to show this, define ε a (h, h0 ) := EDa [|h( X ) − h0 ( X )|] so that
ED0 [|h( X ) − h0∗ ( X )|] − ED1 [|h( X ) − h1∗ ( X )|] = ε 0 (h, h0∗ ) − ε 1 (h, h1∗ ) .
To bound ε 0 (h, h0∗ ) − ε 1 (h, h1∗ ) , realize that |h( X ) − h∗a ( X )| ∈ {0, 1}. On one hand, we have:ε 0 (h, h0∗ ) − ε 1 (h, h1∗ ) = ε 0 (h, h0∗ ) − ε 0 (h, h1∗ ) + ε 0 (h, h1∗ ) − ε 1 (h, h1∗ )≤ ε 0 (h, h0∗ ) − ε 0 (h, h1∗ ) + ε 0 (h, h1∗ ) − ε 1 (h, h1∗ )≤ ε 0 (h0∗ , h1∗ ) + dTV (D0 ( X ), D1 ( X )),where the last inequality is due to ε 0 (h, h1∗ ) − ε 1 (h, h1∗ ) = D0 (|h − h1∗ | = 1) − D1 (|h − h1∗ | = 1) ≤supE |D0 ( E) − D1 ( E)| = dTV (D0 , D1 ). Similarly, by subtracting and adding back ε 1 (h, h0∗ ) instead, we
can also show that ε 0 (h, h0∗ ) − ε 1 (h, h1∗ ) ≤ ε 1 (h0∗ , h1∗ ) + dTV (D0 ( X ), D1 ( X )).
Combine the above two inequalities yielding:ε 0 (h, h0∗ ) − ε 1 (h, h1∗ ) ≤ min{ε 0 (h0∗ , h1∗ ), ε 1 (h0∗ , h1∗ )} + dTV (D0 ( X ), D1 ( X )).
Incorporating the difference of noise back to the above inequality then completes the proof.
105



6.4

Empirical Validation

Our theoretical results on the lower bound imply that over-training the feature transformation function toachieve group-invariant representations will inevitably lead to large joint errors. On the other hand, ourupper bound also implies that group-invariant representations help to achieve accuracy parity. To verify
these theoretical implications, in this section we conduct experiments on a real-world benchmark dataset,the UCI Adult dataset, to present empirical results with various metrics.
Dataset The Adult dataset contains 30,162/15,060 training/test instances for income prediction. Eachinstance in the dataset describes an adult from the 1994 US Census. Attributes include gender, educationlevel, age, etc. In this experiment we use gender (binary) as the sensitive attribute, and we preprocess
the dataset to convert categorical variables into one-hot representations. The processed data contains 114
attributes. The target variable (income) is also binary: 1 if ≥ 50K/year otherwise 0. For the sensitive
attribute A, A = 0 means Male otherwise Female. In this dataset, the base rates across groups are different:
Pr(Y = 1 | A = 0) = 0.310 while Pr(Y = 1 | A = 1) = 0.113. Also, the group ratios are different:Pr( A = 0) = 0.673.
Experimental Protocol To validate the effect of learning group-invariant representations with adversarial
debiasing techniques (Beutel et al., 2017; Madras et al., 2018; Zhang et al., 2018), we perform a controlled
experiment by fixing the baseline network architecture to be a three hidden-layer feed-forward networkwith ReLU activations. The number of units in each hidden layer are 500, 200, and 100, respectively. The
output layer corresponds to a logistic regression model. This baseline without debiasing is denoted as
NoDebias. For debiasing with adversarial learning techniques, the adversarial discriminator network takes
the feature from the last hidden layer as input, and connects it to a hidden-layer with 50 units, followed bya binary classifier whose goal is to predict the sensitive attribute A. This model is denoted as AdvDebias.
Compared with NoDebias, the only difference of AdvDebias in terms of objective function is that besides
the cross-entropy loss for target prediction, the AdvDebias also contains a classification loss from theadversarial discriminator to predict the sensitive attribute A. In the experiment, all the other factors are
fixed to be the same between these two methods, including learning rate, optimization algorithm, training
epoch, and also batch size. To see how the adversarial loss affects the joint error, the demographic parity as
well as the accuracy parity, we vary the coefficient ρ for the adversarial loss between 0.1, 1.0, 5.0 and 50.0.
Results and Analysis The experimental results are listed in Table 6.4.1. Note that in the table |ε D0 − ε D1 |b)could be understood as measuring an approximate version of accuracy parity, and similarly ∆DP (Ymeasures the closeness of the classifier to satisfy demographic parity. From the table, it is then clearthat with increasing ρ, both the overall error ε D (sensitive to the marginal distribution of A) and the jointb) is drasticallyerror ε D0 + ε D1 (insensitive to the imbalance of A) are increasing. As expected, ∆DP (Ydecreasing with the increasing of ρ. Furthermore, |ε D0 − ε D1 | is also gradually decreasing, but muchb). This is due to the existing noise in the data as well as the shift between the optimal
slowly than ∆DP (Ydecision functions across groups, as indicated by our upper bound. To conclude, all the empirical results
are consistent with our theoretical findings.

6.5

Related Work

Fairness Frameworks Two central notions of fairness have been extensively studied, i.e., group fairness
and individual fairness. In a seminal work, Dwork et al. (2012) define individual fairness as a measure of106Table 6.4.1: Adversarial debiasing on demographic parity, joint error across groups, and accuracy parity.

NoDebias
AdvDebias, ρ = 0.1
AdvDebias, ρ = 1.0
AdvDebias, ρ = 5.0
AdvDebias, ρ = 50.0

εD

ε D0 + ε D1

| ε D0 − ε D1 |b)
∆DP (Y

0.157
0.159
0.162
0.166
0.201

0.275
0.278
0.286
0.295
0.360

0.115
0.116
0.106
0.106
0.112

0.189
0.190
0.113
0.032
0.028

smoothness of the classification function. Under the assumption that number of individuals is finite, theauthors proposed a linear programming framework to maximize the utility under their fairness constraint.
However, their framework requires apriori a distance function that computes the similarity between
individuals, and their optimization formulation does not produce an inductive rule to generalize to unseen
data. Based on the definition of positive rate parity, Hardt et al. (2016) proposed a post-processing method toachieve fairness by taking as input the prediction and the sensitive attribute. In a concurrent work, Kleinberg
et al. (2016) offer a calibration technique to achieve the corresponding fairness criterion as well. However,both of the aforementioned two approaches require sensitive attribute during the inference phase, which is
not available in many real-world scenarios.
Regularization Techniques The line of work on fairness-aware learning through regularization dates atleast back to Kamishima et al. (2012), where the authors argue that simple deletion of sensitive features indata is insufficient for eliminating biases in automated decision making, due to the possible correlations
among attributes and sensitive information (Lum and Johndrow, 2016). In light of this, the authors proposeda prejudice remover regularizer that essentially penalizes the mutual information between the predictedgoal and the sensitive information. In a more recent approach, Zafar et al. (2015) leveraged a measureof decision boundary fairness and incorporated it via constraints into the objective function of logistic
regression as well as support vector machines. As discussed in Section 7.2, both approaches essentiallyreduce to achieving demographic parity through regularization.
Representation Learning In a pioneer work, Zemel et al. (2013) proposed to preserve both group andindividual fairness through the lens of representation learning, where the main idea is to find a good
representation of the data with two competing goals: to encode the data for utility maximization while atthe same time to obfuscate any information about membership in the protected group. Due to the power oflearning rich representations offered by deep neural nets, recent advances in building fair automated decision
making systems focus on using adversarial techniques to learn fair representation that also preserves enoughinformation for the prediction vendor to achieve his utility (Adel et al., 2019a; Beutel et al., 2017; Edwards
and Storkey, 2015; Louizos et al., 2015; Song et al., 2019; Zhang et al., 2018; Zhao et al., 2019d). Madras
et al. (2018) further extended this approach by incorporating reconstruction loss given by an autoencoder
into the objective function to preserve demographic parity, equalized odds, and equal opportunity.

6.6

Conclusion

In this chapter we theoretically and empirically study the important problem of quantifying the tradeoff
between utility and fairness in learning group-invariant representations. Specifically, we prove a novel
lower bound to characterize the tradeoff between demographic parity and the joint utility across different107population groups when the base rates differ between groups. In particular, our results imply that any
method aiming to learn fair representations admits an information-theoretic lower bound on the joint error,
and the better the representation, the larger the joint error. Complementary to our negative results, we also
show that learning fair representations leads to accuracy parity if the optimal decision functions acrossdifferent groups are close. These theoretical findings are also confirmed empirically on real-world datasets.
We believe our results take an important step towards better understanding the tradeoff between utility anddifferent notions of fairness. Inspired by our lower bound, one interesting direction for future work is todesign instance-weighting algorithm to balance the base rates during representation learning.

108

Chapter 7

Conditional Learning of Fair
Representations
In this chapter we propose a novel algorithm for learning fair representations that can simultaneously
mitigate two notions of disparity among different demographic subgroups in the classification setting.
Two key components underpinning the design of our algorithm are balanced error rate and conditionalalignment of representations. We show how these two components contribute to ensuring accuracy parityand equalized false-positive and false-negative rates across groups without impacting demographic parity.
Furthermore, we also demonstrate both in theory and on two real-world experiments that the proposed
algorithm leads to a better utility-fairness trade-off on balanced datasets compared with existing algorithms
on learning fair representations for classification.

109

7.1

Introduction

High-stakes settings, such as loan approvals, criminal justice, and hiring processes, use machine learning
tools to help make decisions. A key question in these settings is whether the algorithm makes fair decisions.
In settings that have historically had discrimination, we are interested in defining fairness with respect
to a protected group, the group which has historically been disadvantaged. The rapidly growing field ofalgorithmic fairness has a vast literature that proposes various fairness metrics, characterizes the relationshipbetween fairness metrics, and describes methods to build classifiers that satisfy these metrics (Chouldechova
and Roth, 2018; Corbett-Davies and Goel, 2018). Among many recent attempts to achieve algorithmic
fairness (Dwork et al., 2012; Hardt et al., 2016; Zafar et al., 2015; Zemel et al., 2013), learning fair
representations has attracted increasing attention due to its flexibility in learning rich representations basedon advances in deep learning (Beutel et al., 2017; Edwards and Storkey, 2015; Louizos et al., 2015; Madras
et al., 2018). The backbone idea underpinning this line of work is very intuitive: if the representations ofdata from different groups are similar to each other, then any classifier acting on such representations will
also be agnostic to the group membership.
However, it has long been empirically observed (Calders et al., 2009) and recently been proved (Zhaoand Gordon, 2019) that fairness is often at odds with utility. For example, consider demographic parity, which requires the classifier to be independent of the group membership attribute. It is clear that
demographic parity will cripple the utility if the demographic group membership and the target variable
are indeed correlated. To escape such inherent trade-off, other notions of fairness, such as equalized
odds (Hardt et al., 2016), which asks for equal false positive and negative rates across groups, and accuracy
parity (Zafar et al., 2017), which seeks equalized error rates across groups, have been proposed. It is awell-known result that equalized odds is incompatible with demographic parity (Barocas et al., 2017) except
in degenerate cases where group membership is independent of the target variable. Accuracy parity and theso-called predictive rate parity (c.f. Definition 7.2.4) could be simultaneously achieved, e.g., the COMPAS
tool (Dieterich et al., 2016). Furthermore, under some conditions, it is also known that demographic parity
can lead to accuracy parity (Zhao and Gordon, 2019). However, whether it is possible to simultaneously
guarantee equalized odds and accuracy parity remains an open question.
In this chapter, we provide an affirmative answer to the above question by proposing an algorithm toalign the conditional distributions (on the target variable) of representations across different demographic
subgroups. The proposed formulation is a minimax problem that admits a simple reduction to cost-sensitive
learning. The key component underpinning the design of our algorithm is the balanced error rate (BER, c.f.
Section 7.2) (Feldman et al., 2015; Menon and Williamson, 2018), over the target variable and protected
attributes. We demonstrate both in theory and on two real-world experiments that together with theconditional alignment, BER helps our algorithm to simultaneously ensure accuracy parity and equalized
odds across groups. Our key contributions are summarized as follows:• We prove that BER plays a fundamental role in ensuring accuracy parity and a small joint error
across groups. Together with the conditional alignment of representations, this implies that we cansimultaneously achieve equalized odds and accuracy parity. Furthermore, we also show that whenequalized odds is satisfied, BER serves as an upper bound on the error of each subgroup. These
results help to justify the design of our algorithm in using BER instead of the marginal error as ourloss functions.
• We provide theoretical results that our method achieves equalized odds without impacting demo-

graphic parity. This result shows that we can preserve the demographic parity gap for free while
simultaneously achieving equalized odds.

• Empirically, among existing fair representation learning methods, we demonstrate that our algorithm110

is able to achieve a better utility on balanced datasets. On an imbalanced dataset, our algorithm is the
only method that achieves accuracy parity; however it does so at the cost of decreased utility.
We believe our theoretical results contribute to the understanding on the relationship between equalized
odds and accuracy parity, and the proposed algorithm provides an alternative in real-world scenarios whereaccuracy parity and equalized odds are desired.

7.2

Preliminaries

We first introduce the notations used throughout this chapter and formally describe the problem setup andvarious definitions of fairness explored in the literature.
Notation We use X ⊆ Rd and Y = {0, 1} to denote the input and output space. Accordingly, we use X
and Y to denote the random variables which take values in X and Y , respectively. Lower case letters x andy are used to denote the instantiation of X and Y. To simplify the presentation, we use A ∈ {0, 1} as thesensitive attribute, e.g., race, gender, etc. 1 Let H be the hypothesis class of classifiers. In other words,
for h ∈ H, h : X → Y is the predictor that outputs a prediction. Note that even if the predictor does not
explicitly take the sensitive attribute A as input, this fairness through blindness mechanism can still bebiased due to the potential correlations between X and A. In this chapter we study the stochastic setting
where there is a joint distribution D over X, Y and A from which the data are sampled. To keep the notationconsistent, for a, y ∈ {0, 1}, we use D a to mean the conditional distribution of D given A = a and D y
to mean the conditional distribution of D given Y = y. For an event E, D( E) denotes the probability of
E under D . In particular, in the literature of fair machine learning, we call D(Y = 1) the base rate of
distribution D and we use ∆BR (D , D 0 ) := |D(Y = 1) − D 0 (Y = 1)| to denote the difference of the baserates between two distributions D and D 0 over the same sample space.
Given a feature transformation function g : X → Z that maps instances from the input space
X to feature space Z , we define g] D := D ◦ g−1 to be the induced (pushforward) distribution of D
under g, i.e., for any event E0 ⊆ Z , g] D( E0 ) := D( g−1 ( E0 )) = D({ x ∈ X | g( x ) ∈ E0 }). To
measure the discrepancy between distributions, we use dTV (D , D 0 ) to denote the total variation between
them: dTV (D , D 0 ) := supE |D( E) − D 0 ( E)|. In particular, for binary random variable Y, it can bereadily verified that the total variation between the marginal distributions D(Y ) and D 0 (Y ) reduces to thedifference of their base rates, ∆BR (D , D 0 ). To see this, realize that dTV (D(Y ), D 0 (Y )) = max{|D(Y =1) − D 0 (Y = 1)|, |D(Y = 0) − D 0 (Y = 0)|} = |D(Y = 1) − D 0 (Y = 1)| = ∆BR (D , D 0 ) bydefinition.
Given a joint distribution D , the error of a predictor h under D is defined as ε D (h) := ED [|Y − h( X )|].
Note that for binary classification problems, when h( X ) ∈ {0, 1}, ε D (h) reduces to the true error rateof binary classification. To make the notation more compact, we may drop the subscript D when it
b k Y ) to denote the cross-entropy loss function
is clear from the context. Furthermore, we use CED (Ybbetween the predicted variable Y and the true label distribution Y over the joint distribution D . For binary
b k Y ) to be the balanced error rate of predicting Y using Y,b e.g.,
random variables Y, we define BERD (Yb k Y ) := D(Yb = 0 | Y = 1) + D(Yb = 1 | Y = 0). Realize that D(Yb = 0 | Y = 1) is the
BERD (Ybbfalse negative rate (FNR) of Y and D(Y = 1 | Y = 0) corresponds to the false positive rate (FPR). So
b We canthe balanced error rate can also be understood as the sum of FPR and FNR using the predictor Y.
bsimilarly define BERD ( A k A) as well.
1 Our main results could also be straightforwardly extended to the setting where A is a categorical variable.

111Problem Setup We focus on group fairness where the group membership is given by the sensitive
attribute A. We assume that the sensitive attribute A is available to the learner during training phase, but
not inference phase. As a result, post-processing techniques to ensure fairness are not feasible under our
setting. In the literature, there are many possible definitions of fairness (Narayanan, 2018), and in what
follows we provide a brief review of the ones that are mostly relevant to this work.
b satisfies demoDefinition 7.2.1 (Demographic Parity (DP)). Given a joint distribution D , a classifier Ybgraphic parity if Y is independent of A.
b is a deterministic binary classifier, demographic parity reduces to the requirement that
When Ybb = 1), i.e., positive outcome is given to the two groups at the same rate. Demographic
D 0 (Y = 1 ) = D 1 (Yparity is also known as statistical parity, and it has been adopted as the default definition of fairness in aseries of work (Adel et al., 2019a; Calders and Verwer, 2010; Calders et al., 2009; Edwards and Storkey,
2015; Johndrow et al., 2019; Kamiran and Calders, 2009; Kamishima et al., 2011; Louizos et al., 2015;
Madras et al., 2018; Zemel et al., 2013). It is not surprising that demographic parity may cripple theutility that we hope to achieve, especially in the common scenario where the base rates differ between two
groups (Hardt et al., 2016). Formally, the following theorem characterizes the trade-off in terms of the joint
error across different groups:
b = h( g( X )) be the classifier. Then ε D (h ◦ g) + ε D (h ◦Theorem 7.2.1. (Zhao and Gordon, 2019) Let Y01g) ≥ ∆BR (D0 , D1 ) − dTV ( g] D0 , g] D1 ).
In this case of representations that are independent of the sensitive attribute A, then the second termdTV ( g] D0 , g] D1 ) becomes 0, and this implies:
ε D0 (h ◦ g) + ε D1 (h ◦ g) ≥ ∆BR (D0 , D1 ).
At a colloquial level, the above inequality could be understood as an uncertainty principle which says:
For fair representations, it is not possible to construct a predictor that simultaneously minimizes
the errors on both demographic subgroups.
More precisely, by the pigeonhole principle, the following corollary holds:
Corollary 7.2.1. If dTV ( g] D0 , g] D1 ) = 0, then for any hypothesis h, max{ε D0 (h ◦ g), ε D1 (h ◦ g)} ≥∆BR (D0 , D1 )/2.
In words, this means that for fair representations in the demographic parity sense, at least one of thesubgroups has to incur a prediction error of at least ∆BR (D0 , D1 )/2 which could be large in settings likecriminal justice where ∆BR (D0 , D1 ) is large. In light of such inherent trade-off, an alternative definition isaccuracy parity, which asks for equalized error rates across different groups:
b satisfies accuracy parity if
Definition 7.2.2 (Accuracy Parity). Given a joint distribution D , a classifier Ybb
D 0 (Y 6 = Y ) = D 1 (Y 6 = Y ) .
A violation of accuracy parity is also known as disparate mistreatment (Zafar et al., 2017). Different
from the definition of demographic parity, the definition of accuracy parity does not eliminate the perfectpredictor even when the base rates differ across groups. Of course, other more refined definitions of fairness
also exist in the literature, such as equalized odds (Hardt et al., 2016).
b
Definition 7.2.3 (Equalized Odds, a.k.a. Positive Rate Parity). Given a joint distribution D , a classifier Y
b is independent of A conditioned on Y.
satisfies equalized odds if Y
The definition of equalized odds essentially requires equal true positive and false positive rates between
different groups, hence it is also known as positive rate parity. Analogous to accuracy parity, equalized
odds does not eliminate the perfect classifier (Hardt et al., 2016), and we will also justify this observation
by formal analysis shortly. Last but not least, we have the following definition for predictive rate parity:112

b satisfies predictive
Definition 7.2.4 (Predictive Rate Parity). Given a joint distribution D , a classifier Yb = c ) = D 1 (Y = 1 | Y
b = c), ∀c ∈ [0, 1].
rate parity if D0 (Y = 1 | Y
b to be probabilistic, meaning that the output
Note that in the above definition we allow the classifier Yb could be any value between 0 and 1. For the case where Y
b is deterministic, Chouldechova (2017)of Y
showed that no deterministic classifier can simultaneously satisfy equalized odds and predictive rate parity
when the base rates differ across subgroups and the classifier is not perfect.

7.3

Algorithm and Analysis

In this section we first give the proposed optimization formulation and then discuss through formal analysis
the motivation of our algorithmic design. Specifically, we show in Section 7.3.1 why our formulation
helps to escape the utility-fairness trade-off. We then in Section 7.3.2 formally prove that the BERs in theobjective function could be used to guarantee a small joint error across different demographic subgroups.
In Section 7.3.3 we establish the relationship between equalized odds and accuracy parity by providing
an upper bound of the error gap in terms of both BER and the equalized odds gap. We conclude thissection with a brief discussion on the practical implementation of the proposed optimization formulation in
Section 7.3.4. Due to the space limit, we defer all the proofs to the appendix and focus on explaining thehigh-level intuition and implications of our results.
As briefly discussed in Section 7.5, a dominant approach in learning fair representations is via adversarial training. Specifically, the following objective function is optimized:
min max CED (h( g( X )) k Y ) − λ CED (h0 ( g( X )) k A)
h,g

(7.1)

h0

In the above formulation, the first term corresponds to minimization of prediction loss of the target variable
and the second term represents the loss incurred by the adversary h0 . Overall this minimax optimization
problem expresses a trade-off (controlled by the hyperparameter λ > 0) between utility and fairness
through the representation learning function g: on one hand g needs to preserve sufficient information
related to Y in order to minimize the first term, but on the other hand g also needs to filter out information
related to A in order to maximize the second term.

7.3.1

Conditional Learning of Fair Representations

However, as we introduced in Section 7.2, the above framework is still subjective to the inherent trade-off
between utility and fairness. To escape such a trade-off, we advocate for the following optimization
formulation instead:min max BERD (h( g( X )) k Y ) − λ BERD 0 (h0 ( g( X )) k A) + BERD 1 (h00 ( g( X )) k A)h,g h0 ,h00



(7.2)

Note that here we optimize over two distinct adversaries, one for each conditional distribution D y , y ∈{0, 1}. Intuitively, the main difference between (7.2) and (7.1) is that we use BER as our objective function
in both terms. By definition, since BER corresponds to the sum of Type-I and Type-II errors in classification,
the proposed objective function essentially minimizes the conditional errors instead of the original marginalerror:
b 6= Y ) = D(Y = 0)D(Yb 6= Y | Y = 0) + D(Y = 1)D(Yb 6 = Y | Y = 1)
D(Y
(7.3)
b k Y ) ∝ 1 D(Yb 6= Y | Y = 0) + 1 D(Yb 6 = Y | Y = 1),
BERD (Y22which means that the loss function gives equal importance to the classification error from both groups. Notethat the BERs in the second term of (7.2) are over D y , y ∈ {0, 1}. Roughly speaking, the second term
113

y

y

encourages alignment of the the conditional distributions g] D0 and g] D1 for y ∈ {0, 1}. The following
proposition shows that a perfect conditional alignment of the representations also implies that any classifier
based on the representations naturally satisfies the equalized odds criterion:yyProposition 7.3.1. For g : X → Z , if dTV ( g] D0 , g] D1 ) = 0, ∀y ∈ {0, 1}, then for any classifierh : Z → {0, 1}, h ◦ g satisfies equalized odds.
To understand why we aim for conditional alignment of distributions instead of aligning the marginal
feature distributions, the following proposition characterizes why such alignment will help us to escape theprevious trade-off:yyProposition 7.3.2. For g : X → Z , if dTV ( g] D0 , g] D1 ) = 0, ∀y ∈ {0, 1}, then for any classifierh : Z → {0, 1}, dTV ((h ◦ g)] D0 , (h ◦ g)] D1 ) ≤ ∆BR (D0 , D1 ).
As a corollary, this implies that the lower bound given in Theorem 8.2.1 now vanishes if we insteadalign the conditional distributions of representations:
ε D0 (h ◦ g) + ε D1 (h ◦ g) ≥ ∆BR (D0 , D1 ) − dTV ((h ◦ g)] D0 , (h ◦ g)] D1 ) = 0,
where the first inequality is due to Lemma 3.1 (Zhao and Gordon, 2019) and the triangle inequality by
the dTV (·, ·) distance. Of course, the above lower bound can only serve as a necessary condition but not
sufficient to ensure a small joint error across groups. Later (c.f. Theorem 7.3.2) we will show that together
with a small BER on the target variable, it becomes a sufficient condition as well.

7.3.2

The Preservation of Demographic Parity Gap and Small Joint Error

In this section we show that learning representations by aligning the conditional distributions across groups
cannot increase the DP gap as compared to the DP gap of Y. Before we proceed, we first introduce a metricto measure the deviation of a predictor from satisfying demographic parity:b isDefinition 7.3.1 (DP Gap). Given a joint distribution D , the demographic parity gap of a classifier Yb) := |D0 (Yb = 1 ) − D 1 (Yb = 1)|.
∆DP (Ybb satisfies demographic parity. To simplify the exposition, let γa :=Clearly, if ∆DP (Y ) = 0, then Y
D a (Y = 0), ∀ a ∈ {0, 1}. We first prove the following lemma:b = h( g( X )) be the classifier,Lemma 7.3.1. Assume the conditions in Proposition 7.3.1 hold and let Y
b = y ) − D 1 (Yb = y)| ≤ |γ0 − γ1 | · D 0 (Yb = y ) + D 1 (Yb = y) , ∀y ∈ {0, 1}.
then |D0 (YLemma 7.3.1 gives an upper bound on the difference of the prediction probabilities across different
subgroups. Applying Lemma 7.3.1 twice for y = 0 and y = 1, we can prove the following theorem:b = h( g( X )) be the classifier,
Theorem 7.3.1. Assume the conditions in Proposition 7.3.1 hold and let Ybthen ∆DP (Y ) ≤ ∆BR (D0 , D1 ) = ∆DP (Y ).
Remark Theorem 7.3.1 shows that aligning the conditional distributions of representations between
groups will not add more bias in terms of the demographic parity gap. In particular, the DP gap of
any classifier that satisfies equalized odds will be at most the DP gap of the perfect classifier. This isparticularly interesting as it is well-known in the literature (Barocas et al., 2017) that demographic parity is
not compatible with equalized odds except in degenerate cases. Despite this result, Theorem 7.3.1 says that
we can still achieve equalized odds and simultaneously preserve the DP gap.
In Section 7.3.1 we show that aligning the conditional distributions of representations between groups
helps reduce the lower bound of the joint error, but nevertheless that is only a necessary condition. In thenext theorem we show that together with a small Type-I and Type-II error in inferring the target variable Y,
these two properties are also sufficient to ensure a small joint error across different demographic subgroups.

114b = h( g( X )) be the classifier,
Theorem 7.3.2. Assume the conditions in Proposition 7.3.1 hold and let Yb ) + ε D (Yb) ≤ 2BERD (Yb k Y ).
then ε D (Y0

1

The above bound means that in order to achieve small joint error across groups, it suffices for us
to minimize the BER if a classifier satisfies equalized odds. Note that by definition, the BER in theb as a classifier. Theorem 7.3.2
bound equals to the sum of Type-I and Type-II classification errors using Y
gives an upper bound of the joint error across groups and it also serves as a motivation for us to design
the optimization formulation (7.2) that simultaneously minimizes the BER and aligns the conditional
distributions.

7.3.3

Conditional Alignment and Balanced Error Rates Lead to Small Error

In this section we will see that a small BER and equalized odds together not only serve as a guarantee of asmall joint error, but they also lead to a small error gap between different demographic subgroups. Recall
that we define γa := D a (Y = 0), ∀ a ∈ {0, 1}. Before we proceed, we first formally define the accuracyb
gap and equalized odds gap of a classifier Y:
b is ∆ε (Yb) :=Definition 7.3.2 (Error Gap). Given a joint distribution D , the error gap of a classifier Ybb|D0 (Y 6= Y ) − D1 (Y 6= Y )|.
Definition 7.3.3 (Equalized Odds Gap). Given a joint distribution D , the equalized odds gap of a classifierb is ∆EO (Yb) := maxy∈{0,1} |D y (Yb = 1 ) − D y (Yb = 1)|.
Y0
1
By definition the error gap could also be understood as the accuracy parity gap between different
subgroups. The following theorem characterizes the relationship between error gap, equalized odds gap
and the difference of base rates across subgroups:b ∆ ε (Yb) ≤ ∆BR (D0 , D1 ) · BERD (Yb k Y ) + 2∆EO (Yb ).
Theorem 7.3.3. For any classifier Y,b) = 0.
b satisfies equalized odds, then ∆EO (YAs a direct corollary of Theorem 7.3.3, if the classifier Yb
In this case since ∆BR (D0 , D1 ) is a constant, minimizing the balanced error rate BERD (Y k Y ) also leads
to minimizing the error gap. Furthermore, if we combine Theorem 7.3.2 and Theorem 7.3.3 together, we
can guarantee that each of the errors cannot be too large:b if Yb satisfies equalized odds, thenCorollary 7.3.1. For any joint distribution D and classifier Y,b ) , ε D (Yb)} ≤ ∆BR (D0 , D1 ) · BERD (Yb k Y )/2 + BERD (Yb k Y ).
max{ε D0 (Y1Remark It is a well-known fact that out of the three fairness criteria, i.e., demographic parity, equalized
odds, and predictive rate parity, any two of them cannot hold simultaneously (Barocas et al., 2017) except
in degenerate cases. By contrast, Theorem 7.3.3 suggests it is possible to achieve both equalized odds andaccuracy parity. In particular, among all classifiers that satisfy equalize odds, it suffices to minimize theb k Y ) in order to achieve accuracy parity. It is also worth pointing
sum of Type-I and Type-II error BERD (Yout that Theorem 7.3.3 provides only an upper bound, but not necessarily the tightest one. In particular, theb k Y ) is greater than 0. To see this, we haveerror gap could still be 0 while BERD (Y(b ) = D 0 (Y = 0 ) · D 0 (Yb = 1 | Y = 0 ) + D 0 (Y = 1 ) · D 0 (Yb = 0 | Y = 1)
ε D 0 (Yb ) = D 1 (Y = 0 ) · D 1 (Yb = 1 | Y = 0 ) + D 1 (Y = 1 ) · D 1 (Yb = 0 | Y = 1).
ε D 1 (Yb satisfies equalized odds, thenNow if the predictor Y
b = 1 | Y = 0 ) = D 1 (Yb = 1 | Y = 0) = D(Yb = 1 | Y = 0),
D 0 (Yb = 0 | Y = 1 ) = D 1 (Yb = 0 | Y = 1) = D(Yb = 0 | Y = 1).
D 0 (Y115b) admits the following identity:
Hence the error gap ∆ε (Yb) = D(Yb = 1 | Y = 0) D0 (Y = 0) − D1 (Y = 0) + D(Yb = 0 | Y = 1 ) D 0 (Y = 1 ) − D 1 (Y = 1 )∆ ε (Yb = 1 | Y = 0) − D(Yb = 0 | Y = 1)
= ∆BR (D0 , D1 ) · D(Yb) − FNR(Yb) .
= ∆BR (D0 , D1 ) · FPR(Yb satisfies equalized odds, then in order to have equalized accuracy, Yb onlyIn other words, if the predictor Y
needs to have equalized FPR and FNR globally when the base rates differ across groups. This is a muchb k Y ) = 0.
weaker condition to ask for than the one asking BERD (Y7.3.4

Practical Implementation

We cannot directly optimize the proposed optimization formulation (7.2) since the binary 0/1 loss is
NP-hard to optimize, or even approximately optimize over a wide range of hypothesis classes (Ben-Davidb and y ∈ {0, 1}, the log-loss (cross-entropy loss)
et al., 2003). However, observe that for any classifier Yb
CED y (Y k Y ) is a convex relaxation of the binary loss:
b 6= y | Y = y) =D(Yb 6= y, Y = y)b k Y)D(YCED y (Y≤.
D(Y = y)D(Y = y)(7.4)

Hence in practice we can relax the optimization problem (7.2) to a cost-sensitive cross-entropy loss
minimization problem, where the weight for each class is given by the inverse marginal probability of
the corresponding class. This allows us to equivalently optimize the objective function without explicitly
computing the conditional distributions.

7.4

Empirical Studies

In light of our theoretic findings, in this section we verify the effectiveness of the proposed algorithm insimultaneously ensuring equalized odds and accuracy parity using real-world datasets. We also analyze theimpact of imposing such parity constraints on the utility of the target classifier, as well as its relationship to
the intrinsic structure of the binary classification problem, e.g., the difference of base rates across groups,
the global imbalance of the target variable, etc. We analyze how this imbalance affects the utility-fairness
trade-off. As we shall see shortly, we will empirically demonstrate that, in many cases, especially the ones
where the dataset is imbalanced in terms of the target variable, this will inevitably compromise the target
utility. While for balanced datasets, this trend is less obvious: the proposed algorithm achieves a better
fairness-utility trade-off when compared with existing fair representation learning methods and we canhope to achieve fairness without sacrificing too much on utility.
Table 7.4.1: Statistics about the Adult and COMPAS datasets.
Train / Test
Adult
COMPAS30, 162/15, 060
4, 320/1, 852

D 0 (Y = 1 )

D 1 (Y = 1 )∆BR (D0 , D1 )D(Y = 1)

D( A = 1)

0.310
0.400

0.113
0.529

0.196
0.129

0.246
0.467

0.673
0.514

116

7.4.1

Experimental Setup

To this end, we perform experiments on two popular real-world datasets in the literature of algorithmic
fairness, including an income-prediction dataset, known as the Adult dataset, from the UCI Machine
Learning Repository (Dua and Graff, 2017), and the Propublica COMPAS dataset (Dieterich et al., 2016).
The basic statistics of these two datasets are listed in Table 7.4.1.
Adult Each instance in the Adult dataset describes an adult, e.g., gender, education level, age, etc, fromthe 1994 US Census. In this dataset we use gender as the sensitive attribute, and the processed data contains
114 attributes. The target variable (income) is also binary: 1 if ≥ 50K/year otherwise 0. For the sensitive
attribute A, A = 0 means male otherwise female. From Table 7.4.1 we can see that the base rates arequite different (0.310 vs. 0.113) across groups in the Adult dataset. The dataset is also imbalanced in thesense that only around 24.6% of the instances have target label 1. Furthermore, the group ratio is also
imbalanced: roughly 67.3% of the data are male.
COMPAS The goal of the COMPAS dataset is binary classification on whether a criminal defendant will
recidivate within two years or not. Each instance contains 12 attributes, including age, race, gender, numberof prior crimes, etc. For this dataset, we use the race (white A = 0 vs. black A = 1) as our sensitive
attribute and target variable is 1 iff recidivism. The base rates are different across groups, but the COMPAS
dataset is balanced in both the target variable and the sensitive attribute.
To validate the effect of ensuring equalized odds and accuracy parity, for each dataset, we perform
controlled experiments by fixing the baseline network architecture so that it is shared among all the fair
representation learning methods. We term the proposed method CFAIR (for conditional fair representations)that minimizes conditional errors both the target variable loss function and adversary loss function. To
demonstrate the importance of using BER in the loss function of target variable, we compare with avariant of CFAIR that only uses BER in the loss of adversaries, denoted as CFAIR -EO. To see the relative
effect of using cross-entropy loss vs L1 loss, we also show the results of L AFTR (Madras et al., 2018), a
state-of-the-art method for learning fair representations. Note that L AFTR is closely related to CFAIR -EO
but slightly different: L AFTR uses global cross-entropy loss for target variable, but conditional L1 loss forthe adversary. Also, there is only one adversary in L AFTR, while there are two adversaries, one for D 0 and
one for D 1 , in both CFAIR and CFAIR -EO. Lastly, we also present baseline results of FAIR (Edwards andStorkey, 2015), which aims for demographic parity representations, and N O D EBIAS, the baseline network
without any fairness constraint. For all the fair representation learning methods, we use the gradient
reversal layer (Ganin et al., 2016) to implement the gradient descent ascent (GDA) algorithm to optimize
the minimax problem. All the experimental details, including network architectures, learning rates, batch
sizes, etc. are provided in the appendix.

7.4.2

Results and Analysis

In Figure 7.4.1 and Figure 7.4.2 we show the error gap ∆ε , equalized odds gap ∆EO , demographic parity gap∆DP and the joint error across groups ε 0 + ε 1 of the aforementioned fair representation learning algorithms
on both the Adult and the COMPAS datasets. For each algorithm and dataset, we also gradually increase
the value of the trade-off parameter λ and compute the corresponding metrics.
Adult Due to the imbalance of A in the Adult dataset, in the first plot of Figure 7.4.1 we can see that
all the algorithms except CFAIR have a large error gap of around 0.12. As a comparison, observe thatthe error gap of CFAIR when λ = 1e3 almost reduces to 0, confirming the effectiveness of our algorithm
117Figure 7.4.1: The error gap ∆ε , equalized odds gap ∆EO , demographic parity gap ∆DP and joint error
ε 0 + ε 1 on the Adult dataset with λ ∈ {0.1, 1.0, 10.0, 100.0, 1000.0}.

Figure 7.4.2: The error gap ∆ε , equalized odds gap ∆EO , demographic parity gap ∆DP and joint error
ε 0 + ε 1 on the COMPAS dataset with λ ∈ {0.1, 1.0, 10.0}.
in ensuring accuracy parity. From the second plot, we can verify that all the three methods, including
CFAIR, CFAIR -EO and L AFTR successfully ensure a small equalized odds gap, and they also decrease
demographic parity gaps (the third plot). FAIR is the most effective one in mitigating ∆DP since its
objective function directly optimizes for that goal. Note that from the second plot we can also confirm that
CFAIR -EO is more effective than L AFTR in reducing ∆EO . The reason is two-fold. First, CFAIR -EO uses
two distinct adversaries and hence it effectively competes with stronger adversaries than L AFTR. Second,
CFAIR -EO uses the cross-entropy loss instead of the L1 loss for the adversary, and it is well-known thatthe maximum-likelihood estimator (equivalent to using the cross-entropy loss) is asymptotically efficientand optimal. On the other hand, since the Adult dataset is imbalanced (in terms of Y), using BER in theloss function of the target variable can thus to a large extent hurt the utility, and this is also confirmed fromthe last plot, where we show the joint error.
COMPAS The first three plots of Figure 7.4.2 once again verify that CFAIR successfully leads to reduced
error gap, equalized odds gap and also demographic parity gap. These experimental results are consistent
with our theoretical findings where we show that if the representations satisfy equalized odds, then its∆DP cannot exceed that of the optimal classifier, as shown by the horizontal dashed line in the third plot.
In the fourth plot of Figure 7.4.2, we can see that as we increase λ, all the fair representation learningalgorithms sacrifice utility. However, in contrast to Figure 7.4.1, here the proposed algorithm CFAIR has
the smallest trade-off: this shows that CFAIR is particularly suited in the cases when the dataset is balanced
and we would like to simultaneously ensure accuracy parity and equalized odds. As a comparison, while
CFAIR -EO is still effective, it is slightly worse than CFAIR in terms of both ensuring parity and achieving
small joint error.

118

7.5

Related Work

Algorithmic Fairness In the literature of algorithmic fairness, two key notions of fairness have been
extensively proposed and explored, i.e., group fairness, including various variants defined in Section 7.2,
and individual fairness, which means that similar individuals should be treated similarly. Due to thecomplexity in defining a distance metric to measure the similarity between individuals (Dwork et al.,2012), most recent research focuses on designing efficient algorithms to achieve group fairness (Creager
et al., 2019; Hardt et al., 2016; Madras et al., 2018, 2019; Zafar et al., 2015, 2017; Zemel et al., 2013).
In particular, Hardt et al. (2016) proposed a post-processing technique to achieve equalized odds bytaking as input the model’s prediction and the sensitive attribute. However, the post-processing techniquerequires access to the sensitive attribute during the inference phase, which is often not available in many
real-world scenarios. Another line of work uses causal inference to define notions of causal fairness and toformulate procedures for achieving these notions (Kilbertus et al., 2017; Kusner et al., 2017; Madras et al.,2019; Nabi and Shpitser, 2018; Wang et al., 2019; Zhang et al., 2018). These approaches require making
untestable assumptions. Of particular note is the observation in Coston et al. (2019) that fairness-adjustment
procedures based on Y in settings with treatment effects may lead to adverse outcomes. To apply our
method in such settings, we would need to match conditional counterfactual distributions, which could be adirection of future research.
Theoretical Results on Fairness Theoretical work studying the relationship between different kindsof fairness notions are abundant. Motivated by the controversy of the potential discriminatory bias inrecidivism prediction instruments, Chouldechova (2017) showed an intrinsic incompatibility between
equalized odds and predictive rate parity. In the seminal work of Kleinberg et al. (2016), the authors
demonstrated that when the base rates differ between different groups, then a non-perfect classifier cannot
simultaneously be statistically calibrated and satisfy equalized odds. In the context of cost-sensitive
learning, Menon and Williamson (2018) show that if the optimal decision function is dissimilar to a fairdecision, then the fairness constraint will not significantly harm the target utility. The idea of reducing fairclassification to cost-sensitive learning is not new. Agarwal et al. (2018) explored the connection between
fair classification and a sequence of cost-sensitive learning problems where each stage corresponds tosolving a linear minimax saddle point problem. In a recent work (Zhao and Gordon, 2019), the authors
proved a lower bound on the joint error across different groups when a classifier satisfies demographic
parity. They also showed that when the decision functions are close between groups, demographic parity
also implies accuracy parity. The theoretical results in this work establish a relationship between accuracy
parity and equalized odds: these two fairness notions are fundamentally related by the base rate gap andthe balanced error rate. Furthermore, we also show that for any predictor that satisfies equalized odds, thebalanced error rate also serves as an upper bound on the joint error across demographic subgroups.
Fair Representations Through the lens of representation learning, recent advances in building fairalgorithmic decision making systems focus on using adversarial methods to learn fair representations that
also preserve sufficient information for the prediction task (Adel et al., 2019a; Beutel et al., 2017; Edwards
and Storkey, 2015; Madras et al., 2018; Zhang et al., 2018). In a nutshell, the key idea is to frame theproblem of learning fair representations as a two-player game, where the data owner is competing against
an adversary. The goal of the adversary is to infer the group attribute as much as possible while the goalof the data owner is to remove information related to the group attribute and simultaneously to preserve
utility-related information for accurate prediction. Apart from using adversarial classifiers to enforce groupfairness, other distance metrics have also been used to learn fair representations, e.g., the maximum mean

119

discrepancy (Louizos et al., 2015), and the Wasserstein-1 distance (Jiang et al., 2019). In contrast to thesemethods, in this chapter we advocate for optimizing BER on both the target loss and adversary loss inorder to simultaneously achieve accuracy parity and equalized odds. We also show that this leads to better
utility-fairness trade-off for balanced datasets.

7.6

ProofsWe provide all the missing proofs in this section.

7.6.1

Proof of Proposition 7.3.1
yy

Proposition 7.3.1. For g : X → Z , if dTV ( g] D0 , g] D1 ) = 0, ∀y ∈ {0, 1}, then for any classifierh : Z → {0, 1}, h ◦ g satisfies equalized odds.
Proof. To prove this proposition, we first show that for any pair of distributions D , D 0 over Z and any
hypothesis h : Z → {0, 1}, dTV (h] D , h] D 0 ) ≤ dTV (D , D 0 ). Note that since h is a hypothesis, there are
only two events in the induced probability space, i.e., h(·) = 0 or h(·) = 1. Hence by definition of theinduced (pushforward) distribution, we have:dTV (h] D , h] D 0 ) =max|D( E) − D 0 ( E)|

sup|D( E) − D 0 ( E)|

E=h−1 (0), or E=h−1 (1)≤E is measurable subset of Z
= dTV (D , D 0 ).

Apply the above inequality twice for y ∈ {0, 1}:
y

y

y

y

0 ≤ dTV ((h ◦ g)] D0 , (h ◦ g)] D1 ) ≤ dTV ( g] D0 , g] D1 ) = 0,
meaningyydTV ((h ◦ g)] D0 , (h ◦ g)] D1 ) = 0,

which further implies that h( g( X )) is independent of A given Y = y since h( g( X )) is binary.

7.6.2



Proof of Proposition 7.3.2
yy

Proposition 7.3.2. For g : X → Z , if dTV ( g] D0 , g] D1 ) = 0, ∀y ∈ {0, 1}, then for any classifierh : Z → {0, 1}, dTV ((h ◦ g)] D0 , (h ◦ g)] D1 ) ≤ ∆BR (D0 , D1 ).
b = (h ◦ g)( X ) and note that Y
b is binary, we have
Proof. Let Y
dTV ((h ◦ g)] D0 , (h ◦ g)] D1 ) =1
b = 0 ) − D 1 (Yb = 0)| + |D0 (Yb = 1 ) − D 1 (Yb = 1)| .
|D0 (Y2yyyNow, by Proposition 7.3.1, if dTV ( g] D0 , g] D1 ) = 0, ∀y ∈ {0, 1}, it follows that dTV ((h ◦ g)] D0 , (h ◦yg)] D1 ) = 0, ∀y ∈ {0, 1} as well. Applying Lemma 7.3.1, we know that ∀y ∈ {0, 1},b = y ) − D 1 (Yb = y)| ≤ |D0 (Y = 0) − D1 (Y = 0)| · D 0 (Yb = y ) + D 1 (Yb = y) .
|D0 (Y120

Hence,1
b = 0 ) − D 1 (Yb = 0)| + |D0 (Yb = 1 ) − D 1 (Yb = 1)||D0 (Y2
|D0 (Y = 0) − D1 (Y = 0)|  0 b
b = 0 ) + D 0 (Yb = 1 ) + D 1 (Yb = 1)≤
D (Y = 0 ) + D 1 (Y2
|D0 (Y = 0) − D1 (Y = 0)|  0 b
b = 1 ) + D 1 (Yb = 0 ) + D 1 (Yb = 1)=
D (Y = 0 ) + D 0 (Y2
|D0 (Y = 0) − D1 (Y = 0)|·2=
2= |D0 (Y = 0) − D1 (Y = 0)|

dTV ((h ◦ g)] D0 , (h ◦ g)] D1 ) == ∆BR (D0 , D1 ).

7.6.3



Proof of Lemma 7.3.1

Recall that we define γa := D a (Y = 0), ∀ a ∈ {0, 1}.
b = h( g( X )) be the classifier,Lemma 7.3.1. Assume the conditions in Proposition 7.3.1 hold and let Y01
b = y ) − D 1 (Yb = y)| ≤ |γ0 − γ1 | · D (Yb = y ) + D (Yb = y) , ∀y ∈ {0, 1}.
then |D0 (Yb = y ) − D 1 (Yb = y)|, for y ∈ {0, 1}, by the law of total probability, we have:
Proof. To bound |D0 (Yb = y ) − D 1 (Yb = y)| =|D0 (Yb = y)D0 (Y = 0) + D01 (Yb = y)D0 (Y = 1) − D 0 (Yb = y)D1 (Y = 0) + D11 (Yb = y)D1 (Y = 1)
= D00 (Y1b = y) − γ1 D 0 (Yb = y) + (1 − γ0 )D01 (Yb = y) − (1 − γ1 )D11 (Yb = y) ,≤ γ0 D00 (Y1

where the above inequality is due to the triangular inequality. Now apply Proposition 7.3.1, we know thatb satisfies equalized odds, so we have D 0 (Yb = y ) = D 0 (Yb = y ) = D 0 (Yb = y) and D 1 (Yb = y) =
Y
0
0
1
1
1
b
b
D1 (Y = y) = D (Y = y), leading to:b = y) + (1 − γ0 ) − (1 − γ1 ) · D 1 (Yb = y)= γ0 − γ1 · D 0 (Y
b = y ) + D 1 (Yb = y) ,= |γ0 − γ1 | · D 0 (Ywhich completes the proof.

7.6.4

Proof of Theorem 7.3.1

b = h( g( X )) be the classifier,
Theorem 7.3.1. Assume the conditions in Proposition 7.3.1 hold and let Yb) ≤ ∆BR (D0 , D1 ) = ∆DP (Y ).
then ∆DP (Yb), realize that |D0 (Yb = 0 ) − D 1 (Yb = 0)| = |D0 (Yb = 1 ) − D 1 (Yb = 1)|, so we
Proof. To bound ∆DP (Ycan rewrite the DP gap as follows:b ) = 1 D 0 (Yb = 0 ) − D 1 (Yb = 0)| + |D0 (Yb = 1 ) − D 1 (Yb = 1) .
∆DP (Y2
Now apply Lemma 7.3.1 twice for y = 0 and y = 1, we have:b = 0 ) − D 1 (Yb = 0)| ≤ |γ0 − γ1 | · D 0 (Yb = 0 ) + D 1 (Yb = 0)|D0 (Yb = 1 ) − D 1 (Yb = 1)| ≤ |γ0 − γ1 | · D 0 (Yb = 1 ) + D 1 (Yb = 1) .
|D0 (Y
121

Taking sum of the above two inequalities yields
b = 0 ) − D 1 (Yb = 0)| + |D0 (Yb = 1 ) − D 1 (Yb = 1)||D0 (Y
b = 0 ) + D 1 (Yb = 0 ) + D 0 (Yb = 1 ) + D 1 (Yb = 1)≤ |γ0 − γ1 | D 0 (Y
b = 0 ) + D 0 (Yb = 1 ) + D 1 (Yb = 0 ) + D 1 (Yb = 1)= |γ0 − γ1 | D 0 (Y

= 2 γ0 − γ1 .

Combining all the inequalities above, we know thatb = 0 ) − D 1 (Yb = 0)| + |D0 (Yb = 1 ) − D 1 (Yb = 1)b ) = 1 D 0 (Y∆DP (Y2≤ γ0 − γ1= |D0 (Y = 0) − D1 (Y = 0)|= |D0 (Y = 1) − D1 (Y = 1)|= ∆BR (D0 , D1 ) = ∆DP (Y ),completing the proof.

7.6.5

Proof of Theorem 7.3.2

b = h( g( X )) be the classifier,
Theorem 7.3.2. Assume the conditions in Proposition 7.3.1 hold and let Yb ) + ε D (Yb) ≤ 2BERD (Yb k Y ).
then ε D (Y0

1

Proof. First, by the law of total probability, we have:b ) + ε D (Yb ) = D 0 (Y 6 = Yb ) + D 1 (Y 6 = Yb)
ε D 0 (Y1
b = 0)D1 (Y = 1) + D 0 (Yb = 1)D1 (Y = 0)
b = 0)D0 (Y = 1) + D00 (Yb = 1)D0 (Y = 0) + D11 (Y= D01 (Y1b = (h ◦ g)( X ) satisfies equalized odds, so we have D 1 (Yb=Again, by Proposition 7.3.1, the classifier Y
0
0
0
1
1
0
0
1
b
b
b
b
b
b
b
0) = D (Y = 0), D0 (Y = 1) = D (Y = 1), D1 (Y = 0) = D (Y = 0) and D1 (Y = 1) = D (Y =1):
b = 0)D0 (Y = 1) + D 0 (Yb = 1)D0 (Y = 0) + D 1 (Yb = 0)D1 (Y = 1) + D 0 (Yb = 1)D1 (Y = 0)
= D 1 (Y
b = 0 ) · D 0 (Y = 1 ) + D 1 (Y = 1 ) + D 0 (Yb = 1 ) · D 0 (Y = 0 ) + D 1 (Y = 0 )= D 1 (Yb = 0 ) + 2 D 0 (Yb = 1)≤ 2 D 1 (Yb k Y ),
= 2BERD (Ywhich completes the proof.

7.6.6

Proof of Theorem 7.3.3

b ∆ ε (Yb) ≤ ∆BR (D0 , D1 ) · BERD (Yb k Y ) + 2∆EO (Yb ).
Theorem 7.3.3. For any classifier Y,
Before we give the proof of Theorem 7.3.3, we first prove the following two lemmas that will be usedin the following proof.
b = 1) − γ1 D 0 (Yb = 1)| ≤Lemma 7.6.1. Define γa := D a (Y = 0), ∀ a ∈ {0, 1}, then |γ0 D00 (Y1
b = 1) + γ0 D 0 ( A = 1)∆EO (Yb) + γ1 D 0 ( A = 0)∆EO (Yb ).
|γ0 − γ1 | · D 0 (Y122Proof. In order to prove the upper bound in the lemma, it suffices if we could give the desired upper boundfor the following term
b = 1) − γ1 D 0 (Yb = 1)| − |(γ0 − γ1 )D 0 (Yb = 1)||γ0 D00 (Y1
b = 1) − γ1 D 0 (Yb = 1) − (γ0 − γ1 )D 0 (Yb = 1)≤ γ0 D00 (Y1
b = 1 ) − D 0 (Yb = 1)) − γ1 (D 0 (Yb = 1 ) − D 0 (Yb = 1)) ,= γ0 (D00 (Y1following which we will have:b = 1) − γ1 D 0 (Yb = 1)| ≤ |(γ0 − γ1 )D 0 (Yb = 1)||γ0 D00 (Y1

b = 1 ) − D 0 (Yb = 1)) − γ1 (D 0 (Yb = 1 ) − D 0 (Yb = 1)) ,+ γ0 (D00 (Y1b=
and an application of the Bayes formula could finish the proof. To do so, let us first simplify D00 (Y0
b = 1). Applying the Bayes’s formula, we know that:1 ) − D (Y
b = 1 ) − D 0 (Yb = 1) = D00 (Yb = 1) − D00 (Yb = 1)D 0 ( A = 0) + D 0 (Yb = 1)D 0 ( A = 1)
D00 (Y1b = 1) − D00 (Yb = 1)D 0 ( A = 0) − D 0 (Yb = 1)D 0 ( A = 1)
= D00 (Y1b = 1 ) − D 0 (Yb = 1) .
= D 0 ( A = 1) D00 (Y1
b = 1 ) − D 0 (Yb = 1), we can show that:
Similarly, for the second term D10 (Y
b = 1 ) − D 0 (Yb = 1 ) = D 0 ( A = 0 ) D 0 (Yb = 1) − D00 (Yb = 1) .
D10 (Y
1
Plug these two identities into above, we can continue the analysis withb = 1 ) − D 0 (Yb = 1)) − γ1 (D 0 (Yb = 1 ) − D 0 (Yb = 1))
γ0 (D00 (Y1
b = 1 ) − D 0 (Yb = 1)) − γ1 D 0 ( A = 0)(D 0 (Yb = 1) − D00 (Yb = 1))= γ0 D 0 ( A = 1)(D00 (Y11
b = 1 ) − D 0 (Yb = 1)) + γ1 D 0 ( A = 0)(D 0 (Yb = 1) − D00 (Yb = 1))≤ γ0 D 0 ( A = 1)(D00 (Y11b) + γ1 D 0 ( A = 0)∆EO (Yb ).
≤ γ0 D 0 ( A = 1)∆EO (YThe first inequality holds by triangular inequality and the second one holds by the definition of equalized
odds gap.
b = 0) − (1 − γ1 )D 1 (Yb=Lemma 7.6.2. Define γa := D a (Y = 0), ∀ a ∈ {0, 1}, then |(1 − γ0 )D01 (Y1111
b = 0) + (1 − γ0 )D ( A = 1)∆EO (Yb) + (1 − γ1 )D ( A = 0)∆EO (Yb ).
0)| ≤ |γ0 − γ1 | · D (YProof. The proof of this lemma is symmetric to the previous one, so we omit it here.

Now we are ready to prove Theorem 7.3.3:
Proof of Theorem 7.3.3. First, by the law of total probability, it is easy to verify that following identity
holds for a ∈ {0, 1}:
b 6= Y ) = D a (Y = 1, Y
b = 0) + D a (Y = 0, Y
b = 1)
D a (Yb = 0) + γa D a0 (Yb = 1).
= (1 − γa )D a1 (Y123

Using this identity, to bound the error gap, we have:b ) − D 1 (Y 6 = Yb)| = ((1 − γ0 )D01 (Yb = 0) + γ0 D00 (Yb = 1)) − ((1 − γ1 )D11 (Yb = 0) + γ1 D 0 (Yb = 1))|D0 (Y 6= Y1
b = 1) − γ1 D 0 (Yb = 1) + (1 − γ0 )D01 (Yb = 0) − (1 − γ1 )D11 (Yb = 0) .
≤ γ0 D00 (Y1
Invoke Lemma 7.6.1 and Lemma 7.6.2 to bound the above two terms:b ) − D 1 (Y 6 = Yb)||D0 (Y 6= Y
b = 0) − (1 − γ1 )D11 (Yb = 0)
b = 1) − γ1 D 0 (Yb = 1) + (1 − γ0 )D01 (Y≤ γ0 D00 (Y1b) + γ1 D 0 ( A = 0)∆EO (Yb)≤ γ0 D 0 ( A = 1)∆EO (Yb) + (1 − γ1 )D 1 ( A = 0)∆EO (Yb)+ (1 − γ0 )D 1 ( A = 1)∆EO (Yb = 1) + γ0 − γ1 D 1 (Yb = 0),+ γ0 − γ1 D 0 (YRealize that both γ0 , γ1 ∈ [0, 1], we have:b) + D 0 ( A = 0)∆EO (Yb) + D 1 ( A = 1)∆EO (Yb) + D 1 ( A = 0)∆EO (Yb)≤ D 0 ( A = 1)∆EO (Yb = 0)
b = 1) + γ0 − γ1 D 1 (Y+ γ0 − γ1 D 0 (Yb = 0)
b = 1) + γ0 − γ1 D 1 (Yb) + γ0 − γ1 D 0 (Y= 2∆EO (Yb) + ∆BR (D0 , D1 ) · BERD (Yb k Y ),
= 2∆EO (Ywhich completes the proof.
We also provide the proof of Corollary 7.3.1:
b if Yb satisfies equalized odds, thenCorollary 7.3.1. For any joint distribution D and classifier Y,b ) , ε D (Yb)} ≤ ∆BR (D0 , D1 ) · BERD (Yb k Y )/2 + BERD (Yb k Y ).
max{ε D0 (Y1b satisfies equalized odds, then ∆EO (Yb) = 0, which implies:
Proof. We first invoke Theorem 7.3.3, if Y
b k Y ).
b ) = ε D (Yb ) − ε D (Yb) ≤ ∆BR (D0 , D1 ) · BERD (Y∆ ε (Y0
1
On the other hand, by Theorem 7.3.2, we know thatb ) + ε D (Yb) ≤ 2BERD (Yb k Y ).
ε D 0 (Y1

Combine the above two inequalities and recall that max{ a, b} = (| a + b| + | a − b|)/2, ∀ a, b ∈ R,
yielding:bbbbb ) , ε D (Yb)} = |ε D0 (Y ) − ε D1 (Y )| + |ε D0 (Y ) + ε D1 (Y )|max{ε D0 (Y12
b k Y ) + 2BERD (Yb k Y)∆BR (D0 , D1 ) · BERD (Y≤2bb k Y ),
= ∆BR (D0 , D1 ) · BERD (Y k Y )/2 + BERD (Ycompleting the proof.

124

7.7

Conclusion

In this chapter we propose a novel representation learning algorithm that aims to simultaneously ensure
accuracy parity and equalized odds. The main idea underlying the design of our algorithm is to align theconditional distributions of representations (rather than marginal distributions) and use balanced error rate(i.e., the conditional error) on both the target variable and the sensitive attribute. Theoretically, we prove
how these two concepts together help to ensure accuracy parity and equalized odds without impacting
demographic parity, and we also show how these two can be used to give a guarantee on the joint error
across different demographic subgroups. Empirically, we demonstrate on two real-world experimentsthat the proposed algorithm effectively leads to the desired notions of fairness, and it also leads to better
utility-fairness trade-off on balanced datasets.
Calibration and Utility Our work takes a step towards better understanding the relationships between
different notions of fairness and their corresponding trade-off with utility. In some scenarios, e.g., theCOMPAS tool, it is desired to have a decision making system that is also well calibrated. While it iswell-known that statistical calibration is not compatible with demographic parity or equalized odds, froma theoretical standpoint it is still not clear whether calibration will harm utility and if so, what is thefundamental limit of a calibrated tool on utility.
Fairness and Privacy Future work could also investigate how to make use of the close relationshipbetween privacy and group fairness. At a colloquial level, fairness constraints require a predictor to be(to some extent) agnostic about the group membership attribute. The membership query attack in privacy
asks the same question – is it possible to guarantee that even an optimal adversary cannot steal personal
information through inference attacks. Prior work (Dwork et al., 2012) has described the connection
between the notion of individual fairness and differential privacy. Hence it would be interesting to
exploit techniques developed in the literature of privacy to develop more efficient fairness-aware learningalgorithms. On the other hand, results obtained in the algorithmic fairness literature could also potentiallylead to better privacy-preserving machine learning algorithms (Zhao et al., 2019a).

125

Appendix
7.A

Experimental Details

7.A.1

The Adult Experiment

For the baseline network N O D EBIAS, we implement a three-layer neural network with ReLU as the hidden
activation function and logistic regression as the target output function. The input layer contains 114 units,
and the hidden layer contains 60 hidden units. The output layer only contain one unit, whose output isb = 1 | X = x ).
interpreted as the probability of D(YFor the adversary in FAIR and L AFTR, again, we use a three-layer feed-forward network. Specifically,
the input layer of the adversary is the hidden representations of the baseline network that contains 60 units.
The hidden layer of the adversary network contains 50 units, with ReLU activation. Finally, the output ofb = 1 | Z = z ).
the adversary also contains one unit, representing the adversary’s inference probability D( A
The network structure of the adversaries in both CFAIR and CFAIR -EO are exactly the same as the one
b = 1 | Z = z) and one forused in FAIR and L AFTR, except that there are two adversaries, one for D 0 ( A1b
D ( A = 1 | Z = z ).
The hyperparameters used in the experiment are listed in Table 7.A.1.
Table 7.A.1: Hyperparameters used in the Adult experiment.
Optimization Algorithm
Learning Rate
Batch Size
Training Epochs λ ∈ {0.1, 1.0, 10.0, 100.0, 1000.0}

7.A.2

AdaDelta
1.0
512
100

The COMPAS Experiment

Again, for the baseline network N O D EBIAS, we implement a three-layer neural network with ReLU as thehidden activation function and logistic regression as the target output function. The input layer contains 11
units, and the hidden layer contains 10 hidden units. The output layer only contain one unit, whose output
b = 1 | X = x ).
is interpreted as the probability of D(YFor the adversary in FAIR and L AFTR, again, we use a three-layer feed-forward network. Specifically,
the input layer of the adversary is the hidden representations of the baseline network that contains 60 units.
The hidden layer of the adversary network contains 10 units, with ReLU activation. Finally, the output ofb = 1 | Z = z ).
the adversary also contains one unit, representing the adversary’s inference probability D( A
The network structure of the adversaries in both CFAIR and CFAIR -EO are exactly the same as the one
b = 1 | Z = z) and one forused in FAIR and L AFTR, except that there are two adversaries, one for D 0 ( A1b
D ( A = 1 | Z = z ).
127

The hyperparameters used in the experiment are listed in Table 7.A.2.
Table 7.A.2: Hyperparameters used in the COMPAS experiment.
Optimization Algorithm
Learning Rate
Batch Size
Training Epochs λ ∈ {0.1, 1.0}
Training Epochs λ = 10.0128

AdaDelta
1.0
512
20
15

Chapter 8

Learning Language-Invariant
Representations for Universal MachineTranslation
The goal of universal machine translation is to learn to translate between any pair of languages, given a
corpus of paired translated documents for a small subset of all pairs of languages. Despite impressive
empirical results and an increasing interest in massively multilingual models, theoretical analysis ontranslation errors made by such universal machine translation models is only nascent. In this chapter, weformally prove certain impossibilities of this endeavour in general, as well as prove positive results inthe presence of additional (but natural) structure of data. For the former, we derive a lower bound on thetranslation error in the many-to-many translation setting, which shows that any algorithm aiming to learn
shared sentence representations among multiple language pairs has to make a large translation error on atleast one of the translation tasks, if no assumption on the structure of the languages is made. For the latter,
we show that if the paired documents in the corpus follow a natural encoder-decoder generative process,we can expect a natural notion of “generalization”: a linear number of language pairs, rather than quadratic,
suffices to learn a good representation. Our theory also explains what kinds of connection graphs between
pairs of languages are better suited: ones with longer paths result in worse sample complexity in terms ofthe total number of documents per language pair needed.

129

8.1

Introduction

Despite impressive improvements in neural machine translation (NMT), training a large multilingual NMT
model with hundreds of millions of parameters usually requires a collection of parallel corpora at a large
scale, on the order of millions or even billions of aligned sentences (Arivazhagan et al., 2019; Johnson
et al., 2017) for supervised training. Although it is possible to automatically crawl the web (Nie et al.,
1999; Resnik, 1999; Resnik and Smith, 2003) to collect parallel sentences for high-resource language pairs
such as German-English and Chinese-English, it is often infeasible or expensive to manually translate large
amounts of documents for low-resource language pairs, e.g., Nepali-English, Sinhala-English (Guzmán
et al., 2019). Much recent progress in low-resource machine translation, has been driven by the ideaof universal machine translation (UMT), also known as multilingual machine translation (Gu et al.,2018; Johnson et al., 2017; Zoph and Knight, 2016), which aims at training one single NMT to translate
between multiple source and target languages. Typical UMT models leverage either a single shared encoder
or language-specific encoders to map all source languages to a shared space, and translate the source
sentences to a target language by a decoder. Inspired by the idea of UMT, there has been a recent trend
towards learning language-invariant embeddings for multiple source languages in a shared latent space,which eases the cross-lingual generalization from high-resource languages to low-resource languages
on many tasks, e.g., parallel corpus mining (Artetxe and Schwenk, 2019; Schwenk, 2018), sentenceclassification (Conneau et al., 2018b), cross-lingual information retrieval (Litschko et al., 2018), anddependency parsing (Kondratyuk and Straka, 2019), just to name a few.
The idea of finding an abstract “lingua franca” is very intuitive and the empirical results are impressive,
yet theoretical understanding of various aspects of universal machine translation is limited. In this chapter,we particularly focus on two basic questions:
1. How can we measure the inherent tradeoff between the quality of translation and how languageinvariant a representation is?
2. How many language pairs do we need aligned sentences for, to be able to translate between any pairof languages?
Toward answering the first question, we show that in a completely assumption-free setup on thelanguages and distribution of the data, it is impossible to avoid making a large translation error on at least
one pair of the translation tasks. Informally we highlight our first theorem as follows, and provide theformal statements in Theorems 8.2.1 and 8.2.2.
Theorem 8.1.1 (Impossibility, Informal). There exist a choice of distributions over documents fromdifferent languages, s.t. for any choice of maps from the language to a common representation, at least
one of the translation pairs must incur a high cost. In addition, there is an inherent tradeoff between thetranslation quality and the degree of representation invariance w.r.t. languages: the better the language
invariance, the higher the cost on at least one of the translation pairs.
To answer the second question, we show that under fairly mild generative assumptions on the aligned
documents for the pairwise translations, it is possible to not only do well on all of the pairwise translations,but also be able to do so after only seeing aligned documents of a linear number of languages, rather
than a quadratic one. We summarize the second theorem as follows, and provide a formal statement in
Theorem 8.3.1.
Theorem 8.1.2 (Sample complexity, Informal). Under a generative model where the documents for eachlanguage are generated from a “ground-truth” encoder-decoder model, after seeing aligned documents fora linear number of pairs of languages, we can learn encoders/decoders that perform well on any unseen
language pair.

130Notation and Setup We first introduce the notation used throughout the chapter and then briefly describe
the problem setting of universal machine translation.
We use L to denote the set of all possible languages, e.g., {English, French, German, Chinese, . . .}.
For any language L ∈ L, we associate with L an alphabet Σ L that contains all the symbols from L. Notethat we assume |Σ L | < ∞, ∀ L ∈ L, but different languages could potentially share part of the alphabet.
Given a language L, a sentence x in L is a sequence of symbols from Σ L , and we denote Σ∗L as the set of all
sentences generated from Σ L . Note that since in principle different languages could share the same alphabet,to avoid ambiguity, for each language L, there is a unique token h Li ∈ Σ L and h Li 6∈ Σ0L , ∀ L0 6= L. The
goal of the unique token h Li is used to denote the source sentence, and a sentence x in L will have a uniqueprefix h Li to indicate that x ∈ Σ∗L . Also, in this manuscript we will use sentence and string interchangeably.
Formally, let { Li }i∈[K] 1 be the set of K source languages and L 6∈ { Li }i∈[K] be the target language weare interested in translating to. For a pair of languages L and L0 , we use D L,L0 to denote the joint distribution
over the parallel sentence pairs from L and L0 . Given this joint distribution, we also use D L,L0 ( L) to mean
the marginal distribution over sentences from L. Likewise we use D L,L0 ( L0 ) to denote the corresponding
marginal distribution over sentences from L0 . Finally, for two sets A and B, we use A t B to denote thedisjoint union of A and B. In particular, when A and B are disjoint, their disjoint union equals the usual set
Sunion, i.e., A t B = A B.

8.2

An Impossibility Theorem

In this section, for the clarity of presentation, we first focus the deterministic setting where for eachlanguage pair L 6= L0 , there exists a ground-truth translator f L∗→ L0 : Σ∗L → Σ∗L0 that takes an input sentencex from the source language L and outputs the ground-truth translation f L∗→ L0 ( x ) ∈ Σ∗L0 . Later we shallextend the setup to allow a probabilistic extension as well. Before we proceed, we first describe someconcepts that will be used in the discussion.
Given a feature map g : X → Z that maps instances from the input space X to feature space Z , wedefine g] D := D ◦ g−1 to be the induced (pushforward) distribution of D under g, i.e., for any event
E0 ⊆ Z , Prg]D ( E0 ) := PrD ( g−1 ( E0 )) = PrD ({ x ∈ X | g( x ) ∈ E0 }). For two distribution D and
D 0 over the same sample space, we use the total variation distance to measure the discrepancy them:dTV (D , D 0 ) := supE | PrD ( E) − PrD 0 ( E)|, where E is taken over all the measurable events under thecommon sample space. We use I( E) to denote the indicator function which takes value 1 iff the event E istrue otherwise 0.
In general, given two sentences x and x 0 , we use `( x, x 0 ) to denote the loss function used to measure
their distance. For example, we could use a 0 − 1 loss function `0−1 ( x, x 0 ) = 0 iff x = x 0 else 1. If both x
and x 0 are embedded in the same Euclidean space, we could also use the squared loss `2 ( x, x 0 ) as a morerefined measure. To measure the performance of a translator f on a given language pair L → L0 w.r.t. theground-truth translator f L∗→ L0 , we define the error function of f as
0

ε LD→ L ( f ) := ED [`0−1 ( f ( X ), f L∗→ L0 ( X ))] ,which is the translation error of f as compared to the ground-truth translator f L∗→ L0 . For universal machinetranslation, the input string of the translator can be any sentence from any language. To this end, let Σ∗ beS
the union of all the sentences/strings from all the languages of interest: Σ∗ := L∈L Σ∗L . Then a universal
machine translator of target language L ∈ L is a mapping f L : Σ∗ → Σ∗L . In words, f L takes as input a
1 We use [ K ] to denote the set {0, 1, . . . , K − 1}.

131string (from one of the possible languages) and outputs the corresponding translation in target language L.
It is not hard to see that for such task there exists a perfect translator f L∗ :f L∗ ( x ) = ∑ I( x ∈ Σ∗L0 ) · f L∗0 → L ( x ).

(8.1)

L0 ∈L

Note that {Σ∗L0 | L0 ∈ L} forms a partition of Σ∗ , so exactly one of the indicator I( x ∈ Σ∗L0 ) in (8.1) willtake value 1.
Given a target language L, existing approaches for universal machine seek to find an intermediate
space Z , such that source sentences from different languages are aligned within Z . In particular, for eachsource language L0 , the goal is to find a feature mapping g L0 : Σ∗L0 → Z so that the induced distributions ofdifferent languages are close in Z . The next step is to construct a decoder h : Z → Σ∗L that maps feature
representation in Z to sentence in the target language L.
One interesting question about the idea of learning language-invariant representations is that, whether
such method will succeed even under the benign setting where there is a ground-truth universal translator
and the learner has access to infinite amount of data with unbounded computational resources. That is,
we are interested in understanding the information-theoretic limit of such methods for universal machinetranslation.
In this section we first present an impossibility theorem in the restricted setting of translating from twosource languages L0 and L1 to a target language L. Then we will use this lemma to prove a lower bound of
the universal translation error in the general many-to-many setting. We will mainly discuss the implications
and intuition of our theoretical results and use figures to help illustrate the high-level idea of the proof.

8.2.1

Two-to-One Translation

Recall that for each translation task Li → L, we have a joint distribution D Li ,L (parallel corpora) over thealigned source-target sentences. For convenience of notation, we use Di to denote the marginal distribution
D Li ,L ( Li ), ∀i ∈ [K ] when the target language L is clear from the context. Given a fixed constant e > 0, we
first define the e-universal language mapping:S
Definition 8.2.1 (e-Universal Language Mapping). A map g : i∈[K] Σ∗Li → Z is called an e-universal
language mapping if dTV ( g] Di , g] D j ) ≤ e, ∀i 6= j.
In particular, if e = 0, we call the corresponding feature mapping a universal language mapping.
In other words, a universal language mapping perfectly aligns the feature representations of different
languages in feature space Z . The following lemma provides a useful tool to connect the 0-1 translation
error and the TV distance between the corresponding distributions.
S
Lemma 8.2.1. Let Σ := L∈L Σ L and DΣ be a language model over Σ∗ . For any two string-to-string
maps f , f 0 : Σ∗ → Σ∗ , let f ] DΣ and f ]0 DΣ be the corresponding pushforward distributions. ThendTV ( f ] DΣ , f ]0 DΣ ) ≤ PrDΣ ( f ( X ) 6= f 0 ( X )) where X ∼ DΣ .
Proof. Note that the sample space Σ∗ is countable. For any two distributions P and Q over Σ∗ , it is a132well-known fact that dTV (P , Q) = 12 ∑y∈Σ∗ |P (y) − Q(y)|. Using this fact, we have:dTV ( f ] D , f ]0 D) =

=
=
≤
=

1
f ] D(y) − f ]0 D(y)
2 y∑
∗
∈Σ

1
Pr( f ( X ) = y) − Pr( f 0 ( X ) = y)
2 y∑
D
∗
∈Σ D

1
ED [I( f ( X ) = y)] − ED [I( f 0 ( X ) = y)]
2 y∑
∗
∈Σ



1
ED I ( f ( X ) = y ) − I ( f 0 ( X ) = y )∑2 y∈Σ∗

1
ED [I( f ( X ) = y, f 0 ( X ) 6= y) + I( f ( X ) 6= y, f 0 ( X ) = y)]
2 y∑
∗
∈Σ





1
ED I( f ( X ) = y, f 0 ( X ) 6= f ( X )) + ED I( f 0 ( X ) = y, f 0 ( X ) 6= f ( X ))∑2 y∈Σ∗
= ∑ ED I( f ( X ) = y, f 0 ( X ) 6= f ( X ))

=

y∈Σ∗

= ∑ Pr f ( X ) = y, f 0 ( X ) 6= f ( X )y∈Σ∗ D= Pr( f ( X ) 6= f 0 ( X )).
D

The second equality holds by the definition of the pushforward distribution. The inequality on the fourthline holds due to the triangle inequality and the equality on the seventh line is due to the symmetry betweenf ( X ) and f 0 ( X ). The last equality holds by the total law of probability.
The next lemma follows from the data-processing inequality for total variation and it shows that if
languages are close in a feature space, then any decoder cannot increase the corresponding discrepancy ofthese two languages in the output space.
Lemma 8.2.2. (Data-processing inequality) Let D and D 0 be any distributions over Z , then for any decoderh : Z → Σ∗L , dTV (h] D , h] D 0 ) ≤ dTV (D , D 0 ).
As a direct corollary, this implies that any distributions induced by a decoder over e-universal language
mapping must also be close in the output space:
Corollary 8.2.1. If g : Σ∗ → Z is an e-universal language mapping, then for any decoder h : Z → Σ∗L ,dTV ((h ◦ g)] D0 , (h ◦ g)] D1 ) ≤ e.
With the above tools, we can state the following theorem that characterizes the translation error in a
two-to-one setting:
Theorem 8.2.1. (Lower bound, Two-to-One) Consider a restricted setting of universal machine translation
S
task with two source languages where Σ∗ = Σ∗L0 Σ∗L1 and the target language is L. Let g : Σ∗ → Z bean e-universal language mapping, then for any decoder h : Z → Σ∗L , we haveε LD00→ L (h ◦ g) + ε LD11→ L (h ◦ g) ≥ dTV (D L0 ,L ( L), D L1 ,L ( L)) − e.

(8.2)

Proof of Theorem 8.2.1. First, realize that dTV (·, ·) is a distance metric, the following chain of triangle

133

⇤

Distributions over Z

DL1 ,L (L)

1 !L ErrL
(h g)
D1

{

D1

h

g
D0

Distributions over ⌃⇤L{

Distributions over ⌃g ] D0 = g ] D1
DL0 ,L (L)

0 !L ErrL(h g)
D0

Figure 8.2.1: Proof by picture: Language-invariant representation g induces the same feature distribution
over Z , which leads to the same output distribution over the target language Σ∗L . However, the parallel
corpora of the two translation tasks in general have different marginal distributions over the target language,
hence a triangle inequality over the output distributions gives the desired lower bound.
inequalities hold:dTV (D L0 ,L ( L), D L1 ,L ( L)) ≤ dTV (D L0 ,L ( L), (h ◦ g)] D0 )1

+ dTV ((h ◦ g)] D1 , D L1 ,L ( L))+ dTV ((h ◦ g)] D0 , (h ◦ g)] D1 ).

Now by the assumption that g is an e-universal language mapping and Corollary 8.2.1, the third term on
the RHS of the above inequality, dTV ((h ◦ g)] D0 , (h ◦ g)] D1 ), is upper bounded by e. Furthermore, notethat since the following equality holds:

D Li ,L ( L) = f L∗i → L ] Di ,∀i ∈ {0, 1},

we can further simplify the above inequality asdTV (D L0 ,L ( L), D L1 ,L ( L)) ≤ dTV ( f L∗0 → L ] D0 , (h ◦ g)] D0 ) + dTV ((h ◦ g)] D1 , f L∗1 → L ] D1 ) + e.
Now invoke Lemma 8.2.1 for i ∈ {0, 1} to upper bound the first two terms on the RHS, yielding:dTV ( f L∗i → L ] Di , (h ◦ g)] Di ) ≤ Pr (h ◦ g)( X ) 6= f L∗i → L ( X ) = ε LDi i→ L (h ◦ g).
Di

A simple rearranging then completes the proof.

Remark Recall that under our setting, there exists a perfect translator f L∗ : Σ∗ → Σ∗L in (8.1) that
achieves zero translation error on both translation tasks. Nevertheless, the lower bound in Theorem 8.2.1
shows that one cannot hope to simultaneously minimize the joint translation error on both tasks throughuniversal language mapping. Second, the lower bound is algorithm-independent and it holds even withunbounded computation and data. Third, the lower bound also holds even if all the data are perfect, in thesense that all the data are sampled from the perfect translator on each task. Hence, the above result could
be interpreted as a kind of uncertainty principle in the context of universal machine translation, which saysthat any decoder based on language-invariant representations has to achieve a large translation error on atleast one pair of translation task. We provide a proof-by-picture in Fig. 8.2.1 to illustrate the main idea
underlying the proof of Theorem 8.2.1 in the special case where e = 0.
134

The lower bound is large whenever the distribution over target sentences differ between these twotranslation tasks. This often happens in practical scenarios where the parallel corpus of high-resource
language pair contains texts over a diverse domain whereas as a comparison, parallel corpus of low-resource
language pair only contains target translations from a specific domain, e.g., sports, news, product reviews,
etc. Such negative impact on translation quality due to domain mismatch between source and target
sentences has also recently been observed and confirmed in practical universal machine translation systems,
see Shen et al. (2019) and Pires et al. (2019) for more empirical corroborations.

8.2.2

Many-to-Many Translation

Theorem 8.2.1 presents a negative result in the setting where we have two source languages and one target
language for translation. Nevertheless universal machine translation systems often involve multiple input
and output languages simultaneously (Artetxe and Schwenk, 2019; Johnson et al., 2017; Ranzato et al.,2019; Wu et al., 2016). In this section we shall extend the previous lower bound in the simple two-to-one
setting to the more general translation task of many-to-many setting.
To enable such extension, i.e., to be able to make use of multilingual data within a single system, weneed to modify the input sentence to introduce the language token h Li at the beginning of the input sentence
to indicate the target language L the model should translate to. This simple modification has already been
proposed and used in practical MT systems (Johnson et al., 2017, Section 3). To give an example, consider
the following English sentence to be translated to French,hEnglishi Hello, how are you?
It will be modified to:
hFrenchihEnglishi Hello, how are you?
Note that the first token is used to indicate the target language to translate to while the second one is used
to indicate the source language to avoid the ambiguity due to the potential overlapping alphabets between
different languages.
Recall in Definition 8.2.1 we define a language map g to be e-universal iff dTV ( g] Di , g] D j ) ≤ e, ∀i, j.
This definition is too stringent in the many-to-many translation setting since this will imply that the feature
representations lose the information about which target language to translate to. In what follows we shallfirst provide a relaxed definition of e-universal language mapping in the many-to-many setting and thenshow that even under this relaxed definition, learning universal machine translator via language-invariant
representations is impossible in the worst case.
Definition 8.2.2 (e-Universal Language Mapping, Many-to-Many). Let D Li ,Lk , i, k ∈ [K ] be the jointS
distribution of sentences (parallel corpus) in translating from Li to Lk . A map g : i∈[K] Σ∗Li → Z iscalled an e-universal language mapping if there exists a partition of Z = tk∈[K] Zk such that ∀k ∈ [K ] and∀i 6= j, g] D Li ,Lk ( Li ) and g] D L j ,Lk ( L j ) are supported on Zk and dTV ( g] D Li ,Lk ( Li ), g] D L j ,Lk ( L j )) ≤ e.
First of all, it is clear that when there is only one target language, then Definition 8.2.2 reduces toDefinition 8.2.1. Next, the partition of the feature space Z = tk∈[K] Zk essentially serves as a way todetermine the target language L the model should translate to. Note that it is important here to enforce thepartitioning condition of the feature space Z , otherwise there will be ambiguity in determining the target
language to translate to. For example, if the following two input sentences
hFrenchihEnglishi Hello, how are you?
hChineseihEnglishi Hello, how are you?
are mapped to the same feature representation z ∈ Z , then it is not clear whether the decoder h should
translate z to French or Chinese.
With the above extensions, now we are ready to present the following theorem which gives a lower
135bound for both the maximum error as well as the average error in the many-to-many universal translation
setting.
Theorem 8.2.2. (Lower bound, Many-to-Many) Consider a universal machine translation task whereSΣ∗ = i∈[K] Σ∗Li . Let D Li ,Lk , i, k ∈ [K ] be the joint distribution of sentences (parallel corpus) in translatingfrom Li to Lk . If g : Σ∗ → Z be an e-universal language mapping, then for any decoder h : Z → Σ∗ , wehavee1
max max dTV (D Li ,Lk ( Lk ), D L j ,Lk ( Lk )) − ,i k
2 k∈[K] i6= j2
i,k ∈[K ]1e1
Lkε LDi →(h ◦ g) ≥ 2∑ ∑ dTV (D Li ,Lk ( Lk ), D Lj ,Lk ( Lk )) − 2 .
Li ,LkK2 i,k∑
K
(
K
−
1
)
∈[K ]
k ∈[K ] i < jLkmax ε LDi →(h ◦ g) ≥L ,LProof of Theorem 8.2.2. First let us fix a target language Lk . For each pair of source languages Li , L j , i 6= jtranslating to Lk , applying Theorem 8.2.1 gives us:
L →L

Lk
ε LDi →(h ◦ g) + ε Dj L ,L k (h ◦ g) ≥ dTV (D Li ,Lk ( Lk ), D L j ,Lk ( Lk )) − e.
L ,L
i k

j k

(8.3)

Now consider the pair of source languages ( Li∗ , L j∗ ) with the maximum dTV (D Li ,Lk ( Lk ), D L j ,Lk ( Lk )):L ∗ →LL ∗ → Lk

Lk
2 max ε LDi →(h ◦ g) ≥ ε Di L ,L k (h ◦ g) + ε Dj L ,L (h ◦ g)
L ,Li ∈[K ]

i k

i∗

k

j∗

k

≥ max dTV (D Li ,Lk ( Lk ), D L j ,Lk ( Lk )) − e.
i6= j

(8.4)

Since the above lower bound (8.4) holds for any target language Lk , taking a maximum over the target
languages yields:
Lk
2 max ε LDi →(h ◦ g) ≥ max max dTV (D Li ,Lk ( Lk ), D L j ,Lk ( Lk )) − e,
L ,Li,k ∈[K ]i kk ∈[K ] i 6= jwhich completes the first part of the proof. For the second part, again, for a fixed target language Lk ,to lower bound the average error, we apply the triangle inequality in (8.3) iteratively for all pairs i < j,yielding:
Lk(K − 1) ∑ ε LDi →(h ◦ g) ≥ ∑ dTV (D Li ,Lk ( Lk ), D L j ,Lk ( Lk )) −L ,Li ∈[K ]i k

i< j

K ( K − 1)e.
2Dividing both sides by K (K − 1) gives the average translation error to Lk . Now summing over all thepossible target language Lk yields:11eLkε LDi →(h ◦ g) ≥ 2
dTV (D Li ,Lk ( Lk ), D L j ,Lk ( Lk )) − .
∑
∑
∑
2
L
,L
i k
K i,k∈[K]
K (K − 1) k∈[K] i< j2It is clear from the proof above that both lower bounds in Theorem 8.2.2 include the many-to-one
setting as a special case. The proof of Theorem 8.2.2 essentially applies the lower bound in Theorem 8.2.1
iteratively. Again, the underlying reason for such negative result to hold in the worst case is due to themismatch of distributions of the target language in different pairs of translation tasks. It should also be
noted that the results in Theorem 8.2.2 hold even if language-dependent encoders are used, as long as they
induce invariant feature representations for the source languages.
136How to Bypass this Limitation? There are various ways to get around the limitations pointed out by thetheorems in this section.
One way is to allow the decoder h to have access to the input sentences (besides the languageinvariant representations) during the decoding process – e.g. via an attention mechanism on the input level.
Technically, such information flow from input sentences during decoding would break the Markov structureof “input-representation-output” in Fig. 8.2.1, which is an essential ingredient in the proof of Theorem 8.2.1
and Theorem 8.2.2. Intuitively, in this case both language-invariant (hence language-independent) andlanguage-dependent information would be used.
Another way would be to assume extra structure on the distributions D Li ,L j , i.e., by assuming somenatural language generation process for the parallel corpora that are used for training (Cf. Section 8.3).
Since languages share a lot of semantic and syntactic characteristics, this would make a lot of sense— and intuitively, this is what universal translation approaches are banking on. In the next section wewill do exactly this — we will show that under a suitable generative model, not only will there be alanguage-invariant representation, but it will be learnable using corpora from a very small (linear) numberof pairs of language.

8.3

Sample Complexity under a Generative Model

The results from the prior sections showed that absent additional assumptions on the distributions of thesentences in the corpus, there is a fundamental limitation on learning language-invariant representations foruniversal machine translation. Note that our negative result also holds in the setting where there exists a
ground-truth universal machine translator – it’s just that learning language-invariant representations cannot
lead to the recovery of this ground-truth translator.
In this section we show that with additional natural structure on the distribution of the corpora we
can resolve this issue. The structure is a natural underlying generative model from which sentences fromdifferent languages are generated, which “models” a common encoder-decoder structure that has beenfrequently used in practice (Cho et al., 2014; Ha et al., 2016; Sutskever et al., 2014). Under this setting,
we show that it is not only possible to learn the optimal translator, but it is possible to do so only seeing
documents from only a small subset of all the possible language pairs.
Moreover, we will formalize a notion of “sample complexity” in terms of number of pairs of languages
for which parallel corpora are necessary, and how it depends on the structure of the connection graphbetween language pairs.
We first describe our generative model for languages and briefly talk about why such generative model
could help to overcome the negative result in Theorem 8.2.2.

8.3.1

Language Generation Process and Setup

Language Generative Process The language generation process is illustrated in Fig. 8.3.1. Formally,
we assume the existence of a shared “semantic space” Z . Furthermore, for every language L ∈ L, we havea “ground truth” pair of encoder and decoder (E L , D L ), where E L : Rd → Rd , E L ∈ F is bijective and1
D L = E−
L . We assume that F has a group structure under function composition: namely, for ∀ f 1 , f 2 ∈ F ,we have that f 1−1 , f 2−1 ∈ F and f 1 ◦ f 2−1 , f 2 ◦ f 1−1 ∈ F (e.g., a typical example of such group is thegeneral linear group F = GLd (R)).
To generate a pair of aligned sentences for two languages L, L0 , we first sample a z ∼ D , andsubsequently generate
x = D L ( z ), x 0 = D L 0 ( z ),
(8.5)
137

D(Z)
Representation Space Z =

E0
D0
L0

D2
E2

D1
E1
L1

L2

···

EK

DK

LK

Figure 8.3.1: An encoder-decoder generative model of translation pairs. There is a global distribution D
1over representation space Z , from which sentences of language Li are generated via decoder Di . Similarly,
sentences could also be encoded via Ei to Z .
where the x is a vector encoding of the appropriate sentence in L (e.g., a typical encoding is a frequency
count of the words in the sentence, or a sentence embedding using various neural network models (Kiros
et al., 2015; Wang et al., 2017; Zhao et al., 2015a)). Similarly, x 0 is the corresponding sentence in L0 .
Reciprocally, given a sentence x from language L, the encoder E L maps the sentence x into its corresponding
latent vector in Z : z = E L ( x ).
We note that we assume this deterministic map between z and x for simplicity of exposition—inSection 8.3.4 we will extend the results to the setting where x has a conditional distribution given z of aparametric form.
We will assume the existence of a graph H capturing the pairs of languages for which we have aligned
corpora – we can think of these as the “high-resource” pairs of languages. For each edge in this graph, wewill have a corpus S = {( xi , xi0 )}in=1 of aligned sentences.2 The goal will be to learn encoder/decoders
that perform well on the potentially unseen pairs of languages. To this end, we will be providing a sample
complexity analysis for the number of paired sentences for each pair of languages with an edge in thegraph, so we will need a measure of the complexity of F . We will use the covering number, though our
proofs are flexible, and similar results would hold for Rademacher complexity, VC dimension, or any of
the usual complexity measures.
Definition 8.3.1 (Covering number). For any e > 0, the covering number N (F , e) of the function
class F under the `∞ norm is the minimum number k ∈ N such that F could be covered with k (`∞ )balls of radius e, i.e., there exists { f 1 , . . . , f k } ⊆ F such that, for all f ∈ F , there exists i ∈ [k ] withk f − f i k∞ = maxx∈Rd k f ( x ) − f i ( x )k2 ≤ e.
Finally, we will assume that the functions in F are bounded and Lipschitz:
Assumption 8.3.1 (Smoothness and Boundedness). F is bounded under the k · k∞ norm, i.e., there exists
M > 0, such that ∀ f ∈ F , k f k∞ ≤ M. Furthermore, there exists 0 ≤ ρ < ∞, such that for ∀ x, x 0 ∈ Rd ,2 In general each edge can have different number of aligned sentences. We use the same number of aligned sentences n just for

the ease of presentation.

138

∀ f ∈ F , k f ( x ) − f ( x 0 )k2 ≤ ρ · k x − x 0 k2 .
Training Procedure Turning to the training procedure, we will be learning encoders EL ∈ F for eachlanguage L. The decoder for that language will be EL−1 , which is well defined since F has a group structure.
Since we are working with a vector space, rather than using the (crude) 0-1 distance, we will work with amore refined loss metric for a translation task L → L0 :1
2ε( EL , EL0 ) := k EL−01 ◦ EL − E−
L0 ◦ E L k`2 (D L ] D) .

(8.6)

1
Note that the `2 loss is taken over the distribution of the input samples D L ] D = E−
L ] D , which is thenatural one under our generative process. Again, the above error measures the discrepancy between thepredicted translation w.r.t. the one give by the ground-truth translator, i.e., the composition of encoder
E L and decoder D L0 . Straightforwardly, the empirical error over a corpus S = {( xi , xi0 )}in=1 of aligned
sentences for a pair of languages ( L, L0 ) is defined bybε S ( EL , EL0 ) : =1∑ kEL−01 ◦ EL (xi ) − xi0 k22 ,
n i∈[
n]

(8.7)

where S is generated by the generation process. Following the paradigm of empirical risk minimization,
the loss to train the encoders will be the obvious one:min

{ EL ,L∈L}∑( L,L0 )∈ Hbε S ( E L , E L 0 ).

(8.8)

Remarks Before we proceed, one natural question to ask here is that, how does this generative model
assumption circumvent the lower bound in Theorem 8.2.2? To answer this question, note the following
easy proposition:
Proposition 8.3.1. Under the encoder-decoder generative assumption, ∀i, j ∈ [K ], dTV (D Li ,L ( L), D L j ,L ( L)) =0.
Proposition 8.3.1 holds because the marginal distribution of the target language L under any pair oftranslation task equals the pushforward of D( Z ) under D L : ∀i ∈ [K ], D Li ,L ( L) = D L ] D(Z ). Hence thelower bounds gracefully reduce to 0 under our encoder-decoder generative process, meaning that there is
no loss of translation accuracy using universal language mapping.

8.3.2

Main Result: Translation between Arbitrary Pairs of Languages

The main theorem we prove is that if the graph H capturing the pairs of languages for which we have aligned
corpora is connected, given sufficiently many sentences for each pair, we will learn encoder/decoders that
perform well on the unseen pairs. Moreover, we can characterize how good the translation will be based on
the distance of the languages in the graph. Concretely:
Theorem 8.3.1 (Sample complexity under generative model). Suppose H is connected. Furthermore,
suppose the trained { EL } L∈L satisfy∀ L, L0 ∈ H : bε S ( EL , EL0 ) ≤ e L,L0 ,for e L,L0 > 0. Furthermore, for 
0 < δ < 1 suppose the number of sentences
 for each aligned corpora fore L,L0each training pair ( L, L0 ) is Ω e21 · log N (F , 16M) + log(K/δ) . Then, with probability 1 − δ,L,L0for any pair of languages ( L, L0 ) ∈ L × L and L = L1 , L2 , . . . , Lm = L0 a path between L and L0 in H,−1
we have ε( EL , EL0 ) ≤ 2ρ2 ∑m
k =1 e Lk ,Lk+1 .
139

L3
L6
L1
L4
L5
L2
Figure 8.3.2: A translation graph H over K = 6 languages. The existence of an edge between a pair ofnodes Li and L j means that the learner has been trained on the corresponding language pair. In this example
the diameter of the graph diam( H ) = 4: L3 , L1 , L4 , L5 , L6 .
Remark We make several remarks about the theorem statement. Note that the guarantee is in terms oftranslation error rather than parameter recovery. In fact, due to the identifiability issue, we cannot hope
to recover the ground truth encoders {E L } L∈L : it is easy to see that composing all the encoders with aninvertible mapping f ∈ F and composing all the decoders with f −1 ∈ F produces exactly the same
outputs.
Furthermore, the upper bound is adaptive, in the sense that for any language pair ( Li , L j ), the error depends on the sum of the errors connecting ( Li , L j ) in the translation graph H. One can think naturally as the
low-error edges as resource-rich pairs: if the function class F is parametrized by finite-dimensional parameter space with dimension p, then using standard result on the covering number of finite-dimensional vectorespace (Anthony and Bartlett, 2009), we know that log N (F , 16M) = Θ( p log(1/e)); as a consequence,
the number of documents needed for a pair scales as log(1/e L,L0 )/e2L,L0 .
Furthermore, as an immediate corollary of the theorem, if we assume e L,L0 ≤ e for all ( L, L0 ) ∈ H,
we have ε( EL , EL0 ) ≤ 2ρ2 d L,L0 · e, where d L,L0 is the length of the shortest path connecting L and L0 in H.
It also immediately follows that for any pair of languages L, L0 , we have ε( EL , EL0 ) ≤ 2ρ2 diam( H ) · e
where diam( H ) is the diameter of H – thus the intuitive conclusion that graphs that do not have long paths
are preferable.
The upper bound in Theorem 8.3.1 also provides a counterpoint to the lower-bound, showing that undera generative model for the data, it is possible to learn a pair of encoder/decoder for each language pair after
seeing aligned corpora only for a linear number of pairs of languages (and not quadratic!), corresponding
to those captured by the edges of the translation graph H. As a final note, we would like to point out thatan analogous bound can be proved easily for other losses like the 0-1 loss or the general ` p loss as well.

8.3.3

Proof Sketch of the Theorem

Before we provide the proof for the theorem, we first state several useful lemmas that will be used during
our analysis.

140

Concentration Bounds The first step is to prove a concentration bound for the translation loss metricon each pair of languages. In this case, it will be easier to write the losses in terms of one single
function: namely notice that in fact ε( EL , EL0 ) only depends on EL−01 ◦ EL , and due to the group structure,
F 3 f := EL−01 ◦ EL . To that end, we will abuse the notation somewhat and denote ε( f ) := ε( EL , EL0 ). The
following lemma is adapted from Bartlett (1998) where the bound is given in terms of binary classification
error while here we present a bound using `2 loss. At a high level, the bound uses covering number toconcentrate the empirical loss metric to its corresponding population counterpart.
Lemma 8.3.1. If S = {( xi , xi0 )}in=1 is sampled i.i.d. according to the encoder-decoder generative process,the following bound holds:
!


−ne2
e
) · exp.
Pr sup |ε( f ) − bε S ( f )| ≥ e ≤ 2N (F ,
16M
16M4
S∼D n
f ∈F
This lemma can be proved using a e-net argument with covering number. With this lemma, we canbound the error given by an empirical risk minimization algorithm:
Theorem 8.3.2. (Generalization, single task) Let S be a sample of size n according to our generative
process. Then for any 0 < δ < 1, for any f ∈ F , w.p. at least 1 − δ, the following bound holds:
selog N (F , 16M) + log(1/δ)
.
ε( f ) ≤ bεS( f ) + O (8.9)
nTheorem 8.3.2 is a finite sample bound for generalization on a single pair of languages. This boundgives us an error measure on an edge in the translation graph in Fig. 8.3.2. Now, with an upper bound on
the translation error of each seen language pair, we are ready to prove the main theorem (Theorem 8.3.1)
which bounds the translation error for all possible pairs of translation tasks:
Proof of Theorem 8.3.1. First, under the assumptionof Theorem 8.3.1, for any pairof language ( L, L0 ),
e L,L0
we know that the corpus contains at least Ω e21 · log N (F , 16M) + log(K/δ)
parallel sentences.
L,L0

Then by Theorem 8.3.2, with probability 1 − δ, for any L, L0 connected by an edge in H, we haveε ( EL , EL0 ) ≤ bε( EL , EL0 ) + e L,L0 ≤ e L,L0 + e L,L0 = 2e L,L0 ,where the last inequality is due to the assumption that bε( EL , EL0 ) ≤ e L,L0 . Now consider any L, L0 ∈ L × L,connected by a path
L 0 = L1 , L2 , L3 , . . . , L m = L
of length at most m. We will bound the error
12ε( EL , EL0 ) = k EL−01 ◦ EL − E−
L0 ◦ E L k`2 (D L ] D)

by a judicious use of the triangle inequality. Namely, let’s denote
1
I1 := E−
L1 ◦ E L m ,1
Ik := EL−11 ◦ ELk ◦ E−
Lk ◦ E Lm ,Im := EL−11 ◦ ELm .

141

2 ≤ k ≤ m − 1,

Then, we can write
m −1

m −1

k =1

k =1

1
k EL−01 ◦ EL − E−
L0 ◦ E L k`2 (D L ] D) = k ∑ Ik − Ik +1 k`2 (D L ] D) ≤ ∑ k Ik − Ik+1 k`2 (D L ] D) .

(8.10)

Furthermore, notice that we can rewrite Ik − Ik+1 as


1
−1
−1
EL−11 ◦ ELk E−
◦
E
−
E
◦
E
L k +1
L k +1 E L k +1 ◦ E L m .
Lk
Lk
Given that EL−11 and ELk are ρ-Lipschitz we have1
k Ik − Ik+1 k`2 (DL ] D) = EL−11 ◦ ELk EL−k1 ◦ ELk+1 − E−L k ◦ E L k +1

≤ρ



2

1
EL−1 ◦ ELk+1 − E−L k ◦ E L k +1
k

`2 (D Lk+1 D)]

`2 (D Lk+1 D)]

2≤ 2ρ e Lk ,Lk+1 ,where the first line is from the definition of pushforward distribution, the second line is due to the
Lipschitzness of F and the last line follows since all ( Lk , Lk+1 ) are edges in H. Plugging this into (8.10),
we havem12k EL−01 ◦ EL − E−
L0 ◦ E L k`2 (D L ] D) ≤ 2ρ ∑ e Lk ,Lk+1 .
k =1

To complete the proof, realize that we need the events |ε( Lk , Lk+1 ) − bε( Lk , Lk+1 )| ≤ e Lk ,Lk+1 to holdsimultaneously for all the edges in the graph H. Hence it suffices if we can use a union bound to bound thefailing probability. To this end, for each edge, we amplify the success probability by choosing the failure
probability to be δ/K2 , and we can then bound the overall failure probability as:
Pr (At least one edge in the graph H fails to satisfy (8.9))
≤ ∑ Pr |ε( Li , L j ) − bε( Li , L j )| > e Li ,L j(i,j)∈ H≤∑ δ/K2(i,j)∈ H

K ( K − 1) δ
· 2
2
K
≤ δ.

≤

The first inequality above is due to the union bound, and the second one is from Theorem 8.3.2 by choosing
the failing probability to be δ/K2 .


8.3.4

Extension to Randomized Encoders and Decoders

Our discussions so far on the sample complexity under the encoder-decoder generative process assume
that the ground-truth encoders and decoders are deterministic and bijective. This might seem to be a quite
restrictive assumption, but nevertheless our underlying proof strategy using transitions on the translationgraph still works in more general settings. In this section we shall provide an extension of the previous
deterministic encoder-decoder generative process to allow randomness in the generation process. Note that
this extension simultaneously relaxes both the deterministic and bijective assumptions before.
As a first step of the extension, since there is not a notion of inverse function anymore in the randomized
setting, we first define the ground-truth encoder-decoder pair (E L , D L ) for a language L ∈ L.
142

Definition 8.3.2. Let Dr and Dr0 be two distributions over random seeds r and r 0 respectively. A randomized decoder D Li is a deterministic function that maps a feature z along with a random seed r to a sentencesin language Li . Similarly, a randomized encoder E Li maps a sentence x ∈ Σ∗Li and a random seed r 0 to
a representation in Z . (E Li , D Li ) is called an encoder-decoder pair if it keeps the distribution D over Z
invariant under the randomness of Dr and Dr0 :E Li ] (D Li ] (D × Dr ) × Dr0 ) = D ,(8.11)

where we use D × D 0 to denote the product measure of distributions D and D 0 .
Just like the deterministic setting, here we still assume that E Li , D Li ∈ F where F is closed underfunction composition. Furthermore, in order to satisfy Definition 8.3.2, we assume that ∀ D Li ∈ F ,there exists a corresponding E Li ∈ F , such that (E Li , D Li ) is an encoder-decoder pair that verifies
Definition 8.3.2. It is clear that the deterministic encoder-decoder pair in Section 8.3.1 is a special case1of that in Definition 8.3.2: in that case D Li = E−
Li so that E Li ◦ D Li = idZ , the identity map overfeature space Z . Furthermore there is no randomness from r and r 0 , hence the invariant criterion becomes
E Li ] D Li ] D = (E Li ◦ D Li )] D = idZ ] D = D , which trivially holds.
The randomness mechanism in Definition 8.3.2 has several practical implementations in practice. For
example, the denoising autoencoder (Vincent et al., 2008), the encoder part of the conditional generative
adversarial network (Mirza and Osindero, 2014), etc. Again, in the randomized setting we still need tohave an assumption on the structure of F , but this time a relaxed one:
Assumption 8.3.2 (Smoothness and Boundedness). F is bounded under the k · k∞ norm, i.e., there exists
M > 0, such that ∀ f ∈ F , k f k∞ ≤ M. Furthermore, there exists 0 ≤ ρ < ∞, such that for ∀ x, x 0 ∈ Rd ,∀ f ∈ F , kEDr [ f ( x, r ) − f ( x 0 , r )]k2 ≤ ρ · k x − x 0 k2 .
Correspondingly, we also need to slightly extend our loss metric under the randomized setting to thefollowing:ε( EL , DL0 ) := Er,r0 k DL0 ◦ EL − D L0 ◦ E L k2`2 (DL ] (D×Dr )) ,where the expectation is taken over the distributions over random seeds r and r 0 . The empirical error could
be extended in a similar way by replacing the population expectation with the empirical expectation. With
the above extended definitions, now we are ready to state the following generalization theorem under
randomized setting:
Theorem 8.3.3. (Sample complexity under generative model, randomized setting) Suppose H is connected
and the trained { EL } L∈L satisfy∀ L, L0 ∈ H : bε S ( EL , DL0 ) ≤ e L,L0 ,for e L,L0 > 0. Furthermore, for 
0 < δ < 1 suppose the number of sentences
for each aligned corpora for


e
0
L,L
each training pair ( L, L0 ) is Ω e21 · log N (F , 16M) + log(K/δ) . Then, with probability 1 − δ,L,L0for any pair of languages ( L, L0 ) ∈ L × L and L = L1 , L2 , . . . , Lm = L0 a path between L and L0 in H,−1
we have ε( EL , DL0 ) ≤ 2ρ2 ∑m
k=1 e Lk ,Lk+1 .
We comment that Theorem 8.3.3 is completely parallel to Theorem 8.3.1, except that we use generalized
definitions under the randomized setting instead. Hence all the discussions before on Theorem 8.3.1 also
apply here.

8.4

Related WorkMultilingual Machine Translation Early studies on multilingual machine translation mostly focusedon pivot methods (Cohn and Lapata, 2007; De Gispert and Marino; Och and Ney, 2001; Utiyama and143Isahara, 2007) that use one pivot language to connect the translation between ultimate source and target
languages, and train two separate statistical translation models (Koehn et al., 2003) to perform source-topivot and pivot-to-target translations. Since the successful application of encoder-decoder architecturesin sequential tasks (Sutskever et al., 2014), neural machine translation (Bahdanau et al., 2014; Wu et al.,2016) has made it feasible to jointly learn from parallel corpora in multiple language pairs, and perform
translation to multiple languages by a single model. Existing studies have been proposed to explore
different variants of encoder-decoder architectures by using separate encoders (decoders) for multiple
source (target) languages (Dong et al., 2015; Firat et al., 2016a,b; Platanios et al., 2018; Zoph and Knight,
2016) or sharing the weight of a single encoder (decoder) for all source (target) languages (Ha et al., 2016;
Johnson et al., 2017). Recent advances of universal neural machine translation have also been applied to
improve low-resource machine translation (Aharoni et al., 2019; Arivazhagan et al., 2019; Gu et al., 2018;
Neubig and Hu, 2018) and downstream NLP tasks (Artetxe and Schwenk, 2019; Schwenk and Douze,2017). Despite the recent empirical success in the literature, theoretical understanding is only nascent. Our
work takes a first step towards better understanding the limitation of existing approaches and proposes a
sufficient generative assumption that guarantees the success of universal machine translation.
Invariant Representations The line of work on seeking a shared multilingual embedding space started
from learning cross-lingual word embeddings from parallel corpora (Gouws et al., 2015; Luong et al., 2015)
or a bilingual dictionary (Artetxe et al., 2017; Conneau et al., 2018a; Faruqui and Dyer, 2014; Mikolov
et al., 2013), and later extended to learning cross-lingual contextual representations (Conneau et al., 2019;
Devlin et al., 2019; Huang et al., 2019; Lample and Conneau, 2019) from monolingual corpora. The ideaof learning invariant representations is not unique in machine translation. In fact, similar ideas have alreadybeen used in other contexts, including domain adaptation (Combes et al., 2020; Ganin et al., 2016; Zhao
et al., 2018b, 2019e), fair representations (Zemel et al., 2013; Zhang et al., 2018; Zhao and Gordon, 2019;
Zhao et al., 2019c) and counterfactual reasoning in causal inference (Johansson et al., 2016; Shalit et al.,2017). Different from these existing work which mainly focuses on binary classification, our work provides
the first impossibility theorem on learning language-invariant representations in terms of recovering aperfect translator under the setting of seq-to-seq learning.

8.5

ProofsIn this section we provide all the missing proofs in Section 8.3. Again, in what follows we will first restate
the corresponding theorems for the ease of reading and then provide the detailed proofs.
Lemma 8.3.1. If S = {( xi , xi0 )}in=1 is sampled i.i.d. according to the encoder-decoder generative process,the following bound holds:
!


e
−ne2
Pr sup |ε( f ) − bε S ( f )| ≥ e ≤ 2N (F ,) · exp
.
16M
16M4
S∼D n
f ∈F
Proof. For f ∈ F , define `S ( f ) := ε( f ) − bε S ( f ) to be the generalization error of f on sample S. The firststep is to prove the following inequality holds for ∀ f 1 , f 2 ∈ F and any sample S:|`S ( f 1 ) − `S ( f 2 )| ≤ 8M · k f 1 − f 2 k∞ .
In other words, `S (·) is a Lipschitz function in F w.r.t. the `∞ norm. To see, by definition of the144generalization error, we have|`S ( f 1 ) − `S ( f 2 )|= |ε( f 1 ) − bε S ( f 1 ) − ε( f 2 ) + bε S ( f 2 )|≤ |ε( f 1 ) − ε( f 2 )| + |bε S ( f 1 ) − bε S ( f 2 )|.
To get the desired upper bound, it suffices for us to bound |ε( f 1 ) − ε( f 2 )| by k f 1 − f 2 k∞ and the same
technique could be used to upper bound |b
ε S ( f1 ) − bε S ( f 2 )| since the only difference lies in the measure
where the expectation is taken over. We now proceed to upper bound |ε( f 1 ) − ε( f 2 )|:|ε( f 1 ) − ε( f 2 )| = Ez∼D [k f 1 (x) − x0 k22 ] − Ez∼D [k f 2 (x) − x0 k22 ]= Ez∼D [k f 1 (x)k22 − k f 2 (x)k22 − 2x0T ( f 1 (x) − f 2 (x))]≤ Ez∼D ( f 1 (x) − f 2 (x))T ( f 1 (x) + f 2 (x)) − 2x0T ( f 1 (x) − f 2 (x))
hihi
≤ Ez∼D ( f 1 (x) − f 2 (x))T ( f 1 (x) + f 2 (x)) + 2Ez∼D x0T ( f 1 (x) − f 2 (x))
≤ Ez∼D [k f 1 (x) − f 2 (x)k · k f 1 (x) + f 2 (x)k] + 2Ez∼D kx0 k · k f 1 (x) − f 2 (x)k
≤ 2MEz∼D [k f 1 (x) − f 2 (x)k] + 2MEz∼D [k f 1 (x) − f 2 (x)k]≤ 4Mk f 1 − f 2 k∞ .

In the proof above, the first inequality holds due to the monotonicity property of integral. The second
inequality holds by triangle inequality. The third one is due to Cauchy-Schwarz inequality. The fourth
inequality holds by the assumption that ∀ f ∈ F , maxx∈X k f (x)k ≤ M and the identity mapping is in
F so that kx0 k = kid(x0 )k ≤ kid(·)k∞ ≤ M. The last one holds due to the monotonicity property ofintegral.
It is easy to see that the same argument could also be used to show that |bε S ( f1 ) − bε S ( f 2 )| ≤ 4Mk f 1 −f 2 k∞ . Combine these two inequalities, we have|`S ( f 1 ) − `S ( f 2 )| ≤ |ε( f 1 ) − ε( f 2 )| + |bε S ( f 1 ) − bε S ( f 2 )|≤ 8Mk f 1 − f 2 k∞ .
In the next step, we show that suppose F could be covered by k subsets C1 , . . . , Ck , i.e., F = ∪i∈[k] Ci .
Then for any e > 0, the following upper bound holds:
Pr n sup |`S ( f )| ≥ e ≤ ∑ Pr n sup |`S ( f )| ≥ e .
S∼D

f ∈F

i ∈[k ]

S∼D

f ∈Ci

This follows from the union bound:Pr n sup |`S ( f )| ≥ e = Pr n

S∼D

f ∈F

S∼D

[

sup |`S ( f )| ≥ ei ∈[k ] f ∈Ci≤ ∑ Pr n sup |`S ( f )| ≥ e .
i ∈[k ]

S∼D

f ∈Ci

e
Next, within each L∞ ball Ci centered at f i with radius 16M
such that F ⊆ ∪i∈[k] Ci , we bound each term in
the above union bound as:
Pr n sup |`S ( f )| ≥ e ≤ Pr n |`S ( f i )| ≥ e/2 .
S∼D

S∼D

f ∈Ci

145

To see this, realize that ∀ f ∈ Ci , we have k f − f i k∞ ≤ e/16M, which impliese|`S ( f ) − `S ( f i )| ≤ 8Mk f − f i k∞ ≤ .
2Hence we must have |`S ( f i )| ≥ e/2, otherwise sup f ∈Ci |`S ( f )| < e. This argument means that
Pr n sup |`S ( f )| ≥ e ≤ Pr n |`S ( f i )| ≥ e/2 .

S∼D

S∼D

f ∈Ci


To finish the proof, we use the standard Hoeffding inequality to upper bound PrS∼D n |`S ( f i )| ≥ e/2 asfollows:Pr n |`S ( f i )| ≥ e/2 = Pr n |ε( f i ) − bε S ( f i )| ≥ e/2
S∼D
S∼D


2n2 (e/2)2≤ 2 exp −n((2M )2 − 0)2


ne2
.
= 2 exp −16M4
Now combine everything together, we obtain the desired upper bound as stated in the lemma.
!


e
−ne2
Pr sup |ε( f ) − bε S ( f )| ≥ e ≤ 2N (F ,.
) · exp
16M
16M4
S∼D n
f ∈F



We next prove the generalization bound for a single pair of translation task:
Theorem 8.3.2. (Generalization, single task) Let S be a sample of size n according to our generative
process. Then for any 0 < δ < 1, for any f ∈ F , w.p. at least 1 − δ, the following bound holds:
selog N (F , 16M ) + log(1/δ)
.
(8.9)
ε( f ) ≤ bεS( f ) + O nProof. This is a direct corollary of Lemma 8.3.1 by setting the upper bound in Lemma 8.3.1 to be δ andsolve for e.

We now provide the proof sketch of Theorem 8.3.3. The main proof idea is exactly the same as theone we have in the deterministic setting, except that we replace the original definitions of errors andLipschitzness with the generalized definitions under the randomized setting.
Theorem 8.3.3. (Sample complexity under generative model, randomized setting) Suppose H is connected
and the trained { EL } L∈L satisfy∀ L, L0 ∈ H : bε S ( EL , DL0 ) ≤ e L,L0 ,for e L,L0 > 0. Furthermore, for 
0 < δ < 1 suppose the number of sentences
for each aligned corpora for


e
L,L0
each training pair ( L, L0 ) is Ω e21 · log N (F , 16M) + log(K/δ) . Then, with probability 1 − δ,L,L0for any pair of languages ( L, L0 ) ∈ L × L and L = L1 , L2 , . . . , Lm = L0 a path between L and L0 in H,−1
we have ε( EL , DL0 ) ≤ 2ρ2 ∑m
k=1 e Lk ,Lk+1 .
146

Proof Sketch. The first step is prove the corresponding error concentration lemma using covering numbers
as the one in Lemma 8.3.1. Again, due to the assumption that F is closed under composition, we haveDL0 ◦ EL ∈ F , hence it suffices if we could prove a uniform convergence bound for an arbitrary functionf ∈ F . To this end, for f ∈ F , define `S ( f ) := ε( f ) − bε S ( f ) to be the generalization error of f on
sample S. The first step is to prove the following inequality holds for ∀ f 1 , f 2 ∈ F and any sample S:|`S ( f 1 ) − `S ( f 2 )| ≤ 8M · k f 1 − f 2 k∞ .
In other words, `S (·) is a Lipschitz function in F w.r.t. the `∞ norm. To see this, by definition of thegeneralization error, we have|`S ( f 1 ) − `S ( f 2 )| = |ε( f 1 ) − bε S ( f 1 ) − ε( f 2 ) + bε S ( f 2 )| ≤ |ε( f 1 ) − ε( f 2 )| + |bε S ( f 1 ) − bε S ( f 2 )|.
To get the desired upper bound, it suffices for us to bound |ε( f 1 ) − ε( f 2 )| by k f 1 − f 2 k∞ and the same
technique could be used to upper bound |b
ε S ( f1 ) − bε S ( f 2 )| since the only difference lies in the measure
where the expectation is taken over.
Before we proceed, in order to make the notation uncluttered, we first simplify ε( f ):hiε( f ) = Er,r0 k f − D L0 ◦ E L k2`2 (DL ] (D×Dr )) .
Define z ∼ D to mean the sampling process of ( x, r, r 0 ) ∼ D L ] (D × Dr ) × Dr × Dr0 , x := ( x, r, r 0 ) and
x0 := D L0 (E L ( x, r 0 ), r ). Thenhiε( f ) = Er,r0 k f − D L0 ◦ E L k2`2 (DL ] (D×Dr ))= Ez∼D [k f (x) − x0 k22 ].

With the simplified notation, it is now clear that we essentially reduce the problem in the randomized
setting to the original one in the deterministic setting. Hence by using exactly the same proof as the one ofLemma 8.3.1, we can obtain the following high probability bound:
!


e
−ne2
.
Pr sup |ε( f ) − bε S ( f )| ≥ e ≤ 2N (F ,) · exp
16M
16M4
f ∈F
As a direct corollary, a similar generalization bound for a single pair of translation task like the one in
Theorem 8.3.2 also holds. To finish the proof, by the linearity of the expectation Er,r0 , it is clear that exactly
the same chaining argument in the proof of Theorem 8.3.1 could be used as well as the only thing we needto do is to take an additional expectation Er,r0 at the most outside level.


8.6Conclusion

In this chapter we provided the first theoretical study on using language-invariant representations foruniversal machine translation. Our results are two-fold. First, we showed that without appropriate
assumption on the generative structure of languages, there is an inherent tradeoff between learning languageinvariant representations versus achieving good translation performance jointly in general. In particular,
our results show that if the distributions (language models) of the target language differ between different
translation pairs, then any machine translation method based on learning language-invariant representations
is bound to achieve a large error on at least one of the translation tasks, even with unbounded computational
resources.
147

On the positive side, we also show that, under appropriate generative model assumption of languages,e.g., a typical encoder-decoder model, it is not only possible to recover the ground-truth translator between
any pair of languages that appear in the parallel corpora, but also we can hope to achieve a small translation
error on sentences from unseen pair of languages, as long as they are connected in the so-called translationgraph. This result holds in both deterministic and randomized settings. In addition, our result alsocharacterizes how the relationship (distance) between these two languages in the graph affects the qualityof translation in an intuitive manner: a graph with long connections results in a poorer translation.

148

Part II

Learning Tractable Circuits for
Probabilistic Reasoning

149

Chapter 9

A Unified Framework for Parameter
Learning
In this chapter we present a unified approach for learning the parameters of Sum-Product networks(SPNs). We prove that any complete and decomposable SPN is equivalent to a mixture of trees where
each tree corresponds to a product of univariate distributions. Based on the mixture model perspective, wecharacterize the objective function when learning SPNs based on the maximum likelihood estimation (MLE)
principle and show that the optimization problem can be formulated as a signomial program. We construct
two parameter learning algorithms for SPNs by using sequential monomial approximations (SMA) and theconcave-convex procedure (CCCP), respectively. The two proposed methods naturally admit multiplicative
updates, hence effectively avoiding the projection operation. With the help of the unified framework, we
also show that, in the case of SPNs, CCCP leads to the same algorithm as Expectation Maximization (EM)despite the fact that they are different in general.

151

9.1

Sum-Product Networks as a Mixture of Trees

We introduce the notion of induced trees from SPNs and use it to show that every complete and decomposable SPN can be interpreted as a mixture of induced trees, where each induced tree corresponds to a
product of univariate distributions. From this perspective, an SPN can be understood as a huge mixture
model where the effective number of components in the mixture is determined by its network structure. The
method we describe here is not the first method for interpreting an SPN (or the related arithmetic circuit) asa mixture distribution Chan and Darwiche; Dennis and Ventura (2015); Zhao et al. (2015b); but, the new
method can result in an exponentially smaller mixture, see the end of this section for more details.
Definition 9.1.1 (Induced Sum-Product Network). Given a complete and decomposable SPN S over X[n] ,let T = (TV , T E ) be a subgraph of S . T is called an induced SPN from S if
1. Root(S) ∈ TV .
2. If v ∈ TV is a sum node, then exactly one child of v in S is in TV , and the corresponding edge is inTE .
3. If v ∈ TV is a product node, then all the children of v in S are in TV , and the corresponding edges
are in T E .
For notational convenience we will call T an induced SPN by omitting the fact that T is induced from
S if there is no confusion in the context.
Theorem 9.1.1. If T is an induced SPN from a complete and decomposable SPN S , then T is a tree thatis complete and decomposable.
As a result of Thm. 9.1.1, we will use the terms induced SPNs and induced trees interchangeably. With
some abuse of notation, we use T (x) to mean the value of the network polynomial of T with input vector
x.
Theorem 9.1.2. If T is an induced tree from S over X[n] , then T (x) = ∏(vi ,v j )∈TE wij ∏in=1 Ixi , wherewij is the edge weight of (vi , v j ) if vi is a sum node and wij = 1 if vi is a product node.
Remark. Although we focus our attention on Boolean random variables for the simplicity of discussion
and illustration, Thm. 9.1.2 can be extended to the case where the univariate distributions at the leaf nodes
are continuous or discrete distributions with countably infinitely many values, e.g., Gaussian distributions
or Poisson distributions. We can simply replace the product of univariate distributions term, ∏in=1 Ixi , inThm. 9.1.2 to be the general form ∏in=1 Pri ( Xi ), where Pri ( Xi ) is a univariate distribution over Xi . Also
note that it is possible for two unique induced trees to share the same product of univariate distributions,but in this case their weight terms ∏(vi ,vi )∈TE wij are guaranteed to be different. As we will see shortly,Thm. 9.1.2 implies that the joint distribution over { Xi }in=1 represented by an SPN is essentially a mixture
model with potentially exponentially many components in the mixture.
Definition 9.1.2 (Network cardinality). The network cardinality τS of an SPN S is the number of uniqueinduced trees.
Theorem 9.1.3. τS = Vroot (1 | 1), where Vroot (1 | 1) is the value of the network polynomial of S with
input vector 1 and all edge weights set to be 1.
S
Theorem 9.1.4. S(x) = ∑τt=
1 Tt (x), where Tt is the tth unique induced tree of S .
Remark. The above four theorems prove the fact that an SPN S is an ensemble or mixture of trees,
where each tree computes an unnormalized distribution over X[n] . The total number of unique trees in S is
the network cardinality τS , which only depends on the structure of S . Each component is a simple productof univariate distributions. We illustrate the theorems above with a simple example in Fig. 9.1.1.
Zhao et al. (2015b) show that every complete and decomposable SPN is equivalent to a bipartite
Bayesian network with a layer of hidden variables and a layer of observable random variables. The number

152

+

w1
×

X1

+

w3

w2
×

X1

×

X2

= w1

X2

+

+w2

×

X1

X2

+

+w3

×

X1

X2

×

X1

X2

Figure 9.1.1: A complete and decomposable SPN is a mixture of induced trees. Double circles indicate
univariate distributions over X1 and X2 . Different colors are used to highlight unique induced trees; eachinduced tree is a product of univariate distributions over X1 and X2 .
of hidden variables in the bipartite Bayesian network is equal to the number of sum nodes in S . A naive
expansion of such Bayesian network to a mixture model will lead to a huge mixture model with 2O(|S|)
components, where |S| is the number of sum nodes in S . Here we complement the theory and show thateach complete and decomposable SPN is essentially a mixture of trees and the effective number of uniqueinduced trees is given by τS . Note that τS = Vroot (1 | 1) depends only on the network structure, and canoften be much smaller than 2O(|S|) . Without loss of generality, assuming that in S layers of sum nodes arealternating with layers of product nodes, then Vroot (1 | 1) = Ω(2h ), where h is the height of S . However,
the exponentially many trees are recursively merged and combined in S such that the overall network size
is still tractable.

9.2

Maximum Likelihood Estimation as Signomial Programming

Let’s consider the likelihood function computed by an SPN S over n binary random variables with model
parameters w and input vector x ∈ {0, 1}n . Here the model parameters in S are edge weights from everyp
sum node, and we collect them together into a long vector w ∈ R++ , where p corresponds to the numberof edges emanating from sum nodes in S . By definition, the probability distribution induced by S can becomputed by
Vroot (x | w)
Vroot (x | w)
Pr(x | w) :==Vroot (1 | w)S
∑x Vroot (x | w)p

Corollary 9.2.1. Let S be an SPN with weights w ∈ R++ over input vector x ∈ {0, 1}n , the network
V

(t)

(1|1)

p

Iw ∈T

polynomial Vroot (x | w) is a posynomial: Vroot (x | w) = ∑t=root1∏in=1 Ixi ∏d=1 wd d t , where Iwd ∈Tt
is the indicator variable whether wd is in the t-th induced tree Tt or not. Each monomial corresponds
exactly to a unique induced tree SPN from S .
The above statement is a direct corollary of Thm. 9.1.2, Thm. 9.1.3 and Thm. 9.1.4. From the definitionof network polynomial, we know that Vroot (x | w) is a multilinear function of the indicator variables.
Corollary 9.2.1 works as a complement to characterize the functional form of a network polynomial interms of w. It follows that the likelihood function LS (w) := PrS (x | w) can be expressed as the ratio of
two posynomial functions. We now show that the optimization problem based on MLE is an SP. Using thedefinition of PrS (x | w) and Corollary 9.2.1, let τ = Vroot (1 | 1), the MLE problem can be rewritten as:
maximizew
subject to

(t)

p

d =1

d

Iw ∈TtVroot (x | w)
∑τt=1 ∏in=1 Ixi ∏d=1 wd d
=
Iw ∈T
p
Vroot (1 | w)
w d t
∑τ ∏
t =1

p

w ∈ R++

153

(9.1)

Proposition 9.2.1. The MLE problem for SPNs is a signomial program.
Being nonconvex in general, SP is essentially hard to solve from a computational perspective Boydet al. (2007); Chiang (2005). However, despite the hardness of SP in general, the objective function in the
MLE formulation of SPNs has a special structure, i.e., it is the ratio of two posynomials, which makes thedesign of efficient optimization algorithms possible.

9.3

Difference of Convex Functions

Both projected gradient descent (PGD) and exponentiated gradient (EG) are first-order methods andthey can be viewed as approximating the SP after applying a logarithmic transformation to the objectivefunction only. Although ((9.1)) is a signomial program, its objective function is expressed as the ratio of two
posynomials. Hence, we can still apply the logarithmic transformation trick used in geometric programming
to its objective function and to the variables to be optimized. More concretely, let wd = exp(yd ), ∀d ∈ [ p]and take the log of the objective function; it becomes equivalent to maximize the following new objective
without any constraint on y:
!!
!!
τ (x)

maximize logp∑ exp ∑ yd Iy ∈T

t =1

d =1

d

t

− log

τ

p

t =1

d =1

∑ exp ∑ yd Iy ∈T
d

t

(9.2)

Note that in the first term of Eq. (9.2) the upper index τ (x) ≤ τ := Vroot (1 | 1) depends on the current
input x. By transforming into the log-space, we naturally guarantee the positivity of the solution at each
iteration, hence transforming a constrained optimization problem into an unconstrained optimization
problem without any sacrifice. Both terms in Eq. (9.2) are convex functions in y after the transformation.
Hence, the transformed objective function is now expressed as the difference of two convex functions, whichis called a DC function (Hartman et al., 1959). This helps us to design two efficient algorithms to solve theproblem based on the general idea of sequential convex approximations for nonlinear programming.

9.3.1

Sequential Monomial Approximation

Let’s consider the linearization of both terms in Eq. (9.2) in order to apply first-order methods in thetransformed space. To compute the gradient with respect to different components of y, we view each nodeof an SPN as an intermediate function of the network polynomial and apply the chain rule to back-propagate
the gradient.
The differentiation of Vroot (x | w) with respect to the root node of the network is set to be 1. The
differentiation of the network polynomial with respect to a partial function at each node can then becomputed in two passes of the network: the bottom-up pass evaluates the values of all partial functions
given the current input x and the top-down pass differentiates the network polynomial with respect to eachpartial function. Since the model parameters y(w) are only associated with sum nodes, they can be easily
computed once we have obtained the differentiations for each node as∂ log Vroot (x | w)
∂ log Vroot (x | w) ∂Vvi (x | w) ∂wij=
∂yij
∂Vvi (x | w)
∂wij
∂yij

=

∂ log Vroot (x | w)
Vv j (x | w)wij∂Vvi (x | w)

(9.3)

where vi is restricted to be a sum node and v j is a child of vi . Following the evaluation-differentiation
passes, the gradient of the objective function in ((9.2)) can be computed in O(|S|). Furthermore, although154the computation is conducted in y, the results are fully expressed in terms of w, which suggests that inpractice we do not need to explicitly construct y from w. An illustration of the process is provided inFig. 9.3.1.

∂ log Vroot (x|w)∂Vvi (x|w)+
wij (yij )Vvj (x | w)

×

×

×

Figure 9.3.1: Information flow about the computation of the gradient of log-network polynomial withrespect to yij (wij ). Each edge yij (wij ) collects the evaluation value from v j in bottom-up pass and also
differentiation value from vi in top-down pass.
Let f (y) := log Vroot (x | exp(y)) − log Vroot (1 | exp(y)). Consider the optimal first-order approximation of f (y) at point y(k) :fˆ(y) := f (y(k) ) + ∇y f (y(k) )T (y − y(k) )
p

(9.4)

∇ y f (y( k ) )which is equivalent to exp( fˆ(w)) = C1 ∏d=1 wd din the original space, where C1 is a positive
constant w.r.t. y(w). It follows that approximating f (y) with the best linear function is equivalent tousing the best monomial approximation of the signomial program ((9.1)). This leads to a sequential
monomial approximations of the original SP formulation: at each iteration y(k) , we linearize both terms in
Eq. (9.2) and form the optimal monomial function in terms of w(k) . The additive update of y(k) leads to a
multiplicative update of w(k) since w(k) = exp(y(k) ), and we use a backtracking line search to determine
the step size of the update in each iteration.

9.3.2

Concave-convex Procedure

Sequential monomial approximation fails to use the structure of the problem when learning SPNs. Here we
propose another approach based on the concave-convex procedure (CCCP) (Yuille et al., 2002) to use thefact that the objective function is expressed as the difference of two convex functions. At a high level CCCP
solves a sequence of concave surrogate optimizations until convergence. In many cases, the maximum of
a concave surrogate function can only be solved using other convex solvers and as a result the efficiencyof the CCCP highly depends on the choice of the convex solvers. However, we show that by a suitabletransformation of the network we can compute the maximum of the concave surrogate in closed form intime that is linear in the network size, which leads to a very efficient algorithm for learning the parametersof SPNs. We also prove the convergence properties of our algorithm.

155

Consider the objective function to be maximized in DCP: f (y) = log Vroot (x | exp(y)) − log Vroot (1 |exp(y)) := f 1 (y) + f 2 (y) where f 1 (y) := log Vroot (x | exp(y)) is a convex function and f 2 (y) :=− log Vroot (1 | exp(y)) is a concave function. We can linearize only the convex part f 1 (y) to obtain asurrogate functionfˆ(y, z) = f 1 (z) + ∇z f 1 (z)T (y − z) + f 2 (y)(9.5)
for ∀y, z ∈ R p . Now fˆ(y, z) is a concave function in y. Due to the convexity of f 1 (y) we havef 1 (y) ≥ f 1 (z) + ∇z f 1 (z) T (y − z),∀y, z

and as a result the following two properties always hold for ∀y, z:fˆ(y, z) ≤ f (y)andfˆ(y, y) = f (y)(9.6)

CCCP updates y at each iteration k by solving y(k) ∈ arg maxy fˆ(y, y(k−1) ) unless we already havey(k−1) ∈ arg max fˆ(y, y(k−1) ), in which case a generalized fixed point y(k−1) has been found and theyalgorithm stops.
It is easy to show that at each iteration of CCCP we always have f (y(k) ) ≥ f (y(k−1) ). Note also thatf (y) is computing the log-likelihood of input x and therefore it is bounded above by 0. By the monotone
convergence theorem, limk→∞ f (y(k) ) exists and the sequence { f (y(k) )} converges.
We now discuss how to compute a closed form solution for the maximization of the concave surrogatefˆ(y, y(k−1) ). Since fˆ(y, y(k−1) ) is differentiable and concave for any fixed y(k−1) , a sufficient andnecessary condition to find its maximum is∇y fˆ(y, y(k−1) ) = ∇y(k−1) f 1 (y(k−1) ) + ∇y f 2 (y) = 0(9.7)

In the above equation, if we consider only the partial derivative with respect to yij (wij ), we obtain( k −1)wij

Vv j (x | w(k−1) ) ∂Vroot (x | w(k−1) )Vroot (x | w(k−1) )∂Vvi (x | w(k−1) )=wij Vv j (1 | w) ∂Vroot (1 | w)
Vroot (1 | w) ∂Vvi (1 | w)

(9.8)

Eq. (9.8) leads to a system of p nonlinear equations, which is hard to solve in closed form. However, if we
do a change of variable by considering locally normalized weights wij0 (i.e., wij0 ≥ 0 and ∑ j wij0 = 1 ∀i ∈ S),
then a solution can be easily computed. As described in (Peharz et al., 2015; Zhao et al., 2015b), any SPN
can be transformed into an equivalent normal SPN with locally normalized weights in a bottom up pass asfollows:
wij Vv j (1 | w)
(9.9)
wij0 =∑ j wij Vv j (1 | w)

We can then replace wij Vv j (1 | w) in the above equation by the expression it is equal to in Eq. (9.8) toobtain a closed form solution:( k −1) )∂Vroot (x | w(k−1) )(k−1) Vv j (x | w
0wij ∝ wij
Vroot (x | w(k−1) ) ∂Vvi (x | w(k−1) )(9.10)

Note that in the above derivation both Vvi (1 | w)/Vroot (1 | w) and ∂Vroot (1 | w)/∂Vvi (1 | w) can betreated as constants and hence absorbed since wij0 , ∀ j are constrained to be locally normalized. In order toobtain a solution to Eq. (9.8), for each edge weight wij , the sufficient statistics include only three terms, i.e,( k −1)the evaluation value at v j , the differentiation value at vi and the previous edge weight wij
156, all of whichTable 9.3.1: Summary of PGD, EG, SMA and CCCP. Var. means the optimization variables.
Algo

Var.

Update Type

Update Formulano( k +1)(k)wd← PRe++ wd + γ(∇wd f 1 (w(k) ) − ∇wd f 2 (w(k) ))PGDw

Additive

EGw

Multiplicative

wd

SMA

log w

Multiplicative

wd

CCCP

log w

Multiplicativewij( k +1)( k +1)( k +1)(k)← wd exp{γ(∇wd f 1 (w(k) ) − ∇wd f 2 (w(k) ))}
(k)

(k)

← wd exp{γwd × (∇wd f 1 (w(k) ) − ∇wd f 2 (w(k) ))}(k)∝ wij × ∇vi Vroot (w(k) ) × Vv j (w(k) )can be obtained in two passes of the network for each input x. Thus the computational complexity to obtaina maximum of the concave surrogate is O(|S|). Interestingly, Eq. (9.10) leads to the same update formula
as in the EM algorithm Peharz (2015) despite the fact that CCCP and EM start from different perspectives.
We show that all the limit points of the sequence {w(k) }∞k =1 are guaranteed to be stationary points of DCPin (9.2).
Theorem 9.3.1. Let {w(k) }∞k =1 be any sequence generated using Eq. (9.10) from any positive initialpoint, then all the limiting points of {w(k) }∞k=1 are stationary points of the DCP in (9.2). In addition,
(
k
)
∗
∗
limk→∞ f (y ) = f (y ), where y is some stationary point of (9.2).
We summarize all four algorithms and highlight their connections and differences in Table 9.3.1.
Although we mainly discuss the batch version of those algorithms, all of the four algorithms can be easily
adapted to work in stochastic and/or parallel settings.

9.4

Experiments

9.4.1

Experimental Setting

We conduct experiments on 20 benchmark data sets from various domains to compare and evaluate theconvergence performance of the four algorithms: PGD, EG, SMA and CCCP (EM). We list here thedetailed statistics of the 20 data sets used in the experiments in Table 10.4.1. All the features in the 20 data
sets are binary features. All the SPNs that are used for comparisons of PGD, EG, SMA and CCCP aretrained using LearnSPN (Gens and Domingos, 2013). We discard the weights returned by LearnSPN and
use random weights as initial model parameters. The random weights are determined by the same random
seed in all four algorithms. The sizes of different SPNs produced by LearnSPN and ID-SPN are shown in
Table 9.4.2.

9.4.2

Parameter Learning

We implement all four algorithms in C++. For each algorithm, we set the maximum number of iterations
to 50. If the absolute difference in the training log-likelihood at two consecutive steps is less than 0.001,
the algorithms are stopped. For PGD, EG and SMA, we combine each of them with backtracking line
search and use a weight shrinking coefficient set at 0.8. The learning rates are initialized to 1.0 for all threemethods. For PGD, we set the projection margin e to 0.01. There is no learning rate and no backtracking
line search in CCCP. We set the smoothing parameter to 0.001 in CCCP to avoid numerical issues.
We show in Fig. 9.4.1 the average log-likelihood scores on 20 training data sets to evaluate theconvergence speed and stability of PGD, EG, SMA and CCCP. Clearly, CCCP wins by a large margin157

Table 9.4.1: Statistics of data sets and models. N is the number of variables modeled by the network, |S|is the size of the network and D is the number of parameters to be estimated in the network. N × V/Dmeans the ratio of training instances times the number of variables to the number parameters.
Data set
NLTCS
MSNBC
KDD 2kPlants
Audio
Jester
Netflix
Accidents
Retail
Pumsb-starDNA
Kosarak
MSWeb
Book
EachMovie
WebKB
Reuters-52
20 Newsgrp
BBC
Ad

N
16
17
64
69
100
100
100
111
135
163
180
190
294
500
500
839
889
910
1058
1556

|S|
13,73354,83948,279132,959
739,525
314,013
161,655
204,501
56,931
140,339
108,021203,32168,853
190,625
522,753
1,439,751
2,210,325
14,561,965
1,879,921
4,133,421

D
1,716
24,452
14,29258,853
196,103
180,750
51,60174,804
22,11363,17352,12153,204
20,346
41,122
188,387
879,893
1,453,390
8,295,407
1,222,536
1,380,676

Train
16,181
291,326
180,092
17,412
15,0009,000
15,00012,75822,041
12,262
1,600
33,37529,441
8,700
4,524
2,803
6,532
11,293
1,670
2,461

Valid
2,157
38,843
19,907
2,321
2,000
1,000
2,000
1,700
2,938
1,635
400
4,450
3,270
1,159
1,002
558
1,028
3,764
225
327

Test
3,236
58,26534,955
3,482
3,000
4,116
3,000
2,551
4,408
2,452
1,186
6,675
5,000
1,739
591
838
1,540
3,764
330
491

N × V/D
150.871202.541806.457
20.4147.649
4.979
29.06918.931134.560
31.6385.526
119.187425.423105.783
12.007
2.673
3.995
1.239
1.445
2.774

over PGD, EG and SMA, both in convergence speed and solution quality. Furthermore, among the fouralgorithms, CCCP is the most stable one due to its guarantee that the log-likelihood (on training data) will
not decrease after each iteration. As shown in Fig. 9.4.1, the training curves of CCCP are more smooth thanthe other three methods in almost all the cases. These 20 experiments also clearly show that CCCP often
converges in a few iterations. On the other hand, PGD, EG and SMA are on par with each other since they
are all first-order methods. SMA is more stable than PGD and EG and often achieves better solutions than
PGD and EG. On large data sets, SMA also converges faster than PGD and EG. Surprisingly, EG performs
worse than PGD in some cases and is quite unstable despite the fact that it admits multiplicative updates.
The “hook shape” curves of PGD in some data sets, e.g. Kosarak and KDD, are due to the projection
operations.
The computational complexity per update is O(|S|) in all four algorithms. CCCP often takes less timethan the other three algorithms because it takes fewer iterations to converge. We list detailed running time
statistics for all four algorithms on the 20 data sets

9.4.3

Fine Tuning

We combine CCCP as a “fine tuning” procedure with the structure learning algorithm LearnSPN andcompare it to the state-of-the-art structure learning algorithm ID-SPN (Rooshenas and Lowd, 2014). Moreconcretely, we keep the model parameters learned from LearnSPN and use them to initialize CCCP. We
then update the model parameters globally using CCCP as a fine tuning technique. This normally helps

158

Table 9.4.2: Sizes of SPNs produced by LearnSPN and ID-SPN.
Data set
NLTCS
MSNBC
KDD 2kPlants
Audio
Jester
Netflix
Accidents
Retail
Pumsb-starDNA
Kosarak
MSWeb
Book
EachMovie
WebKB
Reuters-52
20 Newsgrp
BBCAd

LearnSPN
13,73354,83948,279132,959
739,525
314,013
161,655
204,501
56,931
140,339
108,021203,32168,853
190,625
522,753
1,439,751
2,210,325
14,561,965
1,879,921
4,133,421

ID-SPN
24,690579,364
1,286,657
2,063,708
2,643,948
4,225,471
7,958,088
2,273,186
60,961
1,751,092
3,228,616
1,272,981
1,886,777
1,445,501
2,440,864
2,605,141
4,563,861
3,485,029
2,426,602
2,087,253

to obtain a better generative model since the original parameters are learned greedily and locally during
the structure learning algorithm. We use the validation set log-likelihood score to avoid overfitting. The
algorithm returns the set of parameters that achieve the best validation set log-likelihood score as output.
Experimental results are reported in Table. 9.4.3. As shown in Table 9.4.3, the use of CCCP after LearnSPN
always helps to improve the model performance. By optimizing model parameters on these 20 data sets,
we boost LearnSPN to achieve better results than state-of-the-art ID-SPN on 7 data sets, where the original
LearnSPN only outperforms ID-SPN on 1 data set. Note that the sizes of the SPNs returned by LearnSPN
are much smaller than those produced by ID-SPN. Hence, it is remarkable that by fine tuning the parameterswith CCCP, we can achieve better performance despite the fact that the models are smaller. For a faircomparison, we also list the size of the SPNs returned by ID-SPN in the supplementary material. As aresult, we suggest using CCCP after structure learning algorithms to fully exploit the expressiveness of theconstructed model.

9.5

ProofsIn this section we provide all the omitted proofs in Sec. 9.1.

9.5.1

Structural Properties of SPNs

Theorem 9.1.1. If T is an induced SPN from a complete and decomposable SPN S , then T is a tree thatis complete and decomposable.

159

Table 9.4.3: Average log-likelihoods on test data. Highest log-likelihoods are highlighted in bold. ↑ shows
statistically better log-likelihoods than CCCP and ↓ shows statistically worse log-likelihoods than CCCP.
The significance is measured based on the Wilcoxon signed-rank test.
Data set
NLTCS
MSNBC
KDD 2kPlants
Audio
Jester
Netflix
Accidents
Retail
Pumsb-star

CCCP-6.029-6.045-2.134-12.872-40.020-52.880-56.782-27.700-10.919-24.229

LearnSPN↓-6.099↓-6.113↓-2.233↓-12.955↓-40.510↓-53.454↓-57.385↓-29.907↓-11.138↓-24.577

ID-SPN↓-6.050-6.048↓-2.153↑-12.554-39.824↓-52.912↑-56.554↑-27.232-10.945↑-22.552

Data set
DNA
Kosarak
MSWeb
Book
EachMovie
WebKB
Reuters-52
20 Newsgrp
BBC
Ad

CCCP
-84.921-10.880-9.970-35.009-52.557-157.492-84.628-153.205-248.602-27.202

LearnSPN↓-85.237↓-11.057↓-10.269↓-36.247↓-52.816↓-158.542↓-85.979↓-156.605↓-249.794↓-27.409

ID-SPN↑-84.693-10.605-9.800↑-34.436↑-51.550↑-153.293↑-84.389↑-151.666↓-252.602↓-40.012

Proof. Argue by contradiction that T is not a tree, then there must exist a node v ∈ T such that v has
more than one parent in T . This means that there exist at least two paths R, p1 , . . . , v and R, q1 , . . . , v
that connect the root of S(T ), which we denote by R, and v. Let t be the last node in R, p1 , . . . , v andR, q1 , . . . , v such that R, . . . , t are common prefix of these two paths. By construction we know that such t
must exist since these two paths start from the same root node R (R will be one candidate of such t). Also,
we claim that t 6= v otherwise these two paths overlap with each other, which contradicts the assumptionthat v has multiple parents. This shows that these two paths can be represented as R, . . . , t, p, . . . , v andR, . . . , t, q, . . . , v where R, . . . , t are the common prefix shared by these two paths and p 6= q since t is
the last common node. From the construction process defined in Def. 9.1.1, we know that both p and q
are children of t in S . Recall that for each sum node in S , Def. 9.1.1 takes at most one child, hence weclaim that t must be a product node, since both p and q are children of t. Then the paths that t → pv
and t → qv indicate that scope(v) ⊆ scope( p) ⊆ scope(t) and scope(v) ⊆ scope(q) ⊆ scope(t),leading to ∅ 6= scope(v) ⊆ scope( p) ∩ scope(q), which is a contradiction of the decomposability of the
product node t. Hence as long as S is complete and decomposable, T must be a tree.
The completeness of T is trivially satisfied because each sum node has only one child in T . It is alsostraightforward to verify that T satisfies the decomposability as T is an induced subgraph of S , which isdecomposable.

Theorem 9.1.2. If T is an induced tree from S over X[n] , then T (x) = ∏(vi ,v j )∈TE wij ∏in=1 Ixi , wherewij is the edge weight of (vi , v j ) if vi is a sum node and wij = 1 if vi is a product node.
Proof. First, the scope of T is the same as the scope of S because the root of S is also the root of T . Thisshows that for each Xi there is at least one indicator Ixi in the leaves otherwise the scope of the root nodeof T will be a strict subset of the scope of the root node of S . Furthermore, for each variable Xi there is at
most one indicator Ixi in the leaves. This is observed by the fact that there is at most one child collectedfrom a sum node into T and if Ixi and Ix̄i appear simultaneously in the leaves, then their least common
ancestor must be a product node. Note that the least common ancestor of Ixi and Ix̄i is guaranteed to exist
because of the tree structure of T . However, this leads to a contradiction of the fact that S is decomposable.
As a result, there is exactly one indicator Ixi for each variable Xi in T . Hence the multiplicative constantof the monomial admits the form ∏in=1 Ixi , which is a product of univariate distributions. More specifically,
it is a product of indicator variables in the case of Boolean input variables.

160

We have already shown that T is a tree and only product nodes in T can have multiple children.
It follows that the functional form of f T (x) must be a monomial, and only edge weights that are in T
contribute to the monomial. Combing all the above, we know that f T (x) = ∏(vi ,vi )∈TE wij ∏nN=1 Ixn . 
Theorem 9.1.3. τS = Vroot (1 | 1), where Vroot (1 | 1) is the value of the network polynomial of S with
input vector 1 and all edge weights set to be 1.
S
Theorem 9.1.4. S(x) = ∑τt=
1 Tt (x), where Tt is the tth unique induced tree of S .
Proof. We prove by induction on the height of S . If the height of S is 2, then depending on the type of theroot node, we have two cases:
1. If the root is a sum node with K children, then there are CK1 = K different subgraphs that satisfy
Def. 9.1.1, which is exactly the value of the network by setting all the indicators and edge weightsfrom the root to be 1.
2. If the root is a product node then there is only 1 subgraph which is the graph itself. Again, this equals
to the value of S by setting all indicators to be 1.

Assume the theorem is true for SPNs with height ≤ h. Consider an SPN S with height h + 1. Again,
depending on the type of the root node, we need to discuss two cases:
1. If the root is a sum node with K children, where the kth sub-SPN has f Sk (1|1) unique induced
trees, then by Def. 9.1.1 the total number of unique induced trees of S is ∑kK=1 f Sk (1|1) = ∑kK=1 1 ·f S k (1|1) = f S (1|1).
2. If the root is a product node with K children, then the total number of unique induced trees of S canthen be computed by ∏kK=1 f Sk (1|1) = f S (1|1).
The second part of the theorem follows by using distributive law between multiplication and addition tocombine unique trees that share the same prefix in bottom-up order.


9.5.2

MLE as Signomial Programming

Proposition 9.2.1. The MLE problem for SPNs is a signomial program.
Proof. Using the definition of Pr(x|w) and Corollary 9.2.1, let τ = f S (1|1), the MLE problem can be
rewritten as
Iw ∈T
(t)
f S (x|w)∑τt=1 ∏nN=1 Ixn ∏dD=1 wd d t
maximizew=
Iw ∈T
f S (1|w)(9.11)∑τ ∏ D w d t
t =1

subject tod =1

Dw ∈ R++dwhich we claim is equivalent to:minimizew,z−zsubject to∑ z ∏ wd d t − ∑ ∏ I xn ∏ wd d t ≤ 0

τ

D

Iw ∈T

t =1

d =1
D
,z > 0w ∈ R++

τN

l =1 n =1

(t)

D

Iw ∈T

(9.12)

d =1

It is easy to check that both the objective function and constraint function in (9.12) are signomials. To
see the equivalence of (9.11) and (9.12), let p∗ be the optimal value of (9.11) achieved at w∗ . Choose
z = p∗ and w = w∗ in (9.12), then −z is also the optimal solution of (9.12) otherwise we can find feasible(z0 , w0 ) in (9.12) which has −z0 < −z ⇔ z0 > z. Combined with the constraint function in (9.12), we161f (x |w0 )have p∗ = z < z0 ≤ f S (1|w0 ) , which contradicts the optimality of p∗ . In the other direction, let z∗ , w∗ beS
the solution that achieves optimal value of (9.12), then we claim that z∗ is also the optimal value of (9.11),
f (x|w)otherwise there exists a feasible w in (9.11) such that z , f S (1|w) > z∗ . Since (w, z) is also feasible inS(9.12) with −z < −z∗ , this contradicts the optimality of z∗ .
The transformation from (9.11) to (9.12) does not make the problem any easier to solve. Rather,
it destroys the structure of (9.11), i.e., the objective function of (9.11) is the ratio of two posynomials.
However, the equivalent transformation does reveal some insights about the intrinsic complexity of the
optimization problem, which indicates that it is hard to solve (9.11) efficiently with the guarantee ofachieving a globally optimal solution.

9.5.3

Convergence of CCCP for SPNs

We discussed before that the sequence of function values { f (y(k) )} converges to a limiting point. However,this fact alone does not necessarily indicate that { f (y(k) )} converges to f (y∗ ) where y∗ is a stationary pointof f (·) nor does it imply that the sequence {y(k) } converges as k → ∞. Zangwill’s global convergence
theory (Zangwill, 1969) has been successfully applied to study the convergence properties of many
iterative algorithms frequently used in machine learning, including EM (Wu, 1983), generalized alternating
minimization (Gunawardana and Byrne, 2005) and also CCCP (Lanckriet and Sriperumbudur, 2009). Here
we also apply Zangwill’s theory and combine the analysis from Lanckriet and Sriperumbudur (2009) toshow the following theorem:
Theorem 9.3.1. Let {w(k) }∞k =1 be any sequence generated using Eq. (9.10) from any positive initialpoint, then all the limiting points of {w(k) }∞k=1 are stationary points of the DCP in (9.2). In addition,
limk→∞ f (y(k) ) = f (y∗ ), where y∗ is some stationary point of (9.2).
Proof. We will use Zangwill’s global convergence theory for iterative algorithms (Zangwill, 1969) to show
the convergence in our case. Before showing the proof, we need to first introduce the notion of “point-to-set
mapping”, where the output of the mapping is defined to be a set. More formally, a point-to-set map Φfrom a set X to Y is defined as Φ : X 7→ P (Y ), where P (Y ) is the power set of Y . Suppose X andY are equipped with the norm k · kX and k · kY , respectively. A point-to-set map Φ is said to be closed
∗
∞
∗
∗
∗
at x ∗ ∈ X if xk ∈ X , { xk }∞k =1 → x and yk ∈ Y , { yk }k =1 → y , yk ∈ Φ ( xk ) imply that y ∈ Φ ( x ).
A point-to-set map Φ is said to be closed on S ⊆ X if Φ is closed at every point in S. The concept ofclosedness in the point-to-set map setting reduces to continuity if we restrict that the output of Φ to be a setof singleton for every possible input, i.e., when Φ is a point-to-point mapping.
Theorem 9.5.1 (Global Convergence Theorem (Zangwill, 1969)). Let the sequence { xk }∞k =1 be generated
by xk+1 ∈ Φ( xk ), where Φ(·) is a point-to-set map from X to X . Let a solution set Γ ⊆ X be given, andsuppose that:
1. all points xk are contained in a compact set S ⊆ X .
2. Φ is closed over the complement of Γ.
3. there is a continuous function α on X such that:(a) if x 6∈ Γ, α( x 0 ) > α( x ) for ∀ x 0 ∈ Φ( x ).
(b) if x ∈ Γ, α( x 0 ) ≥ α( x ) for ∀ x 0 ∈ Φ( x ).

∗Then all the limit points of { xk }∞k =1 are in the solution set Γ and α ( xk ) converges monotonically to α ( x )∗for some x ∈ Γ.

162

D . Let Φ (w(k −1) ) = exp(arg max fˆ(y, y(k−1) )) and let α (w) = f (log w) = f (y) =Let w ∈ R+ylog f S (x| exp(y)) − log f S (1| exp(y)). Here we use w and y interchangeably as w = exp(y) or eachcomponent is a one-to-one mapping. Note that since the arg maxy fˆ(y, y(k−1) ) given y(k−1) is achievable,D.
Φ(·) is a well defined point-to-set map for w ∈ R+
Specifically, in our case given w(k−1) , at each iteration of Eq. 9.10 we havewij0 =

wij f v j (1|w)∑ j wij f v j (1|w)( k −1) )∂ f S (x | w( k −1) )( k −1) f v j (x | w
f S (x | w( k −1) ) ∂ f v i (x | w( k −1) )∝ wiji.e., the point-to-set mapping is given by
Φij (w(k−1) ) =( k −1)wij∂ f (x | w( k −1) )f v j ( x | w ( k − 1 ) ) ∂ f S (x | w( k −1) )vi( k −1)∂ f (x | w( k −1) )f v j 0 ( x | w ( k − 1 ) ) ∂ f S (x | w( k −1) )∑ j0 wij0v
i

Let S = [0, 1] D , the D dimensional hyper cube. Then the above update formula indicates that Φ(w(k−1) ) ∈S. Furthermore, if we assume w(1) ∈ S, which can be obtained by local normalization before any update,D
we can guarantee that {wk }∞k=1 ⊆ S, which is a compact set in R+ .
The solution to maxy fˆ(y, y(k−1) ) is not unique. In fact, there are infinitely many solutions to thisnonlinear equations. However, as we define above, Φ(w(k−1) ) returns one solution to this convex programin the D dimensional hyper cube. Hence in our case Φ(·) reduces to a point-to-point map, where thedefinition of closedness of a point-to-set map reduces to the notion of continuity of a point-to-point map.
Define Γ = {w∗ | w∗ is a stationary point of α(·)}. Hence we only need to verify the continuity of Φ(w)∂ f (x|w)
when w ∈ S. To show this, we first characterize the functional form of ∂ f vS (x|w) as it is used inside Φ(·).
i∂ f (x|w)
We claim that for each node vi , ∂ f vS (x|w) is again, a posynomial function of w. A graphical illustration isigiven in Fig. 9.5.1 to explain the process. This can also be derived from the sum rules and product rules
used during top-down differentiation. More specifically, if vi is a product node, let v j , j = 1, . . . , J be its
parents in the network, which are assumed to be sum nodes, the differentiation of f S with respect to f vi is∂ f (x|w)∂ f (x|w) ∂ f v (x|w)

given by ∂ f vS (x|w) = ∑ jJ=1 ∂ f vS (x|w) ∂ f vj (x|w) . We reach
i

j

i

J
∂ f S (x|w)∂ f (x|w)= ∑ wij S∂ f vi (x|w)∂ f v j (x|w)
j =1(9.13)

Similarly, if vi is a sum node and its parents v j , j = 1, . . . , J are assumed to be product nodes, we haveJ
∂ f S (x|w)∂ f (x|w) f v j (x|w)=∑ S∂ f vi (x|w)∂ f v j (x|w) f vi (x|w)
j =1(9.14)

Since v j is a product node and v j is a parent of vi , so the last term in Eq. 9.14 can be equivalently expressedasf v j (x|w)= ∏ f v h (x|w)
f vi (x|w)
h 6 =iwhere the index is range from all the children of v j except vi . Combining the fact that the partial
differentiation of f S with respect to the root node is 1 and that each f v is a posynomial function, it follows∂ f (x|w)
by induction in top-down order that ∂ f vS (x|w) is also a posynomial function of w.
i163

We have shown that both the numerator and the denominator of Φ(·) are posynomial functions of w.
Because posynomial functions are continuous functions, in order to show that Φ(·) is also continuous on
S\Γ, we need to guarantee that the denominator is not a degenerate posynomial function, i.e., the denominator of Φ(w) 6= 0 for all possible input vector x. Recall that Γ = {w∗ | w∗ is a stationary point of α(·)},
hence ∀w ∈ S\Γ, w 6∈ bd S, where bd S is the boundary of the D dimensional hyper cube S. Hence wehave ∀w ∈ S\Γ ⇒ w ∈ int S ⇒ w > 0 for each component. This immediately leads to f v (x|w) > 0, ∀v.
As a result, Φ(w) is continuous on S\Γ since it is the ratio of two strictly positive posynomial functions.
We now verify the third property in Zangwill’s global convergence theory. At each iteration of CCCP,
we have the following two cases to consider:
1. If w(k−1) 6∈ Γ, i.e., w(k−1) is not a stationary point of α(w), then y(k−1) 6∈ arg maxy fˆ(y, y(k−1) ),so we have α(w(k) ) = f (y(k) ) ≥ fˆ(y(k) , y(k−1) ) > fˆ(y(k−1) , y(k−1) ) = f (y(k−1) ) = α(w(k−1) ).
2. If w(k−1) ∈ Γ, i.e., w(k−1) is a stationary point of α(w), then y(k−1) ∈ arg max fˆ(y, y(k−1) ), soywe have α(w(k) ) = f (y(k) ) ≥ fˆ(y(k) , y(k−1) ) = fˆ(y(k−1) , y(k−1) ) = f (y(k−1) ) = α(w(k−1) ).

By Zangwill’s global convergence theory, we now conclude that all the limit points of {wk }∞k =1 are inΓ and α(wk ) converges monotonically to α(w∗ ) for some stationary point w∗ ∈ Γ.
Remark Technically we need to choose w0 ∈ int S to ensure the continuity of Φ(·). This initialcondition combined with the fact that inside each iteration of CCCP the algorithm only applies positive
multiplicative update and renormalization, ensure that after any finite k steps, wk ∈ intS. Theoretically,
only in the limit it is possible that some components of w∞ may become 0. However in practice, due to thenumerical precision of float numbers on computers, it is possible that after some finite update steps some of
the components in wk become 0. So in practical implementation we recommend to use a small positive
number e to smooth out such 0 components in wk during the iterations of CCCP. Such smoothing may hurt
the monotonic property of CCCP, but this can only happens when wk is close to w∗ and we can use early
stopping to obtain a solution in the interior of S.
∞
Thm. 9.3.1 only implies that any limiting point of the sequence {wk }∞k =1 ({yk }k =1 ) must be a stationary∗∗
point of the log-likelihood function and { f (y)k }∞k =1 must converge to some f (y ) where y is a stationary∞∞
point. Thm. 9.3.1 does not imply that the sequence {wk }k=1 ({yk }k=1 ) is guaranteed to converge. Lanckriet
and Sriperumbudur (2009) studies the convergence property of general CCCP procedure. Under morestrong conditions, i.e., the strict concavity of the surrogate function or that Φ() to be a contraction mapping,∞
it is possible to show that the sequence {wk }∞k =1 ({yk }k =1 ) also converges. However, none of suchconditions hold in our case. In fact, in general there are infinitely many fixed points of Φ(·), i.e., theequation Φ(w) = w has infinitely many solutions in S. Also, for a fixed value t, if α(w) = t has at least
one solution, then there are infinitely many solutions. Such properties of SPNs make it generally very∞
hard to guarantee the convergence of the sequence {wk }∞k =1 ({yk }k =1 ). We give a very simple example
below to illustrate the hardness in SPNs in Fig. 9.5.2. Consider applying the CCCP procedure to learn theparameters on the SPN given in Fig. 9.5.2 with three instances {(0, 1), (1, 0), (1, 1)}. Then if we choose
the initial parameter w0 such that the weights over the indicator variables are set as shown in Fig. 9.5.2, then
any assignment of (w1 , w2 , w3 ) in the probability simplex will be equally optimal in terms of likelihood
on inputs. In this example, there are uncountably infinite equal solutions, which invalidates the finite
solution set requirement given in (Lanckriet and Sriperumbudur, 2009) in order to show the convergence of∞{ wk } ∞k =1 . However, we emphasize that the convergence of the sequence {wk }k =1 is not as important as∗
the convergence of {α(w)k }∞k =1 to desired locations on the log-likelihood surface as in practice any w
with equally good log-likelihood may suffice for the inference/prediction task.

164

It is worth to point out that the above theorem does not imply the convergence of the sequence(k) ∞{ w( k ) } ∞k=1 . Thm. 9.3.1 only indicates that all the limiting points of {w }k =1 , i.e., the limits of subsequences of {w(k) }∞k =1 , are stationary points of the DCP in (9.2). We also present a negative example inFig. 9.5.2 that invalidates the application of Zangwill’s global convergence theory on the analysis in thiscase.
The convergence rate of general CCCP is still an open problem (Lanckriet and Sriperumbudur, 2009).
Salakhutdinov et al. (2002) studied the convergence rate of unconstrained bound optimization algorithms
with differentiable objective functions, of which our problem is a special case. The conclusion is that
depending on the curvature of f 1 and f 2 (which are functions of the training data), CCCP will exhibit either
a quasi-Newton behavior with superlinear convergence or first-order convergence. We show in experimentsthat CCCP normally exhibits a fast, superlinear convergence rate compared with PGD, EG and SMA. Both
CCCP and EM are special cases of a more general framework known as Majorization-Maximization. We
show that in the case of SPNs these two algorithms coincide with each other, i.e., they lead to the same
update formulas despite the fact that they start from totally different perspectives.

165

−logPr(x|w)

11

7

8

6

7

9

9

10

20

30

Iterations

40

Plants

55

6
0

50

45

20
10

10

20

30

40

Iterations

65−logPr(x|w)−logPr(x|w)

20

45

15

40
10

20

30

Iterations

40

Netflix

85

35
0

50

75

10

20

30

40

Iterations

50
0

50

Accidents

50−logPr(x|w)

40

20

55
10

20

30

Iterations

40

Pumsb Star

140

30
0

50

10

20

30

40

Iterations

0
0

50

DNA

20

30

40

Iterations

Kosarek

50

PGD
EG
SMA
CCCP

120
100

−logPr(x|w)−logPr(x|w)

PGD
EG
SMA
CCCP

140

120

60

10

160

PGD
EG
SMA
CCCP

130

80

Retail

50

60

140

100

40

40

150

PGD
EG
SMA
CCCP

120

30

Iterations−logPr(x|w)

50
0

20

80

−logPr(x|w)−logPr(x|w)

70

60

PGD
EG
SMA
CCCP

100

60

65

10

120

PGD
EG
SMA
CCCP

80

70

50

55

90

PGD
EG
SMA
CCCP

80

40

Jester

60

50

25

30

Iterations

65

55

30

20

70

60

35

10

75

PGD
EG
SMA
CCCP

70

40

0
0

50

Audio

75

PGD
EG
SMA
CCCP

50

10
0

30

−logPr(x|w)

5
0

PGD
EG
SMA
CCCP

40

10

8

KDD 2000

50

PGD
EG
SMA
CCCP

12

−logPr(x|w)

10

MSNBC

13

PGD
EG
SMA
CCCP

−logPr(x|w)

NLTCS

12
11

80
60

110

40
40
20
0

100
10

20

30

Iterations

40

MSWeb

250

90
0

50

20

30

Iterations

40

0
0

50

Book

450

PGD
EG
SMA
CCCP

200

20
10

PGD
EG
SMA
CCCP

400
350

−logPr(x|w)−logPr(x|w)−logPr(x|w)

150
100

50

20

30

Iterations

40

WebKB

700

0
0

50

50
10

20

30

Iterations

40

600

−logPr(x|w)−logPr(x|w)−logPr(x|w)

20

30

Iterations

40

0
0

50

300

10

BBC

900

20

40

100
0

50

5

10

Ad

1400

15

20

Iterations

25

30

35

40

PGD
EG
SMA
CCCP

1200
1000

−logPr(x|w)−logPr(x|w)

700

30

Iterations

PGD
EG
SMA
CCCP

800

600

800

500

600

400

400

300
200
0

PGD
EG
SMA
CCCP

200

100
10

20 Newsgroup

50

500

200

100
0

40

400

300

300

30

Iterations

600

400

200

20

700

500

400

10

800

PGD
EG
SMA
CCCP

700

500

0
0

50

Reuters-52

800

PGD
EG
SMA
CCCP

600

PGD
EG
SMA
CCCP

200

100

10

50

300

150

0
0

40

250

200

50

30

Iterations

350

250

100

20

EachMovie

400

300

150

10

450

200

10

20

30

Iterations

40

50

0
0

10

20

30

Iterations

40

50

Figure 9.4.1: Negative log-likelihood values versus number of iterations for PGD, EG, SMA and CCCP.
166

+
w1
×

×

vi

+

+

×

+

×

+

∂ f (x|w)

Figure 9.5.1: Graphical illustration of ∂ f vS (x|w) . The partial derivative of f S with respect to f vi (in red) is aiposynomial that is a product of edge weights lying on the path from root to vi and network polynomials
from nodes that are children of product nodes on the path (highlighted in blue).

+
w1

w3

w2

×

×

×

+

+

2
3

1
3

X1

X̄1

2
3

X2

1
3

X̄2

Figure 9.5.2: A counterexample of SPN over two binary random variables where the weights w1 , w2 , w3
are symmetric and indistinguishable.

167

Appendix
9.A

Experiment Details

9.A.1

Methods

We will briefly review the current approach for training SPNs using projected gradient descent (PGD).
Another related approach is to use exponentiated gradient (EG) (Kivinen and Warmuth, 1997) to optimize(9.11). PGD optimizes the log-likelihood by projecting the intermediate solution back to the positive
orthant after each gradient update. Since the constraint in (9.11) is an open set, we need to manually createa closed set on which the projection operation can be well defined. One feasible choice is to project on
D | w ≥ e, ∀ d } where e > 0 is assumed to be very small. To avoid the projection,
to ReD , {w ∈ R++d
one direct solution is to use the exponentiated gradient (EG) method (Kivinen and Warmuth, 1997), which
was first applied in an online setting and latter successfully extended to batch settings when training withconvex models. EG admits a multiplicative update at each iteration and hence avoids the need for projectionin PGD. However, EG is mostly applied in convex setting and it is not clear whether the convergenceguarantee still holds or not in nonconvex setting.

9.A.2

Experimental Setup

Table 9.A.1 shows the detailed running time of PGD, EG, SMA and CCCP on 20 data sets, measured inseconds.

169

Table 9.A.1: Running time of 4 algorithms on 20 data sets, measured in seconds.
Data set
NLTCS
MSNBC
KDD 2kPlants
Audio
Jester
Netflix
Accidents
Retail
Pumsb-starDNA
Kosarak
MSWeb
Book
EachMovie
WebKB
Reuters-52
20 Newsgrp
BBC
Ad

PGD
438.352720.7346388.60
12595.60
19647.90
6099.4429573.10
14266.50
28669.50
3115.58599.93122204.00
136524.00
190398.00
30071.60
123088.00
13092.10
151243.00
20920.60
12246.40

EG
718.982917.7222154.10
10752.10
3430.696272.8027931.50
3431.827729.89
13872.80
199.63112273.00
13478.10
6487.8432793.60
50290.90
5438.35
96025.80
18065.00
2183.08

170

SMA
458.998078.41
27101.50
7604.09
12801.70
4082.6515080.50
5776.00
9866.944864.72727.5649120.50
65221.20
69730.50
17751.1044004.50
20603.70
173921.00
36952.20
12346.70

CCCP
206.102008.0729541.20
13049.80
14307.30
1931.41
8400.2020345.90
5200.202377.541380.3642809.30
45132.30
23076.40
60184.00
168142.00
1194.3111031.80
3440.37731.48

Chapter 10

Collapsed Variational Inference
Existing parameter learning approaches for SPNs are largely based on the maximum likelihood principle
and are subject to overfitting compared to more Bayesian approaches. Exact Bayesian posterior inference
for SPNs is computationally intractable. Even approximation techniques such as standard variational
inference and posterior sampling for SPNs are computationally infeasible even for networks of moderate
size due to the large number of local latent variables per instance. In this chapter, we propose a novel
deterministic collapsed variational inference algorithm for SPNs that is computationally efficient, easy to
implement and at the same time allows us to incorporate prior information into the optimization formulation.
Extensive experiments show a significant improvement in accuracy compared with a maximum likelihood
based approach.

171

10.1

Introduction

Standard variational Bayes inference is an optimization-based approach to approximate the full posterior
distribution of a probabilistic model (Jordan et al., 1999). It works by constructing and maximizing anevidence lower bound (ELBO) of the log marginal likelihood function log p(x). Equivalently, one canminimize the Kullback-Leibler (KL) divergence between the true posterior distribution and the variational
posterior distribution. To review, let Θ = {H, W} represent the set of latent variables in a probabilistic
model (including both the local, H, and the global, W, latent variables) and let X represent the data.
For example, in mixture models such as LDA, H corresponds to the topic assignments of the words andW corresponds to the topic-word distribution matrix. The joint probability distribution of Θ and X isp(X, Θ | α ) where α is the set of hyperparameters of the model. Standard VI approximates the true posteriorp(Θ | X, α ) with a variational distribution q(Θ | β ) with a set of variational parameters β . This reduces aninference problem into an optimization problem in which the objective function is given by the ELBO:b β ).
log p(x | α ) ≥ Eq [log p(x, Θ|α )] + H[q(Θ|β )] =: L(
The variational distribution q(Θ | β ) is typically assumed to be fully factorized, with each variationalparameter β i governing one latent variable θi . The variational parameters are then optimized to maximize
the ELBO, and the optimal variational posterior will be used as a surrogate to the true posterior distributionp(Θ | X, α ). It is worth noting that in standard VI the number of variational parameters is linearly
proportional to the number of latent variables, including both the global and local latent variables.

10.1.1

Motivation

Standard VI methods are computationally infeasible for SPNs due to the large number of local latentvariables for each training instance, as shown in Fig. 10.1.1. Let W denote the set of global latent variables(model parameters) and Hd denote the set of local latent variables, where d indexes over the training
instances. In standard VI we need to maintain a set of variational parameters for each of the latent variables,i.e., W and {Hd }dD=1 . In the case of SPNs, the number of local latent variables is exactly the numberof internal sum nodes in the network, which can be linearly proportional to the size of the network,|S|. Together with the global latent variables, this leads to a total number of O( D |S| + |S|) variationalparameters to be maintained in standard VI. As we will see in the experiments, this is prohibitively
expensive for SPNs that range from tens of thousands to millions of nodes.
To deal with the expensive computation and storage in standard VI, we develop CVB-SPN, a collapsed
variational algorithm, which, instead of assuming independence among the local latent variables, models thedependence among them in an exact fashion. More specifically, we marginalize all the local latent variables
out of the joint posterior distribution and maintain a marginal posterior distribution over the global latentvariables directly. This approach would not be an option for many graphical models, but as we will see later,
we can take advantage of fast exact inference in SPNs. On the other hand, we still variationally approximate
the posterior distribution of the global variables (model parameters) using a mean-field approach. Note thisbasic assumption made in CVB-SPN is different from typical collapsed variational approaches developed
for LDA and HDP (Teh et al., 2006, 2007), where global latent variables are integrated out and local
latent variables are assumed to be mutually independent. As a result, CVB-SPN models the marginal
posterior distribution over global latent variables only and hence the number of variational parameters to be
optimized is O(|S|) compared with O( D |S|) in the standard case.
Intuitively, this is not an unreasonable assumption to make since compared with local latent variables,
the global latent variables in Fig. 10.1.1 are further away from the influence of observations of X and they
are mutually independent a priori. Besides the computational consideration, another motivation to collapse
172

X1

W1

W2

W3

···

Wm

H1

H2

H3

···

Hm

X2

···

X3

Xn
D

Figure 10.1.1: Graphical model representation of SPN S . The box is a plate that represents replication
over D training instances. m = O(|S|) corresponds to the number of sum nodes and n is the number ofobservable variables in S . Typically, m  n. W, H, X correspond to global latent variables, local latentvariables and observable variables, respectively.
out the local latent variables is that no interpretation associated with the local latent variables in an SPN
has so far proven to be useful in practice. Unlike other mixture models such as LDA, where local latentvariables correspond to topic assignment of words, the sum nodes in SPNs do not share typical statisticalinterpretations that may be useful in real-world applications.
CVB-SPN makes fewer assumptions about the independence among random variables and has fewer
variational variables to be optimized, but to achieve these benefits, we must overcome the following
difficulties: the cost of exact marginalization over local latent variables and the non-conjugacy between
the prior distribution and the likelihood function introduced by the marginalization. The first problem iselegantly handled by the property of SPN that exact inference over X is always tractable. In what follows
we proceed to derive the CVB-SPN algorithm that efficiently solves the second problem.

10.2

Collapsed Variational Inference

Throughout the derivation we will assume that the weights wkj associated with a sum node k are locallynormalized, i.e., ∑ j∈Ch(k) wkj = 1, ∀k. This can be achieved by a bottom-up pass of the network in time
O(|S|) without changing the joint probability distribution over X; see Peharz et al. (2015) and Zhao
et al. (2015b) for more details. For SPNs with locally normalized weights w, it can be verified that
Vroot (1 | w) = 1, hence the marginal likelihood function p(x | w) that marginalizes out local latentvariables h is given by Vroot (x | w).
Since the weights associated with each sum node k are locally normalized, we can interpret each sum
node as a multinomial random variable with one possible value for each child of the sum node. It follows
that we can specify a Dirichlet prior Dir(wk | αk ) for each sum node k. Since all the global latent variables
are d-separated before we get the observation x, a prior distribution over all the weights can be factorized
as:
m

m

k =1

k =1

p(w | α ) = ∏ p(wk | αk ) = ∏ Dir(wk | αk ).

173(10.1)

The true posterior distribution after a sequence of observations {xd }dD=1 is:
D

m

D

d =1

k =1

d=1 t=1 (k,j)∈TtEτSp(w | {xd }dD=1 , α ) ∝ p(w | α ) ∏ Vroot (xd | w) = ∏ Dir(wk | αk ) ∏ ∑∏nwkj ∏ pt ( xdi ).
i =1(10.2)
Intuitively, Eq. (10.2) indicates that the true posterior distribution of the model parameters is a mixture
model where the number of components scales as τSD and each component is a product of m Dirichlets,
one for each sum node. Here τS corresponds to the number of induced trees in S (cf. Thm. 9.1.4). For
discrete SPNs the leaf univariate distributions are simply point mass distributions, i.e., indicator variables.
For continuous distributions such as Gaussians, we also need to specify the priors for the parameters of
those leaf distributions, but the analysis goes the same as the discrete case. Eq. (10.2) is intractable tocompute exactly, hence we resort to collapsed variational inference. To simplify notation, we will assume
that there is only one instance in the data set, i.e., D = 1. Extension of the following derivation to multiple
training instances is straightforward. Consider the log marginal probability over observable variables thatupper bounds the new ELBO L(β ):log p(x | α ) ≥ Eq(w|β ) [log p(x, w | α )] + H[q(w | β )](10.3)= Eq(w|β ) [log ∑ p(x, h, w | α )] + H[q(w | β )]h=: L(β ),where q(w | β ) = ∏mk =1 Dir( wk | β k ) is the factorized variational distribution over w to approximate thetrue marginal posterior distribution p(w | x, α ) = ∑h p(w, h | x, α ). Note that here we are using q(w) as
opposed to q(w)q(h) in standard VI. We argue that L(β ) gives us a better lower bound to optimize thanb β ) be the ELBO given by standard VI, i.e.,the one given by standard VI. To see this, let L(b β ) = Eq(w)q(h) [log p(x, w, h|α )] + H[q(w)q(h)],L(
we have:L(β ) = Eq(w) [log p(x, w | α )] + H[q(w)]p(h, w, x | α )] + H[q(w)]= Eq(w) E p(h|w,x,αα ) [logp(h | w, x, α )p(h, w, x | α )= max Eq(w) Eq(h|w) [log] + H[q(w)]q (h | w)q (h|w)p(h, w, x | α )] + H[q(w)]≥ max Eq(w) Eq(h) [log
q (h)
q (h)
≥ Eq(w)q(h) [log p(x, w, h | α )] + H[q(w)q(h)]b β ).
= L(
The first equality holds by the definition of L(β ) and the second equality holds since log p(x, w | α ) =p(h,w,x|α )log p(h|w,x,αα ) is constant w.r.t. E p(h|w,x,αα ) [·]. The third equality holds because the inner expectation is the
maximum that can be achieved by the negative KL divergence between the approximate posterior q(h|w)
and the true posterior p(h|w, x, α ). The inequality in the fourth line is due to the fact that the maximization
over q(h | w) is free of constraint hence the optimal posterior is given by the true conditional posteriorq∗ (h | w) = p(h | w, x, α ), while the maximization over q(h) in the fourth line needs to satisfy the174independence assumption made in standard VI, i.e., q(h | w) = q(h). Combining the inequality above
with (10.3), we haveb β ),
log p(x | α ) ≥ L(β ) ≥ L(
(10.4)
which shows that the ELBO given by the collapsed variational inference is a better lower bound than the
one given by standard VI. This conclusion is also consistent with the one obtained in collapsed variational
inference for LDA and HDP (Teh et al., 2006, 2007) where the authors collapsed out the global latentvariables instead of the local latent variables. It is straightforward to verify that the difference between
log p(x | α ) and L(β ) is given by KL(q(w | β ) k p(w | x, α )), i.e., the KL-divergence between thevariational marginal posterior and the exact marginal posterior distribution. Substituting q(w | β ) into the
KL-divergence objective and simplifying it, we reach the following optimization objective:
minimize KL(q(w | β ) k p(w | α )) − Eq(w|β ) [log p(x | w)],

(10.5)

βwhere the first part can be interpreted as a regularization term that penalizes a variational posterior that is
too far away from the prior, and the second part is a data-fitting term that requires the variational posterior
to have a good fit to the training data set. The first part in ((10.5)) can be efficiently computed due to thefactorization assumption of both the prior and the variational posterior. However, the second part does not
admit an analytic form because after we marginalize out all the local latent variables, q(w | β ) is no longer
conjugate to the likelihood function p(x|w) = Vroot (x | w). We address this problem in the next section.

10.3

Upper Bound by Logarithmic Transformation

The hardness of computing Eq(w|β ) [log p(x | w)] makes the direct optimization of (10.5) infeasible inpractice. While nonconjugate inference with little analytic work is possible with recent innovations (Bleiet al., 2012; Kingma and Welling, 2013; Mnih and Gregor, 2014; Ranganath et al., 2014; Titsias andLázaro-Gredilla, 2014; Titsias, 2015), they fail to make use of a key analytic property of SPNs, i.e., easy
marginalization, that allows for the optimal variational distributions of local variables to be used. In thissection we show how to use a logarithmic transformation trick to develop an upper bound of the objectivein (10.5) which leads to the efficient CVB-SPN algorithm.
The key observation is that the likelihood of w is a posynomial function (Boyd et al., 2007). To see this,nS
as shown in Thm. 9.1.4, we have p(x | w) = ∑τt=
1 ∏(k,j)∈TtE wkj ∏i =1 pt ( Xi = xi ). The product termnwith respect to x, ∏i=1 pt ( Xi = xi ), is guaranteed to be nonnegative and can be treated as a constant w.r.t.
w. Hence each component in p(x | w), in terms of w, is a monomial function with positive multiplicative
constant, and it follows that p(x | w) is a posynomial function of w. A natural implication of thisobservation is that we can do a change of variables transformation to w such that log p(x | w) becomes aconvex function in terms of the transformed variables. More specifically, let w0 = log w, where log(·) istaken elementwise. The log likelihood, now expressed in terms of w0 , isτSlog p(x | w) = log  ∑∏t=1 (k,j)∈TtEnwkj ∏ pt ( Xi = xi )
i =1





τS

= log  ∑ exp ct +t =1=: log p(x | w0 ),175∑(k,j)∈TtE

0 
wkj

(10.6)

0 is an affine
where ct is defined as ct = log ∏in=1 pt ( Xi = xi ). For each unique tree Tt , ct + ∑(k,j)∈TtE wkj
function of w0 . Since the log-sum-exp function is convex in its argument, log p(x | w0 ) is convex in w0 .
Such a change of variables trick is frequently applied in the geometric programming literature to transforma non-convex posynomial optimization problem into a convex programming problem (Boyd et al., 2007;
Chiang, 2005).
The convexity of log p(x | w0 ) helps us to develop a lower bound of Eq(w|β ) [log p(x | w)] that is
efficient to compute. Let q0 (w0 ) be the corresponding variational distribution over w0 induced from q(w)by the bijective transformation between w and w0 . We haveEq(w) [log p(x | w)] ==Z

q(w) log p(x | w) dw

Z

q0 (w0 ) log p(x | w0 ) dw0≥ log p(x | Eq0 (w0 ) [w0 ]),where log p(x | Eq0 (w0 ) [w0 ]) means the log-likelihood of x with the edge weights set to be exp(Eq0 (w0 ) [w0 ])).


0 ]Since q(w) = ∏m
Dir
(
w
|
β
)
is
a
productofDirichlets,
wecancomputetheweight
exp
E
[
w
0
0
k
k
q
(
w
)
k =1
kj
for each edge (k, j) as0
Eq0 (w0 ) [wkj
]=

=

Z

0
q0 (w0 )wkj
dw0 =

Z

Z

q(wk ) log wkj dwk = ψ( β kj ) − ψ(∑ β kj0 ),0
q0 (wk0 )wkj
dwk0

j0

where ψ(·) is the digamma function. The equation above then implies the new edge weight can be computedby!

β kj − 210,(10.7)
exp Eq0 (w0 ) [wkj ] = exp ψ( β kj ) − ψ(∑ β kj0 ) ≈∑ j0 β kj0 − 12j0where the approximation is by exp(ψ( x )) ≈ x − 12 when x > 1. Note that the mean
 of the variational
0 ]posterior is given by w̄kj = Eq(w) [wkj ] = β kj / ∑ j0 β kj0 , which is close to exp Eq0 (w0 ) [wkjwhen

β kj > 1. Roughly speaking, this shows that the lower bound we obtained for Eq(w) [log p(x | w)] by
utilizing the logarithmic transformation is trying to optimize the variational parameters β such that thevariational posterior mean has a good fit to the training data. This is exactly what we hope for since atthe end we need to use the variational posterior mean as a Bayesian estimator of our model parameter.
Combining all the analysis above, we formulate the following objective function to be minimized that is anupper bound of the objective function given in (10.5):
KL(q(w | β ) k p(w | α )) − log p(x | Eq0 (w0 |β ) [w0 ]).

(10.8)

Note that we will use the approximation given by Eq. (10.7) in the above optimization formulation and in
Alg. 3. This is a non-convex optimization problem due to the digamma function involved. Nevertheless wecan still achieve a local optimum with projected gradient descent in the experiments. We summarize ouralgorithm, CVB-SPN, in Alg. 3. For each instance, the gradient of the objective function in (10.8) withrespect to β can be computed by a bottom-up and top-down pass of the network in time O(|S|). Pleaserefer to (Peharz et al., 2016; Zhao et al., 2016b) for more details.

176

Algorithm 3 CVB-SPN
Input: Initial β , prior hyperparameter α , training instances {xd }dD=1 .
Output: Locally optimal β ∗ .
1: while not converged do2:Update w = exp(Eq0 (w0 |β ) [w0 ]) with Eq. (10.7).
3:
Set ∇β = 0.
4:
for d = 1 to D do
5:
Bottom-up evaluation of log p(xd |w).
∂6:
Top-down differentiation of ∂w
log p(xd |w).
7:
Update ∇β based on xd .
8:
end for9:
Update ∇β based on KL(q(w|β ) k p(w|α )).
10:Update β with projected GD.
11: end while
Parallel and Stochastic Variants Note that Alg. 3 is easily parallelizable by splitting training instancesin the loop (Line 4–Line 8) across threads. It can also be extended to the stochastic setting where at eachround we sample one instance or a mini-batch of instances {xik }sk=1 (s is the size of the mini-batch) fromthe training set. The stochastic formulation will be helpful when the size of the full training data set is toolarge to be stored in the main memory as a whole, or when the training instances are streaming so that at
each time we only have access to one instance (Hoffman et al., 2013).

10.4

Experiments

10.4.1

Experimental Setting

We conduct experiments on a set of 20 benchmark data sets to compare the performance of the proposed
collapsed variational inference method with maximum likelihood estimation (Gens and Domingos, 2012).
The 20 real-world data sets used in the experiments have been widely used (Rooshenas and Lowd, 2014) toassess the modeling performance of SPNs. All the features are binary. The 20 data sets also cover both
low dimensional and high dimensional statistical estimation, hence, they enable a thorough experimental
comparison. Detailed information about each data set as well as the SPN models is shown in Table 10.4.1.
All the SPNs are built using LearnSPN (Gens and Domingos, 2013).
We evaluate and compare the performance of CVB-SPN with other parameter learning algorithms inboth the batch and online learning settings. For a baseline, we compare to the state-of-the-art parameter
learning algorithm for SPNs where the algorithm optimizes the training set log-likelihood directly in order
to find a maximum likelihood estimator, which we will denote as MLE-SPN. We compare CVB-SPN and
MLE-SPN in both batch and online cases. To have a fair comparison, we apply the same optimization
method, i.e., projected gradient descent, to optimize the objective functions in CVB-SPN and MLE-SPN.
CVB-SPN optimizes over the variational parameters of the posterior distribution based on (3.5) while
MLE-SPN optimizes directly over the model parameters to maximize the log-likelihood of the training
set. Since the optimization variables are constrained to be positive in both CVB-SPN and MLE-SPN, weneed to project the parameters back onto the positive orthant after every iteration. We fix the projection
margin e to 0.01, i.e., w = max{w, 0.01} to avoid numerical issues. We implement both methods withbacktracking line search to automatically adjust the learning rate at each iteration. In all experiments,
the maximum number of iterations is fixed to 50 for both methods. We discard the model parameters
177

Table 10.4.1: Statistics of data sets and models. n is the number of observable random variables modeledby the network, |S| is the size of the network and p is the number of parameters to be estimated. n × D/pmeans the ratio of training instances times the number of variables to the number of parameters.
Data set
NLTCS
MSNBC
KDD 2kPlants
Audio
Jester
Netflix
Accidents
Retail
Pumsb-starDNA
Kosarak
MSWeb
Book
EachMovie
WebKB
Reuters-52
20 Newsgrp
BBC
Ad

n
16
17
64
69
100
100
100
111
135
163
180
190
294
500
500
839
889
910
1058
1556

|S|
13,73354,83948,279132,959
739,525
314,013
161,655
204,501
56,931
140,339
108,021203,32168,853
190,625
522,753
1,439,751
2,210,325
14,561,965
1,879,921
4,133,421

p
1,716
24,452
14,29258,853
196,103
180,750
51,60174,804
22,11363,17352,12153,204
20,346
41,122
188,387
879,893
1,453,390
8,295,407
1,222,536
1,380,676

Train
16,181
291,326
180,092
17,412
15,0009,000
15,00012,75822,041
12,262
1,600
33,37529,441
8,700
4,524
2,803
6,532
11,293
1,670
2,461

Valid
2,157
38,843
19,907
2,321
2,000
1,000
2,000
1,700
2,938
1,635
400
4,450
3,270
1,159
1,002
558
1,028
3,764
225
327

Test
3,236
58,26534,955
3,482
3,000
4,116
3,000
2,551
4,408
2,452
1,186
6,675
5,000
1,739
591
838
1,540
3,764
330
491

n × D/p150.871202.541806.457
20.4147.649
4.979
29.06918.931134.560
31.6385.526
119.187425.423105.783
12.007
2.673
3.995
1.239
1.445
2.774

returned by LearnSPN and use random weights as initial model parameters. CVB-SPN is more flexible toincorporate those model weights returned by LearnSPN as the hyperparameters for prior distributions. In
the experiments we multiply the weights returned by LearnSPN by a positive scalar and treat them as thehyperparameters of the prior Dirichlet distributions. This is slightly better than using randomly initializedpriors, but the differences are negligible on most data sets. MLE-SPN can also incorporate the model
weights returned by LearnSPN by treating them as the hyperparameters of fixed prior Dirichlets. This
corresponds to an MAP formulation. However in practice we find the MAP formulation performs no better
than MLE-SPN, and on small data sets, MAP-SPN gives consistently worse results than MLE-SPN; so, wereport only results for MLE-SPN. For both MLE-SPN and CVB-SPN we use a held-out validation set topick the best solution during the optimization process. We report average log-likelihood on each data set
for each method.
Both CVB-SPN and MLE-SPN are easily extended to the online setting where training instances arecoming in a streaming fashion. In this case we also compare CVB-SPN and MLE-SPN to an online
Bayesian moment matching method (OBMM) (Rashwan et al., 2016a) that is designed for learning SPNs.
OBMM is a purely online algorithm in the sense that it can only process one instance in each updatein order to avoid the exponential blow-up in the number of mixture components. OBMM constructs anapproximate posterior distribution after seeing each instance by matching the first and second momentsof the approximate posterior to the exact posterior. In this experiment, we compare both CVB-SPN(OCVB-SPN) and MLE-SPN (OMLE-SPN) to OBMM where only one pass over the training set is allowed
for learning and at each round only one instance is available to each of the algorithms.
178

Table 10.4.2: Average log-likelihoods on test data. Highest average log-likelihoods are highlighted in bold.
↑ / ↓ are used to represent statistically better/worse results than (O)CVB-SPN respectively.
Data set
NLTCS
MSNBC
KDD 2kPlants
Audio
Jester
Netflix
Accidents
Retail
Pumsb-starDNA
Kosarak
MSWeb
Book
EachMovie
WebKB
Reuters-52
20 Newsgrp
BBCAd

10.4.2

MLE-SPN↓ -6.44↓-7.02↓-4.24↓-28.78↓-46.42↓-59.55↓-64.88↓-50.14↓-15.53↓-80.61↓-102.62↓-47.16↓-19.69↓-88.16↓-97.15↓-199.15↓-218.97↓-260.69↓-372.45↓-311.87

CVB-SPN
-6.08
-6.29
-2.14
-12.86-40.36-54.26-60.69-29.55-10.91-25.93-86.73-10.70-9.89-34.44-52.63-161.46-85.45-155.61-251.23-19.00OBMM↑-6.07-6.35-2.14↑-15.14↓-40.70-53.86-57.99↓-42.66↓-11.42↓-45.27↓-99.61-11.22↓-11.33↓-35.55↑-59.50↑-165.57-108.01↓-158.01↓-275.43↓-63.81

OMLE-SPN↓-7.78↓-6.94↓-27.99↓-30.23↓-48.90↓-63.67↓-65.72↓-58.63↓-82.42↓-80.19↓-96.84↓-111.95↓-140.86↓-299.02↓-284.92↓-413.94↓-513.97↓-728.11↓-517.36↓-572.01

OCVB-SPN
-6.12
-6.34
-2.16
-16.03-40.58-53.84-57.96-38.07-11.31-37.05-91.52-11.12-10.73-34.77-64.75-169.31-108.04-156.63-272.56-57.56

Results

All experiments are run on a server with Intel Xeon CPU E5 2.00GHz. The running time ranges from 2
min to around 5 days depending on the size of the data set and the size of the network. All algorithms
have roughly the same running time on the same data set as they scale linearly in the size of the training
set and the size of the network. Table 10.4.2 shows the average joint log-likelihood scores of different
parameter learning algorithms on 20 data sets. For each configuration, we use bold numbers to highlightthe best score among the offline methods and among the online methods. We also use ↑ / ↓ to indicate
whether the competitor methods achieve statistically significant better/worse results than CVB-SPN on thecorresponding test data set under the Wilcoxon signed-rank test (Wilcoxon, 1950) with p-value ≤ 0.05.
In the batch learning experiment, CVB-SPN consistently dominates MLE-SPN on every data set with alarge margin. The same results can be observed in the online learning scenarios: both OCVB-SPN and
OBMM significantly outperform OMLE-SPN on all the 20 experiments. These experiments demonstrate
the effectiveness and robustness of Bayesian inference methods in parameter estimation on large graphicalmodels like SPNs. In the online learning scenario, OCVB-SPN beats OBMM on 14 out of the 20 data sets,
and achieves statistically better results on 10 out of the 14. On the other hand, OBMM obtains statistically
better results than OCVB-SPN on 4 of the data sets. This is partly due to the fact that OCVB-SPN explicitly
optimizes over an objective function that includes the evaluation of the variational posterior mean on thelikelihood function, while OBMM only tries to match the first and second moments of the distribution after
each update.

179

10.5

Conclusion

We develop a collapsed variational inference method, CVB-SPN, to learn the parameters of SPNs. CVBSPN directly maintains a variational posterior distribution over the global latent variables by marginalizingout all the local latent variables. As a result, CVB-SPN is more memory efficient than standard VI. We also
show that the collapsed ELBO in CVB-SPN is a better lower bound than the standard ELBO. We construct
a logarithmic transformation trick to avoid the intractable computation of a high-dimensional expectation.
We conduct experiments on 20 data sets to compare the proposed algorithm with state-of-the-art learningalgorithms in both batch and online settings. The results demonstrate the effectiveness of CVB-SPN in
both cases.

180

Chapter 11

Linear Time Computation of Moments
Bayesian online algorithms for Sum-Product Networks (SPNs) need to update their posterior distribution
after seeing one single additional instance. To do so, they must compute moments of the model parameters
under this distribution. The best existing method for computing such moments scales quadratically inthe size of the SPN, although it scales linearly for trees. This unfortunate scaling makes Bayesian online
algorithms prohibitively expensive, except for small or tree-structured SPNs. In this chapter we propose an
optimal linear-time algorithm that works even when the SPN is a general directed acyclic graph (DAG),
which significantly broadens the applicability of Bayesian online algorithms for SPNs. There are three key
ingredients in the design and analysis of our algorithm:
1. For each edge in the graph, we construct a linear time reduction from the moment computation
problem to a joint inference problem in SPNs.
2. Using the property that each SPN computes a multilinear polynomial, we give an efficient procedure for polynomial evaluation by differentiation without expanding the network that may containexponentially many monomials.
3. We propose a dynamic programming method to further reduce the computation of the moments ofall the edges in the graph from quadratic to linear.
We demonstrate the usefulness of our linear time algorithm by applying it to develop a linear time assume
density filter (ADF) for SPNs.

181

11.1

Exact Posterior Has Exponentially Many Modes

Let m be the number of sum nodes in S . Suppose we are given a fully factorized prior distribution
p0 (w | α ) = ∏ m
k =1 p0 ( wk | αk ) over w. It is worth pointing out the fully factorized prior distribution
is well justified by the bipartite graph structure of the equivalent BN constructed from the SPN. We areinterested in computing the moments of the posterior distribution after we receive one observation fromthe world. Essentially, this is the Bayesian online learning setting where we update the belief about the
distribution of model parameters as we observe data from the world sequentially. Note that wk corresponds
to the weight vector associated with sum node k, so wk is a vector that satisfies wk > 0 and 1T wk = 1. Let
us assume that the prior distribution for each wk is Dirichlet, i.e.,
m

m

k =1

k =1

p0 (w | α ) = ∏ Dir(wk | αk ) = ∏Γ(∑ j αk,j )αk,j −1∏ wk,j∏ Γ(αk,j )jjAfter observing one instance x, we have the exact posterior distribution to be: p(w | x) = p0 (w; α ) p(x |w)/p(x). Let Zx , p(x) and realize that the network polynomial also computes the likelihood p(x | w).
Plugging the expression for the prior distribution as well as the network polynomial into the above Bayes
formula, we have:n
1 τS mp (w | x) =
Dir
(
w
|
α
)
w
k
k
k,j
∏
∏
∏ p t ( xi )Zx t∑
=1 k =1i =1(k,j)∈TtE

Since Dirichlet is a conjugate distribution to the multinomial, each term in the summation is an updated
Dirichlet with a multiplicative constant. So, the above equation suggests that the exact posterior distribution
becomes a mixture of τS Dirichlets after one observation. In a data set of D instances, the exact posterior
will become a mixture of τSD components, which is intractable to maintain since τS = Ω(2 H (S) ).
The hardness of maintaining the exact posterior distribution appeals for an approximate scheme where
we can sequentially update our belief about the distribution while at the same time efficiently maintainthe approximation. Assumed density filtering (Sorenson and Stubberud, 1968) is such a framework: thealgorithm chooses an approximate distribution from a tractable family of distributions after observing each
instance. A typical choice is to match the moments of an approximation to the exact posterior.

11.2

The Hardness of Computing Moments

In order to find an approximate distribution to match the moments of the exact posterior, we need to be able
to compute those moments under the exact posterior. This is not a problem for traditional mixture models
including mixture of Gaussians, latent Dirichlet allocation, etc., since the number of mixture components in
those models are assumed to be small constants. However, this is not the case for SPNs, where the effective
number of mixture components is τS = Ω(2 H (S) ), which also depends on the input network S .
To simplify the notation, for each t ∈ [τS ], we define ct := ∏in=1 pt ( xi )1 and
ut :=

Z
w

p0 (w)∏

wk,j dw.

(k,j)∈TtE

That is, ct corresponds to the product of leaf distributions in the tth induced tree Tt , and ut is the momentof ∏(k,j)∈TtE wk,j , i.e., the product of tree edges, under the prior distribution p0 (w). Realizing that the
1 For ease of notation, we omit the explicit dependency of ct on the instance x .

182

posterior distribution needs to satisfy the normalization constraint, we have:
τS

∑ ct

t =1

Z
w

τS

∏

p0 (w)(k,j)∈TtE

wk,j dw = ∑ ct ut = Zx

(11.1)

t =1

Note that the prior distribution for a sum node is a Dirichlet distribution. In this case we can compute a
closed form expression for ut as:
ut =

∏

Z

(k,j)∈TtE wk∏

p0 (wk )wk,j dwk =(k,j)∈TtE

E p0 (wk ) [wk,j ] =∏(k,j)∈TtE

αk,j∑ j0 αk,j0(11.2)

More generally, let f (·) be a function applied to each edge weight in an SPN. We use the notation
M p ( f ) to mean the moment of function f evaluated under distribution p. We are interested in computing
M p ( f ) where p = p(w | x), which we call the one-step update posterior distribution. More specifically,for each edge weight wk,j , we would like to compute the following quantity:
1 τSct
M p ( f (wk,j )) =f (wk,j ) p(w | x) dw =
Zx t∑
w
=1
Z

Z
w

p0 (w) f (wk,j )∏(k0 ,j0 )∈TtE

wk0 ,j0 dw(11.3)

We note that (11.3) is not trivial to compute as it involves τS = Ω(2 H (S) ) terms. Furthermore, in order to
conduct moment matching, we need to compute the above moment for each edge (k, j) from a sum node. A
naive computation will lead to a total time complexity Ω(|S| · 2 H (S) ). A linear time algorithm to compute
these moments has been designed by Rashwan et al. (2016b) when the underlying structure of S is a tree.
This algorithm recursively computes the moments in a top-down fashion along the tree. However, thisalgorithm breaks down when the graph is a DAG.
In what follows we will present a O(|S|) time and space algorithm that is able to compute all the
moments simultaneously for general SPNs with DAG structures. We will first show a linear time reduction
from the moment computation in (11.3) to a joint inference problem in S , and then proceed to use thedifferential trick to efficiently compute (11.3) for each edge in the graph. The final component will bea dynamic program to simultaneously compute (11.3) for all edges wk,j in the graph by trading constantfactors of space complexity to reduce time complexity.

11.3

Linear Time Reduction from Moment Computation to Joint Inference

Let us first compute (11.3) for a fixed edge (k, j). Our strategy is to partition all the induced trees basedon whether they contain the tree edge (k, j) or not. Define T F = {Tt | (k, j) 6∈ Tt , t ∈ [τS ]} andTT = {Tt | (k, j) ∈ Tt , t ∈ [τS ]}. In other words, T F corresponds to the set of trees that do not containedge (k, j) and T T corresponds to the set of trees that contain edge (k, j). Then,
M p ( f (wk,j )) =1ct
Zx Tt∑
∈T

Z
w

T

1
+
ct
Zx Tt∑∈TFZw

p0 (w) f (wk,j )∏(k0 ,j0 )∈T

p0 (w) f (wk,j )183∏

wk0 ,j0 dw
tE(k0 ,j0 )∈TtE

wk0 ,j0 dw(11.4)

For the induced trees that contain edge (k, j), we have1
ct
Zx Tt∑∈TZw

T

p0 (w) f (wk,j )∏0 0(k ,j )∈TtE

wk0 ,j0 dw =1
0 ( f ( wk,j ))ct ut M p0,k
Zx Tt∑∈T(11.5)

T

0 is the one-step update posterior Dirichlet distribution for sum node k after absorbing the term
where p0,kwk,j . Similarly, for the induced trees that do not contain the edge (k, j):1ct
Zx Tt∑∈TFZw

p0 (w) f (wk,j )∏0 0(k ,j )∈TtE

wk0 ,j0 dw =1
ct ut M p0,k ( f (wk,j ))Zx Tt∑∈T(11.6)

F

where p0,k is the prior Dirichlet distribution for sum node k. The above equation holds by changing theorder of integration and realize that since (k, j) is not in tree Tt , ∏(k0 ,j0 )∈TtE wk0 ,j0 does not contain the term
0 ( f ( wk,j )) are independent of specific induced trees, so wewk,j . Note that both M p0,k ( f (wk,j )) and M p0,k
can combine the above two parts to express M p ( f (wk,j )) as:!
!
1
1
0 ( f ( wk,j ))(11.7)M p ( f (wk,j )) =ct ut M p0,k ( f (wk,j )) +ct ut M p0,k
Zx Tt∑Zx Tt∑∈T∈T
F

T

From (11.1) we have
1 τS
ct ut = 1
Zx t∑
=1

and

τS

∑ ct ut = ∑ ct ut + ∑ ct ut

t =1

Tt ∈T T

Tt ∈T F0 ( f ). In other words, sinceThis implies that M p ( f ) is in fact a convex combination of M p0,k ( f ) and M p0,k0 ( f ) can be computed in closed form for each edge ( k, j ), so in order to computeboth M p0,k ( f ) and M p0,k(11.3), we only need to be able to compute the two coefficients efficiently. Recall that for each induced
S
tree Tt , we have the expression of ut as ut = ∏(k,j)∈TtE αk,j / ∑ j0 αk,j0 . So the term ∑τt=
1 ct ut can thus beexpressed as:
τS
τS
n
αk,j
c
u
=
(11.8)∑ t t ∑ ∏ ∑ 0 αk,j0 ∏ pt (xi )j
t =1
t=1 (k,j)∈T
i =1tE

The key observation that allows us to find the linear time reduction lies in the fact that (11.8) shares exactly
the same functional form as the network polynomial, with the only difference being the specification ofedge weights in the network. The following lemma formalizes our argument.
S
Lemma 11.3.1. ∑τt=
1 ct ut can be computed in O (|S|) time and space in a bottom-up evaluation of S .
Proof. Compare the form of (11.8) to the network polynomial:
τSp(x | w) = Vroot (x | w) = ∑∏

t=1 (k,j)∈TtEnwk,j ∏ pt ( xi )(11.9)

i =1

Clearly (11.8) and (11.9) share the same functional form and the only difference lies in that the edge weightused in (11.8) is given by αk,j / ∑ j0 αk,j0 while the edge weight used in (11.9) is given by wk,j , both of which
are constrained to be positive and locally normalized. This means that in order to compute the value of(11.8), we can replace all the edge weights wk,j with αk,j / ∑ j0 αk,j0 , and a bottom-up pass evaluation of S
will give us the desired result at the root of the network. The linear time and space complexity then follows
from the linear time and space inference complexity of SPNs.

In other words, we reduce the original moment computation problem for edge (k, j) to a joint inference
problem in S with a set of weights determined by α .
184

11.4

Efficient Polynomial Evaluation by Differentiation

To evaluate (11.7), we also need to compute ∑Tt ∈TT ct ut efficiently, where the sum is over a subset of
induced trees that contain edge (k, j). Again, due to the exponential lower bound on the number of uniqueinduced trees, a brute force computation is infeasible in the worst case. The key observation is that we canS
use the differential trick to solve this problem by realizing the fact that Zx = ∑τt=
1 ct ut is a multilinear
function in αk,j / ∑ j0 αk,j0 , ∀k, j and it has a tractable circuit representation since it shares the same network
structure with S .
SLemma 11.4.1. ∑Tt ∈TT ct ut = wk,j ∂ ∑τt=
1 ct ut /∂wk,j , and it can be computed in O (|S|) time andspace in a top-down differentiation of S .
Proof. Define wk,j , αk,j / ∑ j0 αk,j0 , then∑ ct ut = ∑Tt ∈T T∏0 0n

Tt ∈T T (k ,j )∈TtE= wk,j ∑wk0 ,j0 ∏ pt ( xi )
i =1

n

∏
0 0

Tt ∈T T (k ,j )∈TtE(k0 ,j0 )6=(k,j)= wk,jwk0 ,j0 ∏ pt ( xi ) + 0 · ∑ ct ut
i =1

Tt ∈T F∂∂ct ut +
ct ut∑
∂wk,j Tt ∈T∂wk,j Tt∑
∈T
T

F

!

= wk,j∂ τS
ct ut∂wk,j t∑=1!

where the second equality is by the observation that the network polynomial is a multilinear function of
wk,j and the third equality holds because T F is the set of trees that do not contain wk,j . The last equality
follows by simple algebraic transformations. In summary, the above lemma holds because of the fact thatdifferential operator applied to a multilinear function acts as a selector for all the monomials containingS
a specific variable. Hence, ∑Tt ∈TF ct ut = ∑τt=
1 ct ut − ∑Tt ∈T T ct ut can also be computed. To show thelinear time and space complexity, recall that the differentiation w.r.t.wk,j can be efficiently computed byS
back-propagation in a top-down pass of S once we have computed ∑τt=
1 ct ut in a bottom-up pass of S . 
Remark The fact that we can compute the differentiation w.r.t. wk,j using the original circuit without
expanding it underlies many recent advances in the algorithmic design of SPNs. Zhao et al. (2016a,b) used
the above differential trick to design linear time collapsed variational algorithm and the concave-convex
produce for parameter estimation in SPNs. A different but related approach, where the differential operator
is taken w.r.t. input indicators, not model parameters, is applied in computing the marginal probability
in Bayesian networks and junction trees (Darwiche, 2003; Park and Darwiche, 2004). We finish this
discussion by concluding that when the polynomial computed by the network is a multilinear functionin terms of model parameters or input indicators (such as in SPNs), then the differential operator w.r.t. avariable can be used as an efficient way to compute the sum of the subset of monomials that contain thespecific variable.

11.5

Dynamic Programming: from Quadratic to Linear

S
Define Dk (x | w) = ∂Vroot (x | w)/∂Vk (x | w). Then the differentiation term ∂ ∑τt=
1 ct ut /∂wk,j inLemma 11.4.1 can be computed via back-propagation in a top-down pass of the network as follows:S∂ ∑τt=∂Vroot (x | w) ∂Vk (x | w)
1 ct ut== Dk (x | w)Vj (x | w)
∂wk,j∂Vk (x | w)
∂wk,j

185

(11.10)Let λk,j = wk,j Vj (x | w) Dk (x | w) /Vroot (x | w) and f k,j = f (wk,j ), then the final formula forcomputing the moment of edge weight wk,j under the one-step update posterior p is given byM p ( f k,j ) = 1 − λk,j M p0 ( f k,j ) + λk,j M p00 ( f k,j )(11.11)Corollary 11.5.1. For each edges (k, j), (11.7) can be computed in O(|S|) time and space.
The corollary simply follows from Lemma 11.3.1 and Lemma 11.4.1 with the assumption that the
moments under the prior has closed form solution. By definition, we also have λk,j = ∑Tt ∈TT ct ut /Zx ,hence 0 ≤ λk,j ≤ 1, ∀(k, j). This formula shows that λk,j computes the ratio of all the induced trees that
contain edge (k, j) to the network. Roughly speaking, this measures how important the contribution of a
specific edge is to the whole network polynomial. As a result, we can interpret (11.11) as follows: the more
important the edge is, the more portion of the moment comes from the new observation.
CCCP for SPNs was originally derived using a sequential convex relaxation technique, where in each
iteration a concave surrogate function is constructed and optimized. The key update in each iteration of
0 ∝ w V (x | w) D (x | w) /V (x | w), where
CCCP (Zhao et al. (2016b), (7)) is given as follows: wk,j
root
k,j j
k
the R.H.S. is exactly the same as λk,j defined above. From this perspective, CCCP can also be understoodas implicitly applying the differential trick to compute λk,j , i.e., the relative importance of edge (k, j), andthen take updates according to this importance measure.
In order to compute the moments of all the edge weights wk,j , a naive computation would scale
O(|S|2 ) because there are O(|S|) edges in the graph and from Cor. 11.5.1 each such computation takes
O(|S|) time. The key observation that allows us to further reduce the complexity to linear comes fromthe structure of λk,j : λk,j only depends on three terms, i.e., the forward evaluation value Vj (x | w), thebackward differentiation value Dk (x | w) and the original weight of the edge wk,j . This implies that we
can use dynamic programming to cache both Vj (x | w) and Dk (x | w) in a bottom-up evaluation pass
and a top-down differentiation pass, respectively. At a high level, we trade off a constant factor in spacecomplexity (using two additional copies of the network) to reduce the quadratic time complexity to linear.
Theorem 11.5.1. For all edges (k, j), (11.7) can be computed in O(|S|) time and space.
Proof. During the bottom-up evaluation pass, in order to compute the value Vroot (x; w) at the root of S ,we will also obtain all the values Vj (x; w) at each node j in the graph. So instead of discarding theseintermediate Vj (x; w), we cache them by allocating additional space at each node j. So after one bottom-up
evaluation pass of the network, we will also have all the Vj (x; w) for each node j, at the cost of one
additional copy of the network. Similarly, during the top-down differentiation pass of the network, becauseof the chain rule, we will also obtain all the intermediate Dk (x; w) at each node k. Again, we cache them.
Once we have both Vj (x; w) and Dk (x; w) for each edge (k, j), from (11.11), we can get all the moments
for all the weighted edges in S simultaneously. Because the whole process only requires one bottom-up
evaluation pass and one top-down differentiation pass of S , the time complexity is 2|S|. Since we use two
additional copies of S , the space complexity is 3|S|.

We summarize the linear time algorithm for moment computation in Alg. 4.

11.6

Applications in Online Moment Matching

In this section we use Alg. 4 as a sub-routine to develop a new Bayesian online learning algorithm for SPNs
based on assumed density filtering (Sorenson and Stubberud, 1968). To do so, we find an approximate
distribution by minimizing the KL divergence between the one-step update posterior and the approximate
186

Algorithm 4 Linear Time Exact Moment Computation
Input: Prior p0 (w | α ), moment f , SPN S and input x.
Output: M p ( f (wk,j )), ∀(k, j).
1: wk,j ← αk,j / ∑ j0 αk,j0 , ∀(k, j ).
2: Compute M p0 ( f (wk,j )) and M p0 ( f (wk,j )), ∀(k, j ).
0
3: Bottom-up evaluation pass of S with input x. Record Vk (x; w) at each node k.
4: Top-down differentiation pass of S with input x. Record Dk (x; w) at each node k.

5: Compute the exact moment for each (k, j ): M p ( f k,j ) = 1 − λk,j M p0 ( f k,j ) + λk,j M p0 ( f k,j ).
0
distribution. Let P = {q | q = ∏mk =1 Dir( wk ; β k )}, i.e., P is the space of product of Dirichlet densities
that are decomposable over all the sum nodes in S . Note that since p0 (w; α ) is fully decomposable, wehave p0 ∈ P . One natural choice is to try to find an approximate distribution q ∈ P such that q minimizes
the KL-divergence between p(w|x) and q, i.e.,p̂ = arg min DKL ( p(w | x) k q).
q∈P

It is not hard to show that when q is an exponential family distribution, which is the case in our setting, theminimization problem corresponds to solving the following moment matching equation:
E p(w|x) [ T (wk )] = Eq(w) [ T (wk )](11.12)where T (wk ) is the vector of sufficient statistics of q(wk ). When q(·) is a Dirichlet, we have T (wk ) =log wk , where the log is understood to be taken elementwise. This principle of finding an approximate
distribution is also known as reverse information projection in the literature of information theory (?). As acomparison, information projection corresponds to minimizing DKL (q k p(w | x)) within the same familyof distributions q ∈ P . By utilizing our efficient linear time algorithm for exact moment computation, we
propose a Bayesian online learning algorithm for SPNs based on the above moment matching principle,
called assumed density filtering (ADF). The pseudocode is shown in Alg. 5.
In the ADF algorithm, for each edge wk,j the above moment matching equation amounts to solving thefollowing equation:ψ( β k,j ) − ψ(∑ β k,j0 ) = E p(w|x) [log wk,j ]j0where ψ(·) is the digamma function. This is a system of nonlinear equations about β where the R.H.S. of
the above equation can be computed using Alg. 4 in O(|S|) time for all the edges (k, j). To efficiently
solve it, we take exp(·) at both sides of the equation and approximate the L.H.S. using the fact thatexp(ψ( β k,j )) ≈ β k,j − 12 for β k,j > 1. Expanding the R.H.S. of the above equation using the identity from
(11.11), we have:!

exp ψ( β k,j ) − ψ(∑ β w,j0 ) = exp E p(w|x) [log wk,j ]j0⇔

β k,j − 12

∑ j0 β k,j0 − 12=

αk,j − 21!(1−λk,j )∑ j0 αk,j0 − 12×

αk,j + 12∑ j0 αk,j0 + 12

!λk,j(11.13)Note that (αk,j − 0.5)/(∑ j0 αk,j0 − 0.5) is approximately the mean of the prior Dirichlet under p0 and(αk,j + 0.5)/(∑ j0 αk,j0 + 0.5) is approximately the mean of p00 , where p00 is the posterior by adding one
187

Algorithm 5 Assumed Density Filtering for SPN
Input: Prior p0 (w | α ), SPN S and input {xi }i∞=1 .
1: p (w) ← p0 (w | α )2: for i = 1, . . . , ∞ do3:
Apply Alg. 4 to compute E p(w|xi ) [log wk,j ] for all edges (k, j).
4:
Find p̂ = arg minq∈P DKL ( p(w | xi ) k q) by solving the moment matching equation (11.12).
5:p(w) ← p̂(w).
6: end forpseudo-count to wk,j . So (11.13) is essentially finding a posterior with hyperparameter β such that theposterior mean is approximately the weighted geometric mean of the means given by p0 and p00 , weighted
by λk,j .
Instead of matching the moments given by the sufficient statistics, also known as the natural moments,
BMM tries to find an approximate distribution q by matching the first order moments, i.e., the mean of
the prior and the one-step update posterior. Using the same notation, we want q to match the following
equation:
Eq (w) [ w k ] = E p (w|x) [ w k ]⇔αk,j + 1
β k,jαk,j= (1 − λk,j )+ λk,j∑ j0 β k,j0
∑ j0 αk,j0∑ j0 αk,j0 + 1(11.14)

Again, we can interpret the above equation as to find the posterior hyperparameter β such that the posteriormean is given by the weighted arithmetic mean of the means given by p0 and p00 , weighted by λk,j . Noticethat due to the normalization constraint, we cannot solve for β directly from the above equations, and inorder to solve for β we will need one more equation to be added into the system. However, from line 1 ofAlg. 4, what we need in the next iteration of the algorithm is not β, but only its normalized version. So we
can get rid of the additional equation and use (11.14) as the update formula directly in our algorithm.
Using Alg. 4 as a sub-routine, both ADF and BMM enjoy linear running time, sharing the same orderof time complexity as CCCP. However, since CCCP directly optimizes over the data log-likelihood, inpractice we observe that CCCP often outperforms ADF and BMM in log-likelihood scores.

11.7

Conclusion

In this chapter we propose an optimal linear time algorithm to efficiently compute the moments of model
parameters in SPNs under online settings. The key techniques used in the design of our algorithm include
the liner time reduction from moment computation to joint inference, the differential trick that is able
to efficiently evaluate a multilinear function, and the dynamic programming to further reduce redundant
computations. Using the proposed algorithm as a sub-routine, we are able to improve the time complexity of
BMM from quadratic to linear on general SPNs with DAG structures. We also use the proposed algorithm
as a sub-routine to design a new online algorithm, ADF. As a future direction, we hope to apply the
proposed moment computation algorithm in the design of efficient structure learning algorithms for SPNs.
We also expect that the analysis techniques we develop might find other uses for learning SPNs.

188

Part III

Conclusion

189

Chapter 12Conclusion and Future WorkMy thesis research contributes to two main themes in artificial intelligence: invariant representation learningand tractable probabilistic reasoning. Moving forward, I will continue working along these two themes
towards the long-term goal of building a unified framework that provides a common semantics for learningand reasoning, and also branch out to explore applications related to algorithmic fairness and multilingual
natural language understanding.

12.1

Information Analysis of Invariant Representation Learning

Invariant representation learning has abundant applications in domain adaptation, algorithmic fairness andprivacy-preservation under attribute-inference attacks. Recently, the idea of learning language-invariant
representations has also been actively explored in neural machine translation in order to enable knowledgetransfer from high-resource language pairs to low-resource language pairs. Despite its broad applications,many fundamental questions remain open. Our work (Zhao and Gordon, 2019; Zhao et al., 2019b,e) has
shown that utility has lower bound if exact invariance is attained. However, it is not clear what is the generalform of tradeoff between utility and invariance. In particular, under a budget for approximate invariance,
what is the maximum utility we can hope to achieve? This question calls for a characterization of the Pareto
frontier between utility and invariance. In my future research, I want to apply tools from information theory
to provide a precise answer to the above question, and to use the theory of invariant representation learning
to design Pareto-optimal algorithms in the above mentioned applications.

12.2

Efficient Structure Learning of Probabilistic Circuits

SPNs distinguish themselves from other probabilistic graphical models, including both Bayesian Networks
and Markov Networks, by the fact that reasoning can be performed exactly in linear time with respect tothe size of the network. Similar to traditional graphical models, there are two main problems when learning
SPNs: structure learning and parameter learning. In structure learning the goal is to infer the structure of
SPNs directly from the data. As a direction for future work, I am highly interested in developing principled
structure learning algorithms that can produce compact SPNs with directed acyclic structures. To date, moststructure learning algorithms can only produce SPNs with tree structures, and they are based on various
kinds of heuristics to generate SPNs from data without performance guarantees. In light of the existing
limitations, it is favorable to come up with an algorithm that is able to produce SPNs with directed acyclic
structures to fully exploit their representational power. I am also excited about extending the domain of
SPNs from discrete/continuous data to more structured ones, e.g., string, graph, etc., and apply them to191

problems that require the capability of reasoning, including question answering, reading comprehension
and statistical relation learning over graphs.

12.3

Unified Framework for Learning and Reasoning

I believe the holy grail of artificial intelligence is to build intelligent agents that have the ability to learn
from the experience as well as to reason from what has been learned. In order to achieve this goal, we
need to have a robust and probabilistic framework to unify learning and reasoning. Such framework is
drastically different from the traditional one where symbolic representations are used to construct theknowledge base and first-order logic is used to build the inference engine. Instead, as shown in Figure 1.1,
I propose to use invariant representation that maps real-world objects to their corresponding algebraic
representations to serve as the foundation of knowledge base, and to use tractable probabilistic inferencemachine, e.g., Sum-Product networks, to act as the inference engine. Compared with the classic symbolicand logic-based framework, such new framework is inherently probabilistic and hence can handle theubiquitous uncertainty. In particular, representations that are invariant to the change in the environment can
provide us the robustness against various noise and nuisance factors in real-world, and the tractability ofexact probabilistic inference machine can further allow us to efficiently deal with the uncertainty existingin real-world logic deduction.
Of course, the goal is challenging. First, in order to learn invariant representations, one needs toexplicitly specify a set of nuisance factors that the representations should be invariant to. Due to thecomplexity of the real-world, such supervision is not always available or well-defined. Furthermore, when
the invariant representations contain some internal structures, e.g., the hierarchical structure of sentence
representations, it is not clear how to combine such structured data with existing tractable probabilistic
inference machines. These problems are both fascinating and challenging, and I believe that being able
to solve them could take us a significant step towards the goal of a unified framework for learning andreasoning.

192

Bibliography
Tameem Adel, Han Zhao, and Alexander Wong. Unsupervised domain adaptation with a relaxed covariate
shift assumption. In AAAI, pages 1691–1697, 2017. 1.2.1, 1.5, 3.1, 4.1
Tameem Adel, Isabel Valera, Zoubin Ghahramani, and Adrian Weller. One-network adversarial fairness. In
33rd AAAI Conference on Artificial Intelligence, 2019a. 6.3.2, 6.5, 7.2, 7.5
Tameem Adel, Han Zhao, and Richard E Turner. Continual learning with adaptive weights (claw). In
International Conference on Learning Representations, 2019b. 1.5
Alekh Agarwal, Alina Beygelzimer, Miroslav Dudik, John Langford, and Hanna Wallach. A reductions
approach to fair classification. In International Conference on Machine Learning, pages 60–69, 2018.
7.5
Roee Aharoni, Melvin Johnson, and Orhan Firat. Massively multilingual neural machine translation. In
Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational
Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 3874–3884,
Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. doi: 10.18653/v1/
N19-1388. 8.4
Hana Ajakan, Pascal Germain, Hugo Larochelle, François Laviolette, and Mario Marchand. Domainadversarial neural networks. arXiv preprint arXiv:1412.4446, 2014. 3.1, 3.6, 4.1, 4.2.2, 4.3
Syed Mumtaz Ali and Samuel D Silvey. A general class of coefficients of divergence of one distribution
from another. Journal of the Royal Statistical Society: Series B (Methodological), 28(1):131–142, 1966.
6.2
Martin Anthony and Peter L Bartlett. Neural network learning: Theoretical foundations. cambridge
university press, 2009. 3.7.3, 8.3.2
Pablo Arbelaez, Michael Maire, Charless Fowlkes, and Jitendra Malik. Contour detection and hierarchicalimage segmentation. IEEE transactions on pattern analysis and machine intelligence, 33(5):898–916,
2011. 3.B
Naveen Arivazhagan, Ankur Bapna, Orhan Firat, Dmitry Lepikhin, Melvin Johnson, Maxim Krikun,
Mia Xu Chen, Yuan Cao, George Foster, Colin Cherry, et al. Massively multilingual neural machinetranslation in the wild: Findings and challenges. arXiv preprint arXiv:1907.05019, 2019. 8.1, 8.4
Martin Arjovsky, Léon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk minimization, 2019.
URL http://arxiv.org/abs/1907.02893. cite arxiv:1907.02893. 5.1
Stefan Arnborg, Derek G Corneil, and Andrzej Proskurowski. Complexity of finding embeddings in ak-tree.
SIAM Journal on Algebraic Discrete Methods, 8(2):277–284, 1987. 2.4
Mikel Artetxe and Holger Schwenk. Massively multilingual sentence embeddings for zero-shot crosslingual transfer and beyond. Transactions of the Association for Computational Linguistics, 7:597–610,
193

2019. 8.1, 8.2.2, 8.4
Mikel Artetxe, Gorka Labaka, and Eneko Agirre. Learning bilingual word embeddings with (almost) nobilingual data. In Proceedings of ACL 2017, pages 451–462, 2017. 8.4
Kamyar Azizzadenesheli, Anqi Liu, Fanny Yang, and Animashree Anandkumar. Regularized learning fordomain adaptation under label shifts. 2018. 4.3
Philip Bachman, R. Devon Hjelm, and William Buchwalter. Learning representations by maximizing
mutual information across views. CoRR, abs/1906.00910, 2019. 5.1
R Iris Bahar, Erica A Frohm, Charles M Gaona, Gary D Hachtel, Enrico Macii, Abelardo Pardo, and Fabio
Somenzi. Algebraic decision diagrams and their applications. Formal methods in system design, 10(2-3):
171–206, 1997. 2.4
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly
learning to align and translate, 2014. URL http://arxiv.org/abs/1409.0473. cite
arxiv:1409.0473Comment: Accepted at ICLR 2015 as oral presentation. 8.4
Mahsa Baktashmotlagh, Mehrtash T Harandi, Brian C Lovell, and Mathieu Salzmann. Unsupervised
domain adaptation by domain invariant projection. In Proceedings of the IEEE International Conference
on Computer Vision, pages 769–776, 2013. 3.6
Solon Barocas and Andrew D Selbst. Big data’s disparate impact. Calif. L. Rev., 104:671, 2016. 6.1
Solon Barocas, Moritz Hardt, and Arvind Narayanan. Fairness in machine learning. NIPS Tutorial, 2017.
7.1, 7.3.2, 7.3.3
Peter L Bartlett and Shahar Mendelson. Rademacher and gaussian complexities: Risk bounds and structural
results. Journal of Machine Learning Research, 3(Nov):463–482, 2002. 2.6.1
PeterL Bartlett. Thesamplecomplexityofp atternclassification withneuralnetworks: Thesizeoftheweightsismo reimportantthan thesizeofthenetwork. IEEETrans. Inf. Theory, 44(2), 1998. 8.3.3
Carlos J Becker, Christos M Christoudias, and Pascal Fua. Non-linear domain adaptation with boosting. In
Advances in Neural Information Processing Systems, pages 485–493, 2013. 3.1, 3.6, 4.1
Shai Ben-David, Nadav Eiron, and Philip M Long. On the difficulty of approximately maximizing
agreements. Journal of Computer and System Sciences, 66(3):496–514, 2003. 7.3.4
Shai Ben-David, John Blitzer, Koby Crammer, Fernando Pereira, et al. Analysis of representations fordomain adaptation. Advances in neural information processing systems, 19:137, 2007. 2.2, 2.2, 3.2, 3.2,
3.4, 3.5.3, 3.6, 4.2, 1, 4.2.2, 4.2.1, 4.3, 5.2
Shai Ben-David, John Blitzer, Koby Crammer, Alex Kulesza, Fernando Pereira, and Jennifer Wortman
Vaughan. A theory of learning from different domains. Machine learning, 79(1-2):151–175, 2010. 2.2,
3.1, 3.2, 3.3, 3.6, 3.7.3, 4.1, 4.2, 4.2.2, 4.3, 5.2, 5.2, 5.3.2
Richard Berk, Hoda Heidari, Shahin Jabbari, Michael Kearns, and Aaron Roth. Fairness in criminal justicerisk assessments: The state of the art. Sociological Methods & Research, page 0049124118782533,
2018. 6.1
Alex Beutel, Jilin Chen, Zhe Zhao, and Ed H Chi. Data decisions and theoretical implications whenadversarially learning fair representations. arXiv preprint arXiv:1707.00075, 2017. 6.1, 6.3.2, 6.4, 6.5,
7.1, 7.5
David M Blei, Michael I Jordan, and John W Paisley. Variational Bayesian Inference with Stochastic
Search. In ICML, 2012. 1.3.2, 10.3

194

John Blitzer, Koby Crammer, Alex Kulesza, Fernando Pereira, and Jennifer Wortman. Learning bounds fordomain adaptation. In Advances in neural information processing systems, pages 129–136, 2008. 2.2,
2.2, 2.2.1, 3.1, 3.2, 3.2, 3.2.1, 3.3, 3.6, 4.2
George Boole. The mathematical analysis of logic. Philosophical Library, 1847. 2.4
Konstantinos Bousmalis, George Trigeorgis, Nathan Silberman, Dilip Krishnan, and Dumitru Erhan.
Domain separation networks. In Advances in Neural Information Processing Systems, pages 343–351,
2016. 3.6, 4.4.3, 5.3.1
Stephen Boyd, Seung-Jean Kim, Lieven Vandenberghe, and Arash Hassibi. A tutorial on geometricprogramming. Optimization and Engineering, 8(1):67–127, 2007. 2.5, 2.5, 9.2, 10.3, 10.3
Jop Briët and Peter Harremoës. Properties of classical and quantum jensen-shannon divergence. Phys. Rev.
A, 79:052311, May 2009. doi: 10.1103/PhysRevA.79.052311. URL https://link.aps.org/
doi/10.1103/PhysRevA.79.052311. 5.5.8
Toon Calders and Sicco Verwer. Three naive bayes approaches for discrimination-free classification. Data
Mining and Knowledge Discovery, 21(2):277–292, 2010. 7.2
Toon Calders, Faisal Kamiran, and Mykola Pechenizkiy. Building classifiers with independency constraints.
In 2009 IEEE International Conference on Data Mining Workshops, pages 13–18. IEEE, 2009. 1.2.2,
2.3, 6.1, 6.2, 6.3, 7.1, 7.2
Hei Chan and Adnan Darwiche. On the robustness of most probable explanations. In In Proceedings of theTwenty Second Conference on Uncertainty in Artificial Intelligence. 9.1
Minmin Chen, Zhixiang Xu, Kilian Weinberger, and Fei Sha. Marginalized denoising autoencoders fordomain adaptation. arXiv preprint arXiv:1206.4683, 2012. 3.5, 3.5.1, 3.6, 1, 3.A
Xilun Chen and Claire Cardie. Multinomial adversarial networks for multi-domain text classification. In
Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational
Linguistics: Human Language Technologies, volume 1, 2018. 1.1
Mung Chiang. Geometric programming for communication systems. Now Publishers Inc, 2005. 2.5, 9.2,
10.3
Kyunghyun Cho, Bart Van Merriënboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger
Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder-decoder for statisticalmachine translation. arXiv preprint arXiv:1406.1078, 2014. 8.3
Arthur Choi and Adnan Darwiche. On relaxing determinism in arithmetic circuits. In International
Conference on Machine Learning, pages 825–833, 2017. 2.4
Alexandra Chouldechova. Fair prediction with disparate impact: A study of bias in recidivism prediction
instruments. Big data, 5(2):153–163, 2017. 2.3, 2.3, 2.3.1, 6.2, 6.2, 6.2.1, 7.2, 7.5
Alexandra Chouldechova and Aaron Roth. The frontiers of fairness in machine learning. arXiv preprint
arXiv:1810.08810, 2018. 7.1
Trevor Cohn and Mirella Lapata. Machine translation by triangulation: Making effective use of multiparallel corpora. In Proceedings of the 45th Annual Meeting of the Association of Computational
Linguistics, pages 728–735, Prague, Czech Republic, June 2007. Association for Computational Linguistics. 8.4
Remi Tachet des Combes, Han Zhao, Yu-Xiang Wang, and Geoff Gordon. Domain adaptation withconditional distribution matching and generalized label shift. arXiv preprint arXiv:2003.04475, 2020.
8.4
195Alexis Conneau, Guillaume Lample, Marc’Aurelio Ranzato, Ludovic Denoyer, and Hervé Jégou. Wordtranslation without parallel data. In Proceedings of the 6th International Conference on Learning
Representations (ICLR 2018), 2018a. 8.4
Alexis Conneau, Ruty Rinott, Guillaume Lample, Adina Williams, Samuel Bowman, Holger Schwenk, andVeselin Stoyanov. XNLI: Evaluating cross-lingual sentence representations. In Proceedings of the 2018
Conference on Empirical Methods in Natural Language Processing, pages 2475–2485, Brussels, Belgium,
October-November 2018b. Association for Computational Linguistics. doi: 10.18653/v1/D18-1269. 8.1
Alexis Conneau, Kartikay Khandelwal, Naman Goyal, Vishrav Chaudhary, Guillaume Wenzek, Francisco
Guzmán, Edouard Grave, Myle Ott, Luke Zettlemoyer, and Veselin Stoyanov. Unsupervised cross-lingual
representation learning at scale. arXiv preprint arXiv:1911.02116, 2019. 8.4
Sam Corbett-Davies and Sharad Goel. The measure and mismeasure of fairness: A critical review of fairmachine learning. arXiv preprint arXiv:1808.00023, 2018. 7.1
Corinna Cortes and Mehryar Mohri. Domain adaptation and sample bias correction theory and algorithm
for regression. Theoretical Computer Science, 519:103–126, 2014. 2.2, 3.2, 3.6, 4.2.2
Corinna Cortes, Mehryar Mohri, Michael Riley, and Afshin Rostamizadeh. Sample selection bias correction
theory. In International Conference on Algorithmic Learning Theory, pages 38–53. Springer, 2008. 2.2,
3.2, 3.6, 4.2.2
Amanda Coston, Alexandra Chouldechova, and Edward H Kennedy. Counterfactual risk assessments,
evaluation, and fairness. arXiv preprint arXiv:1909.00066, 2019. 7.5
Nicolas Courty, Rémi Flamary, Amaury Habrard, and Alain Rakotomamonjy. Joint distribution optimaltransportation for domain adaptation. In Advances in Neural Information Processing Systems, pages
3730–3739, 2017a. 4.3
Nicolas Courty, Rémi Flamary, Devis Tuia, and Alain Rakotomamonjy. Optimal transport for domain
adaptation. IEEE transactions on pattern analysis and machine intelligence, 39(9):1853–1865, 2017b.
4.3
Elliot Creager, David Madras, Joern-Henrik Jacobsen, Marissa Weis, Kevin Swersky, Toniann Pitassi, andRichard Zemel. Flexibly fair representation learning by disentanglement. In International Conference
on Machine Learning, pages 1436–1445, 2019. 7.5
Imre Csiszár. Eine informationstheoretische ungleichung und ihre anwendung auf beweis der ergodizitaet
von markoffschen ketten. Magyer Tud. Akad. Mat. Kutato Int. Koezl., 8:85–108, 1964. 6.2
Imre Csiszár. Information-type measures of difference of probability distributions and indirect observation.
studia scientiarum Mathematicarum Hungarica, 2:229–318, 1967. 6.2
Adnan Darwiche. A differential approach to inference in Bayesian networks. volume 50, pages 280–305.
ACM, 2003. 1.3.3, 11.4
Adrià De Gispert and Jose B Marino. Catalan-english statistical machine translation without parallel corpus:
bridging through spanish. Citeseer. 8.4
Aaron Dennis and Dan Ventura. Greedy structure search for sum-product networks. In International Joint
Conference on Artificial Intelligence, volume 24, 2015. 9.1
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep
bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of
the North American Chapter of the Association for Computational Linguistics: Human Language
Technologies, Volume 1 (Long and Short Papers), pages 4171–4186, Minneapolis, Minnesota, June 2019.
196

Association for Computational Linguistics. doi: 10.18653/v1/N19-1423. 8.4
Dua Dheeru and Efi Karra Taniskidou. UCI machine learning repository, 2017. URL http://archive.
ics.uci.edu/ml. 5.4.2, 5.A.1
William Dieterich, Christina Mendoza, and Tim Brennan. Compas risk scales: Demonstrating accuracy
equity and predictive parity. Northpoint Inc, 2016. 7.1, 7.4.1
Jeff Donahue, Yangqing Jia, Oriol Vinyals, Judy Hoffman, Ning Zhang, Eric Tzeng, and Trevor Darrell.
Decaf: A deep convolutional activation feature for generic visual recognition. In Icml, volume 32, pages
647–655, 2014. 3.6
Daxiang Dong, Hua Wu, Wei He, Dianhai Yu, and Haifeng Wang. Multi-task learning for multiple
language translation. In Proceedings of the 53rd Annual Meeting of the Association for Computational
Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long
Papers), pages 1723–1732, Beijing, China, July 2015. Association for Computational Linguistics. doi:
10.3115/v1/P15-1166. 8.4
Dheeru Dua and Casey Graff. UCI machine learning repository, 2017. URL http://archive.ics.
uci.edu/ml. 7.4.1
Cynthia Dwork, Moritz Hardt, Toniann Pitassi, Omer Reingold, and Richard Zemel. Fairness throughawareness. In Proceedings of the 3rd innovations in theoretical computer science conference, pages
214–226. ACM, 2012. 6.1, 6.5, 7.1, 7.5, 7.7
Harrison Edwards and Amos Storkey. Censoring representations with an adversary. arXiv preprint
arXiv:1511.05897, 2015. 2.3, 6.1, 6.2, 6.3.2, 6.5, 7.1, 7.2, 7.4.1, 7.5
Dominik Maria Endres and Johannes E Schindelin. A new metric for probability distributions. IEEE
Transactions on Information theory, 2003. 2.6, 4.4.3, 5.5.3
Theodoros Evgeniou and Massimiliano Pontil. Regularized multi–task learning. In Proceedings of thetenth ACM SIGKDD international conference on Knowledge discovery and data mining, pages 109–117.
ACM, 2004. 3.6
Manaal Faruqui and Chris Dyer. Improving vector space word representations using multilingual correlation.
In Proceedings of the 14th Conference of the European Chapter of the Association for Computational
Linguistics, pages 462–471, Gothenburg, Sweden, April 2014. Association for Computational Linguistics.
doi: 10.3115/v1/E14-1049. 8.4
Michael Feldman, Sorelle A Friedler, John Moeller, Carlos Scheidegger, and Suresh Venkatasubramanian.
Certifying and removing disparate impact. In Proceedings of the 21th ACM SIGKDD International
Conference on Knowledge Discovery and Data Mining, pages 259–268. ACM, 2015. 7.1
Orhan Firat, Kyunghyun Cho, and Yoshua Bengio. Multi-way, multilingual neural machine translation witha shared attention mechanism. In Proceedings of the 2016 Conference of the North American Chapter ofthe Association for Computational Linguistics: Human Language Technologies, pages 866–875, San
Diego, California, June 2016a. Association for Computational Linguistics. doi: 10.18653/v1/N16-1101.
8.4
Orhan Firat, Baskaran Sankaran, Yaser Al-onaizan, Fatos T. Yarman Vural, and Kyunghyun Cho. Zeroresource translation with multi-lingual neural machine translation. In Proceedings of the 2016 Conferenceon Empirical Methods in Natural Language Processing, pages 268–277, Austin, Texas, November 2016b.
Association for Computational Linguistics. doi: 10.18653/v1/D16-1026. 8.4
Lisheng Fu, Thien Huu Nguyen, Bonan Min, and Ralph Grishman. Domain adaptation for relation197

extraction with domain adversarial neural network. In Proceedings of the Eighth International Joint
Conference on Natural Language Processing (Volume 2: Short Papers), volume 2, pages 425–429, 2017.
4.2.2
Chuang Gan, Tianbao Yang, and Boqing Gong. Learning attributes equals multi-source domain generalization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 87–97,
2016. 3.1
Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, François Laviolette,
Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. Journal of
Machine Learning Research, 17(59):1–35, 2016. 3.1, 3.4, 3.5, 3.5.1, 3.5.2, 3.5.2, 3.5.3, 3.6, 2, 3.A, 3.B,
3.C, 4.1, 4.2.2, 4.3, 4.4.3, 4.5, 5.1, 5.2, 5.2, 5.3.3, 6.1, 7.4.1, 8.4
Robert Gens and Pedro Domingos. Discriminative learning of sum-product networks. In Advances in
Neural Information Processing Systems, pages 3248–3256, 2012. 1.3.1, 10.4.1
Robert Gens and Pedro Domingos. Learning the structure of sum-product networks. In Proceedings of The
30th International Conference on Machine Learning, pages 873–880, 2013. 9.4.1, 10.4.1
Pascal Germain, Amaury Habrard, François Laviolette, and Emilie Morvant. A pac-bayesian approach fordomain adaptation with specialization to linear classifiers. In ICML (3), pages 738–746, 2013. 3.6
Muhammad Ghifary, W Bastiaan Kleijn, Mengjie Zhang, and David Balduzzi. Domain generalization for
object recognition with multi-task autoencoders. In Proceedings of the IEEE international conferenceon computer vision, pages 2551–2559, 2015. 3.1, 3.5.2
Xavier Glorot, Antoine Bordes, and Yoshua Bengio. Domain adaptation for large-scale sentiment classification: A deep learning approach. In Proceedings of the 28th international conference on machinelearning (ICML-11), pages 513–520, 2011. 3.1, 3.6, 4.1
Boqing Gong, Kristen Grauman, and Fei Sha. Connecting the dots with landmarks: Discriminatively
learning domain-invariant features for unsupervised domain adaptation. In ICML (1), pages 222–230,
2013. 3.6
Mingming Gong, Kun Zhang, Tongliang Liu, Dacheng Tao, Clark Glymour, and Bernhard Schölkopf.
Domain adaptation with conditional transferable components. In International conference on machinelearning, pages 2839–2848, 2016. 4.3
Ian Goodfellow, Yoshua Bengio, and Aaron Courville.
Deep learning.
2017.
ISBN
9780262035613 0262035618. URL https://www.worldcat.org/title/deep-learning/oclc/985397543&referer=brief_results. 5.1
Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron
Courville, and Yoshua Bengio. Generative adversarial networks, 2014. URL http://arxiv.org/
abs/1406.2661. cite arxiv:1406.2661. 5.1, 5.5.1
Raghuraman Gopalan, Ruonan Li, and Rama Chellappa. Unsupervised adaptation across domain shifts
by generating intermediate data representations. IEEE transactions on pattern analysis and machine
intelligence, 36(11):2288–2302, 2014. 3.1
Stephan Gouws, Yoshua Bengio, and Greg Corrado. BilBOWA: Fast bilingual distributed representations
without word alignments. In Proceedings of ICML 2015, pages 748–756, 2015. 8.4
Arthur Gretton, Karsten M Borgwardt, Malte J Rasch, Bernhard Schölkopf, and Alexander Smola. A kernel
two-sample test. Journal of Machine Learning Research, 13(Mar):723–773, 2012. 5.3.5, 5.5.10
Jiatao Gu, Hany Hassan, Jacob Devlin, and Victor OK Li. Universal neural machine translation for198

extremely low resource languages. In Proceedings of the 2018 Conference of the North American
Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1(Long Papers), pages 344–354, 2018. 8.1, 8.4
Asela Gunawardana and William Byrne. Convergence theorems for generalized alternating minimization
procedures. The Journal of Machine Learning Research, 6:2049–2073, 2005. 9.5.3
Francisco Guzmán, Peng-Jen Chen, Myle Ott, Juan Pino, Guillaume Lample, Philipp Koehn, Vishrav
Chaudhary, and Marc’Aurelio Ranzato. The FLORES evaluation datasets for low-resource machinetranslation: Nepali–English and Sinhala–English. In Proceedings of the 2019 Conference on Empirical
Methods in Natural Language Processing and the 9th International Joint Conference on Natural
Language Processing (EMNLP-IJCNLP), pages 6098–6111, Hong Kong, China, November 2019.
Association for Computational Linguistics. doi: 10.18653/v1/D19-1632. 8.1
Thanh-Le Ha, Jan Niehues, and Alexander Waibel. Toward multilingual neural machine translation with
universal encoder and decoder. arXiv preprint arXiv:1611.04798, 2016. 8.3, 8.4
Jihun Hamm. Minimax filter: Learning to preserve privacy from inference attacks. The Journal of Machine
Learning Research, 18(1):4704–4734, 2017. 6.1
Moritz Hardt, Eric Price, Nati Srebro, et al. Equality of opportunity in supervised learning. In Advances inneural information processing systems, pages 3315–3323, 2016. 2, 2.3, 2.3, 6.1, 6.2, 6.2, 6.3, 6.3.1, 6.5,
7.1, 7.2, 7.2, 7.2, 7.5
Philip Hartman et al. On functions representable as a difference of convex functions. Pacific J. Math, 9(3):707–713, 1959. 9.3
Judy Hoffman, Brian Kulis, Trevor Darrell, and Kate Saenko. Discovering latent domains for multisource
domain adaptation. In Computer Vision–ECCV 2012, pages 702–715. Springer, 2012. 3.1, 3.6
Judy Hoffman, Dequan Wang, Fisher Yu, and Trevor Darrell. Fcns in the wild: Pixel-level adversarial andconstraint-based adaptation. arXiv preprint arXiv:1612.02649, 2016. 4.2.2
Judy Hoffman, Mehryar Mohri, and Ningshan Zhang. Multiple-source adaptation for regression problems.
arXiv preprint arXiv:1711.05037, 2017a. 3.1
Judy Hoffman, Eric Tzeng, Taesung Park, Jun-Yan Zhu, Phillip Isola, Kate Saenko, Alexei A Efros,and Trevor Darrell. Cycada: Cycle-consistent adversarial domain adaptation. arXiv preprint
arXiv:1711.03213, 2017b. 3.1, 4.1, 4.2.2, 5.A.1
Matthew D Hoffman, David M Blei, Chong Wang, and John Paisley. Stochastic Variational Inference. The
Journal of Machine Learning Research, 14(1):1303–1347, 2013. 10.3
Ehsan Hosseini-Asl, Yingbo Zhou, Caiming Xiong, and Richard Socher. Augmented cyclic adversarial
learning for domain adaptation. arXiv preprint arXiv:1807.00374, 2018. 4.2.2
Haoyang Huang, Yaobo Liang, Nan Duan, Ming Gong, Linjun Shou, Daxin Jiang, and Ming Zhou.
Unicoder: A universal language encoder by pre-training with multiple cross-lingual tasks. In Proceedingsof the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International
Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 2485–2494, Hong Kong,
China, November 2019. Association for Computational Linguistics. doi: 10.18653/v1/D19-1252. 8.4
Priyank Jaini, Abdullah Rashwan, Han Zhao, Yue Liu, Ershad Banijamali, Zhitang Chen, and Pascal
Poupart. Online algorithms for sum-product networks with continuous variables. In Conference on
Probabilistic Graphical Models, pages 228–239, 2016. 3, 1.3.3, 1.5
I-Hong Jhuo, Dong Liu, DT Lee, and Shih-Fu Chang. Robust visual domain adaptation with low-rank
199

reconstruction. In Computer Vision and Pattern Recognition (CVPR), 2012 IEEE Conference on, pages
2168–2175. IEEE, 2012. 3.1
Ray Jiang, Aldo Pacchiano, Tom Stepleton, Heinrich Jiang, and Silvia Chiappa. Wasserstein fair classification. arXiv preprint arXiv:1907.12059, 2019. 7.5
Fredrik Johansson, Uri Shalit, and David Sontag. Learning representations for counterfactual inference. In
International conference on machine learning, pages 3020–3029, 2016. 8.4
Fredrik D Johansson, Rajesh Ranganath, and David Sontag. Support and invertibility in domain-invariant
representations. arXiv preprint arXiv:1903.03448, 2019. 4.3James E Johndrow, Kristian Lum, et al. An algorithm for removing sensitive information: application torace-independent recidivism prediction. The Annals of Applied Statistics, 13(1):189–220, 2019. 2.3, 6.2,
7.2
Melvin Johnson, Mike Schuster, Quoc V Le, Maxim Krikun, Yonghui Wu, Zhifeng Chen, Nikhil Thorat,
Fernanda Viégas, Martin Wattenberg, Greg Corrado, et al. Google’s multilingual neural machinetranslation system: Enabling zero-shot translation. Transactions of the Association for Computational
Linguistics, 5:339–351, 2017. 6.1, 8.1, 8.2.2, 8.4
Michael I Jordan, Zoubin Ghahramani, Tommi S Jaakkola, and Lawrence K Saul. An Introduction to
Variational Methods for Graphical Models. Machine Learning, 37(2):183–233, 1999. 1.3.2, 10.1
Faisal Kamiran and Toon Calders. Classifying without discriminating. In 2009 2nd International Conference
on Computer, Control and Communication, pages 1–6. IEEE, 2009. 2.3, 6.2, 6.3, 7.2
Toshihiro Kamishima, Shotaro Akaho, and Jun Sakuma. Fairness-aware learning through regularization
approach. In 2011 IEEE 11th International Conference on Data Mining Workshops, pages 643–650.
IEEE, 2011. 2.3, 6.2, 7.2
Toshihiro Kamishima, Shotaro Akaho, Hideki Asoh, and Jun Sakuma. Fairness-aware classifier withprejudice remover regularizer. In Joint European Conference on Machine Learning and Knowledge
Discovery in Databases, pages 35–50. Springer, 2012. 6.5
Mohammadali Khosravifard, Dariush Fooladivanda, and T Aaron Gulliver. Confliction of the convexity andmetric properties in f-divergences. IEICE Transactions on Fundamentals of Electronics, Communications
and Computer Sciences, 90(9):1848–1853, 2007. 6.2
Daniel Kifer, Shai Ben-David, and Johannes Gehrke. Detecting change in data streams. In Proceedingsof the Thirtieth international conference on Very large data bases-Volume 30, pages 180–191. VLDB
Endowment, 2004. 2.2, 3.2, 3.6, 4.2, 4.3
Niki Kilbertus, Mateo Rojas Carulla, Giambattista Parascandolo, Moritz Hardt, Dominik Janzing, andBernhard Schölkopf. Avoiding discrimination through causal reasoning. In Advances in Neural
Information Processing Systems, pages 656–666, 2017. 7.5
Diederik P Kingma and Max Welling. Auto-encoding Variational Bayes. arXiv preprint arXiv:1312.6114,
2013. 1.3.2, 10.3
Ryan Kiros, Yukun Zhu, Russ R Salakhutdinov, Richard Zemel, Raquel Urtasun, Antonio Torralba, andSanja Fidler. Skip-thought vectors. In Advances in neural information processing systems, pages
3294–3302, 2015. 8.3.1
Jyrki Kivinen and Manfred K Warmuth. Exponentiated gradient versus gradient descent for linear predictors.
Information and Computation, 132(1):1–63, 1997. 9.A.1
Jon Kleinberg, Sendhil Mullainathan, and Manish Raghavan. Inherent trade-offs in the fair determination200

of risk scores. arXiv preprint arXiv:1609.05807, 2016. 2.3, 6.2, 6.5, 7.5
Philipp Koehn, Franz J. Och, and Daniel Marcu. Statistical phrase-based translation. In Proceedings of the2003 Human Language Technology Conference of the North American Chapter of the Association for
Computational Linguistics, pages 127–133, 2003. 8.4
Vladimir Koltchinskii. Rademacher penalties and structural risk minimization. IEEE Transactions on
Information Theory, 47(5):1902–1914, 2001. 3.6
Dan Kondratyuk and Milan Straka. 75 languages, 1 model: Parsing universal dependencies universally.
In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing andthe 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages
2779–2795, Hong Kong, China, November 2019. Association for Computational Linguistics. doi:
10.18653/v1/D19-1279. 8.1
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional
neural networks. In Advances in neural information processing systems, pages 1097–1105, 2012. 1
Matt J Kusner, Joshua Loftus, Chris Russell, and Ricardo Silva. Counterfactual fairness. In Advances in
Neural Information Processing Systems, pages 4066–4076, 2017. 7.5
Guillaume Lample and Alexis Conneau. Cross-lingual language model pretraining. Advances in Neural
Information Processing Systems (NeurIPS), 2019. 8.4
Gert R Lanckriet and Bharath K Sriperumbudur. On the convergence of the concave-convex procedure.
pages 1759–1767, 2009. 9.5.3, 9.5.3, 9.5.3
Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition.
Proceedings of the IEEE, 86(11):2278–2324, 1998a. ISSN 0018-9219. doi: 10.1109/5.726791. 5.A.6
Yann LeCun and Corinna Cortes. MNIST handwritten digit database. http://yann.lecun.com/exdb/mnist/,
2010. URL http://yann.lecun.com/exdb/mnist/. 5.4.2, 5.A.1
Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to
document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998b. 3.5, 2
Jaeho Lee and Maxim Raginsky. Minimax statistical learning with wasserstein distances. In Advances in
Neural Information Processing Systems, pages 2692–2701, 2018. 4.3
Peizhao Li, Han Zhao, and Hongfu Liu. Deep fair clustering for visual learning. In Proceedings of theIEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9070–9079, 2020. 1.5
Chen Liang, Jianbo Ye, Han Zhao, Bart Pursel, and C Lee Giles. Active learning of strict partial orders: A
case study on concept prerequisite relations. arXiv preprint arXiv:1801.06481, 2018. 1.5Friedrich Liese and Igor Vajda. On divergences and informations in statistics and information theory. IEEE
Transactions on Information Theory, 52(10):4394–4412, 2006. 6.3.2, 6.3.2
Jianhua Lin. Divergence measures based on the Shannon entropy. IEEE Transactions on Information
Theory, 37(1):145–151, 1991. 2.6, 2.6.3, 4.4.3, 5.5.3, 6.3.2
Zachary C Lipton, Yu-Xiang Wang, and Alex Smola. Detecting and correcting for label shift with blackbox predictors. arXiv preprint arXiv:1802.03916, 2018. 4.3, 5.1, 5.3, 5.3.4, 5.3.4
Robert Litschko, Goran Glavaš, Simone Paolo Ponzetto, and Ivan Vulić. Unsupervised cross-lingual
information retrieval using monolingual data only. In The 41st International ACM SIGIR Conference on
Research & Development in Information Retrieval, pages 1253–1256, 2018. 8.1
Hong Liu, Mingsheng Long, Jianmin Wang, and Michael I. Jordan. Transferable adversarial training: A
201

general approach to adapting deep classifiers. In Kamalika Chaudhuri and Ruslan Salakhutdinov, editors,
ICML, volume 97 of Proceedings of Machine Learning Research, pages 4013–4022. PMLR, 2019. 5.1
Mingsheng Long, Jianmin Wang, Guiguang Ding, Jiaguang Sun, and Philip S Yu. Transfer joint matchingfor unsupervised domain adaptation. In Proceedings of the IEEE conference on computer vision andpattern recognition, pages 1410–1417, 2014. 4.3
Mingsheng Long, Yue Cao, Jianmin Wang, and Michael Jordan. Learning transferable features with deep
adaptation networks. In International Conference on Machine Learning, pages 97–105, 2015. 3.1, 3.6,
4.3, 5.3.3
Mingsheng Long, Han Zhu, Jianmin Wang, and Michael I Jordan. Unsupervised domain adaptation withresidual transfer networks. In Advances in Neural Information Processing Systems, pages 136–144,
2016. 4.3
Mingsheng Long, Han Zhu, Jianmin Wang, and Michael I Jordan. Deep transfer learning with joint
adaptation networks. In Proceedings of the 34th International Conference on Machine Learning-Volume
70, pages 2208–2217. JMLR, 2017. 5.1, 5.3.5, 5.4.1, 5.A.4, 5.A.4
Mingsheng Long, Zhangjie Cao, Jianmin Wang, and Michael I. Jordan. Conditional adversarial domain
adaptation. In Samy Bengio, Hanna M. Wallach, Hugo Larochelle, Kristen Grauman, Nicolò CesaBianchi, and Roman Garnett, editors, NeurIPS, pages 1647–1657, 2018. 5.1, 5.2, 5.A.1
Christos Louizos, Kevin Swersky, Yujia Li, Max Welling, and Richard Zemel. The variational fairautoencoder. arXiv preprint arXiv:1511.00830, 2015. 2.3, 3.1, 6.1, 6.2, 6.3.2, 6.5, 7.1, 7.2, 7.5
Kristian Lum and James Johndrow. A statistical framework for fair predictive algorithms. arXiv preprint
arXiv:1610.08077, 2016. 6.5
Thang Luong, Hieu Pham, and Christopher D. Manning. Bilingual word representations with monolingual
quality in mind. In Proceedings of the 1st Workshop on Vector Space Modeling for Natural Language
Processing, pages 151–159, 2015. 8.4
David Madras, Elliot Creager, Toniann Pitassi, and Richard Zemel. Learning adversarially fair andtransferable representations. In International Conference on Machine Learning, pages 3381–3390, 2018.
2.3, 6.1, 6.2, 6.4, 6.5, 7.1, 7.2, 7.4.1, 7.5, 7.5
David Madras, Elliot Creager, Toniann Pitassi, and Richard Zemel. Fairness through causal awareness:
Learning causal latent-variable models for biased data. In Proceedings of the Conference on Fairness,
Accountability, and Transparency, pages 349–358. ACM, 2019. 7.5
Yishay Mansour and Mariano Schain. Robust domain adaptation. In ISAIM, 2012. 3.1, 3.6, 4.1
Yishay Mansour, Mehryar Mohri, and Afshin Rostamizadeh. Domain adaptation: Learning bounds andalgorithms. arXiv preprint arXiv:0902.3430, 2009a. 2.2, 3.1, 3.2, 3.6, 4.1, 4.2.2
Yishay Mansour, Mehryar Mohri, and Afshin Rostamizadeh. Domain adaptation with multiple sources. In
Advances in neural information processing systems, pages 1041–1048, 2009b. 3.3
Yishay Mansour, Mehryar Mohri, and Afshin Rostamizadeh. Multiple source adaptation and the rényi
divergence. In Proceedings of the Twenty-Fifth Conference on Uncertainty in Artificial Intelligence,
pages 367–374. AUAI Press, 2009c. 2.2, 3.2, 3.3, 3.6, 4.2.2
R. Thomas McCoy, Ellie Pavlick, and Tal Linzen. Right for the wrong reasons: Diagnosing syntactic
heuristics in natural language inference. Proceedings of the ACL, 2019. 5.1
Jun Mei, Yong Jiang, and Kewei Tu. Maximum a posteriori inference in sum-product networks. arXiv
preprint arXiv:1708.04846, 2017. 2.4
202Aditya Krishna Menon and Robert C Williamson. The cost of fairness in binary classification. In Conference
on Fairness, Accountability and Transparency, pages 107–118, 2018. 7.1, 7.5
Tomas Mikolov, Quoc V Le, and Ilya Sutskever. Exploiting similarities among languages for machinetranslation. arXiv preprint arXiv:1309.4168, 2013. 8.4
Mehdi Mirza and Simon Osindero. Conditional generative adversarial nets. arXiv preprint arXiv:1411.1784,
2014. 8.3.4
Andriy Mnih and Karol Gregor. Neural Variational Inference and Learning in Belief Networks. In ICML,
2014. 1.3.2, 10.3
Mehryar Mohri, Afshin Rostamizadeh, and Ameet Talwalkar. Foundations of machine learning. MIT press,2012. 3.7.5
Alfred Müller. Integral probability metrics and their generating classes of functions. Advances in Applied
Probability, 29(2):429–443, 1997. 5.3, 5.3.5
Kevin P Murphy, Yair Weiss, and Michael I Jordan. Loopy belief propagation for approximate inference:
An empirical study. In Proceedings of the Fifteenth conference on Uncertainty in artificial intelligence,
pages 467–475. Morgan Kaufmann Publishers Inc., 1999. 2.4
Razieh Nabi and Ilya Shpitser. Fair inference on outcomes. In Thirty-Second AAAI Conference on Artificial
Intelligence, 2018. 7.5
Arvind Narayanan. Translation tutorial: 21 fairness definitions and their politics. In Proc. Conf. Fairness
Accountability Transp., New York, USA, 2018. 2.3, 6.2, 7.2
Radford M Neal. Probabilistic inference using markov chain monte carlo methods. 1993. 2.4
Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits innatural images with unsupervised feature learning. In NIPS workshop on deep learning and unsupervised
feature learning, volume 2011, page 5, 2011. 3.5, 2Graham Neubig and Junjie Hu. Rapid adaptation of neural machine translation to new languages. In
Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pages
875–880, Brussels, Belgium, October-November 2018. Association for Computational Linguistics. doi:
10.18653/v1/D18-1103. 8.4
Jian-Yun Nie, Michel Simard, Pierre Isabelle, and Richard Durand. Cross-language information retrieval
based on parallel texts and automatic mining of parallel texts from the web. In Proceedings of the 22nd
annual international ACM SIGIR conference on Research and development in information retrieval,
pages 74–81, 1999. 8.1
Franz Josef Och and Hermann Ney. Statistical multi-source translation. pages 253–258, 2001. 8.4
Executive Office of the President. Big data: A report on algorithmic systems, opportunity, and civil rights.
Executive Office of the President, 2016. 6.1
Sinno Jialin Pan and Qiang Yang. A survey on transfer learning. IEEE Transactions on knowledge anddata engineering, 22(10):1345–1359, 2010. 3.1
James D Park and Adnan Darwiche. A differential semantics for jointree algorithms. Artificial Intelligence,
156(2):197–216, 2004. 11.4
Robert Peharz. Foundations of sum-product networks for probabilistic modeling. PhD thesis, 2015. 2.4,
9.3.2
Robert Peharz, Sebastian Tschiatschek, Franz Pernkopf, Pedro Domingos, and BEEPRI BioTechMed-Graz.
203

On theoretical properties of sum-product networks. In Proceedings of the Eighteenth International
Conference on Artificial Intelligence and Statistics, pages 744–752, 2015. 9.3.2, 10.2
Robert Peharz, Robert Gens, Franz Pernkopf, and Pedro Domingos. On the Latent Variable Interpretationin Sum-Product Networks. arXiv preprint arXiv:1601.06180, 2016. 10.3
Zhongyi Pei, Zhangjie Cao, Mingsheng Long, and Jianmin Wang. Multi-adversarial domain adaptation.
2018. 3.1, 4.1, 4.2.2
Xingchao Peng, Zijun Huang, Ximeng Sun, and Kate Saenko. Domain agnostic learning with disentangled
representations. In Kamalika Chaudhuri and Ruslan Salakhutdinov, editors, ICML, volume 97 ofProceedings of Machine Learning Research, pages 5102–5112. PMLR, 2019. 5.6
Telmo Pires, Eva Schlinger, and Dan Garrette. How multilingual is multilingual bert? arXiv preprint
arXiv:1906.01502, 2019. 8.2.1
Emmanouil Antonios Platanios, Mrinmaya Sachan, Graham Neubig, and Tom Mitchell. Contextual
parameter generation for universal neural machine translation. In Conference on Empirical Methods in
Natural Language Processing (EMNLP), Brussels, Belgium, November 2018. 8.4
Geoff Pleiss, Manish Raghavan, Felix Wu, Jon Kleinberg, and Kilian Q Weinberger. On fairness andcalibration. In Advances in Neural Information Processing Systems, pages 5680–5689, 2017. 2.3, 6.2
Hoifung Poon and Pedro Domingos. Sum-product networks: A new deep architecture. In Proc. 12th Conf.
on Uncertainty in Artificial Intelligence, pages 2551–2558, 2011. 3, 1.3, 1.3.1, 2.4.2, 2.4, 2.4.1
Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. Squad: 100,000+ questions formachine comprehension of text. In Proceedings of the 2016 Conference on Empirical Methods in Natural
Language Processing, pages 2383–2392, 2016. 1
Rajesh Ranganath, Sean Gerrish, and David Blei. Black Box Variational Inference. In AISTATS, pages
814–822, 2014. 1.3.2, 10.3
Marc’Aurelio Ranzato, Paco Guzmán, Vishrav Chaudhary, Peng-Jen Chen, Jiajun Shen, and Xian Li.
Recent advances in low-resource machine translation. 2019. 8.2.2
Abdullah Rashwan, Han Zhao, and Pascal Poupart. Online and Distributed Bayesian Moment Matching for
Parameter Learning in Sum-Product Networks. In International Conference on Artificial Intelligenceand Statistics, 2016a. 10.4.1
Abdullah Rashwan, Han Zhao, and Pascal Poupart. Online and distributed bayesian moment matching forparameter learning in sum-product networks. In Proceedings of the 19th International Conference on
Artificial Intelligence and Statistics, pages 1469–1477, 2016b. 3, 1.3.3, 1.5, 11.2
Philip Resnik. Mining the web for bilingual text. In Proceedings of the 37th Annual Meeting of the
Association for Computational Linguistics, pages 527–534, College Park, Maryland, USA, June 1999.
Association for Computational Linguistics. doi: 10.3115/1034678.1034757. 8.1
Philip Resnik and Noah A. Smith. The web as a parallel corpus. Computational Linguistics, 29(3):349–380,
2003. doi: 10.1162/089120103322711578. 8.1
Neil Robertson and Paul D Seymour. Graph minors. iii. planar tree-width. Journal of Combinatorial
Theory, Series B, 36(1):49–64, 1984. 2.1
Amirmohammad Rooshenas and Daniel Lowd. Learning sum-product networks with direct and indirect
variable interactions. In Proceedings of The 31st International Conference on Machine Learning, pages
710–718, 2014. 9.4.3, 10.4.1

204Dan Roth. On the hardness of approximate reasoning. Artificial Intelligence, 82(1):273–302, 1996. 1.1, 1.3
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang,
Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition
challenge. International Journal of Computer Vision, 115(3):211–252, 2015. 3.1
Kate Saenko, Brian Kulis, Mario Fritz, and Trevor Darrell. Adapting visual category models to new
domains. In Kostas Daniilidis, Petros Maragos, and Nikos Paragios, editors, ECCV (4), volume 6314 of
Lecture Notes in Computer Science, pages 213–226. Springer, 2010. ISBN 978-3-642-15560-4. 5.4.2,
5.A.1
Ruslan Salakhutdinov, Sam Roweis, and Zoubin Ghahramani. On the convergence of bound optimization
algorithms. UAI, 2002. 9.5.3
Holger Schwenk. Filtering and mining parallel data in a joint multilingual space. In Proceedings of
the 56th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers),
pages 228–234, Melbourne, Australia, July 2018. Association for Computational Linguistics. doi:
10.18653/v1/P18-2037. 8.1
Holger Schwenk and Matthijs Douze. Learning joint multilingual sentence representations with neuralmachine translation. In Proceedings of the 2nd Workshop on Representation Learning for NLP, pages
157–167, Vancouver, Canada, August 2017. Association for Computational Linguistics. doi: 10.18653/
v1/W17-2619. 8.4
Uri Shalit, Fredrik D Johansson, and David Sontag. Estimating individual treatment effect: generalization
bounds and algorithms. In Proceedings of the 34th International Conference on Machine LearningVolume 70, pages 3076–3085. JMLR. org, 2017. 8.4
Jiajun Shen, Peng-Jen Chen, Matt Le, Junxian He, Jiatao Gu, Myle Ott, Michael Auli, and Marc’Aurelio
Ranzato. The source-target domain mismatch problem in machine translation. arXiv preprint
arXiv:1909.13151, 2019. 8.2.1
Jian Shen, Yanru Qu, Weinan Zhang, and Yong Yu. Wasserstein distance guided representation learning fordomain adaptation. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018. 4.3
Ashish Shrivastava, Tomas Pfister, Oncel Tuzel, Josh Susskind, Wenda Wang, and Russ Webb. Learningfrom simulated and unsupervised images through adversarial training. arXiv preprint arXiv:1612.07828,
2016. 3.1, 4.2.2
Rui Shu, Hung H Bui, Hirokazu Narui, and Stefano Ermon. A dirt-t approach to unsupervised domain
adaptation. arXiv preprint arXiv:1802.08735, 2018. 3.1
David Silver, Julian Schrittwieser, Karen Simonyan, Ioannis Antonoglou, Aja Huang, Arthur Guez, Thomas
Hubert, Lucas Baker, Matthew Lai, Adrian Bolton, et al. Mastering the game of go without humanknowledge. Nature, 550(7676):354, 2017. 1
Jiaming Song, Pratyusha Kalluri, Aditya Grover, Shengjia Zhao, and Stefano Ermon. Learning controllable
fair representations. In Artificial Intelligence and Statistics, pages 2164–2173, 2019. 6.1, 6.5
David Sontag, Amir Globerson, and Tommi Jaakkola. Introduction to dual composition for inference. In
Optimization for Machine Learning. MIT Press, 2011. 2.4
Harold W Sorenson and Allen R Stubberud. Non-linear filtering by approximation of the a posteriori
density. International Journal of Control, 8(1):33–51, 1968. 1.3.3, 11.1, 11.6
Amos Storkey. When training and test sets are different: Characterising learning transfer. Dataset shift inmachine learning., 2009. 5.1
205Qian Sun, Rita Chattopadhyay, Sethuraman Panchanathan, and Jieping Ye. A two-stage weighting
framework for multi-source domain adaptation. In Advances in neural information processing systems,
pages 505–513, 2011. 3.1
Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. In
Z. Ghahramani, M. Welling, C. Cortes, N. D. Lawrence, and K. Q. Weinberger, editors, Advances in
Neural Information Processing Systems 27, pages 3104–3112. Curran Associates, Inc., 2014. 8.3, 8.4
Yee W Teh, David Newman, and Max Welling. A Collapsed Variational Bayesian Inference Algorithm for
Latent Dirichlet Allocation. In Advances in neural information processing systems, 2006. 1.3.2, 10.1.1,
10.2
Yee W Teh, Kenichi Kurihara, and Max Welling. Collapsed Variational Inference for HDP. In Advances inneural information processing systems, pages 1481–1488, 2007. 1.3.2, 10.1.1, 10.2
Michalis Titsias and Miguel Lázaro-Gredilla. Doubly Stochastic Variational Bayes for Non-conjugate
Inference. In Proceedings of the 31st International Conference on Machine Learning, 2014. 1.3.2, 10.3
Michalis K Titsias. Local Expectation Gradients for Doubly Stochastic Variational Inference. arXiv
preprint arXiv:1503.01494, 2015. 1.3.2, 10.3
Yuta Tsuboi, Hisashi Kashima, Shohei Hido, Steffen Bickel, and Masashi Sugiyama. Direct density ratio
estimation for large-scale covariate shift adaptation. Journal of Information Processing, 17:138–155,
2009. 3.6
Eric Tzeng, Judy Hoffman, Trevor Darrell, and Kate Saenko. Simultaneous deep transfer across domains
and tasks. In Proceedings of the IEEE International Conference on Computer Vision, pages 4068–4076,
2015. 3.1
Eric Tzeng, Judy Hoffman, Kate Saenko, and Trevor Darrell. Adversarial discriminative domain adaptation.
arXiv preprint arXiv:1702.05464, 2017. 3.1, 3.5.2, 4.2.2, 4.4.3, 4.4.3, 5.1, 5.2, 5.3.1
Masao Utiyama and Hitoshi Isahara. A comparison of pivot methods for phrase-based statistical machinetranslation. In Human Language Technologies 2007: The Conference of the North American Chapter ofthe Association for Computational Linguistics; Proceedings of the Main Conference, pages 484–491,
Rochester, New York, April 2007. Association for Computational Linguistics. 8.4
Leslie Valiant. What needs to be added to machine learning? In Proceedings of ACM Turing Celebration
Conference-China, pages 6–6. ACM, 2018. 1
Guy Van den Broeck. Probabilistic and logistic circuits: A new synthesis of logic and machine learning.
2018. 1.3
Hemanth Venkateswara, Jose Eusebio, Shayok Chakraborty, and Sethuraman Panchanathan. Deep hashing
network for unsupervised domain adaptation. In (IEEE) Conference on Computer Vision and Pattern
Recognition (CVPR), 2017. 5.4.2, 5.A.1
Pascal Vincent, Hugo Larochelle, Yoshua Bengio, and Pierre-Antoine Manzagol. Extracting and composing
robust features with denoising autoencoders. In Proceedings of the 25th international conference on
Machine learning, pages 1096–1103. ACM, 2008. 3.6, 8.3.4
Pascal Vincent, Hugo Larochelle, Isabelle Lajoie, Yoshua Bengio, and Pierre-Antoine Manzagol. Stacked
denoising autoencoders: Learning useful representations in a deep network with a local denoisingcriterion. Journal of Machine Learning Research, 11(Dec):3371–3408, 2010. 3.6
Visda. Visual domain adaptation challenge, 2017. URL http://ai.bu.edu/visda-2017/. 5.2,
5.4.2, 5.A.1
206

Martin J Wainwright and Michael I Jordan. Graphical models, exponential families, and variational
inference. Foundations and Trends R in Machine Learning, 1(1-2):1–305, 2008. 1.3.2
Rui Wang, Andrew Finch, Masao Utiyama, and Eiichiro Sumita. Sentence embedding for neural machinetranslation domain adaptation. In Proceedings of the 55th Annual Meeting of the Association for
Computational Linguistics (Volume 2: Short Papers), pages 560–566, 2017. 8.3.1
Wen Wang, Han Zhao, Honglei Zhuang, Nirav Shah, and Rema Padman. Dycrs: Dynamic interpretable
postoperative complication risk scoring. In Proceedings of The Web Conference 2020, pages 1839–1850,
2020. 1.5
Yixin Wang, Dhanya Sridhar, and David M Blei. Equal opportunity and affirmative action via counterfactual
predictions. arXiv preprint arXiv:1905.10870, 2019. 7.5
Frank Wilcoxon. Some Rapid Approximate Statistical Procedures. Annals of the New York Academy of
Sciences, pages 808–814, 1950. 10.4.2
CF Jeff Wu. On the convergence properties of the EM algorithm. The Annals of Statistics, pages 95–103,
1983. 9.5.3
Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V. Le, Mohammad Norouzi, Wolfgang Macherey, Maxim
Krikun, Yuan Cao, Qin Gao, Klaus Macherey, Jeff Klingner, Apurva Shah, Melvin Johnson, Xiaobing
Liu, Lukasz Kaiser, Stephan Gouws, Yoshikiyo Kato, Taku Kudo, Hideto Kazawa, Keith Stevens, George
Kurian, Nishant Patil, Wei Wang, Cliff Young, Jason Smith, Jason Riesa, Alex Rudnick, Oriol Vinyals,
Greg Corrado, Macduff Hughes, and Jeffrey Dean. Google’s neural machine translation system: Bridging
the gap between human and machine translation. CoRR, abs/1609.08144, 2016. 8.2.2, 8.4
Huan Xu and Shie Mannor. Robustness and generalization. Machine learning, 86(3):391–423, 2012. 3.1,
3.6
Yichong Xu, Han Zhao, Xiaofei Shi, and Nihar B Shah. On strategyproof conference peer review. arXiv
preprint arXiv:1806.06266, 2018. 1.5
Yadollah Yaghoobzadeh, Remi Tachet des Combes, Timothy J. Hazen, and Alessandro Sordoni. Robust
natural language inference models with example forgetting. CoRR, abs/1911.03861, 2019. 5.1
Jason Yosinski, Jeff Clune, Yoshua Bengio, and Hod Lipson. How transferable are features in deep neuralnetworks? In Advances in neural information processing systems, pages 3320–3328, 2014. 3.6, 5.1
Alan L Yuille, Anand Rangarajan, and AL Yuille. The concave-convex procedure (CCCP). Advances in
Neural Information Processing Systems, 2:1033–1040, 2002. 9.3.2
Muhammad Bilal Zafar, Isabel Valera, Manuel Gomez Rodriguez, and Krishna P Gummadi. Fairness
constraints: Mechanisms for fair classification. arXiv preprint arXiv:1507.05259, 2015. 6.1, 6.5, 7.1, 7.5
Muhammad Bilal Zafar, Isabel Valera, Manuel Gomez Rodriguez, and Krishna P Gummadi. Fairness
beyond disparate treatment & disparate impact: Learning classification without disparate mistreatment.
In Proceedings of the 26th International Conference on World Wide Web, pages 1171–1180. International
World Wide Web Conferences Steering Committee, 2017. 2.3, 6.1, 6.2, 7.1, 7.2, 7.5
Willard I Zangwill. Nonlinear programming: a unified approach, volume 196. Prentice-Hall Englewood
Cliffs, NJ, 1969. 9.5.3, 9.5.3, 9.5.1
Rich Zemel, Yu Wu, Kevin Swersky, Toni Pitassi, and Cynthia Dwork. Learning fair representations. In
International Conference on Machine Learning, pages 325–333, 2013. 2.3, 6.1, 6.2, 6.5, 7.1, 7.2, 7.5, 8.4
Brian Hu Zhang, Blake Lemoine, and Margaret Mitchell. Mitigating unwanted biases with adversarial
learning. In Proceedings of the 2018 AAAI/ACM Conference on AI, Ethics, and Society, pages 335–340.
207

ACM, 2018. 6.1, 6.4, 6.5, 7.5, 7.5, 8.4
Kun Zhang, Bernhard Schölkopf, Krikamol Muandet, and Zhikun Wang. Domain adaptation under target
and conditional shift. In International Conference on Machine Learning, pages 819–827, 2013. 4.3
Kun Zhang, Mingming Gong, and Bernhard Schölkopf. Multi-source domain adaptation: A causal view.
In AAAI, pages 3150–3157, 2015a. 3.1, 3.5.2
Shanghang Zhang, Guanhang Wu, Joao P Costeira, and Jose MF Moura. Understanding traffic densityfrom large-scale web camera data. arXiv preprint arXiv:1703.05868, 2017a. 3.5, 3.5.3, 3, 3.C
Xu Zhang, Felix X. Yu, Shih-Fu Chang, and Shengjin Wang. Deep transfer network: Unsupervised domain
adaptation. CoRR, abs/1503.00591, 2015b. 5.1
Yuan Zhang, Regina Barzilay, and Tommi Jaakkola. Aspect-augmented adversarial networks for domain
adaptation. arXiv preprint arXiv:1701.00188, 2017b. 4.1, 4.2.2
Han Zhao and Geoff Gordon. Frank-wolfe optimization for symmetric-nmf under simplicial constraint. In
Proceedings of the Thirty-Fourth Conference on Uncertainty in Artificial Intelligence, 2018. 1.5
Han Zhao and Geoffrey J Gordon. Linear time computation of moments in sum-product networks. In
Advances in Neural Information Processing Systems, pages 6894–6903, 2017. 3, 1.3.3
Han Zhao and Geoffrey J Gordon. Inherent tradeoffs in learning fair representations. In Advances in neural
information processing systems, 2019. 1.2.2, 7.1, 7.2.1, 7.3.1, 7.5, 8.4, 12.1
Han Zhao, Zhengdong Lu, and Pascal Poupart. Self-adaptive hierarchical sentence model. In Twenty-FourthInternational Joint Conference on Artificial Intelligence, 2015a. 8.3.1
Han Zhao, Mazen Melibari, and Pascal Poupart. On the relationship between sum-product networks andbayesian networks. In International Conference on Machine Learning, pages 116–124, 2015b. 3, 2.4,
9.1, 9.1, 9.3.2, 10.2
Han Zhao, Tameem Adel, Geoff Gordon, and Brandon Amos. Collapsed variational inference for sumproduct networks. In International Conference on Machine Learning, pages 1310–1318, 2016a. 1.3.1,
11.4
Han Zhao, Pascal Poupart, and Geoffrey J Gordon. A unified approach for learning the parameters of
sum-product networks. In Advances in neural information processing systems, pages 433–441, 2016b. 3,
1.3.3, 10.3, 11.4, 11.5
Han Zhao, Otilia Stretcu, Renato Negrinho, Alex Smola, and Geoff Gordon. Efficient multi-task featureand relationship learning. arXiv preprint arXiv:1702.04423, 2017. 1.5
Han Zhao, Shuayb Zarar, Ivan Tashev, and Chin-Hui Lee. Convolutional-recurrent neural networks forspeech enhancement. In Acoustics, Speech and Signal Processing (ICASSP), 2018 IEEE international
Conference on. IEEE, 2018a. 1.5
Han Zhao, Shanghang Zhang, Guanhang Wu, Geoffrey J Gordon, et al. Adversarial multiple source domain
adaptation. In Advances in neural information processing systems, 2018b. 1.1, 1.2.1, 4.2.2, 4.4.3, 5.1,
8.4
Han Zhao, Shanghang Zhang, Guanhang Wu, Geoffrey J Gordon, et al. Multiple source domain adaptation
with adversarial learning. 2018c. 4.2.2, 5.2, 5.6
Han Zhao, Jianfeng Chi, Yuan Tian, and Geoffrey J Gordon. Adversarial privacy preservation under
attribute inference attack. arXiv preprint arXiv:1906.07902, 2019a. 1.5, 6.1, 7.7
Han Zhao, Jianfeng Chi, Yuan Tian, and Geoffrey J. Gordon. Adversarial privacy preservation under208

attribute inference attack. arXiv preprint arXiv:1906.07902, 2019b. 1, 2, 12.1
Han Zhao, Amanda Coston, Tameem Adel, and Geoffrey J Gordon. Conditional learning of fair representations. arXiv preprint arXiv:1910.07162, 2019c. 1.2.2, 8.4
Han Zhao, Amanda Coston, Tameem Adel, and Geoffrey J. Gordon. Conditional learning of fair representations. arXiv preprint arXiv:1910.07162, 2019d. 6.5
Han Zhao, Remi Tachet Des Combes, Kun Zhang, and Geoffrey Gordon. On learning invariant representations for domain adaptation. In International Conference on Machine Learning, pages 7523–7532,
2019e. 1.2.1, 1.5, 6.1, 8.4, 12.1
Han Zhao, Junjie Hu, Zhenyao Zhu, Adam Coates, and Geoff Gordon. Deep generative and discriminative
domain adaptation. In Proceedings of the 18th International Conference on Autonomous Agents andMultiAgent Systems, pages 2315–2317. International Foundation for Autonomous Agents and Multiagent
Systems, 2019f. 1.2.1, 1.5
Han Zhao, Junjie Hu, Zhenyao Zhu, Adam Coates, and Geoffrey J. Gordon. Deep generative anddiscriminative domain adaptation. In Proceedings of the 18th International Conference on Autonomous
Agents and MultiAgent Systems, 2019g. 4.2.2
Han Zhao, Remi Tachet des Combes, Kun Zhang, and Geoffrey J. Gordon. On learning invariant representations for domain adaptation. In Kamalika Chaudhuri and Ruslan Salakhutdinov, editors, ICML,
volume 97 of Proceedings of Machine Learning Research, pages 7523–7532. PMLR, 2019h. 5.1, 5.2,
5.2, 5.2, 5.3.2, 5.5.3
Sicheng Zhao, Bo Li, Xiangyu Yue, Yang Gu, Pengfei Xu, Runbo Hu, Hua Chai, and Kurt Keutzer. Multisource domain adaptation for semantic segmentation. In Advances in Neural Information Processing
Systems, pages 7285–7298, 2019i. 1.1
Indre Zliobaite. On the relation between accuracy and fairness in binary classification. arXiv preprint
arXiv:1505.05723, 2015. 6.1, 6.3
Barret Zoph and Kevin Knight. Multi-source neural translation. In Proceedings of the 2016 Conferenceof the North American Chapter of the Association for Computational Linguistics: Human Language
Technologies, pages 30–34, San Diego, California, June 2016. Association for Computational Linguistics.
doi: 10.18653/v1/N16-1004. 8.1, 8.4

209