---
title: Quantile-Based Initialization in Federated Learning
url: https://www.emergentmind.com/topics/quantile-based-initialization
type: topic
---

# Quantile-Based Initialization in Federated Learning

Quantile-based initialization refers to techniques that set neural network bias parameters—most notably, in fully connected layers—via explicit quantile computations to control sparse activation probabilities. In the context of federated learning and private data reconstruction, quantile-based initialization is primarily used to engineer neural activations so that each neuron is likely to be activated by a unique input sample within a client batch. This bias configuration enables precise mapping between gradient rows and input samples, thereby facilitating near-perfect recovery of private data from model updates under certain attack models. The quantile-based bias initialization (QBI) method and its PAIRS extension set new empirical and theoretical reconstruction limits in the context of federated learning privacy attacks, and are counteracted by defensive frameworks such as AGGP [2406.18745].

## 1. Mathematical Foundations of Quantile-Based Initialization

The core of quantile-based bias initialization (QBI) is the control of neuron activation probabilities via parameterized bias settings. For a fully connected layer $L$ with $N$ neurons (weight vectors $w_i \in \mathbb{R}^M$, biases $b_i$), the goal is to have each neuron activate on a prescribed fraction $p$ of samples in a client mini-batch $X = \{x_1, \dots, x_B\}$. The $p$-th empirical quantile $\hat{Q}_p(X)$ of a real-valued random variable $X$ is defined as
$$
\hat{Q}_p(X) = \inf\{ t \in \mathbb{R} : \hat{F}_X(t) \geq p \}
$$
where $\hat{F}_X(t) = \frac{1}{n} \sum_{j=1}^n 1[X_j \leq t]$ is the empirical cumulative distribution function.

For gradient-based data leakage attacks, the critical requirement is for each neuron to activate on exactly one of $B$ samples with high probability ($p = 1/B$). Under a Gaussian approximation, assuming weights and inputs are zero-mean and independent with $\mathrm{Var}(w_{ij}x_{ij})=1$, the pre-activation $w_i^\top x$ is approximately $\mathcal{N}(0, M)$. The bias $b_*$ yielding activation probability $p$ is
$$
b_* = \Phi^{-1}(p) \cdot \sqrt{M}
$$
where $\Phi$ is the standard normal CDF.

Alternatively, given calibration data $\{x_j^{(c)}\}$, the bias can be empirically set as
$$
b_i = -\hat{Q}_p(\{w_i^\top x_j^{(c)}\}_j)
$$
so that a fraction $p$ of activations are positive.

As batch size $B$ increases, the target $p$ shrinks, leading to sparser activations and increased likelihood of unique neuron-sample associations.

## 2. Algorithmic Procedures for QBI

The QBI algorithm is executed server-side prior to each federated learning round. The procedure is as follows:

- For each neuron $i = 1, ..., N$:
  - Initialize $w_i \sim \mathcal{N}(0, I_M)$.
  - Set $p = 1/B$ for anticipated batch size $B$.
  - If no calibration data, use theoretical bias $b_i \leftarrow \Phi^{-1}(p) \cdot \sqrt{M}$.
  - If calibration data $X^{(c)}$ of size $K$ are available, set $b_i \leftarrow -\hat{Q}_p(\{w_i^\top x_j^{(c)}\}_{j=1}^K)$.

Computational cost is $O(NM)$ for weights, and bias initialization is $O(N)$ (theoretical) or $O(NKM + NK\log K)$ (empirical). In practice, using the closed form formula incurs negligible overhead beyond standard random initialization.

## 3. Theoretical Limits of Gradient-Sparsity-Based Attacks

Closed-form expectations for extraction metrics under ideal QBI conditions have been derived. For batch size $B$:
- Active neuron fraction: $p_{A;B} = 1 - ((B-1)/B)^B$
- Extraction-precision: $p_{u;B} = ((B-1)/B)^{B-1}$
- With $N$ neurons, expected extraction-recall is
  $$
  E[R] = 1 - (1 - p_{u;B}/B)^N
  $$
