Manuscript Offprint
arXiv:2610.25796Fair Regression under Approximate Demographic Parity
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Exact demographic parity requires the same prediction distribution across sensitive groups. In regression, this can be too restrictive and reduce predictive accuracy. We instead bound every pairwise Wasserstein distance between group-specific prediction distributions by a chosen tolerance, allowing the groups to differ while keeping fairness tunable.
On the real line, the prediction and constrained transport problems have the same infimum. If the transport problem attains this value and suitable Monge maps exist, a deterministic transport-form predictor realizes it. Under a standard one-dimensional condition, the problem becomes a bounded quantile optimization that is convex when the conditional expected loss is convex in prediction. Under squared loss with two positively weighted groups, the , , and constraints yield soft-thresholding, shrinkage, and clipping. Under the stated conditions, we establish rates for the known-cost plug-in estimator. When the cost is unavailable, we describe an observed-loss computational proxy. Synthetic and California 2018 ACS studies illustrate the tunable fairness–accuracy trade-off and distinguish calibration feasibility from held-out fairness and accuracy.
Keywords: Empirical risk minimization, Fairness, Kantorovich barycenter problem, Optimal transport, Wasserstein distance
1 Introduction
Algorithmic fairness asks how predictive models can avoid reinforcing systematic disadvantages associated with sensitive attributes such as gender or marital status. This question is especially important in high-stakes settings, including credit scoring, hiring, criminal justice, and healthcare (Mehrabi et al., 2021; Caton and Haas, 2024). One widely used group-fairness criterion is demographic parity (DP). It requires the prediction distribution to be the same in every sensitive group. In probabilistic terms, the prediction must be independent of group membership.
Optimal transport studies how to move one probability distribution to another at minimum cost. It provides natural tools for aligning prediction distributions across groups. In regression under strict DP, all groups must share one prediction distribution. For squared loss, earlier work identifies the optimal common distribution as a Wasserstein barycenter (Chzhen et al., 2020). Recently, Feng et al. (2026) extend this transport framework to more general loss functions.
Strict DP has a clear mathematical structure, but it can be overly restrictive in practice. Requiring identical prediction distributions may reduce predictive accuracy. This fairness-accuracy
Corresponding author: zhangxiany@stat.tamu.edu.
trade-off is often called the “cost of fairness”. For example, Menon and Williamson (2018) study this trade-off in binary classification.
In this paper, we study fair regression under Approximate Demographic Parity. For , write for the order-p Wasserstein distance, a distance between probability distributions. See Section 2.4 for its formal definition. More specifically, we require the distance between every pair of group-conditional prediction distributions to be at most a user-chosen tolerance . The choice recovers strict DP, while larger values allow more flexibility. Practitioners can therefore vary to study the trade-off between fairness and predictive accuracy.
This relaxation changes the problem in an important way. Strict DP reduces the fairness problem to choosing one common output distribution. Approximate DP allows each group to have its own output distribution, provided that every pair remains close. Since predictions are real-valued, we can compare the group distributions rank by rank. A quantile function gives the prediction value at each percentile. Given any proposed set of prediction values, we can sort the values from low to high without changing their distribution. This sorting step is called monotone rearrangement. As we show later, it also does not increase the relevant pairwise distances. Our contribution is to use these tools to analyze the direct pairwise constraints, derive explicit solutions where possible, and build numerical methods for the remaining cases.
• Transport and quantile formulation. We first show that the prediction problem and a constrained transport problem have the same infimum. In other words, their risks can be made equally small even if no optimizer attains that limit. If the transport problem attains its infimum and suitable optimal deterministic transport maps, called Monge maps, exist, then a predictor built from those maps realizes the common value. Under a standard one-dimensional condition that makes increasing transport optimal—the Spence-Mirrlees or twist condition—the relevant maps are nondecreasing. This leads to an optimization over bounded group-specific quantile functions. The optimization is convex whenever the conditional expected loss, which we call the induced cost, is convex in the prediction.
• Squared-loss geometry. Under the squared-loss model stated below and with two groups that each have positive probability, we derive in closed form the optimal adjusted group quantile functions for the , , and constraints. These functions determine the corresponding approximately fair predictor: for each observation, the predictor finds its rank within its group and returns the adjusted quantile at that rank. To derive the formulas, we modify the difference between the two group quantile functions while preserving their weighted average, and then recover both adjusted quantile functions. The constraint uses soft-thresholding: it sets gaps whose magnitude is below a common threshold to zero and reduces larger gaps by that threshold. The constraint shrinks the entire quantile-gap function by a common factor when the constraint is active. The constraint clips each gap so that its magnitude does not exceed . These formulas make the effect of each constraint directly visible.
• Estimation and computation. We construct a known-cost plug-in estimator and establish its convergence rates under the stated regularity conditions. For computation, we develop a finite-grid projected-gradient algorithm. At each outer iteration, a gradient step is followed by a group-weighted Dykstra projection that jointly enforces pairwise fairness, nondecreasing quantile functions, and prediction bounds. For unknown induced costs, we also provide an observed-loss computational proxy based on observed responses.
Related work. The closest work studies regression under strict DP. For squared loss, Chzhen et al. (2020) show that the optimal fair prediction distribution is a Wasserstein barycenter. Feng et al. (2026) develop a strict-DP framework for more general loss functions. Both settings require every group to have the same prediction distribution. Our setting instead allows group-specific distributions, provided that every pair remains within the chosen Wasserstein tolerance.
Other papers relax fairness in different ways. Agarwal et al. (2019) give reduction-based algorithms for two criteria. One limits differences between each group's prediction distribution function and the overall distribution function. The other limits prediction loss within each group. Xu and Strohmer (2023) study a fairness-utility frontier based on average pairwise Wasserstein disparity. We instead place a hard bound on the largest pairwise distance. Chzhen and Schreuder (2022) measure improvement relative to the unfairness of the unconstrained regression function. Our tolerance is an absolute Wasserstein bound, and it is not scaled by that baseline unfairness.
Optimal transport has also been used to repair data and predictions. Gordaliza et al. (2019) move group-conditional data distributions toward a Wasserstein barycenter for fair classification. Jiang et al. (2020) use distances to enforce independence between classifier outputs and sensitive information. Le Gouic et al. (2020) post-process a regression estimator into the closest estimator satisfying strict DP. More recent work uses a demographic parity penalty rather than a hard constraint (Generali Lince et al., 2026), or enforces parity only at selected quantiles or score thresholds (Charpentier et al., 2026). In contrast, we impose one absolute tolerance on the maximum Wasserstein distance over all pairs of group prediction distributions. Our transport arguments use standard tools from one-dimensional optimal transport (Santambrogio, 2015), and the numerical projection uses efficient projection onto an ball (Duchi et al., 2008).
The remainder of this paper is organized as follows. Section 2 introduces the population problem and its optimal-transport formulation. It then gives the squared-loss closed forms and the extensions to convex induced costs and multiple groups. Section 3 presents the known-cost plug-in estimator and the numerical procedures. Section 4 gives consistency and convergence rates for this estimator. Section 5 presents regression experiments and a classification illustration. Section 6 applies the method to income prediction with California ACS data. Section 7 concludes the paper.
2 Problem Setup and Population Characterization
Consider a regression problem. Let contain the predictors, be the response, and indicate the sensitive group. Write and assume . We suppose that predictions lie in a compact interval . Their accuracy is measured by a loss , where the prediction lies in .
We assess fairness by comparing prediction distributions across groups. For real-valued predictions, each distribution is characterized by its quantile function, which maps a probability level to the corresponding prediction value. Specifically, for a distribution function F, the quantile function is defined by
We write
for the class of bounded quantile functions considered throughout the paper. We extend each to by setting
These limits exist because Q is bounded and nondecreasing. Unless stated otherwise, an equality or constraint between quantile functions need only hold outside a set of ranks with total length zero. Equivalently, it holds almost everywhere with respect to Lebesgue measure.
We next introduce the transport notation used to compare group distributions. A coupling is a way to pair draws from two distributions and . Formally, it is a probability measure on . Its first coordinate has distribution , and its second coordinate has distribution ; these coordinate distributions are called the marginals. We write for all such pairings. If has distribution and we apply a measurable map , the distribution of is the push-forward of . For any measurable set of possible output values, , where is the set of inputs that maps into .
Definition 1 (Demographic parity). A predictor satisfies demographic parity if the conditional law of given is the same for every .
In other words, the prediction and the group label are independent. We write this as .
We first define the population target without restricting the form of the predictor. Let contain all measurable predictors from to . This broad class includes every transport-based adjustment used below. A smaller model class could lead to additional error because it may not contain the best adjustment. Under strict demographic parity, the target fair regression function is
2.1 Connection to the Kantorovich Barycenter Problem
The transport construction begins by reducing to a one-dimensional score. For this reduction to preserve the relevant distributional information, the score must be sufficient for the conditional distribution of Y. We formalize this requirement as follows.
Assumption 1. There exists a measurable such that .
Assumption 1 requires the scalar score to retain all information in relevant to the conditional distribution of Y. This is stronger than ordinary regression, which focuses only on the conditional mean. For squared loss, however, it is enough to use . The remaining noise adds the same amount to the risk of every predictor and therefore does not change which predictor is the best.
For a latent score z and prediction q, the induced cost is the conditional expected loss
Taking the conditional expectation first gives
The prediction risk can therefore be viewed as the cost of changing a latent score into a final prediction. For group , let denote the distribution of its latent scores. Let and be the corresponding distribution and quantile functions.
Non-atomic means that no single latent-score value has positive probability.
Assumption 2. Each is non-atomic, C is continuous on , and every deterministic transport statement below is made only when the corresponding Monge problem admits an optimal measurable map.
The next distinction will matter in Theorem 1. Pairing probability mass through a coupling may allow randomization. A Monge map is instead a deterministic rule that sends each latent score to one adjusted value. Such a map is needed only when we want to construct a deterministic predictor.
We also want higher latent scores to be paired with higher adjusted values. The following standard one-dimensional condition gives this ordering.
Assumption 3. The cost is twice differentiable on and satisfies the Spence-Mirrlees condition: (Villani, 2009; Chiappori et al., 2017).
Under this condition, sorting both variables in the same order gives an optimal pairing. This operation is called increasing rearrangement, and the resulting transport maps are nondecreasing. Under strict demographic parity, all groups must share one target distribution. This recovers the barycenter formulation of Feng et al. (2026): the barycenter is the shared distribution that best balances the group-specific losses.
2.2 Relaxation to Approximate Fairness
Approximate parity allows the group prediction distributions to differ, but only by a chosen tolerance. Let be the prediction distribution for group . We measure the difference between two such distributions by the order- Wasserstein distance , which is defined formally in Section 2.4. For and , the approximate fair-regression problem is
Setting gives strict demographic parity.
We can state the same task directly in terms of distributions. For each group, choose an adjusted prediction distribution and a way to pair its latent scores with predictions from that distribution. The resulting distributional problem is called the constrained Kantorovich problem. It extends the corresponding Kantorovich barycenter problem: when , every group must choose the same distribution. For , the group distributions may differ, so the solution need not be a single barycenter:
(4)
Here contains all probability distributions supported on the allowed prediction range .
Theorem 1 answers two different questions. First, do the prediction problem and the distributional problem have the same best achievable value? Second, when can that value be achieved by a deterministic prediction rule? The first conclusion needs only the base assumptions. The second also needs the optimum and the required deterministic transport maps to exist. For brevity, we call the approximate fair-regression problem AFRP and the constrained Kantorovich problem CKP.
Theorem 1 (Equality of infima and conditional attainment). Under Assumptions 1 and 2, the AFRP and CKP infima in (3) and (4) are equal. If the CKP attains its infimum at and, for every s, an optimal Monge map from to exists, then
attains the AFRP infimum. Without CKP or Monge attainment the theorem asserts only equality of infima.
Thus the distributional problem always identifies the best value of the prediction problem under the stated assumptions. To obtain the displayed deterministic predictor, the distributional optimum must be attained and each group must have the required Monge map.
2.3 Characterization via Quantile Functions
On the real line, the transport rule has a simple interpretation: first find the within-group rank of a latent score, and then return the adjusted value at the same rank. When the optimal deterministic transport map exists, Assumption 3 makes it nondecreasing, with the form . The predictor is therefore
The within-group rank is uniformly distributed: . It follows that determines the final prediction distribution for group .
2.4 Wasserstein Distance Constraint
Wasserstein distance compares two distributions by pairing their values and measuring how far the paired values are apart. For , define , and define
The finite-p Wasserstein distance uses an average of the (powered) paired differences. instead records the largest difference, apart from events with probability zero. On the real line, the best pairing compares values at the same percentile in the two distributions. We can therefore compute both distances from their quantile functions. To state the following lemma, we introduce the norm notation. For a measurable function , write for and , with respect to Lebesgue measure.
Lemma 1. For probability measures on with quantiles ,
This standard formula lets us express fairness directly as a bound on the distance between quantile curves (Santambrogio, 2015, Proposition 2.17).
We study . The distance measures the average absolute gap across ranks. The distance measures the root-mean-square gap. The distance bounds the gap at every rank.
Define the bounded feasible set
This set imposes three requirements at once. Each curve must be a valid quantile function, every prediction must lie in I, and every pair of curves must satisfy the fairness tolerance. We can therefore solve the distributional problem by choosing one adjusted quantile function for each group:
Assumption 3 says, roughly, that lower scores should be paired with lower predictions and higher scores with higher predictions. This way of pairing them is the least costly. Therefore, the problem over group distributions and (6) have the same lowest possible value. This is a convex optimization problem whenever is convex. All integrals are finite because the prediction range is bounded. The common index compares the same within-group rank across groups. At rank , is group 's latent-score value, and is the corresponding adjusted prediction value.
Formally, for a measurable , let be the quantile function of when .
Lemma 2 (Simultaneous monotone rearrangement). Let be measurable, integrable, and -valued. For every ,
If is nondecreasing and C satisfies the Spence-Mirrlees condition, then
Moreover, is nondecreasing, left-continuous, integrable, and has range in I.
The lemma says that sorting cannot make two group curves farther apart. Under the stated cost condition, it also cannot increase prediction loss. The sorted curves remain bounded, integrable quantile functions. We use these facts to construct a valid optimizer for the pointwise problem and to prove the multi-group squared-loss barycenter property in Proposition 1.
2.5 Closed-Form Solutions for Squared Loss
The general problem (6) usually requires numerical optimization. With squared loss and two groups , the adjustment has a simple geometry and a closed-form solution. Appendix A.1 gives the detailed derivations.
In this setting, we assume an additive error model , where the noise is independent of , has mean zero, and has finite variance . Under this model,
. The variance term is constant with respect to . The adjustment therefore keeps the final quantile curves as close as possible to the latent curves under squared distance. Assume and . The fair quantiles solve
By Lemma 1, the Wasserstein distance between the two adjusted distributions, with quantiles and , is . We examine . We first solve for the difference between the curves. We then verify that the resulting curves are still bounded, nondecreasing quantile functions.
2.5.1 Solution Structure
The fairness constraint acts on the difference between the two groups. It does not directly restrict their weighted average. For candidate quantile functions and , define
and let and . A direct expansion gives
The identity separates the loss into a term for the weighted average and a term for the group difference. Changing the weighted average would increase loss without helping the fairness constraint. The unique squared-loss solution therefore keeps . Next, we choose as close as possible to while requiring . Once the new gap is known, the two curves are
2.5.2 Case 1: -Constraint
The rule changes the whole gap curve by one common factor. If the original gap is too large, every value of that curve is multiplied by the same number below one. Geometrically, this is a radial projection onto an ball. Let .
- If , the constraint is inactive, and (the latent predictors are already sufficiently fair).
• If , the difference is linearly shrunk towards zero. The optimal difference is .
Thus the solution shrinks the two latent curves toward their strict-parity barycenter while preserving their weighted average.
2.5.3 Case 2: -Constraint
The rule subtracts the same threshold from the size of the gap at every rank. Gaps below that threshold become zero, while larger gaps keep their sign. This operation is called soft-thresholding. It solves the projection of onto the ball under squared loss.
For a threshold , apply the rule to :
Choose to satisfy the fairness constraint. If , the constraint is inactive, so and . If , there is a unique such that . At exact parity, , the solution is ; the threshold itself need not be unique once it exceeds .
2.5.4 Case 3: -Constraint ( )
The rule leaves a gap unchanged when its size is at most . It caps every larger positive or negative gap at in absolute value, which corresponds to clipping. Formally, the constraint is for almost all , so each is projected onto :
At each rank, the allowed pairs form the band . The rule moves an infeasible pair to the edge of this band while keeping its weighted average fixed.
These calculations solve for a gap function, but a valid solution also needs two genuine quantile functions. The next lemma shows that the recovered curves are nondecreasing, left-continuous, integrable, and confined to I.
Lemma 3 (Monotonicity of the two-group closed-form solutions). Assume that and that with . Let
Suppose that the adjusted difference has the form
where is non-decreasing, 1-Lipschitz, and . Define
Then . Consequently the three closed-form solutions preserve monotonicity, left continuity, integrability, and the bounded range.
2.6 Extension to General Convex Losses and Multiple Groups
The closed forms use both squared loss and the special geometry of two groups. The quantile problem above also applies to more than two groups, provided the same assumptions hold. In particular, Assumption 3 is needed when we match scores and predictions by rank. If the conditional expected loss is convex in the prediction, the resulting problem is convex. The computation depends on how the fairness tolerance is distributed across ranks. Under , every rank has its own bound. Under finite-p distances, all ranks share one overall budget.
Table 1: Closed-form updates (squared loss, ). Let and , with constraint . Write , , and . For , choose so that when . Use when the constraint is inactive. Use when .
| Optimal difference | Effect | |
|---|---|---|
| if ; otherwise . | shrink | |
| . | soft-thresh | |
| . | clip |
Pointwise Wasserstein constraint. When , every pair of adjusted values must be close at each rank:
We can first solve this problem separately at each rank and restore the quantile ordering afterward. At a fixed rank , let be a prediction that minimizes the loss for group without a fairness constraint, with these values chosen measurably as varies. When , fairness requires all adjusted group values to fit in one interval of width . There is a pointwise optimum of the form
where minimizes . In words, choose the left endpoint of a common interval and clip every group's preferred value into that interval. Only the single endpoint must be optimized. If , every value in already fits within the tolerance.
When , the endpoint may change with the rank . We need to choose these endpoints so that they form a measurable function. The possible endpoints lie in the compact interval . The objective is measurable in and continuous in . A standard selection result then guarantees that the endpoints can be chosen measurably. This result is the measurable maximum theorem (Aliprantis and Border, 2006, Theorem 18.19).
After clipping, the resulting curves may be out of order as increases. We sort each curve into quantile order by increasing rearrangement. Sorting does not move any prediction outside the allowed range or make any pair of curves farther apart. Thus the construction has two stages. First, solve for one endpoint and clip at each rank. After all ranks have been processed, sort each completed curve into quantile order. This is an explicit clipping rule with a one-dimensional endpoint solve, although need not have a closed-form formula for general .
Under squared loss, consider the class of collections satisfying the pairwise fairness constraints. The projection of the latent quantile curves onto this class under the group-weighted distance is unique. Moreover, this projection preserves the weighted barycenter even when ; see Proposition 1. A convenient stronger condition also ensures the pairwise tolerance. Specifically, require each group to lie within of the fixed latent weighted barycenter under the same Wasserstein distance. By the triangle inequality, any two groups are then at most apart. Thus the radius guarantees the desired pairwise constraint. The factor is necessary for this argument: using radius would guarantee only a pairwise distance of at most .
Integral Wasserstein constraints. When , the constraint
uses one total budget across all ranks. We therefore cannot optimize each rank separately. For computation, we represent each curve on a midpoint grid:
The grid problem is
where
for finite , with the maximum norm for ;
The three sets have clear roles. The first enforces pairwise fairness. The second keeps every group curve nondecreasing. The third keeps every prediction inside I. Thus the prediction bounds are enforced in the population problem, the grid problem, and each numerical projection.
3 Estimation Procedure
The population problem gives one adjusted quantile function for each group. This section explains how to estimate those functions and use them for new predictions.
The data procedure has four steps. First, train an unconstrained predictor. Second, use a separate calibration sample to estimate the distribution of its scores within each group. Third, adjust the estimated group quantiles to meet the fairness tolerance. Finally, map each new score to its within-group rank and read the prediction from the adjusted quantile curve.
There are several ways to perform the adjustment. With squared loss and two groups, a closed-form rule gives the full adjusted curves. More generally, when the induced cost can be calculated, the full quantile-function problem defines the known-cost plug-in estimator studied in Section 4. Under the regularity assumptions stated there, we establish consistency and convergence rates for this estimator. A numerical implementation represents the curves on a finite midpoint grid. Each iteration first takes a step in the negative-gradient direction. It then projects the grid values back onto the fairness, ordering, and prediction-range constraints. This is projected-gradient descent. The projection is computed by Dykstra's method, which repeatedly projects onto the individual constraints while correcting for earlier projections. When the induced cost cannot be calculated, an observed-loss version instead uses the response paired with each ordered fitted score.
3.1 Stage 1: Unconstrained group-wise regression
First, we estimate using an auxiliary training sample of size m, and let
denote an independent calibration sample of size n. A group-aware regression may fit separate models or may include group indicators and interactions in one model. The theory in Section 4 requires the training and calibration samples to be independent. We call a fitted calibration score. Specifically, the two steps in this stage are listed as follows.
-
Train group-wise regression models for .
-
Apply the trained models to the calibration sample and compute
3.2 Stage 2: Empirical latent quantile estimation
Let be the number of calibration observations in group , and let be its sample proportion. Within each group, sort the fitted scores:
The empirical latent quantile function is
At rank , returns the fitted score in position . Thus it is the exact inverse empirical distribution function of the fitted scores. At a midpoint , we use that order statistic directly. We do not interpolate sample quantiles at this stage. Interpolation is used only after the fairness adjustment has been computed.
The estimator is formed when every calibration group is present, that is, on the event . The positive-proportion assumption below makes this event increasingly likely as the sample grows. The observed-loss method in Remark 1 also keeps each score paired with its own response while sorting. The response paired with the th ordered score is called its concomitant and is written . Only the fitted scores are put in increasing order; the responses are carried along rather than sorted by their values.
3.3 Stage 3: Fairness adjustment
The third stage turns the empirical latent curves into adjusted curves that satisfy the fairness tolerance. Squared loss with two groups uses a closed-form plug-in rule. For a known induced cost, the full quantile-function problem defines the estimator, and a projected-gradient calculation provides a grid approximation. If the induced cost is unavailable, the observed-loss calculation changes only the grid objective. It uses the same fairness, ordering, and prediction-range constraints.
3.3.1 Closed-form adjustment for squared loss and two groups
For squared error loss with K = 2, the formulas in Section 2.5 give a direct plug-in estimator. First, define the empirical weighted average and the difference between the two group curves:
Table 2: Plug-in fairness adjustment for squared loss and two groups. Let and let . For , write . For , choose so that when . Set when the constraint is inactive. Use when .
| Constraint | Fair difference | Interpretation |
|---|---|---|
| if ; otherwise | global shrinkage | |
| soft-thresholding | ||
| clipping |
The fairness adjustment applies the appropriate projection to and returns a new difference . The rules for the three Wasserstein distances are summarized in Table 2.
The adjusted group curves preserve the empirical weighted average:
After this adjustment, the last step maps each unconstrained score through its adjusted group quantile function, as described at the end of this section.
3.3.2 Known-cost target and its grid approximation
We now consider convex induced costs beyond squared loss and settings with more than two groups. When the induced cost is available, we replace the unknown group weights and latent quantiles in the population problem by their sample estimates. We then minimize the resulting objective over the full feasible class of quantile-function tuples on . We call a minimizer of this full quantile-function problem the known-cost plug-in estimator. Its quantile functions may have jumps, and the optimization uses every rank rather than only a finite grid. Under the regularity assumptions in Section 4, we establish convergence rates for this estimator. For numerical work, we approximate the same problem on a finite midpoint grid by projected-gradient descent.
This approach requires the induced cost
or at least its derivative to be available in closed form. Examples include squared loss and canonical generalized linear models with a known conditional model. When this conditional average cannot be calculated, the observed-loss method uses the loss gradient from the response that remains paired with each ordered score. This alternative is stated in Remark 1.
For this finite-grid approximation, fix and let , . For each group, define
and initialize . Let denote the feasible set in (6); its elements are quantile-function tuples defined at every rank. The known-cost plug-in estimator minimizes
The grid approximation replaces each curve by its values at the midpoint nodes and minimizes
with the sets defined in (9). Here enforces every pairwise fairness bound. keeps each group vector nondecreasing, and keeps each grid value in the prediction range .
Group s contributes to the objective in proportion to its estimated frequency . The weighted inner product for the projection is
for , . It uses the same group weights as the objective. With this choice, the gradient component for group is itself because the group weight is already included in the inner product. The projection below uses the same weighted notion of distance.
For integral constraints , one projected-gradient iteration has two steps. First, take a step in the negative-gradient direction for the known-cost objective:
Second, return the updated grid values to the set that satisfies all fairness, ordering, and prediction-range requirements:
The two steps play different roles. The first is a loss-based gradient step. The second enforces all constraints together. We compute this second step with weighted Dykstra projection (Bauschke and Combettes, 2017). Dykstra's method repeatedly projects onto one constraint at a time and keeps a correction for the effect of earlier projections. Pairwise grid balls enforce fairness. Isotonic projection, which replaces a vector by its closest nondecreasing vector, enforces the quantile order within each group. Coordinate-wise clipping keeps all values inside I. The method stores a separate correction for every pairwise set, every group ordering constraint, and the box constraint. It therefore computes a projection onto the full intersection of the constraints.
For two groups, the fairness projection has the same average-difference geometry as the closed-form squared-loss solution. Let
The grid fairness bound requires the adjusted difference to lie in an ball of radius . Project onto this ball and call the result . The projected group vectors are
For , the projection rescales the whole difference vector when necessary. For , it uses the standard soft-thresholding projection onto an ball (Duchi et al., 2008). With , each pair
uses the same calculation after normalizing its two weights to and . Dykstra's method cycles through these pairwise calculations and the other constraints, carrying the corresponding correction variables from one cycle to the next.
For , the fairness bound applies separately at each grid point. One option is to solve the sample version of (8) at each point:
The resulting values may not be ordered across grid points. Sorting each group curve by the simultaneous increasing rearrangement restores the required order. This sorting cannot make any pair of curves farther apart. Assumption 3 also ensures that it does not raise the total loss. A second option is to use the same full-intersection grid projection as above, replacing the finite-p balls by sets that bound the maximum gap.
Examples of known induced costs. The induced cost can often be computed from a familiar conditional model. For squared loss, if and , then
The conditional variance does not depend on q, so it does not affect the fairness adjustment. For logistic loss on the logit scale,
if , then
More generally, consider a generalized linear model (GLM) with its canonical link. If its negative log-likelihood is , with on the natural-parameter scale, and its conditional mean is , then
For logistic and other generalized linear-model losses, the theory requires the objective to rise sufficiently quickly as the prediction moves away from its minimum. This property is called strong convexity. The conditions in Section 4 apply on a compact natural-parameter range or after adding a small ridge regularizer.
Remark 1 (When the induced cost C is unknown). In many applications the conditional law is not available, so the induced cost cannot be evaluated directly. A natural practical proxy is to keep the concomitant response
attached to the ordered fitted value and replace the known-cost gradient in (12) by
Equivalently, this proxy optimizes the grid objective
over the same full intersection. This computational proxy is used in the numerical section, but it is not the estimator covered by the statistical theorem below.
Stage 4: Prediction for new observations. The closed-form rule and the full quantile-function problem return complete adjusted quantile curves. The two grid methods return only adjusted values at the midpoint nodes. We turn these grid values into a curve after the optimization. For , define as the interpolation operator that takes a vector and returns a function on . The function linearly connects and . It equals on and on . We therefore set for . This interpolation preserves the nondecreasing order and keeps the curve in .
This interpolation step is separate from the empirical quantile construction in Stage 2. There, is the exact inverse empirical distribution function. Here, is the interpolated output of a grid calculation. In Section 4, instead denotes the known-cost plug-in estimator defined by (10).
Once an adjusted curve is available, either directly or by interpolation, map a new score to its within-group rank. The final predictor is
where is the empirical distribution function of the unconstrained calibration scores in group s:
We compute this function once from the group-s calibration scores and then hold it fixed for new observations. Its value can equal 0 or 1. The constant pieces on and therefore make the rank map well-defined at both endpoints and keep every prediction inside the allowed range.
The two-group ACS implementation in Section 6 uses one additional convention for its and adjustments. If all adjusted group quantile vectors are exactly equal to their original vectors, it returns a copy of the original predictions; otherwise it applies the rank map above. This avoids changing predictions through an empirical distribution-function/quantile round trip when no curve adjustment is needed. This convention is specific to the two-group ACS implementation; it does not change the simulation, classification, or three-group results, or the full-function known-cost estimator studied in Section 4.
The final prediction rule uses the person’s group label. The grid calculation guarantees only that the adjusted curves meet the tolerance at the grid points. After we convert a fitted score to an estimated rank and read a value from the curve, the resulting predictions need not satisfy exactly the same Wasserstein bound. This difference can arise when groups have different sample sizes or when fitted scores are tied.
4 Theoretical Properties
In this section, we study the statistical behavior of the proposed estimator, which replaces the unknown population group weights and quantile functions with estimates from the data. It then solves the same fairness problem using these estimated inputs. We obtain two main results. First, we show that the estimated fair quantile functions converge to their population targets. Second, we show that the final prediction rule converges to the population fair predictor.
The proof has three steps. Lemma 4 shows that the estimated group quantiles converge to the true group quantiles. Theorem 2 shows that the fairness adjustment preserves the convergence rate. Crucially, strong convexity makes this possible because it prevents the optimizer from changing too much when the inputs change. Lemma 5 and Corollary 1 then show that using estimated ranks still produces consistent predictions.
4.1 Assumptions
We now state the assumptions used in our analysis.
Assumption 4 (Positive group proportions). The number of sensitive groups K is fixed and
For the realized calibration sample, and are fixed inputs to the empirical optimization. Under the i.i.d. sampling, .
Assumption 5 (Density of latent predictors). For each group , the cumulative distribution function of the latent predictor admits a probability density function that is bounded away from zero and infinity on a compact support interval . That is, there exist constants such that for all .
Assumption 6 (Conditional first-stage rate). The estimator , trained on the independent auxiliary sample of size and clipped to , satisfies, for a deterministic and every group ,
The lower density bound in Assumption 5 prevents the quantile curve from changing too quickly. Assumption 6 controls the average squared difference between fitted and true scores within each group, conditional on the training data.
4.2 Convergence of Latent Quantiles
We first study the estimated score quantiles before applying any fairness adjustment.
Lemma 4. Under Assumptions 4, 5 and 6, the empirical latent quantile functions satisfy:
The term comes from fitting the regression function, while comes from estimating the score distributions. We next study how these errors affect the fair quantile functions.
4.3 Convergence of the Fair Predictor
We now compare the population fairness problem with its finite-sample version. Both use the feasible set
where, for , distance means the largest difference after ignoring sets of ranks with measure zero, a convention called the essential supremum. The set is bounded and convex. Both problems minimize a loss over this set. For a candidate tuple of group quantile functions , the population loss is
For each group, the integral averages the induced cost over ranks, and weights that group by its population share. To describe the optimizer, we consider small changes that keep the quantile curves inside K. At the minimum, no allowed direction can reduce G to first order. This condition is called a variational inequality(Showalter, 2009).
Our main result bounds the distance between the population fair quantiles and the estimated fair quantiles . Here and below, the known-cost plug-in estimator means a minimizer of over the full feasible set.
The next assumption has three parts. First, strong convexity means that the objective rises sufficiently quickly as we move away from its minimum. This makes the target unique and stable. Second, the gradient must change smoothly with the latent score, so an error in the score quantiles produces a controlled gradient error. Third, the latent-score and prediction ranges are compact, and the gradient is assumed to be uniformly bounded on that domain.
Assumption 7 (Regularity of Known Cost). The induced expected cost
or its derivative is available analytically, up to terms that do not depend on . It satisfies the following conditions:
- Strong Convexity of Induced Cost: For every latent-score value z, the map is -strongly convex on the feasible prediction range. That is, there exists such that for all feasible and all relevant z,
Consequently, the population objective is -strongly convex on , and the known-cost plug-in objective is strongly convex on the event .
- Lipschitz Continuity of the Score in : The partial derivative is -Lipschitz in , uniformly over feasible : there exists such that for all feasible and all relevant ,
- Bounded feasible range: The feasible set is uniformly bounded in the sense that there exists a compact interval with
In addition, is finite and uniformly bounded on the relevant compact domain:
For squared error loss under , , so and . For logistic and canonical GLM losses, the assumption applies on compact natural-parameter ranges with curvature bounded away from zero, or after adding a small ridge regularizer.
Lemma 4 controls the estimated score quantiles. The regularity conditions above then control the resulting gradients. In particular, Lemma 4 and Assumption 7 imply
To see why, note that the range of lies in the compact support interval , and every feasible lies in . The Lipschitz condition in then controls the effect of replacing by .
The known-cost plug-in estimator solves
This objective estimates in two places. It replaces the population group weights by their sample versions . It also replaces the population score quantiles by the empirical score quantiles . The group-weight error is of order , the same order as the calibration part of the quantile error. Theorem 2 accounts for both sources.
For a tuple , its population-weighted norm is
Given two tuples of square-integrable functions, and , their weighted inner product is
Theorem 2. Suppose Assumptions 4, 5, 6, and 7 hold. Let be the known-cost plug-in minimizer of over , and let denote the population-optimal approximately fair quantile function tuple. Equivalently, let
where the same bounded convex feasible set is used in both problems. Then
The squared error rate has the same two sources as Lemma 4. Fitting the first-stage regression contributes , and using a finite calibration sample contributes . Strong convexity ensures that these small input errors produce a small change in the constrained minimizer.
Theorem 2 controls the estimated target quantile functions. We now turn this result into a statement about predictions. Two facts are needed. First, the rank computed from the fitted score must approach the rank of the population score. Second, the population fair quantile must change continuously when its rank changes slightly. For a function , its Lipschitz constant is
with the convention that if the supremum is infinite. The corollary below needs only continuity, not a finite Lipschitz constant.
As defined in Section 3, the calibration sample is used to construct , , and . We collect it together with the auxiliary training sample in
for all data used to construct the final estimator. Let denote an independent test covariate drawn from the conditional distribution . The population and estimated ranks of this test observation are
Lemma 5 (Stability of empirical ranks). Suppose Assumptions 5 and 6 hold, and suppose the auxiliary training sample used to construct is independent of the calibration sample used to construct . Then, for each group with ,
Equivalently,
Moreover, if
then
Assumption 8 (Continuity of population fair quantiles). For each group with , the population fair quantile function is continuous on .
Remark 2. Lemma 5 verifies the stability of the empirical rank transformation under the sample-splitting scheme used in Section 3. The corollary below does not require a uniform Lipschitz bound on the estimated interpolants . It uses only the monotonicity of the estimated quantile curves, the bounded feasible prediction range from Assumption 7, and the continuity of the population fair quantile functions.
Corollary 1 (Consistency of the final fair predictor). Suppose Assumptions 4, 5, 6, 7, and 8 hold. Define the population approximately fair predictor
and the plug-in fair predictor
Then
Consequently, the final fair prediction rule is consistent in integrated squared prediction error.
5 Numerical Experiments
5.1 Simulation setup
We conducted a simulation study, which focuses on three key questions: (i) what shape does the fairness-accuracy frontier have? (ii) where along the distribution does each rule act? and (iii) how well does a calibration constraint transfer to new data? We report test MSE for regression and test accuracy for classification.
During calibration, we represent each group distribution by a fitted curve on a numerical grid. We report three quantities. The grid gap is the largest distance between any two fitted curves. The grid violation is the amount by which this gap exceeds , with zero meaning that the numerical constraint is met. These two quantities describe the fitted curves on the grid, not the predictions assigned to individual observations. The test gap is computed from the final predictions on the held-out sample. We compare gaps only when they use the same Wasserstein distance.
To put the tolerances on a common scale, we write , where is the grid gap before any adjustment. Most paths use . The classification plot extends to so that its last point lies near the unadjusted fit. At , the fitted curves have zero gap on the grid. For the two-group regression simulations, leaves the calibration quantile curves unchanged. The final test predictions can still differ slightly from the raw predictions because they are reconstructed through the empirical rank map. The two-group ACS implementation instead preserves the raw predictions when the adjustment is inactive, as described in Section 6. For the observed-loss grid method, only makes the original score quantiles feasible. The two-group curves use and replications.
Only the two-group regression results average over repeated samples. The three-group, classification, and ACS examples each use one data split, so their curves are mainly for illustrations.
Data-generating process 1 (DGP1): linear mean shift. This process creates differences across the full prediction distribution. The two groups are balanced: . The feature vector is Gaussian with covariance . This first-order autoregressive, or AR(1), structure makes nearby features correlated. Each group has its own intercept and slope:
with , , and .
Data-generating process 2 (DGP2): tail shift. The second DGP uses the same basic design and adds an additional group difference in the upper tail. In group , the regression function receives the bump
with and .
Implementation. A stratified 40/30/30 split forms auxiliary, calibration, and test samples. We fit separate group-wise random forests on the auxiliary sample, learn the quantile adjustment on the calibration sample, and evaluate it on the test sample. Each forest uses 200 trees, depth 10, and minimum leaf size 5. The quantile calculation uses midpoint nodes on , with prediction range , exact empirical quantiles, right-continuous empirical ranks, and constant endpoint interpolation.
For the computationally more demanding three-group optimization, we use , range , and 25 fairness tolerances, step size 0.1, projection tolerance , and outer tolerance . Weighted Dykstra projection enforces fairness, ordering, and range constraints together.
5.2 Two-group regression results
Figure 1 shows diminishing returns. A moderate tolerance recovers much of the accuracy lost under exact parity, whereas removing the last part of the gap is disproportionately costly. In the DGP1 experiment, for example, removes almost half of the original test gap but incurs only about one quarter of the MSE increase seen at . DGP2 shows the same pattern. This is the practical value of a tolerance: it avoids the steepest part of the fairness–accuracy curve.
The numerical constraints are satisfied accurately on the calibration quantile grid. Across all 6,000 adjusted fits, the largest grid violation is . A test gap can still be positive at because the adjustment is learned from the calibration sample and evaluated on a new sample using estimated ranks. This does not indicate a failure of the grid calculation.
Table 3: Simulation results at (that is, ). Entries are means over replications, with standard errors (SE) in parentheses. “Test gap” is the achieved test-set Wasserstein distance in the norm named by that row.
| Constraint | DGP1 | DGP2 | ||
|---|---|---|---|---|
| MSE | Test gap | MSE | Test gap | |
| 1.5550 (0.0179) | 1.0236 (0.0351) | 1.7159 (0.0204) | 1.2659 (0.0394) | |
| 1.5493 (0.0178) | 1.0700 (0.0341) | 1.7519 (0.0219) | 1.3802 (0.0377) | |
| 1.3862 (0.0159) | 2.4619 (0.0545) | 1.4192 (0.0147) | 3.8044 (0.0743) | |
The quantile plots explain why the adjustment depends on where the groups differ. In DGP1, the gap extends across most ranks, so every rule changes a broad part of each distribution. In DGP2, the extra separation is concentrated in the upper tail. Clipping can therefore leave ranks already inside the allowed band unchanged and act mainly on the largest gaps; in the representative plot, about 62% of the ranks remain unchanged.
Table 3 gives exact results at . The and rules have nearly the same MSE in DGP1 and differ slightly in DGP2. This suggests that the location of the disparity can matter, but it
Regression Trade-off Curves: DGP1 (n=2000)

