We are asked: "Compose a secure multi-party ML training pipeline using secret sharing, secure aggregation, and fairness constraints."
Interpretation: We need to design a pipeline for multi-party machine learning training where multiple parties (data owners) jointly train a model without revealing their raw data. The pipeline should incorporate secret sharing, secure aggregation, and fairness constraints. We must compose it: likely a high-level design and maybe some pseudo-code or description of steps.
We need to ensure security: use cryptographic techniques like secret sharing (e.g., Shamir's secret sharing) to split data or computations, secure aggregation (like Bonawitz et al.'s protocol) to aggregate gradients or updates without revealing individual contributions. Also fairness constraints: ensuring that the trained model is fair across different demographic groups, possibly by incorporating fairness regularization or constraints during training, while maintaining privacy.
We need to produce a coherent answer: perhaps a step-by-step pipeline overview, key components, integration of fairness constraints in a privacy-preserving manner. Might also discuss threat model, assumptions, and possible optimizations.
Given the open-ended nature, we should provide a comprehensive answer: introduction, system model, pipeline steps (data preparation, secret sharing, local training, secure aggregation, fairness enforcement, model distribution), security analysis, fairness guarantee, challenges, and possibly references.
I'll structure:
- Introduction: secure multi-party ML with fairness.
- Threat model and assumptions: semi-honest parties, honest-but-curious, no collusion? Possibly assume honest majority for secret sharing? Or use threshold.
- System architecture: parties, coordinator (maybe optional), cryptographic primitives.
- Pipeline steps:
a. Data preprocessing and feature alignment: possibly using secure multi-party computation to align features without sharing raw data (e.g., using private set intersection).
b. Secret sharing of data or gradients: each party shares its data/model updates via secret sharing across a set of servers or among parties. Use additive secret sharing for efficiency.
c. Local training: each party trains a local model on its data (or a portion) and computes gradients/updates.
d. Secure aggregation: parties secret-share their gradients to an aggregation service (or use a secure aggregation protocol) that sums them securely without revealing individual gradients. This yields an aggregated gradient that is the sum of all parties' gradients.
e. Fairness constraints: integrate fairness into the objective function. However, to enforce fairness, we need to compute fairness metrics (e.g., demographic parity, equalized odds) which require knowledge of sensitive attributes. Sensitive attributes may be private. Need to handle fairness in a privacy-preserving way: either use secure multi-party computation to compute fairness metrics on secret-shared data, or incorporate fairness regularization that can be computed from aggregated statistics (e.g., group-wise loss). Might need to have parties hold shares of sensitive attributes or use techniques like "fairness-aware learning with differential privacy" or "secure aggregation with fairness constraints" where each party computes local group statistics and secret shares them, then aggregated and used to adjust the global gradient.
f. Model update: The aggregated gradient (or adjusted gradient considering fairness) is used to update the global model. The updated model is either broadcast to parties (encrypted) or secret-shared.
g. Repeat for multiple rounds.
- Implementation considerations: choice of secret sharing scheme (additive vs Shamir), communication overhead, use of trusted third party? Possibly avoid TTP.
- Security: How secret sharing and secure aggregation protect data privacy, and how fairness constraints are incorporated without leaking sensitive information.
- Fairness: How the pipeline ensures fairness. Possibly using a method like "aggregate gradients with fairness correction": compute group-wise gradients on each party's data for sensitive groups, then aggregate and adjust the global gradient to satisfy fairness constraints (e.g., via constrained optimization or Lagrangian). This can be done with secret sharing to keep individual group contributions private.
- Challenges: handling non-iid data, different group distributions, computational overhead, ensuring that fairness metrics are computed accurately under secret sharing.
- Conclusion.
We might also include a pseudo-code algorithm summarizing the steps.
Given the instruction "Compose", we should produce a narrative description and maybe a block diagram. Since we're in text, we'll just describe.
Let's craft a detailed answer.
We need to be precise: Use terms like "additive secret sharing", "secure aggregation protocol", "fairness constraints via constrained optimization", "sensitive attribute handling".
Potential approach:
-
Parties hold private datasets with features and labels, and some have sensitive attributes (like race, gender). They want to train a model that is accurate and fair.
-
They agree on a model architecture (e.g., logistic regression, neural network) and hyperparameters.
-
They perform a setup phase: each party generates secret shares of its data (or of gradients) and distributes to other parties or to a set of non-colluding servers (like in a three-server model). Could use a decentralized setting where every party is a server.
-
In each training round:
- Each party locally computes the gradient of its loss on its mini-batch (or full dataset) with respect to model parameters.
- Additionally, if fairness constraints require group-specific statistics (e.g., average loss per sensitive group), the party computes these locally and secret shares them.
- The party secret-shares its gradient (and possibly group gradients) to all other parties (or to aggregators) using additive secret sharing. So each party sends one share to each other party.
- The aggregators (or each party individually) sum the shares component-wise to reconstruct the sum of all gradients (only the sum, not individual ones). This is the secure aggregated gradient.
- The aggregated fairness statistics are similarly summed to get global group statistics.
- The global model update is computed by solving a constrained optimization: minimize loss with fairness constraints. For instance, using the method of Lagrange multipliers, we can incorporate a fairness penalty term that depends on the disparity between group losses. The aggregated gradient already includes the sum of individual gradients. We can adjust the gradient by adding a term that pushes the model towards fairness, based on the aggregated group statistics. The adjustment can be computed in a distributed manner: maybe a designated party (or all) compute the fairness correction using the aggregated statistics (which are known to all after summation? Actually the sum of shares reveals the aggregate; but if shares are distributed among aggregators, only the aggregators can reconstruct; we might have a trusted aggregator? In typical secure aggregation, the sum is revealed to all parties? Actually in Bonawitz protocol, each party receives the sum; they can compute their local update using the sum? Wait: Secure aggregation typically means that parties can jointly compute the sum of their vectors without any individual party learning others' inputs. After the protocol, each party learns the sum (or maybe a designated aggregator learns the sum). In many designs, the output is known to all parties (or to a central server). If all parties learn the sum, then each can compute the global model update by subtracting its own share? That would reveal others? Actually careful: In typical secure aggregation (Bonawitz et al.), parties submit masked shares; the final sum is decrypted and learned by a central server or by all. Usually, the protocol ensures that no party learns anything about other parties' individual vectors, only the sum. If all parties learn the sum, then each knows the sum. That's fine; they can then update the global model parameters. But they need to apply fairness adjustment; that adjustment can be applied by each party locally if they all have the same sum? But the fairness adjustment might require computing a function that depends on the sum and maybe some public parameters. All parties can compute the same update if they have the same sum. So they can all update the global model to the same new parameters. That's typical in federated averaging: after aggregation, the server (or parties) update the global model. So we can have each party compute the global model update using the aggregated gradient and the fairness term computed from aggregated group statistics.
Better: After secure aggregation, all parties learn S = sum_i g_i (gradients) and A = sum_i group_stats_i. Then they compute a fairness correction term Δ_fairness = λ * ∇_fairness(A) (or something). Then the total update = S + Δ_fairness? Actually the aggregated gradient already includes the sum of individual gradients, which are derived from the loss. If we want to incorporate fairness as a constraint, we can formulate the problem as minimizing the sum of losses plus a fairness penalty that depends on group disparities. The gradient of the penalty with respect to model parameters can be computed from aggregated group statistics. So total aggregated gradient = S + ∇_penalty(A). This total gradient can then be used to update the model. All parties can compute the same total gradient because they all have S and A (the sums). Then they update the model parameters.
But careful: If we compute the fairness penalty gradient using only aggregated statistics, it might be possible because the fairness penalty is a function of the aggregated group losses or predictions. For example, suppose we want to enforce equalized odds: we need to equalize false positive rates across groups. That might require computing group-specific gradients. But if we have each party compute its group gradients (gradient of loss on data points from each sensitive group) and secret-share them, then we can sum these to get aggregated group gradients. Then we can compute a projection to satisfy fairness constraints (e.g., as in Agarwal et al.'s reduction). There are methods like "fairness constraints through post-processing" or "in-processing with constrained optimization". We can implement in-processing: we want to find model parameters that minimize total loss subject to fairness constraints. The standard approach: use Lagrangian and gradient descent on the Lagrangian. The gradient includes the fairness constraint gradient, which depends on the difference between group-specific objectives. Those group-specific objectives can be expressed as sums of gradients from each party for each group. By secret-sharing, we can compute the sum of group gradients without revealing parties' individual contributions. Then we can compute the fairness term and update accordingly. This can be done in a distributed manner: after secure aggregation of group gradients, all parties know the sums (or maybe only a designated party calculates the update). Then the update is applied and the new model is shared (maybe via encryption or secret sharing again).
Thus, the pipeline must handle the additional data: sensitive group membership. The sensitive attribute might be private. In many fairness definitions, the sensitive attribute is needed. So parties need to contribute group information. They can compute group-wise statistics locally and secret-share them, without revealing which samples belong to which group individually, only the sums. That's okay if the group labels are considered sensitive but we can still compute aggregate statistics via secret sharing.
So the pipeline:
-
Preprocessing: parties agree on sensitive groups (e.g., binary). They may need to align features and labels. They could use a secure multiple-party computation to perform one-hot encoding of group membership? Or each party encodes its own data's group membership into one-hot vectors and secret shares those sums. That's feasible.
-
In each round:
-
Local training: Each party computes the gradient of the loss on its local data (mini-batch) for the current model. Additionally, compute the gradient for each sensitive group (i.e., average gradient over samples in each group). Or compute group losses and then gradients? Possibly we need group gradients for fairness constraints as per methods like "Fairness-aware learning via constrained optimization" (e.g., the approach by Zafar et al. where the fairness constraint is on the covariance between prediction and sensitive attribute). That can be expressed as a function of the gradients? Actually we need to compute the gradient of the fairness penalty; that might involve sums of features times sensitive attributes, etc. But we can also compute the group-specific gradients directly: the fairness constraints often involve differences in group-specific risks (or gradients). For example, equalized odds: we want the true positive rates equal across groups. That's a complex constraint; but we can approximate with a convex surrogate like minimizing the difference between group-wise losses. So we can define a penalty term: λ * sum_g |L_g - L_avg| or something. Then the gradient of this penalty depends on gradients of L_g. So computing L_g gradients is needed. So each party can compute its own gradient contribution for each group and secret-share those vectors. Then sum across parties gives total group gradients. Then we can compute the penalty gradient from those.
-
Secret sharing: Each party secret-shares its gradient vector g_i (for all parameters) and also its group gradients g_i^group (for each group). The sharing can be additive: split into k shares, send one to each of k other parties or aggregators.
-
Secure aggregation: The aggregators (or all parties) sum the shares to reconstruct the total gradient G = Σ g_i and total group gradients G_g = Σ g_i^group. No individual g_i is revealed.
-
Fairness correction: All parties (or a designated party) compute the fairness gradient correction based on G_g. Example: define fairness penalty P = || (G_g / n_g) - (G_all / n_all) ||^2, where n_g is group size (also secret-shared? need to compute group sample counts). Actually to compute average group gradient, we need the number of samples per group; that can be computed via secret sharing of counts. So parties also secret-share their group sample counts, sum to get total counts per group and total count. Then compute average gradients per group: avg_g = G_g / N_g (where N_g is total count for group g). Then compute disparity D = avg_g1 - avg_g2 (for binary). Then fairness gradient = λ * something like derivative of D^2? Or we can incorporate Lagrangian: the constraint is D <= ε. Use a quadratic penalty: λ * max(0, D-ε)^2, its gradient. Or use an exponential penalty. It's okay for high-level.
We need to ensure fairness constraints are enforced without compromising privacy. The above design reveals the aggregated gradient and aggregated group gradients to all parties. Is that acceptable? In typical federated learning with secure aggregation, the sum of gradients is revealed to all parties (or a server). That's considered okay because the sum doesn't reveal individual data. However, if there are only two parties, the sum might leak some information? But still under the assumption of semi-honest, it's secure as long as the secret sharing and aggregation are done correctly. So it's fine.
But one nuance: we reveal aggregated group gradients, which are sums of gradients from each party for each group. If groups are unbalanced, that might leak something? For example, if one party has only members of group A, then its contribution to G_A is the full gradient for group A, but after summing, the total G_A is the sum over all parties. The other parties might infer something about the distribution? However, the individual contributions are masked by secret sharing; only the sum is revealed. For two parties, if one party knows its own gradient for group A and the total G_A, it can infer the other's contribution by subtraction. That could leak information about the other's data. That's a problem: if we reveal the sum of group gradients, and each party knows its own group gradient, then by subtracting it can learn the sum of others' group gradients. That's the same as revealing the sum of all but one party's gradients, which is just the difference between total and one's own. But does that leak more than the sum of all gradients? In the typical secure aggregation, each party learns the sum of all gradients. If a party knows its own gradient, it can compute the sum of others' gradients by subtracting. But the security guarantee of secure aggregation is that the sum reveals no more than that; but it's usually considered acceptable because the sum of all gradients is needed for updating. However, in the two-party case, revealing the sum essentially reveals the difference between the two parties' gradients? Actually if both parties learn the sum S = g1+g2, and each knows its own gi, then each can compute the other's gj = S - gi. So that completely reveals the other's gradient! That's a violation. That's why secure aggregation protocols for two parties are tricky; they often require additive masking from other parties or a third party. In the standard Bonawitz protocol, for two parties, one party can act as a masker? Actually the protocol uses pairwise masks to hide individual contributions, and the sum of masks cancels out, leaving the sum of vectors. For two parties, each adds a mask and then later removes? The typical secure aggregation with three or more parties relies on each party adding a random mask that is shared among all others so that masks cancel. With only two parties, one party could add a mask and the other subtract? But both need to contribute masks. Actually the classic protocol (Bonawitz et al. 2017) works for any number of parties > 1, but requires a server that aggregates masked shares. The server doesn't learn individual values. The masks are generated via a pseudo-random generator seeded by pairwise shared keys, so that masks cancel out when all shares are summed. In a two-party setting, each party generates a random mask and shares it with the other? But then the other also generates a mask? The typical approach: each party i generates a random mask r_i and sends to the server? That doesn't cancel. Actually the Bonawitz protocol: Each party i generates a random mask r_i and splits it into shares r_{i->j} such that sum_j r_{i->j} = r_i. Then i sends r_{i->j} to party j? No, they send to server? Let's recall: In federated averaging with secure aggregation (Google's model), the server receives masked updates: each client adds a random mask to its update and sends to server. The mask is shared among other clients so they can later remove it. The server cannot see individual updates. At the end, the server sums all masked updates and then clients collectively remove the masks to get the sum. That protocol requires that each client sends its masked update to the server, and later the clients coordinate to send the mask sums to the server. With only two clients, each could add a mask and then they need to exchange mask shares. But there is a known result: secure aggregation with two parties is possible with an external coordinator or using homomorphic encryption. But we might assume a setting with multiple parties (at least 3) or use a trusted third party for aggregation? The problem says "secure multi-party ML training pipeline" not necessarily specifying number. We can assume at least three non-colluding parties, which is common for secret sharing. Or we can design using a set of non-colluding servers that hold shares.
Better: Use additive secret sharing among a set of non-colluding computation servers (e.g., three servers). The parties (data owners) secret-share their data or gradients to the servers. The servers then compute the sum of shares (which is a secret share of the sum) and then reconstruct the sum to parties (or send to a designated party). This is a typical two-server or three-server model for MPC. For two servers, one server could be malicious? We'll assume honest majority or at least non-colluding threshold t < n/2. So I'd say we have a set of computation nodes (could be the parties themselves) that hold shares. But to avoid the two-party leakage issue, we assume at least three parties or use a central aggregator that receives masked updates but cannot invert. The simplest: use a trusted aggregator? But we want to avoid trust. We'll assume a setting with multiple parties (>=3) and use a secure aggregation protocol like Bonawitz that protects individual contributions even when all parties learn the sum. Wait, does Bonawitz protocol protect against a coalition of all but one party? The security model is that no coalition of up to t parties (where t is the threshold) can learn individual inputs beyond the sum. Usually it's set that t = number of parties - 1? Actually in Bonawitz, they assume a honest majority? I'm not entirely sure. Let's recall: The protocol ensures that a semi-honest server (or set of servers) cannot learn individual client updates. The clients may collude? The protocol's security relies on the fact that each client's mask is shared among the other clients, and those shares are sent directly (not via server). The server only sees masked values. At the end, the server aggregates masked values, and then the clients send the mask sums to the server, which then subtracts them. The server never sees individual masks. However, if all clients collude except one, they could reconstruct that one's update by combining masked values and their own masks? Actually the protocol is designed such that even if all other clients collude with the server, they cannot learn the individual input of the remaining client. Let's check: In the protocol, each client i generates a random mask r_i and splits it into shares r_{i->j} for each other client j. It sends r_{i->j} directly to client j (not via server). Then it sends its masked update u_i + r_i to server. At the end, the clients send the sum of masks they received to the server. The server sums all masked updates and then subtracts the sum of all masks? Actually the server gets the sum of (u_i + r_i) from all clients. Then the clients collectively compute the total mask R = sum_i r_i by having each client i send to the server the sum of shares it received (which is sum_{j!=i} r_{j->i})? Hmm, it's a bit complicated but it's proven secure against a malicious server if at most t < n/2 clients are corrupted? I think the standard model is that the server is honest-but-curious? Actually the protocol from "Secure Aggregation for Federated Learning" by Bonawitz et al. assumes the server is semi-honest and might try to infer individual updates. It guarantees that the server learns only the sum, even if it colludes with up to t clients? Not exactly. I'd better not rely on subtle details. Simpler: Use a threshold secret sharing scheme among n parties where each holds a share, and they jointly compute functions using MPC. That's the classic secure multi-party computation approach. So we could say: we employ an MPC protocol (like SPDZ or GMW) to compute the aggregation and fairness correction on secret-shared inputs. That is heavy but conceptually simpler: each party secret-shares its gradient and group statistics among all parties (or among a set of servers). Then they engage in an MPC to compute the total gradient and fairness term, and then each obtains a share of the total gradient? Actually they can reconstruct the total gradient (since it's needed to update local models maybe). But they could also compute the update in secret-shared form and then each update their local model share. However, the simpler federated approach is more practical: use secure aggregation protocol that reveals the sum to all parties, but ensures that no individual contribution is leaked. The two-party leakage issue can be mitigated by the fact that each party also adds its own random mask? Actually if both parties learn the sum, each can compute the other's value. So the protocol must ensure that the sum is known only to a central aggregator or that each party learns only the sum but not their own contribution? In Bonawitz, each client learns the sum? Typically in federated averaging, the server computes the sum and then sends the aggregated model to clients. The clients do not learn the sum of gradients directly; they only get the updated model. So we can have a central aggregator (could be one of the parties or a separate server) that receives masked gradients, computes the sum, applies fairness correction, updates the global model, and then sends the updated model to all parties. In that case, individual gradients remain hidden from the aggregator because of masking. That's a typical architecture: clients -> masked updates -> server; server aggregates; server sends aggregated update to clients. The clients then update their local models. The server never sees individual updates. This avoids the two-party leakage. So we can adopt that.
Thus pipeline:
- Parties (clients) compute local gradients.
- They generate random masks (using a shared secret or via pairwise masks) and send masked gradients to a central aggregator (could be a designated party or untrusted server). They also send masked group statistics.
- The aggregator sums all masked gradients and masked group stats, obtaining sum of gradients and group stats masked by the sum of masks.
- The aggregator then sends back the masked sums to the clients (or clients coordinate to provide mask sums). In Bonawitz, after the server sums masked updates, the clients provide the sum of their masks to the server, which then subtracts to get the true sum. There are variations. But the central aggregator eventually obtains the true sum (or maybe the clients compute the sum and then the aggregator only gets the true sum). However, we want the aggregator not to learn individual gradients. If the aggregator obtains the true sum, that's okay; the sum alone is not revealing individual data (assuming enough parties). So we can have the aggregator compute the sum and then perform fairness correction and update the model, then broadcast the new model.
But careful: The aggregator might learn sensitive group totals? That might be okay as aggregate; but compute fairness correction might reveal some group-level info, but aggregates are usually acceptable.
Alternatively, we can avoid a central aggregator and use fully decentralized MPC, but that's more complex. We'll assume a central aggregator (which could be one of the parties) that is semi-trusted to follow the protocol but not to learn individual updates. We can use secure aggregation to protect from the aggregator as well (the aggregator cannot see individual updates). That's fine.
Thus pipeline:
-
Setup: All parties agree on model architecture, hyperparameters, fairness constraints (e.g., λ, ε). They also agree on an aggregator (could be elected or a dedicated server). They establish secure channels and possibly keys for mask generation (e.g., using pairwise shared secrets).
-
For each communication round:
a. Each party trains locally on its data (maybe for E epochs) to compute gradient g_i (vector) and also computes group gradients g_i^{(g)} for each sensitive group g. Also compute group sample counts c_i^{(g)}. (If fairness constraints require group sample counts.)
b. Masking: Each party generates a random mask vector m_i and also generates pairwise masks with other parties to mask individual contributions. For simplicity, use the approach where each party adds a random mask r_i to its gradient, but then later the total mask is removed by the aggregator after receiving the sum of masks from parties. But to prevent the aggregator from seeing individual masked gradients, we could use pairwise masks: each party i generates random mask shares for each other party j, sends m_{i->j} to j directly (not via aggregator). Then the party adds to its gradient the sum of all masks it generated? Actually the standard: Party i chooses a random mask r_i and splits into shares r_{i->j} for j != i such that Σ_{j≠i} r_{i->j} = r_i. It sends r_{i->j} to party j (or to aggregator? No, directly). Then it sends to aggregator its masked gradient: g_i' = g_i + r_i. The aggregator sums all g_i' to get G' = Σ g_i + Σ r_i. The aggregator also receives the sum of all masks Σ r_i from the parties? They need to communicate mask shares among themselves to reconstruct total mask. The typical Bonawitz has clients send mask shares to each other, and then each client sends the sum of masks it received to the aggregator. Then aggregator sums those sums to get Σ_i Σ_{j≠i} r_{j->i} = Σ_{i≠j} r_{j->i} = Σ_j r_j? Actually each r_i is split into shares to others; the sum of shares from all others onto i equals sum_{j≠i} r_{j->i}. Since each r_i is distributed to all others, the total mask sum Σ_i r_i equals the sum over all shares each client receives? Let's not get too deep. The outcome: aggregator learns G = Σ g_i without learning any individual g_i, assuming no collusion. Also the aggregator does not learn the masks. So we can adopt that.
But we also have group gradients: each party may need to send multiple vectors: g_i for all parameters, and g_i^group for each group (maybe as a matrix). They mask each with the same random mask vector? They can generate separate masks for each, or use same mask but it's okay.
c. The aggregator receives masked vectors from all parties. It also receives mask sums (via a separate step). After invalid parties are handled, it computes the true sums: G = Σ g_i, and for each group g, G_g = Σ g_i^group, and counts C_g = Σ c_i^group.
d. Fairness correction: The aggregator computes the fairness gradient term using G_g and C_g. For example, let avg_g = G_g / C_g (provided C_g>0). Let disparity = avg_g1 - avg_g2. Compute penalty gradient = λ * ∇_disparity (maybe derivative of squared disparity). The aggregator then computes total gradient: G_total = G + penalty_gradient. Or if fairness constraints are equality constraints, could use a projection method: after computing G, project onto feasible set that satisfies fairness. But gradient-level adjustment is easier.
We must also consider that parties might have different local steps; but typical federated learning uses local training before sending updates. We'll incorporate that as part of step a.
Now fairness constraints: we need to specify a concrete fairness metric. We can choose demographic parity or equalized odds. But to keep it generic, we can say: we incorporate a fairness regularizer that penalizes differences in group-wise loss or gradient norms. That can be incorporated as an additional term in the loss function, and its gradient computed from aggregated group statistics.
Alternatively, we could use an approach like "fairness-aware federated learning with secure aggregation" from literature. But we just need to compose a pipeline.
Also, note: secure aggregation may only reveal the sum of gradients. If fairness correction requires more than sum (like min or max), we need more complex MPC. But we can stick to sum-based statistics.
If fairness requires computing group-wise means of features or predictions, those can be aggregated via sums.
So the pipeline is feasible.
Now we should discuss secret sharing: We used masking (random addition) for secure aggregation. That's essentially additive secret sharing with a central aggregator. Alternatively, we could use additive secret sharing among multiple aggregation servers (non-colluding). But we don't need to go deeper.
We should mention that secret sharing is used to protect individual updates (by splitting into shares). Secure aggregation is the protocol that combines shares to compute sum without revealing shares. Fairness constraints are enforced by using aggregated group statistics to adjust the global update.
Potential issues: The fairness correction term might depend on the model parameters themselves (e.g., gradient of fairness penalty depends on current model and data). That's okay; each party can compute its contribution locally and secret-share. But we need the fairness penalty to be expressible as a function of aggregated quantities that can be computed from sums. For many convex fairness penalties (like squared difference of group expected predictions), the gradient can be computed from sums of predictions and group labels. Those sums can be aggregated.
So we need to define a specific fairness penalty that is "sum-friendly". For instance, suppose we want to enforce that the average prediction for group A equals that for group B (demographic parity). Then we can include a penalty: λ * ( (1/N_A Σ_i∈A f(x_i) - 1/N_B Σ_j∈B f(x_j)) )^2. The gradient of this penalty with respect to θ involves sums of gradients of f on group samples. That's exactly the sum of gradients over each group, which we have aggregated. So we can compute it.
Thus, each party computes: For each group g, compute sum of predictions over its samples? Actually gradient of the penalty term: Let p_g = (1/N_g) Σ_i∈g f(x_i). Then penalty = λ (p_A - p_B)^2. The gradient: ∂penalty/∂θ = 2λ (p_A - p_B) * ( (1/N_A) Σ_i∈A ∇_θ f(x_i) - (1/N_B) Σ_j∈B ∇_θ f(x_j) ). So we need N_g and Σ_i∈g ∇_θ f(x_i). That's exactly the group gradient sums and counts we are aggregating. So we can compute the penalty gradient from aggregates.
Thus the fairness correction term can be computed at the aggregator knowing G_g and C_g. However, we also need p_g, which is average prediction: that requires Σ_i∈g f(x_i), not gradients. But we could compute that separately: each party could compute sum of predictions (or outputs) over its group samples and secret-share those as well. Then aggregator sums to get total predictions sum for each group. Then p_g = total_pred_sum_g / C_g. So we need to add that: each party computes its group prediction sums. So additional aggregated quantities: S_g = Σ_i∈g f(x_i). That's also additive. So we need to secret-share that as well. That increases communication but still manageable.
Alternatively, we could use a fairness penalty that only depends on gradients of the loss (like Zafar et al.'s fairness constraints based on covariance), which also requires sums of gradients weighted by sensitive attribute. That can be aggregated.
Thus our pipeline includes sending gradients, group gradient sums, group prediction sums, and group counts.
Now about secret sharing: The parties can use additive secret sharing to split these vectors into shares and send to a set of non-colluding servers (or to other parties). But if we use a central aggregator with masking, we don't need secret sharing per se; we use random masks. But random masks are a form of secret sharing: the mask r_i is secret-shared? Actually each party adds a mask that only they know, but then later they reveal the sum of masks to aggregator. That doesn't split the data among many parties; it's just obfuscation. But it's still secure against aggregator if the mask sum is subtracted appropriately. It's essentially a secure aggregation protocol based on pairwise masks, which can be seen as secret sharing of the sum of masks among parties. It's fine.
We can present both: use additive secret sharing among n parties to distribute shares, and then use a multi-party computation to compute sums. But that's more heavyweight.
Given the problem statement mentions "secret sharing, secure aggregation, and fairness constraints", we should explicitly mention these three components:
- Secret sharing: used to split sensitive data (like gradients, group statistics) into shares that are distributed among non-colluding parties (or servers) so that no individual share reveals information.
- Secure aggregation: a protocol that allows the computation of the sum of these secret-shared values without reconstructing individual shares, ensuring that only the aggregate is revealed.
- Fairness constraints: incorporated into the training objective, and the terms needed to enforce them (e.g., group-wise gradients, counts, predictions) are also protected using secret sharing and aggregated securely.
We'll design a pipeline using an MPC-style where a set of computation nodes (could be the data parties themselves, but each holds shares of others' data) run a protocol to compute sums and then the fairness correction. That might be simpler to explain in a modular way.
Option 1: Use a trusted third party? No.
Option 2: Use a "crypto aggregator" that masks and sums.
I'll opt for a protocol based on additive secret sharing among a set of non-colluding servers (e.g., three servers). This is a common paradigm for privacy-preserving ML. Steps:
-
Each party splits its gradient and group statistics into additive shares modulo a prime field, and sends one share to each server.
-
The servers add up the shares they received component-wise, resulting in a secret share of the sum.
-
To compute the fairness correction, the servers need to jointly compute some functions on the secret-shared sums. They can use MPC to compute arithmetic operations without revealing the underlying sums. For example, they can compute division by counts (using fixed-point arithmetic) and subtraction, multiplication, etc., all on secret-shared data. Finally, they produce a secret share of the total gradient update, which they send back to the parties. Or they can reconstruct the total gradient (by having the servers exchange shares to reconstruct) and send it to parties encrypted? But reconstruction would reveal the sum to all servers; they might be non-colluding individually but not all together? If we assume the servers are non-colluding (i.e., no coalition of less than threshold can learn secrets), we can reconstruct the sum only if enough servers cooperate. For threshold t, we need at least t+1 servers to reconstruct. But if we want the parties to get the update, we might have the servers send shares of the update to the parties, and each party can combine shares from enough servers to reconstruct? That's messy.
Simpler: Have the servers jointly compute the total gradient and then broadcast it to all parties in encrypted form or just send it? But if the servers are non-colluding but we trust that at least one server is honest and won't leak the sum, we could just have one server compute and send. But then that server learns the sum. That's okay if we trust it? But we might not trust any single server. However, in many MPC systems, the sum itself is not considered highly sensitive because it's aggregated; revealing the sum to the servers might be acceptable. The worst-case leakage is the aggregate gradient, which is needed to update the model. So we could allow the servers to learn the aggregate; that's fine. The important thing is that no individual party's contribution is revealed to others or to the servers beyond what's inferable from the aggregate. The servers could be semi-trusted, they see the sum but that's fine. So we can have the secret sharing just for the aggregation step: the servers add shares and then reconstruct the sum (by combining shares among themselves). They can then compute fairness correction and send the final gradient to parties. The servers learn the total gradient, which is not a privacy breach (since it's the sum). So that's acceptable.
Thus pipeline:
- Each party i has gradient g_i and group data (counts, sums, etc).
- Party i generates additive secret shares of each of these values across s servers (e.g., s=3). It sends one share to each server.
- Each server j sums all the shares it received from all parties (component-wise) to obtain [G]_j, a share of the total gradient G. Similarly for group counts C_g, group prediction sums P_g, group gradient sums G_g.
- The servers now hold shares of these aggregates. They can jointly compute fairness correction using MPC: e.g., they can compute the average predictions p_g = P_g / C_g. Since division is not linear, they need to either reconstruct the values (if they trust each other) or do secure division. But we can design: after enough shares are combined, they can reconstruct the aggregates because the sum is the secret, not the shares. They can simply reconstruct G, C_g, P_g, G_g by having the servers exchange their shares among themselves (they are non-colluding? Actually if all servers collude they learn everything; but we assume that no fewer than threshold servers collude, but if we have s servers, we might require that at least one is honest, so we cannot reconstruct without all servers? In additive secret sharing, to reconstruct the secret you need all shares. If we have s servers and we want to keep the aggregates secret from any single server, we need to distribute the reconstruction among all s. But then we would need to send the aggregates to the parties in a secret-shared way as well. That might be overkill. Since the aggregates themselves are not highly sensitive (they are sums of many parties' data), we might be okay with the servers learning them. Many privacy-preserving systems reveal the sum to the aggregator. So we can assume that the servers collectively learn the aggregates; that's fine.
Thus, after summing shares, the servers can reconstruct the aggregates (by pooling shares). They compute fairness correction and total gradient, then send the total gradient to all parties (maybe via encryption). Or they could send to a designated aggregator party. It's simpler: after aggregation, the servers send the total gradient to a central party (or broadcast) which then updates the global model and distributes.
But we must ensure that the servers themselves don't learn individual contributions. They only see shares that are random; by themselves each share reveals nothing. Only when combined they get the sum. If all servers collude, they learn everything, but we assume non-collusion (i.e., at most s-1 servers may be corrupted, but since we need all shares to reconstruct, it's safe if at least one server is honest). But if they all collude, they learn the sum, which is okay. So we can assume semi-honest servers.
Thus pipeline steps:
-
Secret sharing: Each party splits its data (gradients and group stats) into s shares using a random sharing scheme (e.g., generate s-1 random vectors of same length, compute the last share as value minus sum of others modulo p). Sends each share to a distinct server. The party keeps nothing? Actually it sends all s shares away? Usually in secret sharing to multiple servers, the party distributes shares so that it doesn't retain a share; the secret is distributed entirely among the servers. That's fine. The party no longer holds its own secret; it's distributed.
-
Secure aggregation: Each server j receives shares from all parties. It locally sums them component-wise to produce its share of the aggregate: S_j = Σ_i share_{i->j} (mod p). Now the servers collectively hold an additive secret sharing of the total aggregates.
-
Reconstruction (optional): The servers can now reconstruct the aggregates by pooling their shares. They do so among themselves. Since they are non-colluding, we need all of them to combine? If we use t-out-of-n reconstruction? Actually typical additive secret sharing is (n,n) threshold: need all shares to reconstruct. So all servers must pool shares to get the sum. If we want to avoid any single server learning the aggregate, we can keep the aggregates secret-shared and compute the fairness correction using MPC without reconstruction. But that's more complex. But for simplicity, we can assume the servers pool their shares and learn the aggregates (since they are trusted not to leak). Or we could have a designated server that receives all shares and reconstructs; that would be a single point of trust. Better to say: the servers jointly compute the total aggregates by exchanging their shares, or they act as an MPC engine to compute the fairness correction on secret-shared data and produce a secret-shared total gradient, which then is sent to the parties in shares. That would keep the aggregates hidden from servers. But the problem asks to compose a pipeline; we can choose an approach.
Given the complexity, maybe it's better to use the Bonawitz secure aggregation which is widely used in federated learning. That protocol ensures that the aggregator (server) learns only the sum. The server may be semi-trusted. That's simpler and doesn't require secret sharing to multiple servers; it uses pairwise masks. It's standard.
So I'll go with the Bonawitz style secure aggregation with a central aggregator (could be a cloud server). That fits "secure aggregation" as a specific technique. Secret sharing is used implicitly: the pairwise masks can be seen as secret sharing of a random mask among pairs. Actually they use a pseudo-random generator keyed by pairwise secrets to generate masks that sum to zero across pairs, so that the total mask is unknown to the server. That's not exactly secret sharing but similar concept.
But the problem says "using secret sharing, secure aggregation, and fairness constraints". So we need to incorporate both secret sharing and secure aggregation. Possibly secret sharing is used to protect the fairness-related data, while secure aggregation is used to sum the gradients. Or we could use secret sharing as the underlying technique for secure aggregation. Many secure aggregation protocols use additive secret sharing among the clients themselves to mask their updates. For example, each client splits its update into two shares: one kept by itself (?) Actually one approach: each client generates random shares for each other client? That's essentially secret sharing. So it's okay.
Thus I'll describe a pipeline that uses additive secret sharing among a set of non-colluding aggregators (or among clients) to compute the sum, i.e., secure aggregation is the process of summing secret-shared values. Then fairness constraints are incorporated using the aggregated values.
Let's produce a coherent answer:
I. System model:
- Parties: P1, ..., Pn, each with a private dataset D_i containing features X_i, labels Y_i, and sensitive attributes S_i.
- Goal: Train a model f_θ (e.g., neural net) that minimizes a loss L over all data while satisfying a fairness constraint (e.g., demographic parity).
- Assumptions: Parties are semi-honest; they follow the protocol but try to infer others' data. There is no trusted third party. Communication channels are secure (e.g., TLS). We have an aggregator (could be one of the parties or a separate server) that facilitates secure aggregation but is not trusted to see individual updates. Alternatively, we may have a set of non-colluding computation servers that hold shares.
II. Cryptographic building blocks:
- Secret sharing: Each party splits its sensitive information (gradient, group statistics) into additive shares modulo a large prime p. The shares are distributed to a set of aggregation servers (or to other parties) such that the secret can be reconstructed only when enough shares are combined.
- Secure aggregation: Using the secret shares, the servers can compute the sum of the secrets without ever reconstructing individual values. This can be done by servers locally summing their shares; the vector of sums is itself a secret sharing of the total sum. This is a fundamental MPC operation.
- Optional: For fairness metrics that involve non-linear operations (e.g., division), we can use secure computation (e.g., garbled circuits, or arithmetic with fixed-point) on the secret-shared aggregates. Since the values are aggregated (sums), the non-linear operations are performed on the reconstructed aggregates (after pooling shares) or via secure computation among servers if we want to keep aggregates private. For simplicity, we assume the servers reconstruct the aggregates after ensuring the sum is secret-shared among them in a way that no subset learns it (they need all shares). But then they need to pool. That reveals to the set of servers. That's okay if we trust them collectively.
III. Pipeline:
-
Initialization:
- All parties agree on model architecture, hyperparameters (learning rate η, fairness weight λ, number of rounds T), and the fairness constraint definition (e.g., groups G = {0,1}, constraint form).
- Each party initializes a local copy of the global model θ (same random seed or synchronized).
- Parties establish secure channels with the aggregation servers (or with each other for pairwise keys).
-
Local computation per round:
For each training round t = 1..T:
- Each party i samples a minibatch (or uses its full data) and computes:
- Gradient of the primary loss: g_i = ∇_θ L(θ; D_i) (or average over minibatch).
- For each sensitive group g (or for each group label present in its data), compute:
- Count c_i^{(g)} = number of samples in D_i with sensitive attribute = g.
- Gradient sum for group: ∇g_i^{(g)} = Σ_{x∈D_i, s=g} ∇_θ L(θ; x) (i.e., sum of per-sample gradients for that group). Often easier to compute by accumulating over minibatch.
- Prediction sum (or other required statistic): p_i^{(g)} = Σ_{x∈D_i, s=g} f_θ(x) (if needed for fairness penalty).
- Optionally, other group statistics (e.g., loss sums) as required by the fairness constraint.
- Party i then secret-shares these vectors/scalars among the s aggregation servers using additive secret sharing:
For each item v (gradient g_i, group items), generate random shares v^{(1)}, ..., v^{(s)} such that v = Σ_{j=1}^s v^{(j)} mod p. Send v^{(j)} to server j.
-
Secure aggregation:
- Each server j receives shares from all parties. It locally adds all the shares of the same type:
Server j computes: [G]_j = Σ_i g_i^{(j)} (mod p) → share of total gradient.
Similarly, [G_g]_j = Σ_i ∇g_i^{(g),(j)} (share of group gradient sum)
[C_g]_j = Σ_i c_i^{(g),(j)} (share of group count)
[P_g]_j = Σ_i p_i^{(g),(j)} (share of group prediction sum)
- The servers now hold additive secret shares of the aggregated quantities. At this stage, no server knows the actual totals; each only knows a random share.
-
Reconstruction of aggregates (optional):
- To compute the fairness correction, the servers need the actual values of the aggregates (or they can compute using MPC on shares). A simple approach: the servers pool their shares to reconstruct the aggregates because they are assumed to be honest-but-curious but collectively not malicious? Actually if we trust that the servers won't collude to learn the aggregates? That's a trust assumption. But if we treat the servers as a single logical entity (the secure aggregation service), we can assume they are honest but not curious, or we can design that the reconstruction is done by the parties themselves. Another approach: Instead of reconstructing, the servers perform the necessary arithmetic on the secret-shared values using MPC. Since the operations are relatively simple (addition, subtraction, multiplication by public constants, division by public constants, multiplication of secret-shared values), it's feasible. For simplicity, we describe that the servers reconstruct the aggregates by combining shares among themselves; this reveals the aggregates to all servers. This is acceptable if we trust the set of servers as a whole (they are managed by a consortium that is allowed to see aggregated model updates). Many real-world systems (e.g., Google's federated learning) have a central server that learns the sum. So it's okay. So we say:
IV. Security and privacy analysis:
- Secret sharing ensures that no single aggregation server learns an individual party's gradient or group statistics, because each share is uniformly random and independent.
- Secure aggregation ensures that the only information revealed is the sum of the parties' contributions (the aggregates) to the aggregator (or servers). This is necessary for the global update and is not considered a breach because the aggregate alone is unlikely to reveal individual data.
- Fairness constraints are enforced using aggregated group statistics; these aggregates are also protected by secret sharing and only revealed collectively to the servers (or remain secret-shared if using full MPC). No individual party's group membership or data is exposed.
- The model parameters themselves are not secret; they are shared with all parties as they are the output of the joint computation. This is acceptable.
V. Handling practical issues:
- Non-IID data: The pipeline works with arbitrary data distributions; fairness constraints help mitigate bias.
- Communication efficiency: The secret sharing can be done with compression, and the number of rounds is typical for federated learning. The additional group statistics increase communication linearly with number of groups (usually small).
- Secure choice: For two parties, pure additive secret sharing with one server would leak (since share of one party is the gradient minus the other's share). To handle small coalitions, we recommend at least three non-colluding servers or use a protocol like Bonawitz that supports any number of clients without a central party learning masks. The design can be adapted.
- Implementation: Use existing frameworks like TF Encrypted, CrypTen, or MP-SPDZ for the MPC parts.
VI. Conclusion:
We have designed a secure multi-party ML training pipeline that combines secret sharing for data protection, secure aggregation for sum computation, and fairness constraints to ensure equitable model performance. The pipeline is composable, extensible to various fairness definitions, and provides strong privacy guarantees under the semi-honest model.
That should be a solid answer.
We might also include a diagram description: "Figure: Parties -> shares -> Aggregation servers -> compute aggregates -> fairness correction -> update -> broadcast".
We should keep it concise but detailed enough.
Given the instruction "Compose", we should output a clean description, maybe with bullet points or numbered steps.
I'll produce a structured answer with sections.
Let's craft:
Secure Multi-Party ML Training Pipeline with Secret Sharing, Secure Aggregation, and Fairness Constraints
1. Overview
We consider a set of (n) data-owning parties (P_1,\dots,P_n) who wish to jointly train a machine learning model (f_\theta) without revealing their raw data. The training should satisfy a fairness constraint (e.g., demographic parity, equalized odds) across designated sensitive groups. The pipeline leverages additive secret sharing to protect individual contributions, a secure aggregation protocol to compute sums of secret‑shared values, and a fairness‑aware update rule that uses aggregated group‑wise statistics.
2. Threat Model and Assumptions
- Parties are semi‑honest: they follow the protocol but may try to infer others' private data from the messages they receive.
- No trusted third party; a set of (s) non‑colluding aggregation servers (or a central aggregator that does not learn individual updates) assists in the computation.
- Communication channels are confidential and authenticated (e.g., TLS).
- At least (t < s) servers are honest, so that any set of fewer than (t) servers cannot reconstruct secrets (threshold secret sharing).
- The model parameters themselves are not secret; they may be revealed to all parties after each round.
3. Cryptographic Building Blocks
- Additive Secret Sharing over a prime field (\mathbb{Z}_p): A secret (x \in \mathbb{Z}p) is split into (s) shares (x^{(1)},\dots,x^{(s)}) such that (x = \sum{j=1}^s x^{(j)} \bmod p). Each share is uniformly random and reveals nothing about (x) by itself.
- Secure Aggregation: Given secret‑shared inputs from the parties, the servers locally sum their shares to obtain a secret‑shared sum. This can be combined with a reconstruction step that reveals only the sum to the servers (or to the parties if needed).
- Secure Non‑Linear Operations (optional): For fairness corrections that require division or multiplication of secret‑shared values, the servers can perform MPC protocols (e.g., using Beaver triples) without revealing intermediate values.
4. Pipeline Steps
Initialization
- All parties agree on the model structure, loss function (L), learning rate (\eta), number of rounds (T), fairness weight (\lambda), and the fairness constraint (e.g., groups (G)).
- Each party creates a local copy of the model (\theta).
- A set of (s) aggregation servers is chosen (could be the parties themselves or dedicated machines).
For each round (t = 1) to (T):
Step A: Local Computation
Each party (P_i):
- Uses its current local model (\theta^{(t-1)}) to compute the gradient over its data (or a minibatch):
[
g_i = \nabla_\theta L(\theta^{(t-1)}; D_i).
]
- For each sensitive group (g \in G):
- Count: (c_i^{(g)} = |{(x,y,s) \in D_i : s = g}|).
- Group gradient sum: (\nabla g_i^{(g)} = \sum_{(x,y,s) \in D_i, s=g} \nabla_\theta L(\theta^{(t-1)}; x,y)).
- (If needed for the fairness penalty) Prediction sum: (p_i^{(g)} = \sum_{(x,y,s) \in D_i, s=g} f_{\theta^{(t-1)}}(x)).
Step B: Secret Sharing to Servers
Party (P_i) generates additive shares of each quantity among the (s) servers: for each value (v) (e.g., (g_i), (c_i^{(g)}), (\nabla g_i^{(g)}), (p_i^{(g)})), it picks random (v^{(1)},\dots,v^{(s-1)}) and sets (v^{(s)} = v - \sum_{j=1}^{s-1} v^{(j)} \bmod p). It then sends share (v^{(j)}) to server (S_j). After this step, none of the servers holds any complete value.
Step C: Secure Aggregation
Each server (S_j):
- Adds all shares of the same type it received from all parties:
[
[G]_j = \sum_i g_i^{(j)},\quad [G_g]_j = \sum_i \nabla g_i^{(g),(j)},\quad [C_g]_j = \sum_i c_i^{(g),(j)},\quad [P_g]_j = \sum_i p_i^{(g),(j)}.
]
- The vectors ([G]_j, [G_g]_j, [C_g]_j, [P_g]_j) are additive shares of the corresponding aggregates (G = \sum_i g_i), (G_g = \sum_i \nabla g_i^{(g)}), (C_g = \sum_i c_i^{(g)}), (P_g = \sum_i p_i^{(g)}).
Step D: Reconstruction of Aggregates (or Secret‑Shared Computation)
The servers now hold shares of the needed aggregates. For simplicity, we assume the servers are allowed to learn the aggregates (they are a consortium that is trusted collectively). They therefore pool their shares (e.g., all send to a designated server or reconstruct via a broadcast) to obtain the plaintext values:
[
G = \sum_{j=1}^s [G]j,\quad G_g = \sum{j=1}^s [G_g]j,\quad C_g = \sum{j=1}^s [C_g]j,\quad P_g = \sum{j=1}^s [P_g]_j \pmod p.
]
Note: If we prefer not to reveal the aggregates even to the servers, the servers could compute the fairness correction on the secret‑shared data using standard MPC (division can be done via fixed‑point approximation and multiplication triples). That adds overhead but is possible.
Step E: Fairness‑Aware Gradient Correction
Using the reconstructed aggregates, we compute a gradient correction that steers the model toward fairness. As an example, consider demographic parity: we require the average prediction to be equal across the two groups (g\in{0,1}).
- Compute average predictions per group: (\text{avgpred}_g = P_g / C_g) (if (C_g>0)).
- Disparity: (d = \text{avgpred}_1 - \text{avgpred}_0).
- Fairness penalty: (\ell_{\text{fair}} = \lambda \cdot d^2).
- Gradient of the penalty w.r.t. (\theta):
[
g_{\text{fair}} = 2\lambda d \left( \frac{G_1}{C_1} - \frac{G_0}{C_0} \right).
]
(Here (G_g) is the sum of loss gradients for group (g); note that (\frac{G_g}{C_g}) is the average gradient over that group.)
- Total gradient to descend:
[
g_{\text{total}} = G + g_{\text{fair}}.
]
Other fairness constraints (e.g., equalized odds) can be plugged in by replacing the penalty expression; they typically also involve group‑wise gradients and counts.
Step F: Global Model Update
- Update the global model parameters:
[
\theta^{(t)} = \theta^{(t-1)} - \eta \cdot g_{\text{total}}.
]
- The updated parameters (\theta^{(t)}) are broadcast to all parties (e.g., encrypted with a symmetric key known to all parties, or sent through a secure channel).
Step G: Local Synchronization
Each party sets its local model copy to (\theta^{(t)}) and proceeds to the next round.
After (T) rounds, the parties obtain the final fair model.
5. Security & Privacy Discussion
- Secret sharing guarantees that any subset of fewer than (s) aggregation servers learns nothing about any party’s raw gradients or group statistics.
- Secure aggregation ensures that the only information ever revealed (to the servers) is the sum of the parties’ inputs. This sum is necessary for collaborative learning and does not, by itself, reveal individual data.
- Fairness constraints are enforced using only aggregated group statistics (counts, gradient sums, prediction sums). These aggregates are computed within the same protected framework, so no party learns another party’s group‑level breakdown.
- The model parameters (\theta) are not secret; they are the output of the joint computation and are revealed to all parties. This is inherent to training a shared model.
6. Extensions and Practical Considerations
- Non‑linear fairness penalties: If the fairness penalty requires a non‑linear function that cannot be computed efficiently on secret‑shared values (e.g., a hinge loss with max), we can use standard MPC techniques (garbled circuits, GMW, or fixed‑point arithmetic with Beaver triples).
- Communication efficiency: The amount of data sent per round is roughly (O(|\theta| + |G| \cdot |\text{groups}|)). This is comparable to standard federated averaging with secure aggregation. Compression (e.g., sparsification, quantization) can be applied before secret sharing.
- Fault tolerance: The protocol can incorporate drop‑out handling as done in Bonawitz et al. (e.g., using a commitment scheme).
- Two‑party setting: With only two parties, additive secret sharing with a single server would leak (since the server could learn both shares). In that case, we can use a three‑server configuration or a protocol that uses pairwise masks (the standard secure aggregation for federated learning) which works for any number of parties. The high‑level design remains the same.
- Implementation: The pipeline can be realized using frameworks such as TF Encrypted, CrypTen, or MP-SPDZ. The secret sharing and secure aggregation primitives are readily available.
7. Conclusion
We have composed a secure multi‑party machine learning training pipeline that integrates additive secret sharing, secure aggregation, and fairness constraints. The protocol protects raw data and intermediate values while enabling the parties to jointly train a model that meets predefined fairness criteria. The design is modular: any appropriate fairness constraint can be incorporated as long as its gradient can be expressed in terms of aggregated statistics, and the cryptographic layer can be swapped for more advanced MPC if needed.
That should satisfy the request.
Secure Multi‑Party ML Training Pipeline with Secret Sharing, Secure Aggregation, and Fairness Constraints
1. Overview
A set of data‑owning parties (P_1,\dots,P_n) jointly train a model (f_\theta) without revealing their raw data. The pipeline guarantees privacy via secret sharing and secure aggregation, and ensures fairness across sensitive groups (e.g., gender, race). The design works in the semi‑honest setting with no trusted third party.
2. System Model
- Parties: Each (P_i) holds a private dataset (D_i = {(x,y,s)}) where (x) are features, (y) labels, and (s) sensitive attributes.
- Goal: Minimise a global loss (L(\theta) = \sum_i L_i(\theta)) while satisfying a fairness constraint (e.g., demographic parity).
- Assumptions:
- Semi‑honest parties (follow protocol but try to infer others’ data).
- A set of (s) non‑colluding aggregation servers (or a central aggregator that only learns aggregated sums).
- Secure, authenticated communication channels.
- At most (t < s) servers are honest; thus any ( \leq t) servers learn nothing (threshold additive secret sharing).
3. Cryptographic Primitives
-
Additive Secret Sharing over prime field (\mathbb{Z}p):
A secret (x) is split into shares (x^{(1)},\dots,x^{(s)}) with (x = \sum{j=1}^s x^{(j)} \bmod p). Each share is uniformly random.
-
Secure Aggregation:
Servers locally sum all shares of the same type to obtain a secret‑shared sum. The sum can then be reconstructed (if the server consortium is trusted collectively) or used in further MPC without reconstruction.
-
Optional Secure Non‑Linear Operations (e.g., division, multiplication):
Beaver triples, fixed‑point arithmetic, or garbled circuits can be employed to compute fairness‑related terms on secret‑shared data.
4. Pipeline Description
Initialisation
- All parties agree on model architecture, loss (L), learning rate (\eta), rounds (T), fairness weight (\lambda), and the fairness definition (e.g., groups (G = {0,1})).
- Each party creates a local copy of the model (\theta).
- (s) aggregation servers are selected (may be existing parties or dedicated nodes).
Training Round (t = 1,\dots,T)
Step A: Local Computation
Party (P_i) using (\theta^{(t-1)}):
- Compute gradient of primary loss on its data (or minibatch):
[
g_i = \nabla_\theta L(\theta^{(t-1)}; D_i).
]
- For each sensitive group (g \in G):
- Count: (c_i^{(g)} = |{(x,y,s)\in D_i : s=g}|).
- Gradient sum: (\nabla g_i^{(g)} = \sum_{(x,y,s)\in D_i, s=g} \nabla_\theta L(\theta^{(t-1)}; x,y)).
- (If needed) Prediction sum: (p_i^{(g)} = \sum_{(x,y,s)\in D_i, s=g} f_{\theta^{(t-1)}}(x)).
Step B: Secret Sharing to Servers
For every quantity (v) (e.g., (g_i), (c_i^{(g)}), (\nabla g_i^{(g)}), (p_i^{(g)})):
- Pick random (v^{(1)},\dots,v^{(s-1)}) in (\mathbb{Z}_p).
- Set (v^{(s)} = v - \sum_{j=1}^{s-1} v^{(j)} \bmod p).
- Send share (v^{(j)}) to server (S_j).
Now no server holds any complete value.
Step C: Secure Aggregation
Each server (S_j) sums all received shares of the same type:
[
\begin{aligned}
[G]_j &= \sum_i g_i^{(j)} &&\text{(share of total gradient)}\
[G_g]_j &= \sum_i \nabla g_i^{(g),(j)} &&\text{(share of group‑gradient sum)}\
[C_g]_j &= \sum_i c_i^{(g),(j)} &&\text{(share of group count)}\
[P_g]_j &= \sum_i p_i^{(g),(j)} &&\text{(share of group prediction sum)}
\end{aligned}
]
Step D: Reconstruction of Aggregates
The servers now hold additive shares of the needed totals.
We assume the consortium is trusted to learn these aggregates (common in secure aggregation). They pool shares (e.g., all-to-all broadcast) and compute:
[
G = \sum_{j=1}^s [G]j,\quad
G_g = \sum{j=1}^s [G_g]j,\quad
C_g = \sum{j=1}^s [C_g]j,\quad
P_g = \sum{j=1}^s [P_g]_j \pmod p.
]
If we wish to keep aggregates private from the servers, we could instead compute the fairness correction directly on the secret‑shared values using MPC (e.g., with Beaver triples for division/multiplication).
Step E: Fairness‑Aware Gradient Correction
We illustrate with demographic parity (average prediction equal across groups (0) and (1)).
-
Average prediction per group: (\text{avgpred}_g = P_g / C_g).
-
Disparity: (d = \text{avgpred}_1 - \text{avgpred}_0).
-
Fairness penalty: (\ell_{\text{fair}} = \lambda , d^2).
-
Gradient of penalty:
[
g_{\text{fair}} = 2\lambda d \left( \frac{G_1}{C_1} - \frac{G_0}{C_0} \right),
]
where (G_g) is the sum of gradients over group (g).
-
Total gradient for the update:
[
g_{\text{total}} = G + g_{\text{fair}}.
]
Other fairness constraints (e.g., equalized odds, predictive parity) can be substituted by providing analogous expressions that use ((G_g, C_g, P_g)) or other aggregated statistics.
Step F: Global Model Update
[
\theta^{(t)} = \theta^{(t-1)} - \eta \cdot g_{\text{total}}.
]
Step G: Distribution of the Updated Model
The new parameters (\theta^{(t)}) are broadcast to all parties (e.g., via an encrypted channel or a public broadcast).
Each party sets its local copy to (\theta^{(t)}).
Termination
After (T) rounds or when convergence criteria are met, the parties possess the final fair model.
5. Security & Privacy Analysis
- Secret sharing ensures each server sees only random shares; no individual party’s data is exposed.
- Secure aggregation reveals only the sums (G, G_g, C_g, P_g) to the server consortium (or to none if full MPC is used). The sum of many parties’ contributions is not sufficient to reconstruct any single contribution.
- Fairness statistics (group counts, gradient sums, prediction sums) are aggregated under the same protection, so no party learns another’s group‑wise information.
- The model parameters are intentionally shared – they are the output of the joint computation.
The protocol is secure against semi‑honest adversaries controlling up to (t) servers or parties (subject to the threshold property of the secret sharing).
6. Practical Considerations
- Non‑linear operations: If the fairness penalty involves non‑linearities that cannot be computed on linear shares (e.g., hinge), use standard MPC techniques (Beaver triples for multiplication, garbled circuits for non‑arithmetic functions).
- Communication efficiency: The per‑round communication is (O(|\theta| + |G|\cdot|G|)), comparable to federated averaging with secure aggregation. Quantisation or sparsification can be added.
- Fault tolerance: Drop‑outs can be handled by dynamic grouping and commit‑reveal schemes as in Bonawitz et al.’s secure aggregation.
- Two‑party case: Pure additive secret sharing with a single server would leak (since the server gets both shares). Use at least three servers or adopt the pairwise‑masking variant of secure aggregation (Bonawitz) that works for any number of parties without a fully trusted server.
- Implementation: The building blocks are available in libraries such as TF Encrypted, CrypTen, or MP‑SPDZ.
7. Conclusion
We have composed a pipeline that combines additive secret sharing (to protect raw contributions), secure aggregation (to compute sums without exposing individual values), and fairness constraints (embedded in the gradient update). The protocol allows multiple parties to train an accurate and fair model while keeping their data private. The modular design permits plugging in different fairness definitions and swapping in advanced MPC techniques if stricter privacy is required.
This design draws inspiration from secure aggregation in federated learning (Bonawitz et al., 2017) and fairness‑aware constrained optimisation (e.g., Zafar et al., 2017), but integrates them into a single coherent, secret‑sharing‑based pipeline.