As $B\to\infty$, $p_{A;B} \to 1-1/e \approx 0.632$, $p_{u;B} \to 1/e \approx 0.368$. These formulas set upper bounds for any gradient-sparsity attack under normality assumptions, quantifying how many samples can be isolated and perfectly reconstructed per batch.

## 4. PAIRS: Pattern–Aware Iterative Random Search Extension

Real data distributions often deviate from idealized i.i.d. Gaussian assumptions, resulting in suboptimal sparsity patterns for QBI bias settings. The PAIRS extension (Pattern–Aware Iterative Random Search) improves upon QBI by leveraging an auxiliary dataset to fine-tune weights. In this approach, for each group of $B$ neurons, the goal is to configure weight rows so that every sample in a size-$B$ auxiliary batch is uniquely isolated. The algorithm iteratively refines weight vectors using random restarts, freezing neurons that achieve the desired unique activation criterion. PAIRS increases perfect reconstruction recall $R$ by 5–10 percentage points over QBI.

## 5. Empirical Performance on Benchmark Tasks

QBI and PAIRS have demonstrated substantial improvements in reconstruction rates over previous methods ("trap weights", Boenisch et al. 2023) on several standard datasets.

| Dataset    | (N, B)    | Trap (%) | QBI (%)      | PAIRS (%)   |
|------------|-----------|----------|--------------|-------------|
| ImageNet   | (200, 20) | 35.5     | 82.5 ± 2.4   | 85.5 ± 1.3  |
| ImageNet   | (200, 50) | 30.4     | 52.0 ± 1.5   | 56.0 ± 1.1  |
| ImageNet   | (200,100) | 24.0     | 29.0 ± 0.9   | 34.6 ± 0.7  |
| ImageNet   | (200,200) | 11.3     | 15.1 ± 0.6   | 19.5 ± 0.6  |
| IMDB       | 20        | 100.0    | 100.0 ± 0.0  | 99.9 ± 0.2  |
| IMDB       | 50        | 96.2     | 98.9 ± 0.5   | 98.6 ± 0.4  |
| IMDB       | 100       | 65.4     | 90.5 ± 0.3   | 90.8 ± 0.8  |
| IMDB       | 200       | 25.5     | 72.8 ± 0.6   | 73.3 ± 0.8  |

On ImageNet with $(N, B) = (200, 20)$, QBI achieves recall $R$ of $82.5\%$ vs. $35.5\%$ for trap weights. On IMDB, QBI reaches $72.8\%$ recall at $B=200$, improving over $25.5\%$ for prior methods.

## 6. Defensive Countermeasures: AGGP

Activation-based Greedy Gradient Pruning (AGGP) is a framework designed to defend against QBI-enabled gradient sparsity attacks. AGGP computes the number of samples $a_n$ activating each neuron $n$ per batch; neurons with $0 < a_n < c$ (threshold $c=16$) are considered potential isolators, and their gradients are selectively pruned. The pruning probability is set as
$$
p_{\text{keep},n} = \frac{(a_n - 1)^2}{(c - 2)^2} (p_u - p_l) + p_l
$$
with $p_l=0.01$, $p_u=0.95$. Empirical evaluation demonstrates that AGGP reduces perfect reconstruction recall $R$ to zero in all test conditions while maintaining typical validation accuracy within $\pm 1$ percentage point, illustrating its efficacy as a defense mechanism.

## 7. Context and Broader Impact

Quantile-based initialization, as implemented in QBI and PAIRS, has established new performance limits for batch-wise reconstruction attacks in federated learning, raising both the offensive and defensive stakes in privacy-preserving machine learning. The explicit mathematical connection between quantile bias settings, activation sparsity, and recoverability provides a rigorous framework for future advances in both attack methods and countermeasures. The integration of empirical quantile computations, Gaussian approximations, and random search corrections reflects a synthesis of distributional modeling and combinatorial optimization tailored to privacy-sensitive settings [2406.18745].

Source: https://www.emergentmind.com/topics/quantile-based-initialization