Regression Trade-off Curves: DGP2 (n=2000)

Figure 1: Fairness–accuracy frontiers for DGP1 (top) and DGP2 (bottom) at n = 2000. The curves become steep near exact parity: the last reduction in the held-out gap costs more MSE than earlier reductions. Each panel uses its named Wasserstein norm, so horizontal scales should not be compared. Curves are Monte Carlo means; ribbons show plus or minus one standard error.
does not establish a general ranking of the norms. Their test-gap values are on different scales and should be read separately.
5.3 Multi-group regression
This experiment tests simultaneous pairwise constraints and unequal group weights. We use seed 42, n = 3000, d = 5, and , so the largest group is two and a half times as common as the smallest. The outcome follows
where and .
A stratified 40/30/30 split provides auxiliary, calibration, and test data. We fit OLS with group indicators on the auxiliary sample, learn the adjustment on the calibration sample, and evaluate it on the test sample.
With three groups, the pair that limits fairness can change with the tolerance. Under tight constraints, the high-intercept group's distances to both other groups equal the allowed tolerance. From about onward, only the low-versus-high pair reaches that tolerance. The middle group is already close enough. The method therefore adjusts the pairs that need it rather than forcing all three pairwise distances to be equal.
The unequal weights also help determine which group absorbs the adjustment. The realized calibration proportions are (0.1967, 0.2900, 0.5133). At , the smallest group's quantile curve moves almost three times as far as the largest group's curve, as measured by root-mean-square distance across ranks (1.58 versus 0.54). The group-weighted loss gives the largest calibration group more influence on the fitted curves. The active pairwise constraints matter as well. The maximum-pairwise constraint limits how far apart the groups can be, but it does not require all groups to move by the same amount.
As in the two-group experiments, most of the predictive improvement occurs early. The test MSEs are 3.6678, 1.7769, and 1.1359 at , 0.5, and 1, respectively. Thus, by , the method recovers about 74.7% of the MSE improvement along the computed path. Because it minimizes observed calibration losses on a grid, the path need not end at the raw OLS fit. All 25 runs stopped only after meeting the stated numerical criteria. The largest grid violation is . The positive test gap at arises because the fitted adjustment is applied to a new sample using estimated ranks.
Quantile Functions: DGP1
(A) Unconstrained Calibration Quantiles

