SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Next we interpret Theorem 4.2. LF accuracy recovery scales with  $\max \left(1 / \sqrt{n_0}, 1 / \sqrt{n_1}\right)$ . This does not present any additional difficulties compared to vanilla weak supervision—it is the same rate we need to learn LF accuracies. In other words, there is no sample complexity penalty for using our approach. Furthermore, LF accuracy recovery scales inversely to  $\max \left(\sqrt{\mathbf{r}(\Sigma_0) \mathbf{r}(\Sigma_1)}, \mathbf{r}(\Sigma_1)\right)$ . That is, when the distributions  $P_0(x)$  or  $P_1(x')$  have greater spread, it is more difficult to restore fair behavior.
Finally, we briefly comment on extensions. It is not hard to extend these results to a setting with less strict assumptions. For example, we can take  $P$  to be a mixture of Gaussians. In this case, it is possible to combine algorithms for learning mixtures [CGT18] with the approach we presented.
The primary objective of our experiments is to validate that SBM improves fairness while often enhancing model performance as well. In real data experiments, we confirm that our methods work well with real-world fairness datasets (Section 5.1). In the synthetic experiments, we validate our theory claims in a fully controllable setting—showing that our method can achieve perfect fairness and performance recovery (Section 5.2). In addition, we show that our method is compatible with other fair ML techniques developed for fully supervised learning (Section 5.3). Finally, we demonstrate that our
Table 2: NLP dataset results
Table 3: Vision dataset results
Dataset	Methods	Acc	F1	ΔDP	ΔEO	Dataset	Methods	Acc	F1	ΔDP	ΔEO
Civil	FS	0.893	0.251	0.083	0.091	CelebA	FS	0.897	0.913	0.307	0.125
WS (Baseline)	0.854	0.223	0.560	0.546	WS (Baseline)	0.866	0.879	0.308	0.193
SBM (w/o OT)	0.879	0.068	0.048	0.047	SBM (w/o OT)	0.870	0.883	0.309	0.192
SBM (OT-L)	0.880	0.070	0.042	0.039	SBM (OT-L)	0.870	0.883	0.306	0.185
SBM (OT-S)	0.882	0.047	0.028	0.026	SBM (OT-S)	0.872	0.885	0.306	0.184
Hate	FS	0.698	0.755	0.238	0.121	UTKF	FS	0.810	0.801	0.133	0.056
WS (Baseline)	0.584	0.590	0.170	0.133	WS (Baseline)	0.791	0.791	0.172	0.073
SBM (w/o OT)	0.592	0.637	0.159	0.138	SBM (w/o OT)	0.797	0.790	0.164	0.077
SBM (OT-L)	0.670	0.606	0.120	0.101	SBM (OT-L)	0.800	0.793	0.135	0.043
SBM (OT-S)	0.612	0.687	0.072	0.037	SBM (OT-S)	0.804	0.798	0.130	0.041
method can improve weak supervision performance beyond fairness by applying techniques to discover underperforming data slices (Section 5.4). This enables us to outperform state-of-the-art on a popular weak supervision benchmark  $\left[\mathrm{ZYL}^{+}21\right]$ . Our code is available at https://github.com/SprocketLab/fairws.
5.1 Real data experiments
**Claims Investigated** In real data settings, we hypothesize that our methods can reduce the bias of LFs, leading to better fairness and improved performance of the weak supervision end model.
Setup and Procedure We used 6 datasets in three different domains: tabular (Adult and Bank Marketing), NLP (CivilComments and HateXplain), and vision (CelebA and UTKFace). Their task and group variables are summarized in Appendix E, Table 7. LFs are either heuristics or pretrained models. More details are included in Appendix E.3.
For the weak supervision pipeline, we followed a standard procedure. First, we generate weak labels from labeling functions in the training set. Secondly, we train the label model on weak labels. In this experiment, we used Snorkel  $\left[\mathrm{BRL}^{+}19\right]$  as the label model in weak supervision settings. Afterwards, we generate pseudolabels from the label model, train the end model on these, and evaluate it on the test set. We used logistic regression as the end model. The only difference between our method and the original weak supervision pipeline is a procedure to fix weak labels from each labeling function. As a sanity check, a fully supervised learning result (FS), which is the model performance trained on the true labels, is also provided. Crucially, however, in weak supervision, we do not have such labels, and therefore fully supervised learning is simply an upper bound to performance—and not a baseline.
We ran three variants of our method.  $SBM(w / oOT)$  is a 1-nearest neighbor mapping to another group without any transformation.  $SBM(OT - L)$  is a 1-nearest neighbor mapping with a linear map learned via optimal transport.  $SBM(OT - S)$  is a 1-nearest neighbor mapping with a barycentric mapping learned via the Sinkhorn algorithm. To see if our method can improve both fairness and performance, we measured the demographic parity gap  $(\Delta_{DP})$  and the equal opportunity gap  $(\Delta_{EO})$  as fairness metrics, and computed accuracy and F1 score as performance metrics as well.
Results The tabular dataset result is reported in Table 1. As expected, our method improves accuracy while reducing demographic parity gap and equal opportunity gap. However, we observed SBM (OT-L) critically fails at Adult dataset, contrary to what we anticipated. We suspected this originates in one-hot coded features, which might distort computing distances in the nearest neighbor search. To work around one-hot coded values in nearest neighbor search, we deployed LIFT  $\left[\mathrm{DZZ}^{+}22\right]$ , which encodes the input as natural language (e.g. "She/he is <race attribute>). She/he works for <working hour attribute> per week ...") and embeds them with language models (LMs). We provide heuristic rules to convert feature columns into languages in Appendix E.2, and we used BERT as the language model. The result is given in Table 1 under the dashed lines. While it sacrifices a small amount of accuracy, it substantially reduces the unfairness as expected.
The results for NLP datasets are provided in Table 2. In the CivilComments and HateXplain datasets, we observed our methods mitigate bias consistently, as we hoped. While our methods improve performance
(a) True distribution
(b) LF
(c) Transported LF
Figure 3: Synthetic datasets. In (a), seemingly different data distributions from the two groups actually have perfect achievable fairness. However, the labeling function in (b) only works well in group 0, which leads to unfairness. Via OT (c), the input distribution can be matched and the LF applied to similar groups—original and recovered. As a result, LFs on group 1 works as well as on 0 (d).
(d) Recovered LF
as well in the HateXplain dataset, enhancing other metrics in CivilComments results in drops in the F1 score. We believe that a highly unbalanced class setting  $(P(Y = 1) \approx 0.1)$  is the cause of this result.
The results for vision datasets are given in Table 3. Though not as dramatic as other datasets since here the LFs are pretrained models, none of which are heavily biased, our methods can still improve accuracy and fairness. In particular, our approach shows clear improvement over the baseline, which yields performance closer to the fully supervised learning setting while offering less bias.
5.2 Synthetic experiments
(a) Number of samples vs. Performance
(b) Number of samples vs. Unfairness
Figure 4: Synthetic experiment on number of samples vs. performance and fairness. Confidence intervals are obtained by  $\pm 1.96\times$  standard deviation of 10 repetition with different seeds.
Claim Investigated We hypothesized that our method can recover both fairness and accuracy (as a function of the number of samples available) by transporting the distribution of one group to another group when our theoretical assumptions are almost exactly satisfied. To show this, we generate unfair synthetic data and LFs and see if our method can remedy LF fairness and improve LF performance.
Setup and Procedure We generated a synthetic dataset that has perfect fairness as follows. First,  $n$  input features in  $\mathbb{R}^2$  are sampled as  $X_0 \sim \mathcal{N}(0, I)$  for group 0, and labels  $Y_0$  are set by  $Y_0 = \mathbb{1}(X_0[0] \geq 0.5)$ , i.e. 1 if the first dimension is positive or equal. Afterwards,  $n$  input features in  $\mathbb{R}^2$  are sampled as  $\tilde{X}_1 \sim \mathcal{N}(0, I)$  for group 1, and the labels are also set by  $Y_1 = \mathbb{1}(\tilde{X}_1[0] \geq 0.5)$ . Then, a linear transformation is applied to the input distribution:  $X_1 = \Sigma \tilde{X}_1 + \mu$  where  $\mu = \begin{bmatrix} -4 \\ 5 \end{bmatrix}$ ,  $\Sigma = \begin{bmatrix} 2 & 1 \\ 1 & 2 \end{bmatrix}$ , which is the distribution of group 1. Clearly, we can see that  $X_1 = \Sigma X_0 + \mu \sim \mathcal{N}(\mu, \Sigma)$ . Here we applied the same labeling function  $\lambda(x) = \mathbb{1}(x[0] \geq 0)$ , which is the same as the true label distribution in group 0.
Table 4: Compatibility with other fair ML methods (HateXplain dataset)
Acc	F1	ΔDP	ΔEO
FS	0.698	0.755	0.238	0.121
WS (Baseline)	0.584	0.590	0.171	0.133
SBM (OT-S)	0.612	0.687	0.072	0.037
WS (Baseline) + OTh-DP	0.539	0.515	0.005	0.047
SBM (OT-S) + OTh-DP	0.607	0.694	0.002	0.031
Table 5: Slice discovery with SBM results in WRENCH. Evaluation metric is accuracy for iMDB, F1 for the rest.
Methods	Basket ball	Census	iMDB	Mush room	Tennis
FS	0.855	0.634	0.780	0.982	0.858
WS (HyperLM)	0.259	0.551	0.753	0.866	0.812
SBM (w/o OT)	0.261	0.568	0.751	0.790	0.819
SBM (OT-L)	0.242	0.547	0.756	0.903	0.575
SBM (OT-S)	0.260	0.552	0.756	0.935	0.663
We apply our method (SBM OT-L) since our data model fits its basic assumption. Again, we evaluated the results by measuring accuracy, F1 score,  $\Delta_{DP}$ , and  $\Delta_{EO}$ . The setup and procedure are illustrated in Figure 3. We varied the number of samples  $n$  from  $10^{2}$  to  $10^{7}$
Results The result is reported in Figure 4. As we expected, we saw the accuracy and F1 score are consistently improved as the linear Monge map is recovered when the number of samples  $n$  increases. Most importantly, we observed that perfect fairness is achieved after only a small number of samples  $(10^{2})$  are obtained.
5.3 Compatibility with other fair ML methods
Claim Investigated Our method corrects labeling function bias at the individual LF—and not model—level. We expect our methods can work cooperatively, in a constructive way, with other fair ML methods developed for fully supervised learning settings.
Setup and Procedure We used the same real datasets, procedures, and metrics as before. We combined the optimal threshold method [HPS16] with WS (baseline) and our approach, SBM (Sinkhorn). We denote the optimal threshold with demographic parity criteria as OTh-DP.
Results The results are shown in Table 4. As we expected, we saw the effect of optimal threshold method, which produces an accuracy-fairness (DP) tradeoff. This has the same effect upon our method. Thus, when optimal threshold is applied to both, our method has better performance and fairness aligned with the result without optimal threshold. More experimental results with other real datasets and additional fair ML methods are reported in Appendix E.5.
5.4 Beyond fairness: maximizing performance with slice discovery
Claim Investigated We postulated that even outside the context of improving fairness, our techniques can be used to boost the performance of weak supervision approaches. In these scenarios, there are no pre-specified groups. Instead, underperforming latent groups (slices) must first be discovered. Our approach then uses transport to improve labeling function performance on these groups.
Setup and Procedure We used Basketball, Census, iMDB, Mushroom, and Tennis dataset from the WRENCH benchmark  $\left[\mathrm{ZYL}^{+}21\right]$ , which is a well-known weak supervision benchmark but does not include any group information. We generated group annotations by slice discovery [KGZ19,  $\mathrm{SNS}^{+}21$ , ddWLB22,  $\mathrm{EVS}^{+}22$ ], which is an approach to discover data slices that share a common characteristic. To find groups with a large accuracy gap, we used Domino  $\left[\mathrm{EVS}^{+}22\right]$ . It discovers regions of the embedding space based on the accuracy of model. Since the WS setting does not allow access to true labels, we replaced true labels with pseudolabels obtained from the label model, and model scores with label model probabilities. In order to show we can increase performance even for state-of-the-art weak supervision, we used the recently-proposed state-of-the-art Hyper Label Model [WCZC22] as the label model. We used the group information generated by the two discovered slices to apply our methods. We used logistic regression as the end model, and used the same weak supervision pipeline and metrics as in the other experiments, excluding fairness.
Results The results can be seen in Table 5. As expected, even without known group divisions, we still observed improvements in accuracy and F1 score. We see the most significant improvements on the Mushroom dataset, where we substantially close the gap to fully-supervised. These gains suggest that it is possible to generically combine our approach with other principled methods for subpopulation discovery to substantially improve weak supervision in general settings.
Weak supervision has been successful in overcoming manual labeling bottlenecks, but its impact on fairness has not been adequately studied. Our work has found that WS can easily induce additional bias due to unfair LFs. In order to address this issue, we have proposed a novel approach towards mitigating bias in LFs and further improving model performance. We have demonstrated the effectiveness of our approach using both synthetic and real datasets and have shown that it is compatible with traditional fair ML methods. We believe that our proposed technique can make weak supervision safer to apply in important societal settings and so encourages its wider adoption.
We are grateful for the support of the NSF under CCF2106707 (Program Synthesis for Weak Supervision) and the Wisconsin Alumni Research Foundation (WARF). We thank Nick Roberts, Harit Vishwakarma, Tzu-Heng Huang, Jitian Zhao, and John Cooper for their helpful feedback and discussion.
$\left[\mathrm{ABD}^{+}18\right]$  Alekh Agarwal, Alina Beygelzimer, Miroslav Dudík, John Langford, and Hanna Wallach. A reductions approach to fair classification. In International Conference on Machine Learning, pages 60-69. PMLR, 2018.
[ANC+22] Simran Arora, Avanika Narayan, Mayee F Chen, Laurel J Orr, Neel Guha, Kush Bhatia, Ines Chami, Frederic Sala, and Christopher Ré. Ask me anything: A simple strategy for prompting language models. arXiv preprint arXiv:2210.02441, 2022.
[BDB22] Maarten Buyl and Tijl De Bie. Optimal transport of classifiers to fairness. In Advances in Neural Information Processing Systems, 2022.
$\left[\mathrm{BDE}^{+}20\right]$  Sarah Bird, Miro Dudík, Richard Edgar, Brandon Horn, Roman Lutz, Vanessa Milan, Mehrnoosh Sameki, Hanna Wallach, and Kathleen Walker. Fairlearn: A toolkit for assessing and improving fairness in ai. Microsoft, Tech. Rep. MSR-TR-2020-32, 2020.
$\left[\mathrm{BDS}^{+}19\right]$  Daniel Borkan, Lucas Dixon, Jeffrey Sorensen, Nithum Thain, and Lucy Vasserman. Nuanced metrics for measuring unintended bias with real data for text classification. In Companion proceedings of the 2019 world wide web conference, pages 491-500, 2019.
[BRL+19] Stephen H Bach, Daniel Rodriguez, Yintao Liu, Chong Luo, Haidong Shao, Cassandra Xia, Souvik Sen, Alex Ratner, Braden Hancock, Houman Alborzi, et al. Snorkel drybell: A case study in deploying weak supervision at industrial scale. In Proceedings of the 2019 International Conference on Management of Data, pages 362-375, 2019.
[BYF20] Emily Black, Samuel Yeom, and Matt Fredrikson. Fliptest: fairness testing via optimal transport. In Proceedings of the 2020 Conference on Fairness, Accountability, and Transparency, pages 111–121, 2020.
$\left[\mathrm{CFA}^{+}22\right]$  Mayee F Chen, Daniel Y Fu, Dyah Adila, Michael Zhang, Frederic Sala, Kayvon Fatahalian, and Christopher Ré. Shoring up the foundations: Fusing model embeddings and weak supervision. In Uncertainty in Artificial Intelligence, pages 357-367. PMLR, 2022.
[SRT+20] Chiappa Silvia, Jiang Ray, Stepleton Tom, Pacchiano Aldo, Jiang Heinrich, and Aslanides John. A general approach to fairness with optimal transport. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 3633-3640, 2020.
[Ver18] Roman Vershynin. High-dimensional probability: An introduction with applications in data science, volume 47. Cambridge university press, 2018.
[VS22] Harit Vishwakarma and Frederic Sala. Lifting weak supervision to structured prediction. In Advances in Neural Information Processing Systems, 2022.
[WCZC22] Renzhi Wu, Shen-En Chen, Jieyu Zhang, and Xu Chu. Learning hyper label model for programmatic weak supervision. In The Eleventh International Conference on Learning Representations, 2022.
[WFT⁺ 19] Julia K Winkler, Christine Fink, Ferdinand Toberer, Alexander Enk, Teresa Deinlein, Rainer Hofmann-Wellenhof, Luc Thomas, Aimilios Lallas, Andreas Blum, Wilhelm Stolz, et al. Association between surgical skin markings in dermoscopic images and diagnostic performance of a deep learning convolutional neural network for melanoma recognition. JAMA dermatology, 155(10):1135–1141, 2019.
$\left[\mathrm{WGH}^{+}22\right]$  Songhua Wu, Mingming Gong, Bo Han, Yang Liu, and Tongliang Liu. Fair classification with instance-dependent label noise. In Conference on Causal Learning and Reasoning, pages 927-943. PMLR, 2022.
[WH22] Ziwei Wu and Jingrui He. Fairness-aware model-agnostic positive and unlabeled learning. In ACM Conference on Fairness, Accountability, and Transparency (ACM FAccT), 2022.
[WLL21] Jialu Wang, Yang Liu, and Caleb Levy. Fair classification with group-dependent label noise. In Proceedings of the 2021 ACM conference on fairness, accountability, and transparency, pages 526-536, 2021.
[WZN+23] Jiaheng Wei, Zhaowei Zhu, Gang Niu, Tongliang Liu, Sijia Liu, Masashi Sugiyama, and Yang Liu. Fairness improves learning from noisily labeled long-tailed data. arXiv preprint arXiv:2303.12291, 2023.
[ZDC22] Xianli Zeng, Edgar Dobriban, and Guang Cheng. Bayes-optimal classifiers under group fairness. arXiv preprint arXiv:2202.09724, 2022.
$\left[\mathrm{ZHY}^{+}22\right]$  Jieyu Zhang, Cheng-Yu Hsieh, Yue Yu, Chao Zhang, and Alexander Ratner. A survey on programmatic weak supervision. arXiv preprint arXiv:2202.05433, 2022.
[ZSQ17] Zhifei Zhang, Yang Song, and Hairong Qi. Age progression/regression by conditional adversarial autoencoder. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR). IEEE, 2017.
[ZSR23] Jieyu Zhang, Linxin Song, and Alex Ratner. Leveraging instance features for label aggregation in programmatic weak supervision. In International Conference on Artificial Intelligence and Statistics, pages 157-171. PMLR, 2023.
[ZYL+21] Jieyu Zhang, Yue Yu, Yinghao Li, Yujing Wang, Yaming Yang, Mao Yang, and Alexander Ratner. Wrench: A comprehensive benchmark for weak supervision. arXiv preprint arXiv:2109.11377, 2021.
$\left[\mathrm{ZZL}^{+}23\right]$  Yixuan Zhang, Feng Zhou, Zhidong Li, Yang Wang, and Fang Chen. Fair representation learning with unreliable labels. In International Conference on Artificial Intelligence and Statistics, pages 4655-4667. PMLR, 2023.
The appendix contains additional details, proofs, and experimental results. The glossary contains a convenient reminder of our terminology (Appendix A). Appendix B provides more related works and discussion about the relationship between our work and related papers. In Appendix C, we describe the details of our algorithm and discuss their implementations. Appendix D provides the proofs of theorems that appeared in Section 4. Finally, we give more details and analysis of the experiments and provide additional experiment results.
The glossary is given in Table 6 below.
Symbol	Definition
X	Feature space
Y	Label metric space
Z	Latent space of feature space
A	Group variable, assumed to have one of two values {0,1} for simplicity
Xk	Inputs from group k.
X	Inputs from all groups k∈{1,...,l}
Yk	True labels from group k
Y	True labels from all groups k∈{1,...,l}
P	Probability distribution in the latent space
Pk	Probability distribution in the group k
λj	Noisy labels of LF j of group k. If it is used with input (e.g. λj(x)), it denotes LF j from group k such that its outputs are noisy labels
λj	Noisy labels of LF j of all groups k∈{1,...,l}. If it is used with input (e.g. λj(x)), it denotes LF j such that its outputs are noisy labels
Λk	Collection of noisy labels from group k, Λk=[λ1k,...,λm]
Λ	Collection of noisy labels from all groups k∈{1,...,l}, Λ=[λ1,...,λm]
gk	gk: Z→X, k-th group transformation function
hk	hk: X→Z the inverse transformation of gk, i.e. hkgk(x)=x for x∈Z
θy	Prior parameter for Y in label model
θj	Accuracy parameter for λj in label model
θj,x	Accuracy parameter for x of λj in label model [CFA+22]
ajk	Accuracy of LF j in group k, ajk= E[λjY|A=k]
aj	Accuracy of LF j, aj= E[λjY]
ˆak,j	Estimates of ajk,j
μk	Mean of features in group k
Σk	Covariance of features in group k
I	Identity transformation, i.e. I(x)=x
tr(Σ)	Trace of Σ
λmax(Σ),λmin(Σ)	Maximum, minimum values of Σ
r(Σ)	Effective rank of Σ, i.e. r(Σ)=tr(Σ)/λmax(Σ)
Table 6: Glossary of variables and symbols used in this paper.
Weak supervision In weak supervision, we assume the true label  $Y \in \mathcal{Y}$  cannot be accessed, but labeling functions  $\lambda^1, \lambda^2, \dots, \lambda^m \in \mathcal{Y}$  which are noisy versions of true labels, are provided. These weak label sources include code snippets expressing heuristics about  $Y$ , crowdworkers, external knowledge bases, pretrained models, and others [KOS11, MBSJ09, GM14, DZS+17, RBE+18]. Given  $\lambda^1, \lambda^2, \dots, \lambda^m$ , WS often takes a two-step procedure to produce an end model [DS79, RSW+16, FCS+20, RHD+19b, SLV+22, VS22]. The first step, the label model, obtains fine-grained pseudolabels by
modeling accuracies and correlations of label sources. The second step is training or fine-tuning the end model with pseudolabels to yield better generalization than the label model. Not only can our method improve performance and fairness, but it is also compatible with the previous WS label models, as it works at the label source level—prior to the label model.
Another related line of work is WS using embeddings of inputs [LVS,  $\mathrm{CFA}^{+}22$ , ZSR23]. The first work, [LVS], uses embeddings for subset selection, where high-confidence subsets are selected based on the proximity to the same pseudolabels. The second,  $\left[\mathrm{CFA}^{+}22\right]$ , exploits embeddings to estimate local accuracy and improve coverage. The third [ZSR23] also incorporates instance features into label model via Gaussian process and Bayesian mixture models. Similarly, our method uses embeddings to improve fairness by mapping points in different groups in the embedded space. Embedding spaces formed from a pre-trained model typically offer better distance metrics than the input space, which provides an advantage when modeling the relationships between input points.
Fairness in machine learning Fairness in machine learning is an active research area to detect and address biases in ML algorithms. There have been many suggested fairness (bias) notions and solutions for them  $\left[\mathrm{DHP}^{+}12\right.$ , HPS16, KLRS17, HNG19, GNRV19, HWZW20,  $\mathrm{GZS}^{+}22$ . Popular approaches include adopting constrained optimization or regularization with fairness metrics  $\left[\mathrm{DHP}^{+}12\right.$ , HPS16,  $\mathrm{ABD}^{+}18$ , HNG19, GNRV19, HWZW20] and postprocessing model outputs to guarantee fairness notions [MW18, ZDC22]. While they have been successful in reducing bias, those methods often have a fundamental tradeoff between accuracy and fairness.