(B) Adjusted: constraint ( -Dmax)
(C) Adjusted: constraint ( -Dmax)
(D) Adjusted: constraint ( -Dmax)
Figure 2: Calibration quantiles for the linear mean-shift process (DGP1) at . Because the groups differ across nearly all ranks, each rule makes a broad adjustment. Dashed curves are original; solid curves are adjusted.
Quantile Functions: DGP2
(A) Unconstrained Calibration Quantiles

(B) Adjusted: constraint ( -Dmax)
(C) Adjusted: constraint ( -Dmax)
(D) Adjusted: constraint ( -Dmax)
Figure 3: Calibration quantiles for the tail-shift process (DGP2) at . The unconstrained gap grows in the upper tail. Clipping therefore leaves ranks already inside its band unchanged and acts mainly where the gap is largest. Dashed curves are original; solid curves are adjusted.
K=3 regression: calibration constraint and held-out test disparities

Figure 4: Held-out pairwise gaps in the K = 3 experiment. As the tolerance grows, the low-versus-high pair becomes the largest held-out gap, while the other two pairs remain closer. The dashed line is the largest gap between the fitted group curves on the calibration grid; the dotted line is the calibration tolerance.
(A) Calibration latent quantiles

(B) Corrected PGD adjustment at
Figure 5: Calibration quantiles before and after the K = 3 adjustment at half the baseline gap. Panel (A) shows the unadjusted calibration quantile curves. Panel (B) overlays the unadjusted curves (dashed) and the adjusted curves (solid). The smallest group moves most, while the middle and largest groups move much less. Unequal weights and the active pairwise constraints jointly shape these changes. Flat stretches arise when the ordering projection pools neighboring ranks.
5.4 Classification illustration
We next examine whether the same distributional adjustment can reduce between-group differences in classification scores without a large loss in accuracy. With seed 42, we generate observations from two equally likely groups. We use and
We use a stratified 40/30/30 split and grid points. We fit logistic regression using on the auxiliary sample, learn a quantile map from the calibration logits, and apply it to the test logits. We use the clipping rule that is optimal for squared loss and then evaluate classification accuracy. It is not a logistic-risk optimum.
Figure 6 plots the 30 held-out accuracies against the gaps between the adjusted curves on the calibration grid. At , this grid gap is zero. The solid curve is a fitted line constrained not to decrease, also called an isotonic fit. It only summarizes the plotted points and does not imply that test accuracy must increase with the tolerance.
Separate test-gap calculations quantify a useful middle ground. At ( ), the held-out logit gap falls from 1.9300 to 1.2572, a 34.9% reduction, while accuracy falls from 0.7667 to 0.7458, a loss of 2.08 percentage points calculated before rounding. At exact calibration parity ( ), accuracy is 0.7017 and the held-out gap is 0.3226, giving a smaller test gap but more than three times the loss in accuracy. These held-out gaps are distinct from the calibration-grid gaps on the figure's horizontal axis. Accuracy changes in steps when adjusted logits cross the classification threshold.
Classification: held-out accuracy versus calibration gap

Figure 6: Calibration-grid gap versus held-out accuracy. Light points show the 30 observed values. The solid line is a fitted summary constrained not to decrease. The black star marks , where the grid gap is zero, and the red square marks the unadjusted model at its gap before adjustment. The line does not imply that held-out accuracy is monotone.
6 Real Data Application: American Community Survey (ACS) Income Prediction
6.1 Data and protocol
We now move from simulations to real data. This application asks how prediction accuracy changes when group-specific income-prediction distributions are moved closer together. We use the California 2018 one-year ACS person file provided through Folktables (Ding et al., 2021). We ask whether a moderate tolerance preserves much of the accuracy lost under exact parity and, with three groups, which pair has the largest held-out gap.
We keep adults older than 18 who have a positive class-of-worker code and positive personal income. The outcome is . The nine predictors are age (AGEP), class of worker (COW), education (SCHL), marital status (MAR), occupation (OCCP), place of birth (POBP), household relationship (RELP), usual weekly work hours (WKHP), and sex (SEX). Race is not used as a predictor; it only defines the groups. The K = 2 analysis compares White and non-White adults. The K = 3 analysis uses values 1, 2, and 6 of the ACS race field RAC1P for White, Black, and Asian adults. We do not use survey weights. The results therefore describe the unweighted filtered sample. Some ACS predictors describe categories, such as occupation and marital status. We enter their numerical codes directly into the model. The trees split on those codes, so arbitrary coding of nominal categories affects which category groupings a split can express and can affect the fit. This is a limitation of this illustration.
The filtered sample contains 207,019 records. Its subset contains 172,850 records and is split into 69,140, 51,855, and 51,855 observations for the auxiliary, calibration, and test samples. Both analyses use a stratified 40/30/30 split with seed 42. We fit a gradient-boosting regressor on the auxiliary sample using 200 trees, maximum depth 6, learning rate 0.1, and subsample fraction 0.8. The calibration sample determines the adjustment; the test sample provides the reported and gaps.
The calibration grid has midpoint nodes. The prediction maps use ranks from the right-continuous empirical distribution function and the constant endpoint extension defined in Section 3. The fixed log-prediction range is . For , we use 25 tolerances, step size 0.1, projection tolerance , and outer tolerance .
For , the and implementations preserve the original predictions whenever all adjusted quantile vectors exactly equal their originals. In particular, their endpoints coincide with the unadjusted model. Active adjustments still use the empirical rank map. The implementation uses the rank map throughout.
For the fair model, let denote the final prediction for test observation . We measure test prediction quality by :
Here indexes the test sample. For the unadjusted model, we use the same formula with in place of . Figure 7 uses held-out Wasserstein gaps. In Figure 8, the horizontal axis is the largest distance between the fitted group curves on the calibration grid, and the vertical axis is held-out . At , the horizontal value is zero by construction. A nonzero held-out gap
ACS Income: norm-specific fairness-accuracy trade-offs (K=2)

Figure 7: California 2018 ACS income regression with K = 2 groups. The curves show all 30 observed settings per norm in tolerance order. The marked near-half setting is . At , the identity convention preserves the unadjusted predictions, so the final point coincides with the unadjusted model. The final rise reflects both the tolerance change and the bypass of empirical rank reconstruction. The exact-calibration-parity setting can retain a nonzero held-out gap. Each panel uses its own Wasserstein norm and should be read separately.
can remain because the adjustment is learned from one finite sample and applied to another using estimated ranks. It does not mean that the numerical constraint failed.
6.2 Results: (White vs. Non-White)
The two panels in Figure 7 tell the same practical story. At , the tolerance is about half the baseline calibration gap and the held-out gap is also about half its baseline value. The method has recovered 61.6% ( ) and 61.4% ( ) of the lost under exact calibration parity. The and adjustments also trace almost identical paths at matched normalized tolerances. In this example, the tolerance has a clearer effect on prediction than the choice between these two adjustment rules. Their gap scales remain different and are not compared.
At , the corresponding held-out gap falls by more than 90% in either panel, at an absolute cost of 0.0078 (1.34% relative). The largest grid violation is . This confirms that the fitted curves meet the constraint on the grid. It does not imply that the predictions assigned to individual calibration observations have exactly the same empirical distribution.
At the inactive endpoint, both methods reproduce the unadjusted model's , with held-out gaps 0.1865 ( ) and 0.1900 ( ). The last step of the plotted path rises from at to 0.58167 at . At this endpoint, the identity convention bypasses empirical rank reconstruction. The final rise should therefore not be attributed entirely to relaxing the fairness constraint.
6.3 Results: (White vs. Black vs. Asian)
The clearest three-group finding is which pair has the largest held-out gap. White adults make up about three quarters of the calibration sample. Even so, the Black–Asian pair has the largest held-out gap at every tolerance. A method that compared each group only with White would therefore miss the pair with the greatest separation.
At , the largest held-out gap falls from 0.2789 to 0.0817, a 70.7% reduction, while falls by 0.0099 (1.73% relative). Figure 8 plots the 25 held-out values against the largest distances between the fitted group curves on the calibration grid. Loosening the constraint lowers the optimized calibration loss but need not raise held-out . The shallow dip reflects learning the adjustment on one sample and evaluating it on another. The fitted nondecreasing line is only a visual summary, so the tolerance should be selected using validation data.
The computed path does not end at the raw unadjusted model because the method minimizes observed calibration losses on a grid and then applies an estimated rank map. The distance to the red star is therefore not entirely a fairness cost. Across all 25 fits, the largest positive excess of a pairwise calibration-grid distance above its tolerance is .
ACS income (K=3): held-out versus calibration gap

Figure 8: Maximum pairwise distance between the fitted group curves on the calibration grid versus held-out . Light points show the 25 observed values. The solid line is a fitted summary constrained not to decrease. The black diamond marks , where the grid gap is zero, and the red star marks the unadjusted model at its gap before adjustment. The line does not imply that held-out is monotone.
6.4 Distribution shift visualization
We next look beyond the largest pairwise gap and compare the full prediction distributions before and after adjustment. The adjustment changes the shapes and relative locations of the calibration prediction distributions. The smoothed group densities remain distinct at this positive tolerance.
ACS Income: Distribution Shift from Fairness Adjustment (K=3)

Figure 9: Smoothed distributions of the California 2018 ACS calibration predictions before and after the adjustment at . The smoothed group densities remain distinct at this positive tolerance.
7 Conclusion
We developed a framework for fair regression under Approximate Demographic Parity. By replacing strict independence with a distance-based constraint, the framework makes the trade-off between predictive utility and distributional parity explicit and tunable.
Using optimal transport, we show that the prediction problem and the corresponding problem over group distributions have the same best achievable value. When the distributional problem has an optimal solution and the required deterministic transport rules exist, those rules give an optimal approximately fair predictor. Under the stated one-dimensional monotonicity condition, the problem can also be written in terms of group-specific quantile functions. This quantile problem is convex when the induced cost is convex in the prediction argument. For squared error loss with two positively weighted groups, we obtained closed-form solutions under , , and constraints. They correspond to soft-thresholding, linear shrinkage, and clipping. For known induced costs that are convex in the prediction argument, including settings with multiple sensitive groups, we developed numerical methods based on clipping or weighted projected-gradient updates on a finite grid.
When the induced cost is known, we establish convergence rates for the estimated fair quantile functions and consistency of the final prediction rule under the stated assumptions. The simulations show how predictive accuracy and held-out fairness change as the tolerance varies. We report satisfaction of the numerical constraints separately from fairness gaps on held-out data. The California ACS income application further illustrates the framework and shows that, for this prediction task, a substantial portion of the held-out Wasserstein gap can be reduced with only a small loss in predictive accuracy. This interpretation is descriptive for the fitted prediction problem and should not be read as a causal claim about the sources of disparity.
Future work includes deriving error bounds for the finite-grid numerical method, developing analytic solutions for additional multi-group problems, and extending the transport-based approach to other fairness criteria, such as equalized odds.
Acknowledgments
The authors used OpenAI Codex with the GPT-5.6-Sol and GPT-6 models for language editing, LaTeX preparation, code debugging, and mathematical and computational consistency checks. All mathematical arguments, citations, code, numerical results, and final text were reviewed and verified by the authors, who take full responsibility for the manuscript.
References
Agarwal, A., M. Dudík, and Z. S. Wu (2019). Fair regression: Quantitative definitions and reduction-based algorithms. In Proceedings of the 36th International Conference on Machine Learning, Volume 97 of Proceedings of Machine Learning Research, pp. 120–129. PMLR.
Aliprantis, C. D. and K. C. Border (2006). Infinite Dimensional Analysis: A Hitchhiker's Guide (3 ed.). Berlin, Heidelberg: Springer.
Ambrosio, L. (2003). Lecture notes on optimal transport problems. In Mathematical Aspects of Evolving Interfaces, Volume 1812 of Lecture Notes in Mathematics, pp. 1–52. Berlin, Heidelberg: Springer.
Bauschke, H. H. and P. L. Combettes (2017). Convex Analysis and Monotone Operator Theory in Hilbert Spaces (2 ed.). CMS Books in Mathematics. Cham: Springer.
Cambanis, S., G. Simons, and W. Stout (1976). Inequalities for when the marginals are fixed. Zeitschrift für Wahrscheinlichkeitstheorie und Verwandte Gebiete 36(4), 285–294.
Caton, S. and C. Haas (2024). Fairness in machine learning: A survey. ACM Computing Surveys 56(7), 1–38.
Charpentier, A., C. Denis, R. Elie, M. Hebiri, and F. Hu (2026). Fair regression under localized demographic parity constraints. arXiv:2603.25224.
Chiappori, P.-A., R. J. McCann, and B. Pass (2017). Multi-to one-dimensional optimal transport. Communications on Pure and Applied Mathematics 70(12), 2405–2444.
Chzhen, E., C. Denis, M. Hebiri, L. Oneto, and M. Pontil (2020). Fair regression with Wasserstein barycenters. In Advances in Neural Information Processing Systems, Volume 33, pp. 7321–7331.
Chzhen, E. and N. Schreuder (2022). A minimax framework for quantifying risk-fairness trade-off in regression. The Annals of Statistics 50(4), 2416–2442.
Ding, F., M. Hardt, J. Miller, and L. Schmidt (2021). Retiring adult: New datasets for fair machine learning. In Advances in Neural Information Processing Systems, Volume 34, pp. 6478–6490.
Duchi, J., S. Shalev-Shwartz, Y. Singer, and T. Chandra (2008). Efficient projections onto the -ball for learning in high dimensions. In Proceedings of the 25th International Conference on Machine Learning, pp. 272–279. ACM.
Feng, Y., W. Wang, R. K. W. Wong, and X. Zhang (2026). Fair regression under demographic parity: A unified framework. arXiv:2601.10623.
Generali Lince, M., V. Divol, R. Flamary, S. Gaucher, and P. Loiseau (2026). Geometry of relaxed fair regression: A unified framework for aware and unaware settings. arXiv:2605.28233.
Gordaliza, P., E. del Barrio, F. Gamboa, and J.-M. Loubes (2019). Obtaining fairness using optimal transport theory. In Proceedings of the 36th International Conference on Machine Learning, Volume 97 of Proceedings of Machine Learning Research, pp. 2357–2365. PMLR.
Jiang, R., A. Pacchiano, T. Stepleton, H. Jiang, and S. Chiappa (2020). Wasserstein fair classification. In Proceedings of the 35th Conference on Uncertainty in Artificial Intelligence, Volume 115 of Proceedings of Machine Learning Research, pp. 862–872. PMLR.
Le Gouic, T., J.-M. Loubes, and P. Rigollet (2020). Projection to fairness in statistical learning. arXiv:2005.11720.
Mehrabi, N., F. Morstatter, N. Saxena, K. Lerman, and A. Galstyan (2021). A survey on bias and fairness in machine learning. ACM Computing Surveys 54(6), 1–35.
Menon, A. K. and R. C. Williamson (2018). The cost of fairness in binary classification. In Proceedings of the 1st Conference on Fairness, Accountability and Transparency, Volume 81 of Proceedings of Machine Learning Research, pp. 107–118. PMLR.
Santambrogio, F. (2015). Optimal Transport for Applied Mathematicians: Calculus of Variations, PDEs, and Modeling. Cham: Birkhäuser.
Showalter, R. E. (2009). Hilbert space methods for partial differential equations. Electronic journal of differential equations, 01–214.
Villani, C. (2009). Optimal Transport: Old and New, Volume 338 of Grundlehren der Mathematischen Wissenschaften. Berlin: Springer.
Weikard, R. (2018). Real analysis. University of Alabama at Birmingham lecture notes. Section 7.2.9, Integration by parts.
Xu, S. and T. Strohmer (2023). Fair data representation for machine learning at the pareto frontier. Journal of Machine Learning Research 24(331), 1–63.
A Proofs of the Main Results
This appendix first proves the population and statistical results. It then derives the closed-form formulas and the multi-group squared-loss results. Each proof starts with its main idea. The calculations then show how that idea gives the stated result.
Proof of Theorem 1. Let A be the infimum of the prediction problem in (3), and let B be the infimum of the constrained transport problem in (4). We prove the two inequalities separately.
First, . Take any feasible predictor , and let . Because is feasible, the distributions satisfy all pairwise Wasserstein constraints. For group , define
Its first marginal is , and its second marginal is . Thus , and
This holds for every feasible . Taking the infimum over gives .
Next, . Fix . By the definitions of the outer and inner infima in (4), we can choose feasible distributions and couplings such that
Because is non-atomic, the graph-measure approximation used in the proof of Theorem 2.1 of Ambrosio (2003) gives measurable maps satisfying
where denotes weak convergence. The first equality is important: every approximation has exactly the chosen output distribution, so it preserves the pairwise fairness constraints. Since is continuous on the compact set , it is bounded, and weak convergence gives
Define one predictor across all groups by
Its conditional distribution in group is , so is feasible. Because the number of groups is finite,
Letting yields . Therefore .
Finally, suppose a deterministic optimizer exists. Assume that the constrained transport problem attains at and that, for each group, an optimal Monge map from to exists. Define
This predictor has conditional distribution in group s, so it is feasible. Moreover,
Hence attains the AFRP infimum.
Proof of Lemma 2. Increasing rearrangement means sorting each function into quantile order. We show that this sorting has two useful effects. It cannot enlarge the group-to-group distances, and it cannot increase the prediction cost.
Distances between groups. For , matching equal ranks is the least costly way to pair two one-dimensional distributions under the cost . This rank matching is the monotone coupling. It minimizes among all pairings of the same marginal laws. Therefore . The same conclusion for follows from the one-dimensional quantile representation of .
Prediction cost and quantile properties. The inequality says that matching a larger score with a larger prediction is no more costly than crossing the two matches. This property is called submodularity, or quasi-antitonicity. The fixed-marginal rearrangement inequality of Cambanis et al. (1976, Theorem 2), applied to , then shows that matching scores and predictions at the same percentile minimizes the expected cost for . This is also called a comonotone coupling. For the marginals of and , it is . This gives the stated cost inequality.
The rearranged functions are quantile functions, so they are nondecreasing and left-continuous. Sorting changes only the order of the values, not their distribution. This preservation of the value distribution, called equimeasurability, keeps the functions integrable. It also keeps their values in I, apart from possible changes on sets of measure zero. This is the essential-range statement.
Proof of Lemma 3. Each closed-form rule changes only the difference between the two groups. The key fact is that its difference map preserves order, never expands a difference, and leaves zero fixed. We use these properties first to prove that the adjusted curves remain nondecreasing. We then verify their range and regularity.
The adjusted curves remain ordered by rank. Fix and write
Then
For , we have
If , then . Because is nondecreasing, the last term is nonnegative. Hence . Now suppose . The 1-Lipschitz property and monotonicity of imply
Therefore,
Thus cannot decrease as the rank moves from u to v.
Similarly,
If , then , so . Now suppose . The 1-Lipschitz property gives
and hence
Thus is also nondecreasing.
The adjusted values stay in range. The condition , together with monotonicity and the 1-Lipschitz property, implies that for some (take ). Here is the fraction of the original group difference that remains after adjustment. Pointwise,
The coefficients in each line are nonnegative and sum to one. Both adjusted values are therefore weighted averages of and , so they remain in . Every Lipschitz map is continuous, so composition with preserves left continuity. Boundedness then gives integrability.
The three adjustment rules satisfy these conditions. Linear shrinkage uses with . Soft-thresholding uses . Clipping uses . Each map is nondecreasing, 1-Lipschitz, and zero at zero. Therefore the resulting and have all the asserted properties.
Proof of Lemma 4. The estimated quantile differs from the population quantile for two reasons. We use fitted scores instead of true scores, and we observe only a finite calibration sample. We control these two errors separately and then add them.
Error from fitted scores. Fix . Let be the empirical measure of the fitted calibration scores, the empirical measure of the corresponding unobserved true scores with quantile , and the population true-score law. Pair each fitted score with the true score for the same observation. This is one valid way to transport to , so
by independence of training and calibration and Assumption 6.
Error from the finite calibration sample. Let be the empirical cumulative distribution function (CDF) of the true scores. The Dvoretzky–Kiefer–Wolfowitz inequality controls its largest difference from the population distribution function. Because every group has positive probability, has the same order as . Therefore, . Since the density of is at least , its cumulative distribution function cannot be too flat. Inverting the two distribution functions therefore gives , using constant endpoint extensions at
0 and 1. Combining this bound with the fitted-score bound and applying the triangle inequality gives
Proof of Theorem 2. The population and estimated problems use the same feasible set but slightly different inputs. The proof shows that this small input change causes only a small change in the optimizer. We first write the two objectives and their gradients. We then use the fact that no feasible move can improve either optimizer. Strong convexity turns this fact into a stability bound. Finally, we control the gradient difference using the score-quantile and group-weight errors.
Our goal is to bound . Recall that . The corresponding inner product is defined for two tuples of functions, and , by
Write and .
Step 1: Write the two objectives and their slopes. Define the population objective
and the estimated objective
By Assumption 7(1), is -strongly convex on and is convex on the event . The gradient records how an objective changes under a small change in its quantile functions. With respect to the -weighted inner product, these gradients, formally the Fréchet gradients, are
where .
Step 2: Use optimality within the fairness constraints. Let
and set . Since both optimizers lie in the same convex set, moving from either optimizer toward any other feasible point cannot lower its objective. These first-order conditions are called variational inequalities (Showalter, 2009):
Take in the first inequality. Take in the second. This gives
By -strong convexity of G,
where the last inequality uses . Next, add and subtract . Using then yields
This inequality is useful because its left side measures the squared distance between the two optimizers. Its right side depends only on the difference between the population and estimated gradients.
Step 3: Bound the difference between the gradients. The Cauchy–Schwarz inequality separates the gradient error from the optimizer error:
while Assumption 7(2) gives
where the last line uses Assumption 4 and the derived score-gradient bound following Assumption 7. The first term comes from estimating the score quantiles. The second comes from estimating the group weights. Therefore,
with probability tending to one.
Step 4: Insert the two input-error rates. Insert the preceding bound into (15). On the event , divide both sides by . Lemma 4 and Assumption 4 then give
and squaring yields
which proves the theorem.
Proof of Lemma 5. The estimated rank uses both a fitted score and an empirical distribution function. We first control the sampling error in that empirical distribution function. We then compare the fitted-score distribution with the true-score distribution. Finally, we show that the resulting ranks are nearly uniform, as true population ranks are.
Sampling error in the calibration distribution. Fix a group with . Conditional on the auxiliary training sample, is fixed. Let
denote the conditional distribution function of the fitted score in group s. The rank error is at most the sum of the empirical-distribution error and the error caused by replacing the true score with the fitted score:
The first term is the usual sampling error of an empirical cumulative distribution function. Conditional on , the Dvoretzky–Kiefer–Wolfowitz inequality gives
Difference between fitted and true score distributions. For any , a fitted and true score can fall on different sides of a threshold t only if their difference exceeds or the true score lies within of t. Therefore
By Assumption 5, the density of is bounded above, so little probability can lie in an interval of length :
By Assumption 6, the first probability on the right-hand side tends to zero if slowly enough. Hence
The upper density bound also means that is Lipschitz with constant at most . Thus
whose conditional second moment is by Assumption 6. Combining these bounds gives
The estimated ranks are nearly uniform. Because is independent of and is continuous under Assumption 5, conditionally on . Let
The preceding conditional bound and fixed K imply
If is within of , then the event is trapped between the events and . Markov's inequality controls the remaining event. For any and , this gives
and similarly
with the obvious truncation at the endpoints. Hence
Because the number of groups is fixed, we may take the maximum over groups. Choosing a deterministic slowly enough that gives
Proof of Corollary 1. The final prediction evaluates an estimated curve at an estimated rank. Its error therefore has two parts: error in the fair quantile curve and error in the rank used as its input. We show that both parts vanish.
Fix a group s with and write
Insert and subtract . The triangle inequality then separates the two errors:
Error from using an estimated rank. Let I be the compact feasible prediction interval from Assumption 7, and write
At scale , the modulus of continuity of the population fair quantile is
By Assumption 8, as . For every , the curve changes by at most when the two ranks are close. When they are farther apart, its bounded range gives
Therefore,
For fixed , Lemma 5 sends the second term to zero as . We can then let , which sends the first term to zero. Thus the rank-input error is .
Error from estimating the fair quantile curve. Let
Conditional on ,
Both and are nondecreasing quantile functions with values in . Their squared difference is therefore bounded and cannot oscillate without limit. More precisely, and , where TV denotes total variation. Stieltjes integration by parts (Weikard, 2018) then compares the average under the estimated rank distribution with the average under a uniform rank:
The supremum term includes the contributions from both endpoints. By Lemma 5, the right-hand side is . The uniform rank average is
Theorem 2, fixed K, and Assumption 4 imply this is for each group with . Thus the curve-estimation error is also .
Combining the two bounds and summing over the finitely many groups with weights yields
which proves the corollary.
A.1 Derivation of Closed-Form Solutions
This subsection derives the formulas in Section 2.5. Assume and . The key idea is to describe the two quantile functions by their weighted average and their difference. The fairness constraint acts only on the difference. The average can therefore remain at its unconstrained value, while the difference is moved to the nearest feasible function.
For , the objective is
subject to the distance constraint .
Decomposition of the Problem
Let be the weighted average and the difference function. This change of variables keeps all information because we can recover the two original functions from
Define and in the same way for the latent quantiles. Substitution into (16) gives
Expanding the two squares gives
The terms that mix the average and the difference cancel. Since , the remaining coefficients simplify to
Since the constraint depends only on (specifically, ), the two parts can be minimized separately.
-
Minimizing over gives . Thus the adjustment preserves the weighted group average.
-
Minimizing over means finding the feasible difference closest to in . This is a projection problem.
Case 1: -Constraint
Here we seek the function inside the ball that is closest to . In symbols, we minimize subject to . This operation is projection onto a closed convex ball in (Bauschke and Combettes, 2017). If , the feasible set is the singleton , which is the solution. Now suppose . Let be the Lagrange multiplier for the radius constraint. It can be positive only when that constraint is active. The Lagrangian is
Setting its derivative with respect to equal to zero gives
If , the original difference is already feasible, so and . If , the solution lies on the boundary. Substituting into yields , and therefore . The solution is linear shrinkage:
The second branch has a strictly positive denominator; in particular, when , the first branch applies. When the constraint is active, the same factor reduces the group difference at every rank.
Case 2: -Constraint
We now minimize subject to . Let be the Lagrange multiplier for this constraint. The Lagrangian is
The absolute-value function has a corner at zero, so it does not have an ordinary derivative there. Its subgradient is when and . The optimality condition says that, for each , there is a such that
This equation gives the soft-thresholding rule.
• If , then and . It follows that .
• If and , setting allows , satisfying the condition. On the inactive branch , the only point in this case has , and one may take .
Thus, . If , the original difference is feasible, so take and . For , the value of is uniquely determined by . For , the solution is . Unlike the rule, this projection can remove small local differences entirely while retaining larger ones after a common threshold is subtracted.
Case 3: -Constraint ( )
We minimize subject to for almost all . Both the loss and the constraint can be considered one rank at a time. At each , we choose the number in closest to . This is clipping:
Thus only differences outside the admissible fairness band are changed.
A.2 Squared loss with K > 2
We now specialize problem (6) to squared loss with groups. With more than two groups, there is no single difference function that describes every pair. Even so, two parts of the two-group geometry remain. The adjustment preserves the weighted average of the group quantiles. Also, under , each rank can still be solved separately. The fair quantiles solve
A key structural fact (multi-group analog of the two-group barycenter identity). At each rank, define the weighted averages before and after adjustment by
The following result shows that they are equal for any .
Proposition 1 (Weighted barycenter preservation under squared loss). Suppose and . The optimizer of (17) is unique and satisfies
Proof. The main idea is that shifting every group curve by the same function does not change any pairwise distance. At the optimum, such a shared shift cannot reduce squared loss. This forces the weighted average to match its original value. We first make this argument without the quantile and range requirements. We then show that the unique solution already satisfies those requirements.
Consider the weighted space and impose only the pairwise constraints. This is a nonempty closed convex set, so the closest point exists. Strict convexity makes that point unique; denote it by . Adding the same function to every component leaves every group difference unchanged. Therefore, the objective cannot decrease under any such positive or negative shared shift. Its slope in this direction must be zero, which gives
in
We next check the range. Clip every component to I. Clipping cannot enlarge a distance because it is 1-Lipschitz. Since every target lies in I, clipping also cannot increase squared loss. The minimizer is unique, so clipping cannot change it. Thus every already lies in I.
Finally, sort each component into quantile order. By Lemma 2, this cannot increase the pairwise distances or the squared loss. Uniqueness again means that sorting cannot change the minimizer. Hence its components are already nondecreasing and left-continuous. It is therefore the unique optimizer of (17), and the shared-shift identity above gives (18).
Closed-form characterization when . Under , no two group quantiles may differ by more than at any rank:
Both the squared loss and these constraints can be handled one rank u at a time. At a fixed rank, we solve
Equivalently, the constraint is : all adjusted values must fit inside one interval of width . We choose the best such interval and clip each original group value to it. When , let be its lower endpoint. Then
where minimizes the squared loss at that rank. Equivalently, it is chosen so that the clipping preserves the weighted average: for almost all . The multi-group rule is therefore explicit except for a one-dimensional search for the interval endpoint. If , all original group values already fit inside an allowed interval.
Why closed forms generally do not extend to when . For , each constraint combines differences across the full rank interval . We can no longer solve problem (17) one rank at a time. We must also satisfy all pairwise constraints together. In general, one common shrinkage factor or separate groupwise thresholding rules cannot meet all of these requirements. This is why the paper uses numerical projection after placing the quantiles on a finite grid.
Why the formula becomes harder with more than two groups. The first-order conditions show exactly where the difficulty appears. When , write the constraints in squared form: for all . For each pair, let be the Karush–Kuhn–Tucker (KKT) multiplier for the constraint . A positive multiplier identifies a constraint that affects the first-order conditions. Write when . Then, for each ,
(20) together with feasibility of the quantiles and multipliers. The complementary slackness condition means that a multiplier can be positive only when its pairwise constraint is exactly at the tolerance.
If the multipliers were known, (20) would be linear in . They are not known, however, because we do not know in advance which distances satisfy . With two groups, there is only one multiplier, which gives the single shrinkage factor. With more groups, as many as multipliers must be determined together. The equations must therefore identify both the solution and the constraints that are active. This coupled problem is called a nonlinear complementarity system. It generally requires a numerical solver. Examples include a method that searches over active constraints, Dykstra-type projection, the alternating direction method of multipliers (ADMM), and projected gradient on a finite grid.
When , the appropriate constraints are the linear equalities almost everywhere. This is the strict demographic-parity barycenter problem. The squared-constraint equations above are not used when the radius is zero.
A simpler sufficient rule for multiple groups. The exact pairwise problem usually needs a numerical solver. A simpler, conservative alternative compares every group with the same fixed weighted average . It is conservative because its requirements are stronger than the original pairwise requirements, so it may exclude some feasible solutions. Requiring each group to stay within of this average gives
Writing and , problem (21) can be solved separately for each group:
so each group uses the corresponding two-group projection formula. For , use when and otherwise use . For , soft-threshold to radius . For , clip pointwise to . In every case, set . Each update of preserves order, never expands differences, and keeps zero fixed. In the terminology used earlier, it is a nondecreasing 1-Lipschitz map fixing zero. Compare its change between any two ranks, as in the proof of Lemma 3, using and . This shows that is nondecreasing and left-continuous. It lies between these two functions at every rank and therefore remains in .
Different groups may use different shrinkage factors, so this simpler rule need not preserve . It does, however, guarantee the original pairwise tolerance. The triangle inequality gives . Thus each group needs radius , rather than , to ensure that every pair is at most apart.