Records about individuals are predominantly tabular, from medical histories and financial transactions to census returns and administrative files. Machine learning offers immense potential to transform the analysis of tabular data, improving predictions and the decisions they inform. Yet a model, or even a single prediction produced by it, can inadvertently reveal sensitive information. This tension raises a central scientific question: can a model deliver fast and accurate classification on sensitive tabular data while formally guaranteeing that any single individual’s record remains private?
Differential privacy (DP) ([4 , 5 ] ) has emerged as the principal framework for resolving this conflict, formally limiting how much a model’s outputs can depend on any one individual’s record. In standard private machine learning ([1 ] ), DP stochastic optimisation ([6 , 7 , 8 ] ) achieves this protection by bounding the contribution of any individual’s record to the parameter updates and injecting calibrated noise during training. However, applying this approach to tabular data creates major operational hurdles. Training must be repeated from scratch for every new dataset and target privacy level, frequently at a steep cost to predictive performance, especially under strong privacy. Moreover, hyperparameter tuning and model selection can weaken privacy guarantees, and their privacy cost must be accounted for alongside model fitting ([2 ] ). Even when the underlying mechanisms are theoretically private, implemented pipelines can fail to provide the intended guarantee because of privacy-accounting mistakes, noise-calibration errors or subtle implementation bugs ([9 , 10 , 11 , 12 , 3 , 13 ] ) (Figure 1 d). This reveals a critical gap for domain practitioners—who are rarely privacy specialists—and motivates classification methods with privacy built in that are easy to use and straightforward to audit.
Figure 1. Alternative approaches to tabular prediction from sensitive data. a, Private learning trains a new model on each sensitive dataset, requiring relatively slow dataset-specific optimisation. b, Non-private tabular learning fits new datasets in a single forward pass through in-context learning, but retains sensitive data for prediction. c, PrivTab instead releases a reusable private summary in one forward pass; all subsequent predictions are private due to the post-processing property of DP. Dashed lines mark the privacy boundary, and stopwatches indicate relative rather than measured time. d, Qualitative comparison; green ticks, orange crosses and grey dashes denote presence, absence and non-applicability, respectively. The auditability comparison concerns the complete data-dependent path, including hyperparameter tuning and privacy accounting, rather than an isolated private update [1 , 2 , 3 ] . e, Membership-inference attack accuracy for the most vulnerable record of each method. For each record in the dataset, we compute the lower endpoint of the 95% confidence interval for attack accuracy; the bar shows the maximum of these lower endpoints. An accuracy of 50% corresponds to perfect privacy. TabPFN v3 and TabICL v2 approach 100%, whereas PrivTab remains much closer to perfect privacy (50%) at the displayed strong and weak formal privacy levels.
Tabular foundation models (TFMs) address the problem of repeated training from scratch for each new dataset. Models such as TabPFN ([14 , 15 ] ) and TabICL ([16 ] ) take as input a labelled context dataset together with new query rows and predict their labels in a single forward pass. This eliminates the need for iterative retraining and enables near-instant fitting and prediction. They achieve this through in-context learning, by pretraining across millions of simulated tasks consisting of context–target tabular dataset pairs. The labelled context dataset is used to fit the model, whereas the held-out target dataset contains the query rows and their target labels which are used to evaluate the predictions and update the model. These simulated tasks contain no sensitive information. However, these models lack formal privacy protections, and for both TabPFN and TabICL, sensitive context rows—or non-private representations of them—must remain available at inference time to generate predictions. Indeed, using only black-box access to model predictions, we demonstrate that TabPFN and TabICL are vulnerable to context membership-inference attacks, allowing an attacker to determine whether a specific individual’s record was included in the context dataset with near-perfect accuracy (Figure 1 e).
To address both the challenges of traditional private learning and the vulnerability of existing TFMs, we introduce PrivTab, which embeds a privacy mechanism directly within a TFM. Evaluated across a broad tabular benchmark, PrivTab achieves stronger predictive performance and better uncertainty estimates than conventional private baselines under moderate-to-strong privacy, remains competitive under weaker privacy, and reduces fitting time from minutes to milliseconds. It also retains its performance in a workflow that includes private preprocessing. Together, these results show that provable and auditable privacy can be built natively into foundation-model architectures, avoiding costly and difficult dataset-specific private training and opening a path to practical, privacy-preserving prediction from sensitive tabular data at scale.
Principled and efficient privacy-aware in-context learning
PrivTab embeds the privacy mechanism directly within the foundation model architecture at the point where sensitive information enters. It compresses a sensitive context dataset into a compact DP summary (Figure 1 ). Once constructed, this summary can be reused for all downstream query rows, avoiding repeated processing of the sensitive context and making prediction independent of the original context size. This design enables efficient fitting and prediction using standard computational hardware. Because all downstream predictions rely solely on this summary, the post-processing property of DP ([4 ] ) ensures they incur no additional privacy loss, allowing the summary to be stored and queried indefinitely.
Existing work based on pretrained models typically privatise either the inputs to or outputs from a model ([17 , 18 , 19 ] ). While prior approaches have mainly targeted textual data and natural-language tasks ([17 , 18 ] ), DP-TabICL ([19 ] ) computes noisy aggregate statistics over groups of tabular records and converts them into textual examples for large language model (LLM) prediction. Such methods rely on general-purpose LLM inference, which can be substantially more expensive because prediction requires repeated inference for each query row. DP-TabICL, for example, reports prediction times of 0.14–1.11 seconds per query row, and evaluates only 10% of the target rows for the larger datasets owing to inference costs ([19 ] ).
Drawing on TabArena’s computational guidelines ([20 ] ), which constrain computational resources and limit model evaluation to at most one hour, we adopt a controlled computational setting. We therefore consider only dedicated private tabular methods compatible with this computational regime: methods that can be fitted on a central processing unit (CPU) or a graphics processing unit (GPU) and support efficient prediction on CPU. This is particularly important for broad adoption, since downstream users might have limited computational resources and rely on standard CPU-based hardware.
PrivTab pretrains the foundation model with the privacy mechanism on millions of simulated tasks and across a range of privacy levels, achieving privacy-aware in-context learning—effectively “learning how to learn under privacy” ([21 ] ). This enables PrivTab to account explicitly for the effect of privacy noise in its predictions and uncertainty estimates—a crucial requirement for high-stakes decision-making. By contrast, standard private-learning pipelines do not provide this guarantee by default unless the effect of privacy noise on predictive uncertainty is explicitly modelled.
Designing a private summary mechanism presents several technical challenges: the influence of each individual record must be bounded, the attention architecture must remain expressive despite the added noise, and the implementation must remain simple enough to be auditable. We address these requirements by designing differentially private multi-head cross-attention (DP-MHCA), a bounded cross-attention layer that produces a private summary with sensitivity that does not grow with context size. This design confines the privacy-critical operations to a self-contained transformer module.
PrivTab’s privacy-critical path is thus more localised and easier to inspect and audit than that of a conventional private-training pipeline. To strengthen the connection between the mathematical privacy guarantee (Supplement S3) and the executable implementation, we used three complementary approaches. First, we isolated the privacy-critical operations in a self-contained reference implementation (Supplement S3.3). Second, we formally verified the sensitivity bound and adaptive Gaussian differential privacy (GDP) composition in Lean 4 ([22 ] ). Third, empirical sensitivity and privacy audits found behaviour consistent with the intended noise calibration across all evaluated privacy regimes (Supplement S6.2). These checks strengthen confidence that the implementation follows the proved mechanism; the Lean formalisation itself does not verify the exact software execution.
Private classification across datasets
We evaluated PrivTab on 33 classification datasets from TabArena ([20 ] ), a standard tabular benchmark, across six privacy regimes and ten independent context–target splits per dataset. In each split, 80% of a dataset’s labelled rows form the context used to fit each method, and the remaining 20% are held-out target rows used to evaluate its predictions. To accommodate varying table sizes, we pretrained two model variants specialised for small and large datasets, routing incoming datasets accordingly. We compared PrivTab with two carefully tuned baselines: differentially private logistic regression (DP-LR) and a differentially private multilayer perceptron (DP-MLP). Both are standard model classes for private tabular learning and can be trained using DP stochastic optimisation for each dataset and privacy level. In contrast, PrivTab requires no dataset-specific optimisation at any privacy level.
PrivTab is more accurate throughout the moderate-to-strong privacy regimes, with DP-MLP closing the gap only under weak privacy constraints (Figure 2 a and Figure 2 b). PrivTab’s advantage is most pronounced in log loss under heavy noise (Figure 2 b), consistent with training through an embedded privacy mechanism helping to preserve reliable uncertainty estimates when privacy bounds are tightest. In aggregate Elo comparisons spanning all datasets, privacy levels and splits, PrivTab achieves the highest overall rating (Figure 2 d), driven by its better performance in the moderate-to-strong privacy regimes (Figure 2 c).
Figure 2. Predictive performance and fitting time across 33 TabArena datasets. a, Paired AUC gap, A U C m − A U C n o n - p r i v a t e L R AUC_m - AUC_{\mathrm{non\text{-}private\ LR}} A U C m − A U C non - private LR , for each method m m m (PrivTab, DP-MLP, DP-LR). b, Relative log-loss improvement over non-private logistic regression for the same three methods. Each quantity is computed on matched context–target splits before aggregation; zero denotes parity with non-private logistic regression and positive values mean m m m is better. Error bars are bootstrap 95% confidence intervals over datasets. c, Elo rating at each privacy level; higher ratings indicate better predictive performance, and shaded bands mark strong (μ < 0.15 \mu< 0.15 μ < 0.15 ), moderate (0.15 ≤ μ < 0.6 0.15 \le\mu< 0.6 0.15 ≤ μ < 0.6 ) and weak (μ ≥ 0.6 \mu\ge0.6 μ ≥ 0.6 ) formal privacy. Elo combines binary-task AUC and multiclass-task log loss and is calibrated separately at each privacy level so that differentially private logistic regression (DP-LR) scores 1,000. All results use ten context–target splits per dataset. d, Aggregate Elo over all privacy levels versus median fitting time per context–target split on a logarithmic scale, so better methods lie towards the upper left. Horizontal and vertical bars are bootstrap 95% confidence intervals for median fitting time and Elo rating, respectively.
The dataset-level breakdown shows contrasting trends with row count (Figure 3 ): PrivTab’s AUC advantage over DP-MLP is largest on smaller datasets and diminishes as datasets grow, whereas its advantage over DP-LR generally grows with dataset size. This is consistent with differences in how the models exploit additional context: PrivTab, like other tabular foundation models, may eventually saturate as context size increases, while DP-LR has limited capacity to benefit from larger datasets. In contrast, the greater capacity of DP-MLP allows it to continue benefiting from additional training data, thereby narrowing the gap to PrivTab on larger datasets. PrivTab also has a positive AUC gap for most of the 33 datasets at each of the three plotted privacy levels, particularly against DP-MLP (Figure S7 ). The corresponding relationship with feature count is less pronounced. Complete per-dataset breakdowns against DP-MLP and DP-LR are provided in Figure S5 and Figure S6 .
Figure 3. AUC gaps versus dataset size across 33 TabArena datasets. a, Mean paired AUC gap between PrivTab and the differentially private multilayer perceptron (DP-MLP). b, The corresponding gap between PrivTab and differentially private logistic regression (DP-LR). Columns show privacy levels μ = 0.1 \mu= 0.1 μ = 0.1 , 0.2 0.2 0.2 and 0.4 0.4 0.4 ; each point is a dataset’s mean paired gap across ten context–target splits, plotted against its number of rows on a logarithmic scale. Positive gaps favour PrivTab, while the dashed horizontal line marks equal AUC. Circles denote binary datasets and squares denote multiclass datasets; AUC is macro-averaged one-versus-rest for multiclass tasks. Grey lines are least-squares fits against log dataset size, shown as visual guides; annotations report Spearman’s ρ \rho ρ and the corresponding p p p -value.
Figure S5. Dataset-level AUC gap between PrivTab and DP-MLP across all privacy levels. Each marker represents a dataset, positioned by its number of features and rows. Marker colour gives the mean paired AUC gap over ten context–target splits; positive values favour PrivTab. Binary AUC is used for binary datasets and macro-averaged one-versus-rest AUC for multiclass datasets.
Figure S6. Dataset-level AUC gap between PrivTab and DP-LR across all privacy levels. Plotting conventions match Figure S5 ; positive values favour PrivTab.
Figure S7. AUC gaps versus feature count across 33 TabArena datasets. a, PrivTab minus DP-MLP AUC; b, PrivTab minus DP-LR AUC. Columns show privacy levels μ = 0.1 \mu= 0.1 μ = 0.1 , 0.2 0.2 0.2 and 0.4 0.4 0.4 . Each point is a dataset’s mean paired AUC gap across ten context–target splits, plotted against its number of features on a logarithmic scale; positive gaps favour PrivTab. Circles denote binary datasets and squares denote multiclass datasets; AUC is macro-averaged one-versus-rest for multiclass tasks. Dashed horizontal lines mark equal AUC, grey lines are least-squares fits against log feature count, and annotations report Spearman’s ρ \rho ρ and its p p p -value.
These results are even more striking when considering the computational difference between PrivTab and traditional private learning. PrivTab requires a median fitting time of approximately 10 milliseconds per context–target split—more than four orders of magnitude faster than DP-MLP and DP-LR, which require minutes of dataset-specific private training (Figure 2 d). Across the entire benchmark, fitting DP-LR and DP-MLP required approximately 400 and 130 graphics processing unit (GPU) hours2 , respectively. In contrast, fitting PrivTab required only 30 GPU seconds. This cost reflects the repeated dataset-specific training and private model selection required by the baselines: there were 198 dataset–privacy configurations per baseline (33 datasets × \times × 6 privacy levels). Ten splits per configuration required 1,980 final training runs per baseline, each preceded by private learning-rate selection that consumed part of the privacy budget. In contrast, PrivTab requires neither dataset-specific nor privacy-level-specific optimisation or hyperparameter tuning. Each pretrained PrivTab variant can be used across different privacy levels without retraining. Comprehensive dataset-level runtimes for each method are provided in Figure S8 .
Figure S8. Fitting time as a function of dataset size. Points are dataset-level measurements and curves are fitted shifted power laws. PrivTab is approximately four orders of magnitude faster than the DP Adam baselines over the studied range.
On a CPU, median prediction times for the full target set were 66.6 milliseconds (ms) for PrivTab, 0.35 ms for DP-MLP and 0.18 ms for DP-LR (Figure S9 and Table S11 ). These medians were computed across the 33 datasets after averaging timings within each dataset.
Table S11. Dataset sizes and post-fit prediction times in milliseconds on a laptop with a 13th-generation Intel Core i5 CPU, underlying Figure S9 . Values average the per-configuration median of three timed runs over six privacy levels and ten context–target splits.
Figure S9. Prediction time as a function of target-set size on a laptop CPU. Points show dataset-level mean post-fit prediction times in milliseconds (ms) on a 13th-generation Intel Core i5, averaged over six privacy levels and ten context–target splits. Curves are shifted power laws fitted in log time as visual guides. Both axes are logarithmic. All methods predict in batches of up to 1,024 target rows.
Private preprocessing in practice
The TabArena benchmark isolates prediction by applying a common idealised preprocessing procedure to all methods. Here, preprocessing refers to shifting and scaling the columns in the sensitive dataset before model fitting, using statistics computed from those columns. The same statistics are then used to transform the queries accordingly and must therefore be privatised before being released alongside the private summary. We show that this is possible in practice for datasets with public column descriptions detailed enough to infer meaningful clipping intervals, and whose modest feature counts allow private preprocessing to retain useful signal. A clipping interval specifies lower and upper bounds for a numeric feature, with values outside the interval truncated to the nearest bound. These bounds limit the sensitivity of the estimated means and variances, allowing the noise required for private preprocessing to be calibrated. We inferred numeric clipping intervals from the public descriptions using an LLM; no sensitive values were supplied to that model.
The total privacy budget used in the case study here, μ = 0.4 \mu= 0.4 μ = 0.4 , was split between private preprocessing and private prediction or training. Bank Marketing, Pima Diabetes and Maternal Health Risk originate from the UCI Machine Learning Repository ([23 ] ); the other two datasets are COMPAS from OpenML and ACS Income from Folktables ([24 , 25 ] ). PrivTab achieved the highest Elo rating across the five datasets in the case study (Figure S12 ), with numerical values reported in Table S25 ; method-level AUC and log-loss results are provided in Figure 4 b and Figure S12 , respectively. Oracle (empirical min–max) bounds and LLM-derived bounds yielded similar AUC and log loss on four of the five datasets (Figure 4 a and Figure S11 ). The oracle comparison is partially private: its standardisation and prediction are privatised, but its data-dependent bounds do not have an end-to-end privacy guarantee. The LLM-derived bounds use only public descriptions. Pipeline details, prompts, bounds and numerical results appear in Supplement S6.6.
Figure 4. Private preprocessing case study. a , Mean PrivTab AUC across ten context–target splits at total privacy level μ = 0.4 \mu= 0.4 μ = 0.4 . The three preprocessing variants compare non-private standardisation, partially private preprocessing using oracle bounds computed from empirical dataset minima and maxima, and private preprocessing using bounds inferred from public dataset descriptions by an LLM. Only the LLM-derived bounds avoid using sensitive values to select clipping intervals; the oracle-bounds comparison is partially private. b , Mean AUC for PrivTab, DP-MLP and DP-LR using LLM-derived bounds and private standardisation across the same five datasets and ten splits. Higher AUC is better. Error bars show bootstrap 95% confidence intervals. Legends beneath each panel identify its plotted variants.
Figure S11. Effect of preprocessing on PrivTab. Mean log loss across ten context–target splits on five datasets, comparing non-private standardisation, partially private standardisation with oracle bounds, and private standardisation with LLM-derived bounds. Lower log loss is better. Error bars show bootstrap 95% confidence intervals. The legend beneath the plot identifies the preprocessing variants.
Figure S12. Performance of privately preprocessed models at μ = 0.4 \mu= 0.4 μ = 0.4 . a,b, AUC and log loss for PrivTab, DP-MLP and DP-LR using LLM-derived bounds and private standardisation across five datasets. c, Elo ratings of these models; DP-LR is calibrated to 1,000. Higher AUC and Elo and lower log loss are better. Error bars show bootstrap 95% confidence intervals. The method legend is beneath all three panels.
Table S25. ELO ratings for the private-preprocessing evaluation underlying Figure 4 e. Ratings combine AUC for binary datasets and log loss for multiclass datasets across the five datasets and ten context–target splits at total privacy level μ = 0.4 \mu= 0.4 μ = 0.4 . The scale is calibrated so that DP-LR has an ELO rating of 1,000. Intervals are 95% confidence intervals.
Non-private models reveal membership {#sec:Non-private models reveal membership}
TFMs use a context dataset to infer labels for incoming query rows. Because these models fit directly to the sensitive context dataset, they provide no formal guarantee against membership inference of specific context records. To evaluate this vulnerability, we conducted a likelihood-ratio membership-inference attack (Carlini et al. [26 ] ), which distinguishes members of a context set from non-members based on prediction confidence. Because these models fit to context records without privacy protection, they can exhibit higher confidence when queried on the same context records. In contrast, PrivTab and private-learning methods use DP mechanisms that limit how reliably an attacker can infer context membership from prediction confidence.
We performed the analysis on clinical records from the Maternal Health Risk dataset. Rather than reporting aggregate averages, which can hide highly vulnerable records [27 ] , we report record-level vulnerability using fitted attack accuracy Figure 1 e and the AUC of record-level ROC curves Figure S3 ,Figure S3 . The conservative lower confidence estimates of fitted attack accuracy in Figure 1 e approach 100% for the most vulnerable records under TabPFN v3 and TabICL v2. In contrast, PrivTab remains much closer to perfect privacy across all evaluated privacy levels. While empirical attacks cannot replace formal proofs, they illustrate the practical importance of DP guarantees. Complete attack specifications, formal confidence bounds and full benchmark evaluations are detailed in the Methods and Supplement S6.1.
Figure S3. FPC-corrected record-level membership-inference curves. ROC curves are shown for the ten most vulnerable Maternal Health Risk records at each setting. Shades distinguish records, and the diagonal denotes perfect privacy. The fitted IN/OUT standard deviations use the same FPC as Figure 5 a. PrivTab remains substantially closer to the diagonal than non-private TabPFN v3 and TabICL v2, whose most vulnerable records are nearly perfectly distinguishable.
Discussion
Our results suggest that introducing privacy into the TFM paradigm can substantially reduce computational cost and improve ease of use while retaining competitive predictive utility under privacy. Traditional private learning methods enforce privacy through the optimisation procedure for every new dataset, which requires repeatedly fitting and privatising a new model. PrivTab instead places the privacy mechanism inside the foundation-model architecture. The model is pretrained once to perform prediction through a private summary, and fitting to a new sensitive dataset only requires constructing this summary through a single forward pass. This amortises computational cost and allows the model to be used across privacy levels without retraining.
This architectural choice also makes the privacy boundary simpler and easier to audit. Once the sensitive dataset has been converted into the private summary, all later predictions are post-processing and do not require further access to the sensitive records. The private summary mechanism can therefore be inspected, its mathematical guarantees formally verified, and its implementation tested through targeted empirical audits. The summary itself can also be stored and shared with other users for later predictions. Moreover, because PrivTab is pretrained using the same privacy mechanism used at prediction, it learns how to make predictions in the presence of privacy noise rather than encountering privacy noise only during dataset-specific private training.
Several limitations remain. We study only classification and not regression. PrivTab’s privacy model assumes one user per row, and extending the guarantee to settings in which one individual contributes multiple rows is less straightforward than for approaches based on DP stochastic optimisation. PrivTab has a smaller relative advantage when privacy is weak or context sizes are large, as models trained separately on each dataset can benefit more from both the relaxed privacy constraint and additional data. Similar diminishing returns on larger context sizes have also been observed in earlier TFMs such as TabPFN v1, and future research could benefit from recent advancements in this area to improve PrivTab. Finally, preprocessing must also be included in the privacy analysis in practice. Our private-preprocessing experiments demonstrate one possible approach, but the appropriate preprocessing pipeline remains application-dependent. The same preprocessing requirement also applies to the private-learning baselines.
More broadly, our results suggest that foundation models can be designed around privacy from the outset, rather than having privacy added retrospectively to every downstream training procedure. PrivTab provides one example of this principle by learning once how to perform inference through a private representation of the sensitive dataset, while keeping the mechanism that accesses the sensitive data explicit and auditable.
Methods
Differential privacy
Differential privacy (DP) limits how much the output distribution of a randomised algorithm can change when one person’s record changes [4 ] . Let D = { z i } i = 1 n \mathcal{D} = \{z_i\}_{i=1}^{n} D = { z i } i = 1 n be a dataset of individual records and A : D → O \mathcal{A} : \mathcal{D} \to\mathcal{O} A : D → O a randomised mechanism from datasets D \mathcal{D} D to an output space O \mathcal{O} O ; in supervised learning, z i z_i z i can be an input–label pair ( x , y ) (x,y) ( x , y ) . Two datasets D \mathcal{D} D and D ′ \mathcal{D}' D ′ are neighbouring or adjacent, denoted D ≃ D ′ \mathcal{D} \simeq\mathcal{D}' D ≃ D ′ , if they have the same size and differ in at most one record z i z_i z i . This is known as the replace-one or substitute adjacency relation.
We report privacy in the Gaussian DP (GDP) parameterisation [5 ] . A mechanism satisfies μ \mu μ -GDP when its outputs on neighbouring datasets are no easier to distinguish than N ( 0 , 1 ) \mathcal{N}(0,1) N ( 0 , 1 ) and N ( μ , 1 ) \mathcal{N}(\mu,1) N ( μ , 1 ) in a hypothesis test; smaller μ \mu μ means stronger privacy. For a vector-valued function f f f , the Gaussian mechanism A ( D ) = f ( D ) + N ( 0 , σ 2 I ) \mathcal{A}(\mathcal{D}) = f(\mathcal{D}) + \mathcal{N}(0,\sigma^2 I) A ( D ) = f ( D ) + N ( 0 , σ 2 I ) has μ = Δ ( f ) / σ \mu= \Delta(f)/\sigma μ = Δ ( f ) / σ , where σ \sigma σ is the noise standard deviation, I I I is the identity matrix of the output dimension, and the ℓ 2 \ell_2 ℓ 2 -sensitivity is Δ ( f ) = sup D ≃ D ′ ∥ f ( D ) − f ( D ′ ) ∥ 2 \Delta(f) = \sup_{\mathcal{D}\simeq\mathcal{D}'} \lVert f(\mathcal{D}) - f(\mathcal{D}') \rVert_2 Δ ( f ) = sup D ≃ D ′ ∥ f ( D ) − f ( D ′ ) ∥ 2 . Thus, bounding a one-row change in f f f determines the noise needed for a target privacy level. The adaptive composition of mechanisms with GDP parameters μ 1 , … , μ k \mu_1,\ldots,\mu_k μ 1 , … , μ k has parameter
μ t o t a l 2 = ∑ i = 1 k μ i 2 . (1) \mu_{\mathrm{total}}^2 = \sum_{i=1}^{k} \mu_i^2. \tag*{(1)} μ total 2 = i = 1 ∑ k μ i 2 . (1)
Once a DP summary is released, computation using only that summary is post-processing and costs no additional privacy budget. Formal definitions, conversion between GDP and ( ε , δ ) (\varepsilon,\delta) ( ε , δ ) -DP, and the precise adaptive-composition statement are in Supplement S1.2.
Model architecture
Neural processes [28 b] use a labelled context set to make predictions at new query inputs without dataset-specific training, requiring only a single forward pass. Transformers [30 ] process collections of input representations using self-attention, which allows each representation to be updated according to its relationships with the others. Attentive and transformer neural processes [31 , 32 ] adapt this mechanism to conditional prediction, allowing query representations to attend to the labelled context and extract information relevant to each prediction. Latent-bottleneck attentive neural processes (LBANP) [33 ] instead first compress the context into a fixed-size set of latent representations, which provides an intermediate summary through which information passes before predictions are made at the queries.
High-level architecture. PrivTab follows the structure of the LBANP but makes the context-to-summary operation differentially private (Figure E1 ). Each row has a feature vector x i = ( x i 1 , … , x i d ) \mathbf{x}_i = (x_{i1},\ldots,x_{id}) x i = ( x i 1 , … , x i d ) , where d d d is the number of input features and x i k x_{ik} x ik is the value of feature k k k in row i i i . Let D c = { ( x i c , y i c ) } i = 1 n c \mathcal{D}_c = \{(\mathbf{x}_i^c,y_i^c)\}_{i=1}^{n_c} D c = {( x i c , y i c ) } i = 1 n c be the labelled context and D t = { x j t , … , x n t t } \mathcal{D}_t = \{\mathbf{x}_j^t,\ldots,\mathbf{x}_{n_t}^t\} D t = { x j t , … , x n t t } the query inputs. During pretraining, D t = { ( x j t , y j t ) } j = 1 n t \mathcal{D}_t = \{(\mathbf{x}_j^t,y_j^t)\}_{j=1}^{n_t} D t = {( x j t , y j t ) } j = 1 n t also contains target labels, which are withheld from the predictor and used only for the learning objective or evaluation.
Figure E1. Detailed PrivTab architecture. Context and target rows are first mapped to row embeddings by RowEmbed. In PrivateSummary, a small set of data-independent learnable pseudo-tokens cross-attends to the sensitive context rows through DP-MHCA, producing privatised summaries. The public Prediction module reuses these summaries through cross-attention and token-wise multilayer perceptrons. DP-MHCA is the only operation that transfers context information into the released summaries; target-side computation is post-processing.
The row embedding model RowEmbed converts each row into a fixed-width token, using the observed label for context rows and an unknown-label marker for queries. It maps each context row ( x i c , y i c ) (\mathbf{x}_i^c,y_i^c) ( x i c , y i c ) to
z i c = RowEmbed ( x ^ i c , LabelEmbed ( y i c ) ) (2) \mathbf{z}_i^c = \operatorname{RowEmbed}\left(\hat{\mathbf{x}}_i^c,\operatorname{LabelEmbed}(y_i^c)\right) \tag*{(2)} z i c = RowEmbed ( x ^ i c , LabelEmbed ( y i c ) ) (2)
and each query x j t \mathbf{x}_j^t x j t to
z j t , ( 0 ) = RowEmbed ( x ^ j t , LabelEmbed ( y n u l l ) ) . (3) \mathbf{z}_j^{t,(0)} = \operatorname{RowEmbed}\left(\hat{\mathbf{x}}_j^t,\operatorname{LabelEmbed}(y_{\mathrm{null}})\right). \tag*{(3)} z j t , ( 0 ) = RowEmbed ( x ^ j t , LabelEmbed ( y null ) ) . (3)
Here x ^ \hat{\mathbf{x}} x ^ is the padded, fixed-width feature representation of x \mathbf{x} x , LabelEmbed is a learned label embedding, and RowEmbed is the row-wise embedding network. The query uses the dedicated unknown-label index y n u l l y_{\mathrm{null}} y null ; see Supplement S3 for the exact construction. Each row token has width d t o k = 256 d_{\mathrm{tok}} = 256 d tok = 256 . The context embeddings pass through the private summary module to produce S ~ \tilde{S} S ~ ; the prediction module then combines each query embedding with this summary to obtain label probabilities:
S ~ = PrivateSummary ϕ ( z 1 : n c c ; μ ) , \tilde{S} = \operatorname{PrivateSummary}_{\phi}\left(\mathbf{z}_{1:n_c}^c;\mu\right), S ~ = PrivateSummary ϕ ( z 1 : n c c ; μ ) ,
q ϕ ( y ∣ x j t , S ~ ) = [ Prediction ψ ( z j t , ( 0 ) ; S ~ ) ] y (4) q_{\phi}\left(y \mid\mathbf{x}_j^t,\tilde{S}\right) = \left[\operatorname{Prediction}_{\psi}\left(\mathbf{z}_j^{t,(0)};\tilde{S}\right)\right]_y \tag*{(4)} q ϕ ( y ∣ x j t , S ~ ) = [ Prediction ψ ( z j t , ( 0 ) ; S ~ ) ] y (4)
Here [ ⋅ ] y [\cdot]_y [ ⋅ ] y denotes the selection of the probability for label y y y , and ϕ \phi ϕ and ψ \psi ψ denote the fixed summary and prediction parameters, respectively, and μ \mu μ is the requested privacy level. The model has 9.3 million parameters, with 8.9 million in the private summary module and 0.4 million additional parameters in the prediction module.
Private summary module. The private summary module compresses the labelled context into a fixed-size collection of noisy summaries. The module starts from m = 128 m = 128 m = 128 pseudo-tokens , u 1 , … , u m \mathbf{u}_1,\ldots,\mathbf{u}_m u 1 , … , u m , learned during pretraining and subsequently fixed. Each of the L m a i n = 3 L_{\mathrm{main}} = 3 L main = 3 main layers first applies private multi-head cross-attention (DP-MHCA) to the context embeddings and then multi-head self-attention (MHSA) Vaswani et al. [30 ] to the resulting summary tokens. Denote u 1 : m \mathbf{u}_{1:m} u 1 : m as a short-hand for u 1 , … , u m \mathbf{u}_1,\ldots,\mathbf{u}_m u 1 , … , u m , and let s ~ 1 : m ( 0 ) = u 1 : m \tilde{\mathbf{s}}_{1:m}^{(0)}=\mathbf{u}_{1:m} s ~ 1 : m ( 0 ) = u 1 : m , then for each layer ℓ = 1 , … , L m a i n \ell=1,\ldots,L_{\mathrm{main}} ℓ = 1 , … , L main ,
s 1 : m ( ℓ ) = DP-MHCA b l o c k ( ℓ ) ( s ~ 1 : m ( ℓ − 1 ) ; z 1 : n c c ) , s ~ 1 : m ( ℓ ) = MHSA b l o c k ( ℓ ) ( s 1 : m ( ℓ ) ) . (5) \begin{aligned}
\mathbf{s}_{1:m}^{(\ell)} &= \operatorname{DP\text{-}MHCA}_{\mathrm{block}}^{(\ell)}\left(\tilde{\mathbf{s}}_{1:m}^{(\ell-1)};\mathbf{z}_{1:n_c}^{c}\right),\\
\tilde{\mathbf{s}}_{1:m}^{(\ell)} &= \operatorname{MHSA}_{\mathrm{block}}^{(\ell)}\left(\mathbf{s}_{1:m}^{(\ell)}\right). \tag*{(5)}
\end{aligned} s 1 : m ( ℓ ) s ~ 1 : m ( ℓ ) = DP - MHCA block ( ℓ ) ( s ~ 1 : m ( ℓ − 1 ) ; z 1 : n c c ) , = MHSA block ( ℓ ) ( s 1 : m ( ℓ ) ) . (5)
The state s 1 : m ( ℓ ) \mathbf{s}_{1:m}^{(\ell)} s 1 : m ( ℓ ) is the intermediate output of the private cross-attention block; s ~ 1 : m ( ℓ ) \tilde{\mathbf{s}}_{1:m}^{(\ell)} s ~ 1 : m ( ℓ ) is the saved summary after the self-attention block. Another L p o s t = 2 L_{\mathrm{post}}=2 L post = 2 layers refine the summary using only self-attention:
s ~ 1 : m ( ℓ ) = MHSA b l o c k ( ℓ ) ( s ~ 1 : m ( ℓ − 1 ) ) , ℓ = L m a i n + 1 , … , L . (6) \tilde{\mathbf{s}}_{1:m}^{(\ell)}=\operatorname{MHSA}_{\mathrm{block}}^{(\ell)}\left(\tilde{\mathbf{s}}_{1:m}^{(\ell-1)}\right),\qquad\ell=L_{\mathrm{main}}+1,\ldots,L. \tag*{(6)} s ~ 1 : m ( ℓ ) = MHSA block ( ℓ ) ( s ~ 1 : m ( ℓ − 1 ) ) , ℓ = L main + 1 , … , L . (6)
Here L = L m a i n + L p o s t = 5 L=L_{\mathrm{main}}+L_{\mathrm{post}}=5 L = L main + L post = 5 , and the module returns the collection of all saved states,
S ~ = ( s ~ 1 : m ( 1 ) , … , s ~ 1 : m ( L ) ) = PrivateSummary ϕ ( z 1 : n c c ; μ ) . (7) \tilde{S}=\left(\tilde{\mathbf{s}}_{1:m}^{(1)},\ldots,\tilde{\mathbf{s}}_{1:m}^{(L)}\right)=\operatorname{PrivateSummary}_{\phi}\left(\mathbf{z}_{1:n_c}^{c};\mu\right). \tag*{(7)} S ~ = ( s ~ 1 : m ( 1 ) , … , s ~ 1 : m ( L ) ) = PrivateSummary ϕ ( z 1 : n c c ; μ ) . (7)
The operators DP-MHCA b l o c k \operatorname{DP\text{-}MHCA}_{\mathrm{block}} DP - MHCA block and MHSA b l o c k \operatorname{MHSA}_{\mathrm{block}} MHSA block denote complete blocks, including a token-wise feed-forward network; their details are in Supplement S3. Only DP-MHCA reads the context embeddings; self-attention and the remaining summary updates are post-processing of its private outputs.
DP-MHCA layer. DP-MHCA replaces the usual softmax attention Vaswani et al. [30 ] with a sum of bounded contributions and adds Gaussian noise to protect individual context rows. For each layer ℓ \ell ℓ and head h h h , learned matrices project the summary token s ~ i ( ℓ − 1 ) \tilde{\mathbf{s}}_i^{(\ell-1)} s ~ i ( ℓ − 1 ) into a query and the context token z j c \mathbf{z}_j^c z j c into a key and a value:
q i ( h ) = W Q ( ℓ , h ) s ~ i ( ℓ − 1 ) , k j ( h ) = W K ( ℓ , h ) z j c , v ˉ j ( h ) = W V ( ℓ , h ) z j c . (8) \begin{aligned}
\mathbf{q}_i^{(h)} &= \mathbf{W}_Q^{(\ell,h)}\tilde{\mathbf{s}}_i^{(\ell-1)},\\
\mathbf{k}_j^{(h)} &= \mathbf{W}_K^{(\ell,h)}\mathbf{z}_j^c,\\
\bar{\mathbf{v}}_j^{(h)} &= \mathbf{W}_V^{(\ell,h)}\mathbf{z}_j^c. \tag*{(8)}
\end{aligned} q i ( h ) k j ( h ) v ˉ j ( h ) = W Q ( ℓ , h ) s ~ i ( ℓ − 1 ) , = W K ( ℓ , h ) z j c , = W V ( ℓ , h ) z j c . (8)
Here each projection matrix lies in R d h × d t o k \mathbb{R}^{d_h\times d_{\mathrm{tok}}} R d h × d tok . In the first layer, s ~ i ( 0 ) = u i \tilde{\mathbf{s}}_i^{(0)}=\mathbf{u}_i s ~ i ( 0 ) = u i ; later layers use summary tokens obtained by post-processing previous private outputs. For each summary token i i i , the attention output before normalisation is
a i ( h ) = ∑ j = 1 n c tanh ( ⟨ q i ( h ) , k j ( h ) ⟩ d h ) v ˉ j ( h ) max { ∥ v ˉ j ( h ) ∥ 2 , ε v } , \mathbf{a}_i^{(h)}=\sum_{j=1}^{n_c}\tanh\left(\frac{\left\langle\mathbf{q}_i^{(h)},\mathbf{k}_j^{(h)}\right\rangle}{\sqrt{d_h}}\right)\frac{\bar{\mathbf{v}}_j^{(h)}}{\max\left\{\left\|\bar{\mathbf{v}}_j^{(h)}\right\|_2,\varepsilon_v\right\}}, a i ( h ) = j = 1 ∑ n c tanh d h ⟨ q i ( h ) , k j ( h ) ⟩ max { v ˉ j ( h ) 2 , ε v } v ˉ j ( h ) ,
s ~ i , a t t n = [ a i ( 1 ) , … , a i ( H ) ] + ξ i . (9) \tilde{\mathbf{s}}_{i,\mathrm{attn}}=\left[\mathbf{a}_i^{(1)},\ldots,\mathbf{a}_i^{(H)}\right]+\boldsymbol{\xi}_i. \tag*{(9)} s ~ i , attn = [ a i ( 1 ) , … , a i ( H ) ] + ξ i . (9)
Here a i ( h ) \mathbf{a}_i^{(h)} a i ( h ) is the pre-noise head output, d h d_h d h is the per-head key dimension, and brackets denote concatenation across heads. The noise vectors ξ i ∼ N ( 0 , σ 2 I H d h ) \boldsymbol{\xi}_i\sim\mathcal{N}(0,\sigma^2\mathbf{I}_{Hd_h}) ξ i ∼ N ( 0 , σ 2 I H d h ) are independent across summary tokens and layers; the noise scale σ \sigma σ is calibrated below. The numerical stabiliser is ε v = 10 − 12 \varepsilon_v=10^{-12} ε v = 1 0 − 12 . Keys and values are computed row-wise, so each summand depends on one context row.
Normalising the noisy attention outputs controls their scale before the residual update. We applied this step in certain configurations, especially during evaluation, by rescaling with the largest token norm:
s ~ i , a t t n = G s ~ i , a t t n max k = 1 , … , m ∥ s ~ k , a t t n ∥ 2 + ε s . (10) \tilde{\mathbf{s}}_{i,\mathrm{attn}}=\frac{G\tilde{\mathbf{s}}_{i,\mathrm{attn}}}{\max_{k=1,\ldots,m}\left\|\tilde{\mathbf{s}}_{k,\mathrm{attn}}\right\|_2+\varepsilon_s}. \tag*{(10)} s ~ i , attn = max k = 1 , … , m ∥ s ~ k , attn ∥ 2 + ε s G s ~ i , attn . (10)
where G = 512 G=512 G = 512 and ε s = 10 − 6 \varepsilon_s=10^{-6} ε s = 1 0 − 6 in the reported experiments. This preserves the relative magnitudes of the attention outputs while controlling their overall scale, which substantially improved performance on longer contexts (Table S37 ). These normalised attention outputs precede the residual and feed-forward updates in the private block and the subsequent self-attention block; the saved states s ~ 1 : m ( ℓ ) \tilde{\mathbf{s}}_{1:m}^{(\ell)} s ~ 1 : m ( ℓ ) include those operations. Applied after noise addition, this normalisation is post-processing and does not affect the privacy guarantee.
Table S37. ELO rankings for the normalisation and model-combination ablation.
Privacy guarantees. The following theorem states the privacy guarantee for the context dataset and all predictions made from its private summary.
Theorem (Privacy of PrivTab). Fix the pretrained parameters which are independent from D C D_C D C . For μ > 0 \mu> 0 μ > 0 , let each of the L m a i n L_{\mathrm{main}} L main DP-MHCA layers add independent noise from N ( 0 , σ 2 ) \mathcal{N}(0,\sigma^2) N ( 0 , σ 2 ) to every attention-output coordinate, where
σ = 2 H m L m a i n μ . (11) \sigma= \frac{2\sqrt{H m L_{\mathrm{main}}}}{\mu}. \tag*{(11)} σ = μ 2 H m L main . (11) Releasing the private summary S ~ \widetilde{S} S together with predictions for any number of public queries satisfies μ \mu μ -GDP with respect to D C D_C D C under replace-one adjacency.
Justification. Theorem S3.1 bounds each layer’s sensitivity of Eq. (9) by 2 H m 2\sqrt{H m} 2 H m , independently of context size. With the noise scale in Eq. (11) , each layer satisfies μ / L m a i n \mu/\sqrt{L_{\mathrm{main}}} μ / L main -GDP, and Theorem S3.2 establishes the overall μ \mu μ -GDP guarantee by adaptive composition. Predictions from the released summary preserve this guarantee by post-processing (Dwork et al., [4 ] ).
Prediction module. The prediction module combines each query with the private summaries to obtain label probabilities. At each layer, query tokens use standard multi-head cross-attention (MHCA) (Vaswani et al., [30 ] ) to attend to the corresponding saved summary state:
z 1 : n t t , ( ℓ ) = MHCA b l o c k ( ℓ ) ( z 1 : n t t , ( ℓ − 1 ) ; s ~ 1 : m ( ℓ ) ) , ℓ = 1 , … , L . (12) z^{t,(\ell)}_{1:n_t} = \operatorname{MHCA}^{(\ell)}_{\mathrm{block}}\left(z^{t,(\ell-1)}_{1:n_t}; \widetilde{s}^{(\ell)}_{1:m}\right), \qquad\ell= 1,\ldots,L. \tag*{(12)} z 1 : n t t , ( ℓ ) = MHCA block ( ℓ ) ( z 1 : n t t , ( ℓ − 1 ) ; s 1 : m ( ℓ ) ) , ℓ = 1 , … , L . (12)
Here MHCA b l o c k \operatorname{MHCA}_{\mathrm{block}} MHCA block denotes the complete query-to-summary block, including pre-normalisation, residual connections and a token-wise feed-forward network. Each query is processed independently using only its embedding and the saved summary states. After the L L L layers, a token-wise multilayer perceptron maps the final query representation z j t , ( L ) z^{t,(L)}_j z j t , ( L ) to a vector of raw class scores (logits) y ^ j ∈ R C max \hat{y}_j \in\mathbb{R}^{C_{\max}} y ^ j ∈ R C m a x , as in the appendix. For a dataset with C ≤ C max C \le C_{\max} C ≤ C m a x public classes indexed 1 , … , C 1,\ldots,C 1 , … , C , the probability assigned to class y y y is
q ψ ( y ∣ x j t , S ~ ) = exp ( y ^ j , y ) ∑ c = 1 C exp ( y ^ j , c ) . (13) q_{\psi}(y \mid x^t_j,\widetilde{S}) = \frac{\exp(\hat{y}_{j,y})}{\sum_{c=1}^{C}\exp(\hat{y}_{j,c})}. \tag*{(13)} q ψ ( y ∣ x j t , S ) = ∑ c = 1 C exp ( y ^ j , c ) exp ( y ^ j , y ) . (13)
where y ^ j , c \hat{y}_{j,c} y ^ j , c is the score for class c c c in y ^ j \hat{y}_j y ^ j , and ψ \psi ψ denotes the predictive-network parameters. The context and query paths share their row embedding weights, so these weights occur in both ϕ \phi ϕ and ψ \psi ψ . The denominator makes these probabilities sum to one; the predicted class is the one with the largest probability. Because the query-side computation depends on the context only through S ~ \widetilde{S} S , predictions for any number of public queries are post-processing of the private release.
The effect of re-ordering rows and columns. PrivTab is invariant to permutations of context rows and equivariant to permutations of target rows: reordering the context leaves predictions unchanged, while reordering targets reorders their predicted labels. This follows because the model uses no positional encodings (Vaswani et al., [30 ] ), and every operation before the DP-MHCA layers is row-wise. PrivTab, however, is neither permutation invariant nor equivariant to column ordering. This is because each row is mapped to a fixed-size vector by padding it to a certain number of columns and then feeding it into a fully connected neural network (RowEmbedding). It learns during pretraining, similar to TabPFN and TabICL, to become less sensitive to the exact ordering of the columns through the randomness of the data simulator.
Pretraining
Following prior work, the model was pretrained once on simulated tabular classification datasets (Müller et al., [34 ] ). We drew tasks from the mixed structural-causal-model simulator introduced for TabICL (Qu et al., [16 ] ). Tasks contained between 2 and 120 active features and at most 10 classes. Each simulated task τ = ( D C , D T ) \tau= (D_C, D_T) τ = ( D C , D T ) has the context and labelled target sets defined above. For each task and sampled privacy level μ \mu μ , S ~ = PrivateSummary ϕ ( z 1 : n C C ; μ ) \widetilde{S} = \operatorname{PrivateSummary}_{\phi}(z^{C}_{1:n_C};\mu) S = PrivateSummary ϕ ( z 1 : n C C ; μ ) was produced by the same noisy summary mechanism used at prediction; only X t X_t X t , not target labels, was supplied to the query-side network. More details on pretraining and ablations can be found in Supplement S4 and Supplement S6.7.
Noise-aware objective. PrivTab was trained to predict target labels from noisy private summaries, using the same summary mechanism as at prediction. Let q ψ ( y ∣ x , S ~ ) q_{\psi}(y \mid x, \widetilde{S}) q ψ ( y ∣ x , S ) denote the predicted label probabilities given target features x x x and noisy private summary S ~ \widetilde{S} S . The main training objective is the target cross-entropy
L p r i v = E τ [ − ∑ ( x , y ) ∈ D t log q ψ ( y ∣ x , S ~ ) ] . (14) \mathcal{L}_{\mathrm{priv}} = \mathbb{E}_{\tau}\left[-\sum_{(x,y)\in D_t}\log q_{\psi}(y \mid x,\widetilde{S})\right]. \tag*{(14)} L priv = E τ − ( x , y ) ∈ D t ∑ log q ψ ( y ∣ x , S ) . (14)
The expectation averages over simulated tasks and the Gaussian noise used to form each private summary. Conditional on S ~ \widetilde{S} S , the query rows are processed independently, so the joint probability is the product
q ψ ( y 1 : n t t ∣ X t , S ~ ) = ∏ j = 1 n t q ψ ( y j t ∣ x j t , S ~ ) . (15) q_{\psi}(y_{1:n_t}^{t} \mid X_t,\widetilde{S}) = \prod_{j=1}^{n_t}q_{\psi}(y_j^{t} \mid x_j^{t},\widetilde{S}). \tag*{(15)} q ψ ( y 1 : n t t ∣ X t , S ) = j = 1 ∏ n t q ψ ( y j t ∣ x j t , S ) . (15)
its negative log is the sum in Eq. (14) . We evaluated the effect of noise-aware pretraining in Table S32 . In contrast, privacy noise in DP stochastic optimisation acts through parameter updates; it is not supplied as an explicit conditioning input when the fitted model produces label probabilities. The probabilistic interpretation of Eq. (14) , including its relation to the posterior predictive conditioned on a private summary, is derived in Supplement S2; Theorem S2.1 characterises the objective for a fixed private mechanism.
Table S32. ELO rankings for the noise-aware-pretraining ablation.
Training curriculum and model combination. We pretrained two variants for small and large contexts, sampling privacy levels logarithmically and gradually introducing stronger noise. Both started with 128,000 steps using context and target sizes of 100–2,048 rows, without summary normalisation. The small-context variant continued with the same context range and no normalisation for 384,000 steps in total. The large-context variant continued with contexts of 1,024–8,192 rows and summary normalisation for 256,000 steps in total. Both used summary normalisation at inference. We used the small-context variant for contexts below 4,096 rows and the large-context variant for all others. This threshold was selected on held-out context–target pairs from the TabICL simulator used for pretraining. The same two pretrained variants were used across all real datasets and privacy levels; changing μ \mu μ changes the summary noise while their weights remain fixed.
Optimisation. We first pretrained the full model, then froze the private summary module late in pretraining and updated only the prediction module for the remaining steps. We optimised cross-entropy using AdamW Loshchilov and Hutter [35 ] , batches of 128 simulated datasets and gradient clipping.
Private baselines
We compared with DP-LR and DP-MLP, the latter with one hidden layer, both trained using DP Adam Avent et al. [36 ] ; Bu et al. [37 ] . Because the same training data are used in repeated, adaptive updates, the privacy loss must be composed over all T T T steps. Under the same substitute adjacency as PrivTab, we numerically computed the privacy profile of the Poisson-subsampled Gaussian mechanism, composed its privacy-loss distribution over T T T updates, and converted the resulting trade-off function to the smallest valid non-asymptotic μ \mu μ -GDP guarantee Gomez et al., [38 ] . The noise scale was chosen by numerically inverting this accounting for the target training budget; we did not use the asymptotic subsampled-Gaussian GDP approximation. The accountant and update rule are specified in Supplement S5.1.
Model selection stages. Baseline model selection combined broad calibration on separate datasets with private learning-rate selection for each evaluation dataset. First, we used Bayesian optimisation on eight classification datasets from prior work Hegselmann et al., [39 ] to select broad architectural and optimiser settings separately for each baseline and privacy level. Second, because a single learning rate was not reliable across all new datasets, we selected it privately for every evaluation dataset, baseline and privacy level. The context dataset was divided into training and validation subsets. Candidate models were trained privately on the training rows, evaluated with a private validation loss and compared under an explicitly composed learning rate selection budget. We set the privacy parameter for learning-rate selection to μ s e l = 0.5 μ \mu_{\mathrm{sel}} = 0.5\mu μ sel = 0.5 μ and chose the privacy parameter μ t r a i n \mu_{\mathrm{train}} μ train for the final training run such that μ s e l 2 + μ t r a i n 2 = μ 2 \mu_{\mathrm{sel}}^{2}+\mu_{\mathrm{train}}^{2}=\mu^{2} μ sel 2 + μ train 2 = μ 2 under GDP composition.
This protocol prevented the comparison from treating data-dependent model selection as free: the privacy cost of all candidate training and validation evaluations was accounted for within the fixed learning-rate selection budget. It also illustrates why DP stochastic optimisation is a pipeline rather than a single private optimiser call. Search grids, fixed hyperparameters and selected configurations are listed in Supplement S5.
TabArena evaluation
We compared predictive performance across a broad benchmark using the same datasets, splits and privacy levels for all methods. We retrieved the 33 TabArena classification datasets from the TabArena-v0.1 benchmark suite on OpenML ([20 , 24 ] ), selecting tasks with at most 100,000 rows and 120 features. This is the same number of compatible datasets from TabArena as TabPFNv2 and consistent with TabArena’s model-specific applicability constraints. The row limit kept baseline evaluation computationally tractable, while the feature limit matched the PrivTab pretraining configuration used here. Each dataset was evaluated at μ ∈ { 0.05 , 0.1 , 0.2 , 0.4 , 0.8 , 1.6 } \mu\in\{0.05, 0.1, 0.2, 0.4, 0.8, 1.6\} μ ∈ { 0.05 , 0.1 , 0.2 , 0.4 , 0.8 , 1.6 } using ten independent 80/20 splits into D c D_c D c and a held-out D t D_t D t ; only X t X_t X t was supplied to the predictor. All methods received the same numeric and categorical feature conversion. To isolate the private prediction mechanism in this broad benchmark, features were standardised using context-set statistics under a common idealised preprocessing convention. We evaluated the cost of private preprocessing separately, as described below.
Metrics and rankings. We evaluated classification with AUC and label-probability quality with log loss, and summarised model comparisons using Elo rankings. AUC was computed directly for binary tasks and macro-averaged one-versus-rest for multiclass tasks. Log loss (cross-entropy loss) penalises low probabilities assigned to true labels, especially confident incorrect predictions. Following TabArena (Erickson et al., [20 ] , maximum-likelihood Elo rankings used AUC for binary tasks and log loss for multiclass tasks. Ratings were recalibrated so that DP-LR scored 1,000 at each privacy level and in the aggregate comparison. For dataset-level breakdowns, we averaged the AUC differences between PrivTab and each specified private baseline over the ten splits.
Uncertainty intervals. We quantified performance uncertainty using 95% confidence intervals (CIs); unless stated otherwise, figures and tables report percentile-bootstrap CIs based on 10,000 replicates. The sampling unit was the dataset for benchmark aggregates and the context–target split for within-dataset evaluations. Record-wise membership-AUC intervals were instead computed using the closed-form standard-error approximation described below.
Fitting time. Runtime measures the GPU time needed to fit the context dataset. We timed each method on one Nvidia V100 using identical software environments and hardware settings, including data transfer and computation. PrivTab required one forward pass to form the private summary; DP Adam baseline timings included private learning-rate selection and training. We reported the median per-context–target-split runtime across datasets, with a percentile-bootstrap 95% CI over datasets.
Prediction time. We separately measured post-fit prediction time on a laptop with a 13th-generation Intel Core i5 CPU across 33 datasets, six privacy levels and ten context–target splits. Predictions were evaluated in batches of up to 1,024 target rows, using one warm-up call and three timed runs per configuration. Timings exclude preprocessing, model loading, fitting and private-summary construction. The complete dataset-level results appear in Figure S9 and Table S11 .
Private preprocessing in practice
We evaluated prediction together with private standardisation for Bank Marketing, COMPAS, ACS Income, Pima Diabetes and Maternal Health Risk datasets. Bank Marketing and Pima Diabetes were accessed through OpenML and originated in the UCI Machine Learning Repository; Maternal Health Risk was fetched directly from UCI ([24 , 23 ] ). COMPAS was accessed through OpenML, and ACS Income is a Folktables task derived from U.S. Census American Community Survey data ([24 , 25 ] ). There are no missing values in these datasets, so that no data imputation was needed.
Private standardisation. We standardised context and query features using private estimates of means and variances, with public clipping bounds limiting each row’s influence. For each of the d d d input features, indexed by k = 1 , … , d k = 1, \ldots, d k = 1 , … , d , we selected a finite clipping interval [ a k , b k ] [a_k, b_k] [ a k , b k ] : numeric-feature intervals came from public descriptions, and categorical variables used publicly known ranges. For context and query rows alike x i = ( x i 1 , … , x i d ) \mathbf{x}_i = (x_{i1}, \ldots, x_{id}) x i = ( x i 1 , … , x i d ) , indexed here by i i i , the clipped value was rescaled to
c i k = clip [ 0 , 1 ] ( x i k − a k b k − a k ) . (16) c_{ik} = \operatorname{clip}_{[0,1]}\left(\frac{x_{ik} - a_k}{b_k - a_k}\right). \tag*{(16)} c ik = clip [ 0 , 1 ] ( b k − a k x ik − a k ) . (16)
Here, c i = ( c i 1 , … , c i d ) \mathbf{c}_i = (c_{i1}, \ldots, c_{id}) c i = ( c i 1 , … , c i d ) denotes the rescaled and clipped row. The bounds determine the scale and cap each feature value before any private statistic is computed. From the n c n_c n c context rows only, we released noisy vectors of sums and sums of squares,
m ~ 1 = ∑ i = 1 n c c i + ξ 1 , m ~ 2 = ∑ i = 1 n c c i ⊙ 2 + ξ 2 , (17) \widetilde{\mathbf{m}}_1 = \sum_{i=1}^{n_c} \mathbf{c}_i + \boldsymbol{\xi}_1,\qquad\widetilde{\mathbf{m}}_2 = \sum_{i=1}^{n_c} \mathbf{c}_i^{\odot2} + \boldsymbol{\xi}_2, \tag*{(17)} m 1 = i = 1 ∑ n c c i + ξ 1 , m 2 = i = 1 ∑ n c c i ⊙ 2 + ξ 2 , (17)
Here the superscript ⊙ 2 \odot2 ⊙ 2 means squaring each feature value, and the independent Gaussian noise vectors ξ 1 \boldsymbol{\xi}_1 ξ 1 and ξ 2 \boldsymbol{\xi}_2 ξ 2 have standard deviations for each feature of d / μ 1 \sqrt{d}/\mu_1 d / μ 1 and d / μ 2 \sqrt{d}/\mu_2 d / μ 2 , respectively. Replacement of one row changes either sum vector by at most d \sqrt{d} d in Euclidean norm. We allocated μ 1 = μ p r e p / 2 \mu_1 = \mu_{\mathrm{prep}}/2 μ 1 = μ prep /2 and μ 2 = μ p r e p 2 − μ 1 2 \mu_2 = \sqrt{\mu_{\mathrm{prep}}^2 - \mu_1^2} μ 2 = μ prep 2 − μ 1 2 , so these two releases compose to μ p r e p \mu_{\mathrm{prep}} μ prep -GDP. Writing m ~ 1 k \widetilde{m}_{1k} m 1 k and m ~ 2 k \widetilde{m}_{2k} m 2 k for the entries of these vectors at feature k k k , the mean and variance estimates are m ~ k = m ~ 1 k / n c \widetilde{m}_k = \widetilde{m}_{1k}/n_c m k = m 1 k / n c and v ~ k = m ~ 2 k / n c − m ~ k 2 \widetilde{v}_k = \widetilde{m}_{2k}/n_c - \widetilde{m}_k^2 v k = m 2 k / n c − m k 2 . When v ~ k ≥ 10 − 6 \widetilde{v}_k \ge10^{-6} v k ≥ 1 0 − 6 and the interval is non-constant, the input z-score was
z i k = c i k − m ~ k v ~ k , (18) z_{ik} = \frac{c_{ik} - \widetilde{m}_k}{\sqrt{\widetilde{v}_k}}, \tag*{(18)} z ik = v k c ik − m k , (18)
otherwise that feature value was set to zero.
Privacy guarantees with private standardisation. When clipping bounds are public, the full pipeline’s privacy guarantee follows by composing private standardisation with PrivTab’s private summary mechanism or the baseline’s private training procedure. The private standardisation in Eq. (18) was applied for both context and query rows using the released statistics from the context rows in Eq. (17) . Query transformation is post-processing; the context then enters PrivTab’s private summary mechanism or the baseline’s private training procedure. Conditional on the released moments, standardisation remains row-wise, preserving one-row adjacency for the next private mechanism. Clipping bounds must also be chosen without unaccounted access to sensitive data. Our LLM-derived bounds used only public feature descriptions. For comparison, oracle bounds used empirical dataset minima and maxima; this workflow is not fully private because bound selection accesses sensitive data without privacy accounting.
Privacy-budget allocation for the case study. The case-study privacy budget covered both preprocessing and prediction or baseline fitting. The total privacy level was μ t o t a l = 0.4 \mu_{\mathrm{total}} = 0.4 μ total = 0.4 . We allocated μ p r e p = 0.24 \mu_{\mathrm{prep}} = 0.24 μ prep = 0.24 to the two private moment releases above and μ p r e d = 0.32 \mu_{\mathrm{pred}} = 0.32 μ pred = 0.32 to PrivTab’s private summary or to the complete baseline training and model-selection pipeline, giving
μ t o t a l = μ p r e p 2 + μ p r e d 2 = 0.4 \mu_{\mathrm{total}} = \sqrt{\mu_{\mathrm{prep}}^2 + \mu_{\mathrm{pred}}^2} = 0.4 μ total = μ prep 2 + μ pred 2 = 0.4
under GDP composition. Results were based on ten independent 80/20 context–target splits. The private moment mechanism, prompts, responses, exact clipping intervals and complete numerical results are given in Supplement S6.6.
Membership-inference audit
Attack setup. We measured membership exposure by testing whether model predictions reveal that a particular row was included in the context. We used a likelihood-ratio framework ([26 ] ) on all 1,014 Maternal Health Risk rows. We generated 4,000 balanced context draws, each containing exactly 507 rows, so that every row appeared as a member in exactly 2,000 contexts. For every draw, the model’s true-label confidence log-odds was recorded for all rows, using the same membership masks for every method.
Attack metrics. Record AUC holds the row fixed and measures the fitted Gaussian distinguishability across all contexts in which that row was or was not a member. We computed a closed-form approximation to the standard error of each record-AUC estimate [27 ] and defined its lower 95% confidence endpoint as L i = max { 0.5 , A U C ^ i − 1.96 S E i } L_i = \max\{0.5, \widehat{\mathrm{AUC}}_i - 1.96\,\mathrm{SE}_i\} L i = max { 0.5 , AUC i − 1.96 SE i } . The Gaussian reference trade-off implies the attack-AUC upper bound Φ ( μ / 2 ) \Phi(\mu/\sqrt{2}) Φ ( μ / 2 ) , where Φ \Phi Φ is the standard normal cumulative distribution function (CDF).
We also reported balanced attack accuracy to summarise how reliably membership can be inferred. We calculated balanced accuracy from fitted Gaussian member (IN) and non-member (OUT) score distributions with variances adjusted by a finite-population correction (FPC) [40 ] , rather than from observed classification counts. We used the delta method to estimate its standard error at the fitted accuracy-maximising threshold, formed a nominal 95% CI and plotted the largest lower endpoint across records for each displayed method. The calculation and its assumptions are detailed in Supplement S6.1. Complementary point-estimate summaries are reported in Table S5 . These attacks measure empirical exposure but cannot establish DP; they complement the mechanism-level guarantee and audit.
Table S5. FPC-corrected membership-inference audit on Maternal Health Risk. Aggregate AUC measures attack performance over 100 held-out context draws; record AUC measures each row’s fitted exposure across 4,000 draws. Means are reported with bootstrap 95% CIs over held-out draws or rows, respectively, and the record-level 95th percentile summarises the most exposed 5% of rows. Values near 0.5 indicate perfect privacy.
Finite-population correction. Sampling contexts without replacement from a fixed pool makes the empirical IN/OUT variance smaller than the variance under independent population draws. We used a finite-population factor f = 1 − N / N + f = 1 - N/N_{+} f = 1 − N / N + [40 ] and replaced each empirical fitted standard deviation by σ ^ F P C = σ ^ / f \hat{\sigma}_{\mathrm{FPC}} = \hat{\sigma}/\sqrt{f} σ ^ FPC = σ ^ / f , leaving the fitted means unchanged. Here N = 507 N = 507 N = 507 , N + = 1,014 N_{+} = 1{,}014 N + = 1 , 014 and f = 0.5 f = 0.5 f = 0.5 , so the standard deviations were inflated by 2 \sqrt{2} 2 . The corrected standard deviations were used both for the analytical record AUCs and for the held-out likelihood-ratio attack.
Verification and auditing
We assessed the private summary mechanism using formal verification, implementation checks and empirical auditing.
Formal verification. The Lean 4 formalisation verifies the sensitivity bound and adaptive GDP composition underlying the noise calibration of the private summary mechanism. It therefore verifies these central mathematical steps independently of the manuscript proof, while the connection between the formal objects and the running system remains subject to implementation review. The lean implementation with the complete description is available in the source code at https://github.com/TrustworthyMLHelsinki/PrivTab/tree/main/privtab-lean.
Implementation checks. Automated tests checked that the implementation applied every transformation before DP-MHCA independently to each context row, without introducing unaccounted dependencies between rows. The implementation checks are available in the source code at https://github.com/TrustworthyMLHelsinki/PrivTab/blob/main/experiments/audit_rowise.py. The test suite also runs this automatically.
Empirical auditing. We empirically tested the sensitivity bound and the distinguishability of private outputs. We used gradient-based optimisation to search for adjacent context datasets that maximised the distance between their pre-noise summaries. We then repeatedly sampled privatised outputs and applied the optimal likelihood-ratio test for each fitted Gaussian pair, using its two noise-free means and calibrated variance. Agreement with the expected trade-off curve is evidence against several implementation errors, but it is not a substitute for the proof. Further details are provided in Supplement S6.2. The empirical auditing checks are available in the source code at https://github.com/TrustworthyMLHelsinki/PrivTab/blob/main/experiments/dp_audit.py. The test suite also runs this automatically.
Code availability
The source code used to implement, train, and evaluate PrivTab, together with the pretrained model weights, is available at https://github.com/TrustworthyMLHelsinki/PrivTab. The repository contains complete documentation of the code, including instructions for reproducing the experiments.
Acknowledgements
This work was supported by the Research Council of Finland (Finnish Center for Artificial Intelligence, FCAI, Grant 356499 and Grant 359111), the Strategic Research Council at the Research Council of Finland (Grant 358247) as well as the European Union (Project 101070617). Richard E. Turner is supported by the EPSRC Probabilistic AI Hub (EP/Y028783/1). Cristiana Diaconu is supported by the Cambridge Trust Scholarship. Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Commission. Neither the European Union nor the granting authority can be held responsible for them. This work has been performed using resources provided by the CSC– IT Center for Science, Finland (Projects 2003275 & 462001244). We also acknowledge CSC for access to the LUMI supercomputer, owned by the EuroHPC Joint Undertaking, hosted by CSC (Finland) and the LUMI consortium. The authors acknowledge the research environment provided by ELLIS Institute Finland. We thank Aki Rehn for his assistance in debugging the GPU-based pretraining of PrivTab. We also thank Joonas Jälkö, Mikko A. Heikkilä and Marlon Tobaben for their discussions and comments throughout the project.
Correspondence: Antti Honkela (antti.honkela@helsinki.fi).
Detailed Background
Notation
Let d X ∈ N d_{\mathcal{X}} \in\mathbb{N} d X ∈ N denote the maximum input dimension, let X : = ⋃ d = 1 d X R d \mathcal{X} := \bigcup_{d=1}^{d_{\mathcal{X}}} \mathbb{R}^{d} X := ⋃ d = 1 d X R d denote the raw input space, and let Y ⊂ N \mathcal{Y} \subset\mathbb{N} Y ⊂ N denote the label space. An input-label pair is a tuple ( x , y ) ∈ X × Y (\mathbf{x}, y) \in\mathcal{X} \times\mathcal{Y} ( x , y ) ∈ X × Y . Let D \mathbb{D} D denote the space of all finite multisets of input-label pairs in X × Y \mathcal{X} \times\mathcal{Y} X × Y , that is,
D = ⋃ n = 0 ∞ ( ( X × Y ) n / ∼ ) , (19) \mathbb{D} = \bigcup_{n=0}^{\infty} ((\mathcal{X} \times\mathcal{Y})^{n}/\sim), \tag*{(19)} D = n = 0 ⋃ ∞ (( X × Y ) n / ∼ ) , (19)
where two elements of ( X × Y ) n (\mathcal{X} \times\mathcal{Y})^{n} ( X × Y ) n are equivalent under ∼ \sim ∼ if one is a permutation of the other. A dataset D ∈ D \mathcal{D} \in\mathbb{D} D ∈ D is a finite collection of input-label pairs, i.e. D = { ( x i , y i ) } i = 1 N \mathcal{D} = \{(\mathbf{x}_i, y_i)\}_{i=1}^{N} D = {( x i , y i ) } i = 1 N for some N ≥ 0 N \ge0 N ≥ 0 . For n ≥ 1 n \ge1 n ≥ 1 , we will write a sequence z 1 , … , z n z_1, \ldots, z_n z 1 , … , z n briefly as z 1 : n z_{1:n} z 1 : n . Whenever indexed notation is used for a multiset, it denotes an arbitrary ordered representative; all dataset-level constructions considered below are invariant to the choice of representative.
Differential Privacy
DP formalises the idea of protecting individuals’ sensitive data when releasing statistics or training machine learning models. It is achieved by limiting how much the algorithm’s output distribution can change when one individual’s data is added, removed, or modified.
Definition S1.1 (Approximate DP; [4 , 41 ] ). A randomised algorithm or mechanism A \mathcal{A} A is ( ε , δ , ≃ ) (\varepsilon, \delta, \simeq) ( ε , δ , ≃ ) -DP under a binary relation ≃ \simeq ≃ over D \mathbb{D} D , if for any two datasets D , D ′ ∈ D \mathcal{D}, \mathcal{D}' \in\mathbb{D} D , D ′ ∈ D such that D ≃ D ′ \mathcal{D} \simeq\mathcal{D}' D ≃ D ′ , and for any subset S \mathcal{S} S of possible outcomes of A \mathcal{A} A , denoted S ⊆ Range ( A ) \mathcal{S} \subseteq\operatorname{Range}(\mathcal{A}) S ⊆ Range ( A ) ,
Pr [ A ( D ) ∈ S ] ≤ exp ( ε ) × Pr [ A ( D ′ ) ∈ S ] + δ . (20) \Pr[\mathcal{A}(\mathcal{D}) \in\mathcal{S}] \leq\exp(\varepsilon) \times\Pr[\mathcal{A}(\mathcal{D}') \in\mathcal{S}] + \delta. \tag*{(20)} Pr [ A ( D ) ∈ S ] ≤ exp ( ε ) × Pr [ A ( D ′ ) ∈ S ] + δ . (20) Any two datasets D ≃ D ′ \mathcal{D} \simeq\mathcal{D}' D ≃ D ′ are said to be adjacent datasets and ≃ \simeq ≃ is called the adjacency relation.
Applying any (randomised) function to the output of a DP mechanism is called post-processing , and it does not weaken the privacy guarantees of the mechanism. In this work, we use the substitute adjacency relation, that is, D ≃ D ′ \mathcal{D} \simeq\mathcal{D}' D ≃ D ′ if for some i ∗ i^{*} i ∗ , D ′ = ( D ∖ { ( x i ∗ , y i ∗ ) } ) ∪ { ( x i ∗ ′ , y i ∗ ′ ) } \mathcal{D}' = (\mathcal{D} \setminus\{(\mathbf{x}_{i^{*}}, y_{i^{*}})\}) \cup\{(\mathbf{x}_{i^{*}}', y_{i^{*}}')\} D ′ = ( D ∖ {( x i ∗ , y i ∗ )}) ∪ {( x i ∗ ′ , y i ∗ ′ )} .
Gaussian Differential Privacy
GDP provides a more interpretable characterisation of privacy in terms of hypothesis testing. For a random output O O O of the mechanism A \mathcal{A} A , consider the binary hypothesis test: H 0 : O ∼ A ( D ) H_0 : O \sim\mathcal{A}(\mathcal{D}) H 0 : O ∼ A ( D ) vs. H 1 : O ∼ A ( D ′ ) H_1 : O \sim\mathcal{A}(\mathcal{D}') H 1 : O ∼ A ( D ′ ) . A test is a function
ϕ : Range ( A ) → [ 0 , 1 ] , (21) \phi: \operatorname{Range}(\mathcal{A}) \to[0, 1], \tag*{(21)} ϕ : Range ( A ) → [ 0 , 1 ] , (21)
where for an observation o o o , ϕ ( o ) = 1 \phi(o) = 1 ϕ ( o ) = 1 means rejecting the null hypothesis, and ϕ ( o ) = 0 \phi(o) = 0 ϕ ( o ) = 0 means not rejecting it. The type I error is denoted α A ( ϕ ; D ) = E O ∼ A ( D ) [ ϕ ( O ) ] \alpha_{\mathcal{A}}(\phi; \mathcal{D}) = \mathbb{E}_{O \sim\mathcal{A}(\mathcal{D})}[\phi(O)] α A ( ϕ ; D ) = E O ∼ A ( D ) [ ϕ ( O )] and the type II error is denoted β A ( ϕ ; D ′ ) = 1 − E O ∼ A ( D ′ ) [ ϕ ( O ) ] \beta_{\mathcal{A}}(\phi; \mathcal{D}') = 1 - \mathbb{E}_{O \sim\mathcal{A}(\mathcal{D}')}[\phi(O)] β A ( ϕ ; D ′ ) = 1 − E O ∼ A ( D ′ ) [ ϕ ( O )] . The trade-off function of A \mathcal{A} A is defined as:
T A ( α ; D , D ′ ) = inf ϕ : α A ( ϕ ; D ) ≤ α β A ( ϕ ; D ′ ) . (22) T_{\mathcal{A}}(\alpha; \mathcal{D}, \mathcal{D}') = \inf_{\phi: \alpha_{\mathcal{A}}(\phi;\mathcal{D}) \leq\alpha} \beta_{\mathcal{A}}(\phi; \mathcal{D}'). \tag*{(22)} T A ( α ; D , D ′ ) = ϕ : α A ( ϕ ; D ) ≤ α inf β A ( ϕ ; D ′ ) . (22)
Definition S1.2 (μ \mu μ -GDP; [5 ] ). A randomised mechanism A \mathcal{A} A satisfies μ \mu μ -GDP if for any two adjacent datasets D ≃ D ′ \mathcal{D} \simeq\mathcal{D}' D ≃ D ′ , and for all α ∈ [ 0 , 1 ] \alpha\in[0, 1] α ∈ [ 0 , 1 ] ,
T A ( α ; D , D ′ ) ≥ Φ ( Φ − 1 ( 1 − α ) − μ ) = : T μ ( α ) , (23) T_{\mathcal{A}}(\alpha; \mathcal{D}, \mathcal{D}') \geq\Phi\left(\Phi^{-1}(1-\alpha) - \mu\right) =: T_{\mu}(\alpha), \tag*{(23)} T A ( α ; D , D ′ ) ≥ Φ ( Φ − 1 ( 1 − α ) − μ ) =: T μ ( α ) , (23) where Φ \Phi Φ denotes the standard normal CDF.
The function T μ ( α ) T_{\mu}(\alpha) T μ ( α ) is the trade-off function of the hypothesis test H 0 : O ∼ N ( 0 , 1 ) H_0 : O \sim\mathcal{N}(0,1) H 0 : O ∼ N ( 0 , 1 ) vs. H 1 : O ∼ N ( μ , 1 ) H_1 : O \sim\mathcal{N}(\mu,1) H 1 : O ∼ N ( μ , 1 ) . In this work, we will use μ \mu μ -GDP to report privacy guarantees. A μ \mu μ -GDP mechanism satisfies ( ε , δ ( ε ) ) (\varepsilon, \delta(\varepsilon)) ( ε , δ ( ε )) -DP for all ε > 0 \varepsilon> 0 ε > 0 ([5 ] ), where
δ ( ε ) = Φ ( − ε μ + μ 2 ) − exp ( ε ) Φ ( − ε μ − μ 2 ) . (24) \delta(\varepsilon) = \Phi\left(-\frac{\varepsilon}{\mu} + \frac{\mu}{2}\right) - \exp(\varepsilon)\Phi\left(-\frac{\varepsilon}{\mu} - \frac{\mu}{2}\right). \tag*{(24)} δ ( ε ) = Φ ( − μ ε + 2 μ ) − exp ( ε ) Φ ( − μ ε − 2 μ ) . (24)
Applying a DP mechanism multiple times, or applying multiple DP mechanisms to the same dataset, is called composition. If later mechanism applications use outputs of earlier ones in addition to the dataset, the composition is said to be adaptive . GDP admits a tight (adaptive) composition rule determined by the privacy guarantees of individual mechanisms.
Theorem S1.3 [5 ] . The (adaptive) composition of μ i \mu_i μ i -GDP mechanisms (i = 1 , … , T i = 1, \ldots, T i = 1 , … , T ) is μ \mu μ -GDP, where
μ = μ 1 2 + … + μ T 2 . (25) \mu= \sqrt{\mu_1^2 + \ldots+ \mu_T^2}. \tag*{(25)} μ = μ 1 2 + … + μ T 2 . (25)
Here, tight means that this composition rule is exact for μ \mu μ -GDP: in general one cannot replace μ 1 2 + … + μ T 2 \sqrt{\mu_1^2 + \ldots+ \mu_T^2} μ 1 2 + … + μ T 2 by a uniformly smaller value and still retain a valid guarantee for all adaptive compositions of μ i \mu_i μ i -GDP mechanisms. The Gaussian mechanism is central to this work. Given a function f : D → R d f : \mathcal{D} \to\mathbb{R}^d f : D → R d , define
A g a u s s ( D ) : = f ( D ) + N ( 0 , σ 2 I d ) , (26) \mathcal{A}_{\mathrm{gauss}}(\mathcal{D}) := f(\mathcal{D}) + \mathcal{N}(0, \sigma^2 I_d), \tag*{(26)} A gauss ( D ) := f ( D ) + N ( 0 , σ 2 I d ) , (26)
where I d I_d I d is the d × d d \times d d × d identity matrix. The privacy guarantee of A g a u s s \mathcal{A}_{\mathrm{gauss}} A gauss is determined by σ \sigma σ and the ℓ 2 \ell_2 ℓ 2 -sensitivity of f f f ,
Δ ( f ) = sup D ≃ D ′ ∥ f ( D ) − f ( D ′ ) ∥ 2 , (27) \Delta(f) = \sup_{\mathcal{D} \simeq\mathcal{D}'} \lVert f(\mathcal{D}) - f(\mathcal{D}') \rVert_2, \tag*{(27)} Δ ( f ) = D ≃ D ′ sup ∥ f ( D ) − f ( D ′ ) ∥ 2 , (27)
according to the following theorem.
Theorem S1.4 [5 ] . The Gaussian mechanism A g a u s s \mathcal{A}_{\mathrm{gauss}} A gauss is μ \mu μ -GDP with μ = Δ ( f ) σ \mu= \frac{\Delta(f)}{\sigma} μ = σ Δ ( f ) .
Bayesian Inference
Assume that a dataset D = { ( x i o b s , y i o b s ) } i = 1 N ∈ D \mathcal{D} = \{(x_i^{\mathrm{obs}}, y_i^{\mathrm{obs}})\}_{i=1}^N \in\mathbb{D} D = {( x i obs , y i obs ) } i = 1 N ∈ D consists of observed input-output pairs. We treat the inputs x 1 : N o b s x_{1:N}^{\mathrm{obs}} x 1 : N obs as given, and assume that the labels are generated from an underlying conditional data-generating distribution p ( y ∣ x , θ ) p(y \mid x, \boldsymbol{\theta}) p ( y ∣ x , θ ) , depending on some parameter θ ∈ Θ \boldsymbol{\theta} \in\Theta θ ∈ Θ . The likelihood of the observed labels, conditioned on the observed inputs, is
p ( y 1 : N o b s ∣ x 1 : N o b s , θ ) = ∏ i = 1 N p ( y i o b s ∣ x i o b s , θ ) . (28) p(y_{1:N}^{\mathrm{obs}} \mid x_{1:N}^{\mathrm{obs}}, \boldsymbol{\theta}) = \prod_{i=1}^{N} p(y_i^{\mathrm{obs}} \mid x_i^{\mathrm{obs}}, \boldsymbol{\theta}). \tag*{(28)} p ( y 1 : N obs ∣ x 1 : N obs , θ ) = i = 1 ∏ N p ( y i obs ∣ x i obs , θ ) . (28)
Given a prior p ( θ ) p(\boldsymbol{\theta}) p ( θ ) , one can compute the posterior using Bayes’ theorem:
p ( θ ∣ D ) = p ( y 1 : N o b s ∣ x 1 : N o b s , θ ) p ( θ ) ∫ Θ p ( y 1 : N o b s ∣ x 1 : N o b s , θ ′ ) p ( θ ′ ) d θ ′ . (29) p(\boldsymbol{\theta} \mid\mathcal{D}) = \frac{p(y_{1:N}^{\mathrm{obs}} \mid x_{1:N}^{\mathrm{obs}}, \boldsymbol{\theta})p(\boldsymbol{\theta})}{\int_{\Theta} p(y_{1:N}^{\mathrm{obs}} \mid x_{1:N}^{\mathrm{obs}}, \boldsymbol{\theta}')p(\boldsymbol{\theta}')\,\mathrm{d}\boldsymbol{\theta}'}. \tag*{(29)} p ( θ ∣ D ) = ∫ Θ p ( y 1 : N obs ∣ x 1 : N obs , θ ′ ) p ( θ ′ ) d θ ′ p ( y 1 : N obs ∣ x 1 : N obs , θ ) p ( θ ) . (29)
The posterior predictive can then be obtained by marginalising over the posterior:
p ( y ∣ x , D ) = ∫ Θ p ( y ∣ x , θ ) p ( θ ∣ D ) d θ . (30) p(y \mid x, \mathcal{D}) = \int_{\Theta} p(y \mid x, \boldsymbol{\theta})p(\boldsymbol{\theta} \mid\mathcal{D})\,\mathrm{d}\boldsymbol{\theta}. \tag*{(30)} p ( y ∣ x , D ) = ∫ Θ p ( y ∣ x , θ ) p ( θ ∣ D ) d θ . (30)
The posterior predictive in Eq. (30) can be extended to multiple query points. Assuming that the labels are conditionally independent given x 1 : n x_{1:n} x 1 : n and θ \boldsymbol{\theta} θ , for n ≥ 1 n \geq1 n ≥ 1 we have
p ( y 1 : n ∣ x 1 : n , D ) = ∫ Θ p ( y 1 : n ∣ x 1 : n , θ ) p ( θ ∣ D ) d θ = ∫ Θ ∏ i = 1 n p ( y i ∣ x i , θ ) p ( θ ∣ D ) d θ . (31) \begin{aligned}
p(y_{1:n} \mid x_{1:n}, \mathcal{D}) &= \int_{\Theta} p(y_{1:n} \mid x_{1:n}, \boldsymbol{\theta})p(\boldsymbol{\theta} \mid\mathcal{D})\,\mathrm{d}\boldsymbol{\theta} \\
&= \int_{\Theta} \prod_{i=1}^{n} p(y_i \mid x_i, \boldsymbol{\theta})p(\boldsymbol{\theta} \mid\mathcal{D})\,\mathrm{d}\boldsymbol{\theta}. \tag*{(31)}
\end{aligned} p ( y 1 : n ∣ x 1 : n , D ) = ∫ Θ p ( y 1 : n ∣ x 1 : n , θ ) p ( θ ∣ D ) d θ = ∫ Θ i = 1 ∏ n p ( y i ∣ x i , θ ) p ( θ ∣ D ) d θ . (31)
Stochastic Processes
A stochastic process (SP) is a collection of random variables
F = { Y x } x ∈ X , (32) F = \{Y_x\}_{x \in\mathcal{X}}, \tag*{(32)} F = { Y x } x ∈ X , (32)
indexed by an input space X \mathcal{X} X , where each Y x Y_x Y x takes values in an output space Y \mathcal{Y} Y . We also write F ( x ) F(x) F ( x ) for the random variable Y x Y_x Y x . Thus, for any x ∈ X x \in\mathcal{X} x ∈ X , the stochastic process defines a distribution over outputs in Y \mathcal{Y} Y . If this distribution admits a density, we denote by p ( y ∣ x ) p(y \mid x) p ( y ∣ x ) the density of F ( x ) F(x) F ( x ) evaluated at y ∈ Y y \in\mathcal{Y} y ∈ Y .
We denote by S P ( X , Y ) \mathcal{SP}(\mathcal{X},\mathcal{Y}) S P ( X , Y ) the set of stochastic processes indexed by X \mathcal{X} X and taking values in Y \mathcal{Y} Y . A stochastic process F ∈ S P ( X , Y ) F \in\mathcal{SP}(\mathcal{X},\mathcal{Y}) F ∈ S P ( X , Y ) can be characterised by its finite-dimensional marginal distributions p ( y 1 : n ∣ x 1 : n ) p(y_{1:n} \mid x_{1:n}) p ( y 1 : n ∣ x 1 : n ) , for all n ≥ 1 n \ge1 n ≥ 1 , provided that these marginals satisfy the conditions of the Kolmogorov consistency theorem (Øksendal, 2010). That is, the finite-dimensional marginals must satisfy permutation invariance and marginalisation consistency.
Amortised Bayesian Prediction
Let F = { Y x } x ∈ X ∈ S P ( X , Y ) F = \{Y_x\}_{x \in\mathcal{X}} \in\mathcal{SP}(\mathcal{X},\mathcal{Y}) F = { Y x } x ∈ X ∈ S P ( X , Y ) be a stochastic process. Assume that its finite-dimensional marginal distributions are parameterised by some parameter θ ∈ Θ \theta\in\Theta θ ∈ Θ , so that for any n ≥ 1 n \ge1 n ≥ 1 ,
Y x 1 , … , Y x n ∼ p ( y 1 : n ∣ x 1 : n , θ ) . (33) Y_{x_1}, \ldots, Y_{x_n} \sim p(y_{1:n} \mid x_{1:n}, \theta). \tag*{(33)} Y x 1 , … , Y x n ∼ p ( y 1 : n ∣ x 1 : n , θ ) . (33)
A dataset D = { ( x i o b s , y i o b s ) } i = 1 N \mathcal{D} = \{(x_i^{\mathrm{obs}}, y_i^{\mathrm{obs}})\}_{i=1}^{N} D = {( x i obs , y i obs ) } i = 1 N can be viewed as observations of the stochastic process at input locations x 1 o b s , … , x N o b s x_1^{\mathrm{obs}}, \ldots, x_N^{\mathrm{obs}} x 1 obs , … , x N obs . Conditioned on these input locations and on θ \theta θ , the corresponding outputs are sampled as
y 1 : N o b s ∼ p ( y 1 : N ∣ x 1 : N o b s , θ ) , (34) y_{1:N}^{\mathrm{obs}} \sim p(y_{1:N} \mid x_{1:N}^{\mathrm{obs}}, \theta), \tag*{(34)} y 1 : N obs ∼ p ( y 1 : N ∣ x 1 : N obs , θ ) , (34)
where this distribution is the finite-dimensional marginal distribution of Y x 1 o b s , … , Y x N o b s Y_{x_1^{\mathrm{obs}}}, \ldots, Y_{x_N^{\mathrm{obs}}} Y x 1 obs , … , Y x N obs .
Given a prior p ( θ ) p(\theta) p ( θ ) , Bayes’ theorem gives the posterior p ( θ ∣ D ) p(\theta\mid\mathcal{D}) p ( θ ∣ D ) . The posterior predictive distribution for any n ≥ 1 n \ge1 n ≥ 1 is then
p ( y 1 : n ∣ x 1 : n , D ) = ∫ Θ p ( y 1 : n ∣ x 1 : n , θ ) p ( θ ∣ D ) d θ . (35) p(y_{1:n} \mid x_{1:n}, \mathcal{D}) = \int_{\Theta} p(y_{1:n} \mid x_{1:n}, \theta)p(\theta\mid\mathcal{D}) \,\mathrm{d}\theta. \tag*{(35)} p ( y 1 : n ∣ x 1 : n , D ) = ∫ Θ p ( y 1 : n ∣ x 1 : n , θ ) p ( θ ∣ D ) d θ . (35)
The collection of posterior predictive distributions { p ( y 1 : n ∣ x 1 : n , D ) } n ≥ 1 \{p(y_{1:n} \mid x_{1:n}, \mathcal{D})\}_{n \ge1} { p ( y 1 : n ∣ x 1 : n , D ) } n ≥ 1 defines a posterior stochastic process, denoted by F D ∈ S P ( X , Y ) F_{\mathcal{D}} \in\mathcal{SP}(\mathcal{X},\mathcal{Y}) F D ∈ S P ( X , Y ) .
More generally, one can view prediction under uncertainty as learning an amortised approximation to the Bayesian map that sends an observed dataset to its posterior predictive law. Given a dataset D \mathcal{D} D , the ideal Bayesian map
π F : D → S P ( X , Y ) (36) \pi_F : \mathbb{D} \to\mathcal{SP}(\mathcal{X},\mathcal{Y}) \tag*{(36)} π F : D → S P ( X , Y ) (36)
returns the posterior stochastic process F D F_{\mathcal{D}} F D , whose finite-dimensional marginals are the posterior predictive distributions. Amortised Bayesian prediction aims to learn a parametric map that directly approximates this posterior predictive object from observed context data, without performing Bayesian inference from scratch for each new task. Concretely, given a context dataset D c \mathcal{D}_c D c , one learns a predictor of the form
q w ( y 1 : n ∣ x 1 : n , D c ) , n ≥ 1 , (37) q_{\mathbf{w}}(y_{1:n} \mid x_{1:n}, \mathcal{D}_c), \quad n \ge1, \tag*{(37)} q w ( y 1 : n ∣ x 1 : n , D c ) , n ≥ 1 , (37)
which approximates the corresponding finite-dimensional posterior predictive distributions. This viewpoint is broad and includes neural processes and their attention-based variants as special cases, as well as other transformer-based amortised predictors.
We denote by τ = ( D c , D t ) \tau= (\mathcal{D}_c,\mathcal{D}_t) τ = ( D c , D t ) a task, consisting of a context set D c \mathcal{D}_c D c and a target set
D t = { ( x j t , y j t ) } j = 1 n t . (38) \mathcal{D}_t = \{(x_j^t,y_j^t)\}_{j=1}^{n_t}. \tag*{(38)} D t = {( x j t , y j t ) } j = 1 n t . (38)
For a task τ = ( D c , D t ) \tau= (\mathcal{D}_c,\mathcal{D}_t) τ = ( D c , D t ) with D t = ( x 1 : n t t , y 1 : n t t ) \mathcal{D}_t = (x_{1:n_t}^t,y_{1:n_t}^t) D t = ( x 1 : n t t , y 1 : n t t ) , we write x 1 : n t t ( τ ) : = x 1 : n t t x_{1:n_t}^t(\tau) := x_{1:n_t}^t x 1 : n t t ( τ ) := x 1 : n t t and y 1 : n t t ( τ ) : = y 1 : n t t y_{1:n_t}^t(\tau) := y_{1:n_t}^t y 1 : n t t ( τ ) := y 1 : n t t . Let T ⊆ D × D \mathcal{T} \subseteq\mathbb{D} \times\mathbb{D} T ⊆ D × D denote the space of such tasks. Tasks are sampled from a task distribution p ( τ ) p(\tau) p ( τ ) . This task distribution can be understood as the marginal distribution induced by first sampling a latent parameter θ \theta θ and then sampling context and target observations from the corresponding stochastic process:
p ( τ ) = ∫ Θ p ( τ ∣ θ ) p ( θ ) d θ . (39) p(\tau) = \int_{\Theta} p(\tau\mid\theta)p(\theta) \,\mathrm{d}\theta. \tag*{(39)} p ( τ ) = ∫ Θ p ( τ ∣ θ ) p ( θ ) d θ . (39)
More explicitly, writing τ = ( D c , D t ) \tau= (\mathcal{D}_c,\mathcal{D}_t) τ = ( D c , D t ) with D c = ( x 1 : n c c , y 1 : n c c ) \mathcal{D}_c = (x_{1:n_c}^c,y_{1:n_c}^c) D c = ( x 1 : n c c , y 1 : n c c ) and D t = ( x 1 : n t t , y 1 : n t t ) \mathcal{D}_t = (x_{1:n_t}^t,y_{1:n_t}^t) D t = ( x 1 : n t t , y 1 : n t t ) , we have
p ( τ ∣ θ ) = p ( y 1 : n c c , y 1 : n t t ∣ x 1 : n c c , x 1 : n t t , θ ) p ( x 1 : n c c , x 1 : n t t ∣ θ ) . (40) p(\tau\mid\theta) = p(y_{1:n_c}^c,y_{1:n_t}^t \mid x_{1:n_c}^c,x_{1:n_t}^t,\theta)\,p(x_{1:n_c}^c,x_{1:n_t}^t \mid\theta). \tag*{(40)} p ( τ ∣ θ ) = p ( y 1 : n c c , y 1 : n t t ∣ x 1 : n c c , x 1 : n t t , θ ) p ( x 1 : n c c , x 1 : n t t ∣ θ ) . (40)
Under the usual conditional independence assumption given θ \theta θ , this becomes
p ( τ ∣ θ ) = [ ∏ i = 1 n c p ( y i c ∣ x i c , θ ) ] [ ∏ j = 1 n t p ( y j t ∣ x j t , θ ) ] p ( x 1 : n c c , x 1 : n t t ∣ θ ) . (41) p(\tau\mid\theta) =
\left[\prod_{i=1}^{n_c} p(y_i^c \mid x_i^c,\theta)\right]
\left[\prod_{j=1}^{n_t} p(y_j^t \mid x_j^t,\theta)\right]
p(x_{1:n_c}^c,x_{1:n_t}^t \mid\theta). \tag*{(41)} p ( τ ∣ θ ) = [ i = 1 ∏ n c p ( y i c ∣ x i c , θ ) ] [ j = 1 ∏ n t p ( y j t ∣ x j t , θ ) ] p ( x 1 : n c c , x 1 : n t t ∣ θ ) . (41)
The task τ \tau τ itself contains only the observed context and target sets; the latent parameter θ \theta θ is not observed by the amortised predictor.
Let q ψ ( y 1 : n t t ∣ x 1 : n t t , D c ) q_{\psi}(y_{1:n_t}^{t} \mid x_{1:n_t}^{t}, \mathcal{D}_c) q ψ ( y 1 : n t t ∣ x 1 : n t t , D c ) denote the amortised predictive family. The amortised predictor is trained by minimising the expected negative log-likelihood of the target outputs conditioned on the target inputs and the context set:
L N L L ( ψ ) = E τ ∼ p ( τ ) [ − log q ψ ( y 1 : n t t ∣ x 1 : n t t , D c ) ] . (42) \mathcal{L}_{\mathrm{NLL}}(\psi)=\mathbb{E}_{\tau\sim p(\tau)}\left[-\log q_{\psi}\left(y_{1:n_t}^{t}\mid x_{1:n_t}^{t},\mathcal{D}_c\right)\right]. \tag*{(42)} L NLL ( ψ ) = E τ ∼ p ( τ ) [ − log q ψ ( y 1 : n t t ∣ x 1 : n t t , D c ) ] . (42)
If the target labels are conditionally independent under the model, this objective becomes
L N L L ( ψ ) = E τ ∼ p ( τ ) [ − ∑ j = 1 n t log q ψ ( y j t ∣ x j t , D c ) ] . (43) \mathcal{L}_{\mathrm{NLL}}(\psi)=\mathbb{E}_{\tau\sim p(\tau)}\left[-\sum_{j=1}^{n_t}\log q_{\psi}\left(y_j^t\mid x_j^t,\mathcal{D}_c\right)\right]. \tag*{(43)} L NLL ( ψ ) = E τ ∼ p ( τ ) [ − j = 1 ∑ n t log q ψ ( y j t ∣ x j t , D c ) ] . (43)
In practice, the expectation over tasks is approximated using finitely many sampled tasks
{ ( D c ( i ) , D t ( i ) ) } i = 1 N t a s k s , \left\{\left(\mathcal{D}_c^{(i)},\mathcal{D}_t^{(i)}\right)\right\}_{i=1}^{N_{\mathrm{tasks}}}, { ( D c ( i ) , D t ( i ) ) } i = 1 N tasks ,
where
D t ( i ) = { ( x j t , ( i ) , y j t , ( i ) ) } j = 1 n t . (44) \mathcal{D}_t^{(i)}=\left\{\left(x_j^{t,(i)},y_j^{t,(i)}\right)\right\}_{j=1}^{n_t}. \tag*{(44)} D t ( i ) = { ( x j t , ( i ) , y j t , ( i ) ) } j = 1 n t . (44)
This gives the empirical objective
L ^ N L L ( ψ ) = − 1 N t a s k s ∑ i = 1 N t a s k s log q ψ ( y 1 : n t t , ( i ) ∣ x 1 : n t t , ( i ) , D c ( i ) ) . (45) \widehat{\mathcal{L}}_{\mathrm{NLL}}(\psi)=-\frac{1}{N_{\mathrm{tasks}}}\sum_{i=1}^{N_{\mathrm{tasks}}}\log q_{\psi}\left(y_{1:n_t}^{t,(i)}\mid x_{1:n_t}^{t,(i)},\mathcal{D}_c^{(i)}\right). \tag*{(45)} L NLL ( ψ ) = − N tasks 1 i = 1 ∑ N tasks log q ψ ( y 1 : n t t , ( i ) ∣ x 1 : n t t , ( i ) , D c ( i ) ) . (45)
Under the conditional independence factorisation, this becomes
L ^ N L L ( ψ ) = − 1 N t a s k s ∑ i = 1 N t a s k s ∑ j = 1 n t log q ψ ( y j t , ( i ) ∣ x j t , ( i ) , D c ( i ) ) . (46) \widehat{\mathcal{L}}_{\mathrm{NLL}}(\psi)=-\frac{1}{N_{\mathrm{tasks}}}\sum_{i=1}^{N_{\mathrm{tasks}}}\sum_{j=1}^{n_t}\log q_{\psi}\left(y_j^{t,(i)}\mid x_j^{t,(i)},\mathcal{D}_c^{(i)}\right). \tag*{(46)} L NLL ( ψ ) = − N tasks 1 i = 1 ∑ N tasks j = 1 ∑ n t log q ψ ( y j t , ( i ) ∣ x j t , ( i ) , D c ( i ) ) . (46)
Neural Processes and Conditional Neural Processes
Neural processes (Garnelo et al. [28 ] ) are a particular family of amortised predictors. In this work, we focus on the conditional neural process (CNP) formulation (Garnelo et al. [29 ] ). A CNP directly parameterises the finite-dimensional predictive distributions conditioned on a context dataset
D c = { ( x i c , y i c ) } i = 1 n c . (47) \mathcal{D}_c=\left\{\left(x_i^c,y_i^c\right)\right\}_{i=1}^{n_c}. \tag*{(47)} D c = { ( x i c , y i c ) } i = 1 n c . (47)
Given such a dataset, a neural network with learnable weights w ∈ W w\in\mathcal{W} w ∈ W defines
q W ( y 1 : n ∣ x 1 : n , D c ) , n ≥ 1 , (48) q_{\mathcal{W}}(y_{1:n}\mid x_{1:n},\mathcal{D}_c),\qquad n\ge1, \tag*{(48)} q W ( y 1 : n ∣ x 1 : n , D c ) , n ≥ 1 , (48)
as an approximation to the finite-dimensional marginals of F D c = π F ( D c ) F_{\mathcal{D}_c}=\pi_F(\mathcal{D}_c) F D c = π F ( D c ) . In practice, neural processes are implemented using an encoder-decoder architecture. Each context pair ( x i c , y i c ) (x_i^c,y_i^c) ( x i c , y i c ) is first mapped to a representation r i r_i r i by an encoder network. These context representations are then aggregated into a global summary r r r using a permutation-invariant operation such as averaging or summation. A decoder network finally combines this summary with a target input x x x to parameterise the predictive distribution q W ( y ∣ x , D c ) q_{\mathcal{W}}(y\mid x,\mathcal{D}_c) q W ( y ∣ x , D c ) . In a CNP, this aggregation step is the main architectural mechanism by which information from the context set is shared across target predictions.
Latent neural processes may instead introduce a task variable to represent uncertainty over the underlying task. PrivTab follows the deterministic conditional formulation; its attention-based latent bottleneck and connection to prior-fitted prediction are described next.
While CNPs provide an amortised approximation to posterior prediction, their predictive performance can be limited by the use of simple permutation-invariant aggregation schemes for the context set. Such aggregators compress the context into a fixed-size representation, but may discard information about interactions among context points and about the relevance of different context rows to a given target query. Transformer neural processes address this limitation by replacing hand-crafted aggregation with attention-based set processing.
Transformers and Attention. At a high level, a transformer is a neural architecture built from attention layers and token-wise feed-forward layers [30 ] . Given a collection of token representations, an attention layer updates each token by combining information from other tokens using data-dependent weights. This allows the representation of each token to depend adaptively on the rest of the set.
For a query token representation q ∈ R d \mathbf{q} \in\mathbb{R}^{d} q ∈ R d , a collection of key representations k 1 , … , k n ∈ R d \mathbf{k}_1,\ldots,\mathbf{k}_n \in\mathbb{R}^{d} k 1 , … , k n ∈ R d , and corresponding value representations v 1 , … , v n ∈ R d v \mathbf{v}_1,\ldots,\mathbf{v}_n \in\mathbb{R}^{d_v} v 1 , … , v n ∈ R d v , attention produces an output of the form
Attn ( q , k 1 : n , v 1 : n ) = ∑ i = 1 n a i ( q , k 1 : n ) v i . (49) \operatorname{Attn}(\mathbf{q},\mathbf{k}_{1:n},\mathbf{v}_{1:n}) = \sum_{i=1}^{n} a_i(\mathbf{q},\mathbf{k}_{1:n})\mathbf{v}_i. \tag*{(49)} Attn ( q , k 1 : n , v 1 : n ) = i = 1 ∑ n a i ( q , k 1 : n ) v i . (49)
In the transformer architecture, the coefficients a 1 , … , a n a_1,\ldots,a_n a 1 , … , a n are defined by applying a softmax to scaled dot-product similarity scores between the query and the keys [30 ] . In practice, the query, key, and value representations are themselves obtained from token embeddings through learned linear transformations. More explicitly, in this case
a i ( q , k 1 : n ) = exp ( ⟨ q , k i ⟩ / d ) ∑ j = 1 n exp ( ⟨ q , k j ⟩ / d ) , i = 1 , … , n , (50) a_i(\mathbf{q},\mathbf{k}_{1:n}) = \frac{\exp\left(\langle\mathbf{q},\mathbf{k}_i\rangle/\sqrt{d}\right)}{\sum_{j=1}^{n}\exp\left(\langle\mathbf{q},\mathbf{k}_j\rangle/\sqrt{d}\right)}, \qquad i=1,\ldots,n, \tag*{(50)} a i ( q , k 1 : n ) = ∑ j = 1 n exp ( ⟨ q , k j ⟩ / d ) exp ( ⟨ q , k i ⟩ / d ) , i = 1 , … , n , (50)
where ⟨ q , k i ⟩ \langle\mathbf{q},\mathbf{k}_i\rangle ⟨ q , k i ⟩ denotes the Euclidean inner product between q \mathbf{q} q and k i \mathbf{k}_i k i .
In self-attention, the query token and the key-value pairs all come from the same set of tokens, so each token can incorporate information from the others in that set. In cross-attention, the query comes from one set and the key-value pairs come from another, allowing one set of tokens to attend to another. Multi-head attention applies several such attention operations in parallel and combines their outputs, allowing the model to represent different kinds of interactions simultaneously.
For set-structured data, attention-based architectures are especially attractive because they can model rich interactions among elements while remaining permutation-equivariant when positional encodings are not used. This makes transformers a natural architectural choice for neural processes on tabular datasets.
Row-order symmetry. The row order of a tabular dataset is arbitrary, so a tabular predictor should not depend on the order in which context rows are presented. Let P c P_c P c and P t P_t P t denote permutation matrices acting on the context and target-row axes, respectively. A set-to-set predictor f f f is context-row invariant and target-row equivariant when
f ( P c D c , P t x 1 : n t t ) = P t f ( D c , x 1 : n t t ) . (51) f\left(P_cD_c,P_t\mathbf{x}^{t}_{1:n_t}\right) = P_tf\left(D_c,\mathbf{x}^{t}_{1:n_t}\right). \tag*{(51)} f ( P c D c , P t x 1 : n t t ) = P t f ( D c , x 1 : n t t ) . (51)
Consequently, permuting context rows leaves every prediction unchanged, while permuting target rows only permutes the corresponding predictions. Token-wise maps, including MLPs and layer normalisation, preserve this property; self-attention is permutation equivariant; and cross-attention is invariant to a permutation of its key-value rows and equivariant to a permutation of its query rows. Finally, a loss that aggregates the per-target losses by summation or averaging is invariant to target-row order. Thus, a row-order-equivariant architecture together with an aggregated loss defines an order-invariant learning objective.
Feature order is different. Columns have fixed coordinates in an input vector, and a generic row encoder need not be invariant to a permutation of those coordinates. Exact feature-order invariance therefore requires an additional architectural constraint or explicit symmetrisation; it does not follow from row-order symmetry.
Transformer Neural Processes. The attentive neural process augments the CNP by replacing simple pooling with attention from the target inputs to encoded context representations [31 ] . In this architecture, the context rows are first encoded independently, and each target input then attends to these encoded context rows to construct a target-dependent summary. This addresses a key limitation of pooled encoders: different target inputs can focus on different parts of the context set.
Transformer neural processes (TNPs) extend this idea by introducing attention earlier in the encoder itself [32 ] . Rather than encoding context rows independently and only applying attention at prediction time, a TNP uses attention among context representations as part of the encoding process, allowing the context representation itself to capture interactions among rows before target-dependent prediction is performed. Context and target rows are then mapped to token representations, and self-attention and cross-attention are used to construct target-dependent summaries of the context set. In this way, a TNP can model both interactions within the context set and relevance of context rows to each target input.
Formally, a TNP defines
q w ( y 1 : n ∣ x 1 : n , D c ) (52) q_w(y_{1:n} \mid x_{1:n}, \mathcal{D}_c) \tag*{(52)} q w ( y 1 : n ∣ x 1 : n , D c ) (52)
through an attention-based architecture operating on the context and target sets. The context set provides observed input-label pairs, while the target set provides query inputs whose labels are to be predicted. Attention allows the model to form representations that depend jointly on the target inputs and the observed context, making TNPs a natural neural-process analogue of target-dependent posterior prediction.
Several recent architectures improve the computational efficiency of attention-based neural processes by introducing a smaller latent bottleneck between the context set and the target predictions. Latent bottleneck attentive neural processes (LBANPs) compress the context information into a fixed set of latent representations before decoding to the target queries [33 ] . Closely related ideas appear in perceiver-style architectures, where a small latent array cross-attends to a large input and is then processed in the latent space [43 , 44 ] . This can reduce the computational cost of full attention over large sets while still allowing expressive target-dependent prediction. PrivTab adopts this LBANP design, using a fixed set of summary tokens to aggregate context information. It also follows the prior-data fitted network perspective [34 ] , in which pretraining on a task prior yields an in-context predictor for new datasets.
This perspective is particularly useful for the private setting considered in this work. Since the sensitive information flows from the context set to the predictions through attention, the attention mechanism is the natural place to introduce a privacy-preserving transformation of the context information before any downstream prediction is performed by post-processing.
Non-DP Tabular Foundation Models. TabPFN [14 , 15 ] and its extensions, including TabPFN v3 [45 ] , use prior-fitted inference to classify from a context dataset in a single forward pass. TabICL and TabICL v2 [16 , 46 ] follow a closely related in-context-learning approach. These models amortise tabular classification across tasks, but do not provide formal protection for sensitive context data. This matters because prediction confidence can support membership inference [26 , 27 ] ; in our audit, TabPFN v3 and TabICL v2 show high aggregate and record-level attack success Supplement S6.1. PrivTab retains the in-context setting while protecting the transferred context representation under DP.
Meta-Learning. PrivTab also belongs to the broader meta-learning literature. A useful distinction is between gradient-based adaptation and amortised inference (Bronskill, 2020). Methods such as MAML [48 ] and Reptile [49 ] adapt to a new task through additional test-time optimisation. By contrast, matching networks [50 ] , prototypical networks [51 ] , and neural-process models [29 ] map a context set directly to predictions. PrivTab follows this latter approach, but explicitly constrains the context-to-prediction map with a DP mechanism.
Neural Processes and Transformer Neural Processes. PrivTab is most closely related to conditional, latent, attentive, and transformer neural processes [29 , 31 , 32 ] . These models condition predictions on a context set in a single forward pass rather than fitting a new model for each dataset. We build most directly on the transformer-neural-process viewpoint, but privatise the context-to-summary interface. PrivTab therefore transfers a formally analysable DP summary rather than an unconstrained representation of the context set.
Differentially Private Machine Learning. Private machine learning most often relies on DP stochastic optimisation [8 , 1 ] . These methods enable private training for many model classes, but privacy remains tied to an adaptive pipeline that includes clipping, accounting, model selection, and hyperparameter tuning. PrivTab explores a different design: it privatises a compact dataset representation once and reuses it by post-processing, making it a private amortised-inference procedure rather than a private optimiser.
Differentially Private Meta-Learning. DPConvCNP [21 ] is most closely aligned with our noise-aware objective. It studies private regression with convolutional conditional neural processes and similarly trains on the privatised representation observed at test time. Its focus, however, is convolutional regression rather than than heterogeneous tabular classification. Other work applies DP during meta-training [52 , 53 ] , rather than privatising an inference-time context set while retaining amortised prediction for that dataset.
Differentially Private In-Context Learning with LLMs. Recent work also studies DP ICL for LLMs. It includes private prompt synthesis [17 ] , private aggregation of LLM responses [18 ] , DP generation of few-shot examples [54 ] , privacy-aware nearest-neighbor retrieval [55 ] , and private prompt learning [56 ] . DP-TabICL [19 ] privatises tabular records or group statistics and converts them to textual examples that are provided to a general-purpose LLM. PrivTab instead is a standalone tabular model whose privacy mechanism is built into context summarisation; fitting to a new dataset requires neither external LLM prompting nor synthetic-query generation. These methods address text prompts and LLM inference rather than tabular amortised classification, but share the goal of controlling information released from a sensitive context dataset.
Local Differential Privacy for Embeddings. Related work also privatises learned representations in a local privacy setting. A local DP approach for transformer text embeddings using a variational information bottleneck has also been studied, with privacy characterised using Rényi divergence and Bayesian Differential Privacy [57 ] . This is complementary to our setting: users privatise their own representations before release, whereas PrivTab applies central DP to a shared context dataset for tabular classification.
Noise-aware Amortised Inference
In the private setting, the predictor does not observe the context dataset D c \mathcal{D}_c D c directly. Instead, it observes the output of a DP mechanism applied to the context set. When this private summary is produced by a learned encoder, the mechanism depends on parameters ϕ \phi ϕ , which we regard as fixed when defining the corresponding noise-aware target. In PrivTab, this mechanism is instantiated by the DP-MHCA-based private encoder that maps D c \mathcal{D}_c D c to a privatised summary. We therefore write A ϕ \mathcal{A}_{\phi} A ϕ for the mechanism, let S \mathcal{S} S denote its output space, and let S ~ ∈ S \widetilde{S} \in\mathcal{S} S ∈ S denote the released random output. Conditional on D c \mathcal{D}_c D c , this output is distributed according to
S ~ ∣ D c ∼ p A , ϕ ( ⋅ ∣ D c ) , (53) \widetilde{S} \mid\mathcal{D}_c \sim p_{\mathcal{A},\phi}(\cdot\mid\mathcal{D}_c), \tag*{(53)} S ∣ D c ∼ p A , ϕ ( ⋅ ∣ D c ) , (53)
where p A , ϕ ( s ~ ∣ D c ) p_{\mathcal{A},\phi}(\widetilde{s} \mid\mathcal{D}_c) p A , ϕ ( s ∣ D c ) denotes the density or mass function induced by A ϕ ( D c ) \mathcal{A}_{\phi}(\mathcal{D}_c) A ϕ ( D c ) . The realised DP output s ~ \widetilde{s} s may be a noisy statistic, a private representation, or a learned DP summary of the context dataset.
The appropriate predictive object is then not the posterior predictive conditioned on D c \mathcal{D}_c D c , but the conditional distribution of the target labels given the public target inputs and the observed private summary. Let X 1 : n X_{1:n} X 1 : n and Y 1 : n Y_{1:n} Y 1 : n denote the target-input and target-label random variables under the joint task law. For fixed mechanism parameters ϕ \phi ϕ , define the noise-aware posterior predictive directly as the regular conditional law induced by the joint task distribution and private mechanism:
p ϕ ( y 1 : n ∣ x 1 : n , s ~ ) : = Pr ϕ ( Y 1 : n = y 1 : n ∣ X 1 : n = x 1 : n , S ~ = s ~ ) . (54) p_{\phi}(y_{1:n} \mid x_{1:n}, \widetilde{s}) := \Pr_{\phi}\left(Y_{1:n}=y_{1:n} \mid X_{1:n}=x_{1:n}, \widetilde{S}=\widetilde{s}\right). \tag*{(54)} p ϕ ( y 1 : n ∣ x 1 : n , s ) := ϕ Pr ( Y 1 : n = y 1 : n ∣ X 1 : n = x 1 : n , S = s ) . (54)
When the joint law admits the latent-variable factorisation described in Supplement S1.6, this conditional law can equivalently be written as
p ϕ ( y 1 : n ∣ x 1 : n , s ~ ) = ∫ p ( y 1 : n ∣ x 1 : n , θ ) p ϕ ( θ ∣ x 1 : n , s ~ ) d θ . (55) p_{\phi}(y_{1:n} \mid x_{1:n}, \widetilde{s}) = \int p(y_{1:n} \mid x_{1:n}, \theta)p_{\phi}(\theta\mid x_{1:n}, \widetilde{s})\,\mathrm{d}\theta. \tag*{(55)} p ϕ ( y 1 : n ∣ x 1 : n , s ) = ∫ p ( y 1 : n ∣ x 1 : n , θ ) p ϕ ( θ ∣ x 1 : n , s ) d θ . (55)
This distribution accounts for uncertainty induced both by the latent parameter θ \theta θ , including any information about it carried by the target inputs, and by the randomness of the fixed private mechanism A ϕ \mathcal{A}_{\phi} A ϕ .
Suppose now that we learn an amortised predictive distribution q ψ ( y 1 : n ∣ x 1 : n , s ~ ) q_{\psi}(y_{1:n} \mid x_{1:n}, \widetilde{s}) q ψ ( y 1 : n ∣ x 1 : n , s ) to approximate this noise-aware posterior predictive. In the private setting, the prediction objective is the same expected negative log-likelihood objective defined in Supplement S1.6, except that the confidential context dataset is replaced by the released DP output S ~ \widetilde{S} S . For fixed mechanism parameters ϕ \phi ϕ , this gives
L N L L p r i v ( ψ , ϕ ) = E p ϕ ( τ , S ~ ) [ − log q ψ ( y 1 : n t t ∣ x 1 : n t t , S ~ ) ] . (56) \mathcal{L}^{\mathrm{priv}}_{\mathrm{NLL}}(\psi,\phi) = \mathbb{E}_{p_{\phi}(\tau,\widetilde{S})}\left[-\log q_{\psi}\left(y^{t}_{1:n_t} \mid x^{t}_{1:n_t}, \widetilde{S}\right)\right]. \tag*{(56)} L NLL priv ( ψ , ϕ ) = E p ϕ ( τ , S ) [ − log q ψ ( y 1 : n t t ∣ x 1 : n t t , S ) ] . (56)
The following theorem identifies the Kullback–Leibler (KL) divergence objective corresponding to the conditional negative log-likelihood at fixed target size n t n_t n t .
Theorem S2.1. Fix mechanism parameters ϕ \phi ϕ and a target size n t ≥ 1 n_t \ge1 n t ≥ 1 . Let Π n t ⊆ Π \Pi_{n_t} \subseteq\Pi Π n t ⊆ Π denote the subset of tasks whose target set has size n t n_t n t , let S ~ ∣ D c ∼ p A , ϕ ( ⋅ ∣ D c ) \widetilde{S} \mid D_c \sim p_{A,\phi}(\cdot\mid D_c) S ∣ D c ∼ p A , ϕ ( ⋅ ∣ D c ) , and let p ϕ ( n t ) ( τ , S ~ ) p_{\phi}^{(n_t)}(\tau,\widetilde{S}) p ϕ ( n t ) ( τ , S ) denote the resulting joint law on Π n t × S \Pi_{n_t} \times\mathcal{S} Π n t × S . Define the conditional objective
L N L L p r i v ( ψ ; ϕ , n t ) : = E p ϕ ( n t ) ( τ , S ~ ) [ − log q ψ ( y 1 : n t t ∣ x 1 : n t t , S ~ ) ] . (57) \mathcal{L}_{\mathrm{NLL}}^{\mathrm{priv}}(\psi;\phi,n_t) := \mathbb{E}_{p_{\phi}^{(n_t)}(\tau,\widetilde{S})}\left[-\log q_{\psi}(y_{1:n_t}^{t}\mid x_{1:n_t}^{t},\widetilde{S})\right]. \tag*{(57)} L NLL priv ( ψ ; ϕ , n t ) := E p ϕ ( n t ) ( τ , S ) [ − log q ψ ( y 1 : n t t ∣ x 1 : n t t , S ) ] . (57) Let q ψ ( y 1 : n t ∣ x 1 : n t , s ~ ) q_{\psi}(y_{1:n_t}\mid x_{1:n_t},\widetilde{s}) q ψ ( y 1 : n t ∣ x 1 : n t , s ) be an amortised predictive distribution. Assume that the relevant joint and conditional densities or mass functions on Π n t × S \Pi_{n_t} \times\mathcal{S} Π n t × S exist and that L N L L p r i v ( ψ ; ϕ , n t ) \mathcal{L}_{\mathrm{NLL}}^{\mathrm{priv}}(\psi;\phi,n_t) L NLL priv ( ψ ; ϕ , n t ) is finite, so that the successive integrations below are justified by Fubini’s theorem. Then
L N L L p r i v ( ψ ; ϕ , n t ) = const ( ϕ , n t ) + E p ϕ ( n t ) ( τ , S ~ ) [ KL ( p ϕ ( ⋅ ∣ x 1 : n t t , S ~ ) ∥ q ψ ( ⋅ ∣ x 1 : n t t , S ~ ) ) ] . (58) \mathcal{L}_{\mathrm{NLL}}^{\mathrm{priv}}(\psi;\phi,n_t) = \operatorname{const}(\phi,n_t) + \mathbb{E}_{p_{\phi}^{(n_t)}(\tau,\widetilde{S})}\left[\operatorname{KL}\left(p_{\phi}(\cdot\mid x_{1:n_t}^{t},\widetilde{S}) \,\middle\|\, q_{\psi}(\cdot\mid x_{1:n_t}^{t},\widetilde{S})\right)\right]. \tag*{(58)} L NLL priv ( ψ ; ϕ , n t ) = const ( ϕ , n t ) + E p ϕ ( n t ) ( τ , S ) [ KL ( p ϕ ( ⋅ ∣ x 1 : n t t , S ) q ψ ( ⋅ ∣ x 1 : n t t , S ) ) ] . (58) where const ( ϕ , n t ) \operatorname{const}(\phi,n_t) const ( ϕ , n t ) does not depend on ψ \psi ψ . Therefore, for fixed ϕ \phi ϕ , minimising L N L L p r i v ( ψ ; ϕ , n t ) \mathcal{L}_{\mathrm{NLL}}^{\mathrm{priv}}(\psi;\phi,n_t) L NLL priv ( ψ ; ϕ , n t ) is equivalent to minimising the expected KL divergence from the noise-aware posterior predictive p ϕ ( ⋅ ∣ x 1 : n t t , S ~ ) p_{\phi}(\cdot\mid x_{1:n_t}^{t},\widetilde{S}) p ϕ ( ⋅ ∣ x 1 : n t t , S ) to the amortised predictive distribution q ψ ( ⋅ ∣ x 1 : n t t , S ~ ) q_{\psi}(\cdot\mid x_{1:n_t}^{t},\widetilde{S}) q ψ ( ⋅ ∣ x 1 : n t t , S ) .
Proof. By definition of expectation with respect to the joint law p ϕ ( n t ) ( τ , S ~ ) p_{\phi}^{(n_t)}(\tau,\widetilde{S}) p ϕ ( n t ) ( τ , S ) ,
L N L L p r i v ( ψ ; ϕ , n t ) = ∫ Π n t ∫ S − log q ψ ( y 1 : n t t ( τ ) ∣ x 1 : n t t ( τ ) , s ~ ) p ϕ ( n t ) ( τ , s ~ ) d s ~ d τ . (59) \mathcal{L}_{\mathrm{NLL}}^{\mathrm{priv}}(\psi;\phi,n_t) = \int_{\Pi_{n_t}}\int_{\mathcal{S}} -\log q_{\psi}(y_{1:n_t}^{t}(\tau)\mid x_{1:n_t}^{t}(\tau),\widetilde{s})p_{\phi}^{(n_t)}(\tau,\widetilde{s})\,\mathrm{d}\widetilde{s}\,\mathrm{d}\tau. \tag*{(59)} L NLL priv ( ψ ; ϕ , n t ) = ∫ Π n t ∫ S − log q ψ ( y 1 : n t t ( τ ) ∣ x 1 : n t t ( τ ) , s ) p ϕ ( n t ) ( τ , s ) d s d τ . (59)
Writing τ = ( D c , D t ) \tau= (D_c,D_t) τ = ( D c , D t ) with D t = ( x 1 : n t t , y 1 : n t t ) D_t = (x_{1:n_t}^{t},y_{1:n_t}^{t}) D t = ( x 1 : n t t , y 1 : n t t ) , and applying Fubini’s theorem to expand the integral over the task coordinates, this is
L N L L p r i v ( ψ ; ϕ , n t ) = ∫ D ∫ X n t ∫ Y n t ∫ S − log q ψ ( y 1 : n t t ∣ x 1 : n t t , s ~ ) p ϕ ( n t ) ( D c , x 1 : n t t , y 1 : n t t , s ~ ) d s ~ d y 1 : n t t d x 1 : n t t d D c . (60) \mathcal{L}_{\mathrm{NLL}}^{\mathrm{priv}}(\psi;\phi,n_t) = \int_{\mathcal{D}}\int_{\mathcal{X}^{n_t}}\int_{\mathcal{Y}^{n_t}}\int_{\mathcal{S}} -\log q_{\psi}(y_{1:n_t}^{t}\mid x_{1:n_t}^{t},\widetilde{s})p_{\phi}^{(n_t)}(D_c,x_{1:n_t}^{t},y_{1:n_t}^{t},\widetilde{s})\,\mathrm{d}\widetilde{s}\,\mathrm{d}y_{1:n_t}^{t}\,\mathrm{d}x_{1:n_t}^{t}\,\mathrm{d}D_c. \tag*{(60)} L NLL priv ( ψ ; ϕ , n t ) = ∫ D ∫ X n t ∫ Y n t ∫ S − log q ψ ( y 1 : n t t ∣ x 1 : n t t , s ) p ϕ ( n t ) ( D c , x 1 : n t t , y 1 : n t t , s ) d s d y 1 : n t t d x 1 : n t t d D c . (60)
Integrating out the context dataset D c D_c D c , again by Fubini’s theorem and the definition of the marginal density, gives
L N L L p r i v ( ψ ; ϕ , n t ) = ∫ X n t ∫ Y n t ∫ S − log q ψ ( y 1 : n t t ∣ x 1 : n t t , s ~ ) p ϕ ( n t ) ( x 1 : n t t , y 1 : n t t , s ~ ) d s ~ d y 1 : n t t d x 1 : n t t . (61) \mathcal{L}_{\mathrm{NLL}}^{\mathrm{priv}}(\psi;\phi,n_t) = \int_{\mathcal{X}^{n_t}}\int_{\mathcal{Y}^{n_t}}\int_{\mathcal{S}} -\log q_{\psi}(y_{1:n_t}^{t}\mid x_{1:n_t}^{t},\widetilde{s})p_{\phi}^{(n_t)}(x_{1:n_t}^{t},y_{1:n_t}^{t},\widetilde{s})\,\mathrm{d}\widetilde{s}\,\mathrm{d}y_{1:n_t}^{t}\,\mathrm{d}x_{1:n_t}^{t}. \tag*{(61)} L NLL priv ( ψ ; ϕ , n t ) = ∫ X n t ∫ Y n t ∫ S − log q ψ ( y 1 : n t t ∣ x 1 : n t t , s ) p ϕ ( n t ) ( x 1 : n t t , y 1 : n t t , s ) d s d y 1 : n t t d x 1 : n t t . (61)
Rewriting the joint density by the chain rule for densities or mass functions as p ϕ ( n t ) ( y 1 : n t t ∣ x 1 : n t t , s ~ ) p ϕ ( n t ) ( x 1 : n t t , s ~ ) p_{\phi}^{(n_t)}(y_{1:n_t}^{t}\mid x_{1:n_t}^{t},\widetilde{s})p_{\phi}^{(n_t)}(x_{1:n_t}^{t},\widetilde{s}) p ϕ ( n t ) ( y 1 : n t t ∣ x 1 : n t t , s ) p ϕ ( n t ) ( x 1 : n t t , s ) gives
L N L L p r i v ( ψ ; ϕ , n t ) = ∫ X n t ∫ S [ ∫ Y n t − log q ψ ( y 1 : n t t ∣ x 1 : n t t , s ~ ) p ϕ ( n t ) ( y 1 : n t t ∣ x 1 : n t t , s ~ ) d y 1 : n t t ] p ϕ ( n t ) ( x 1 : n t t , s ~ ) d s ~ d x 1 : n t t . (62) \mathcal{L}_{\mathrm{NLL}}^{\mathrm{priv}}(\psi;\phi,n_t) = \int_{\mathcal{X}^{n_t}}\int_{\mathcal{S}}\left[\int_{\mathcal{Y}^{n_t}}-\log q_{\psi}(y_{1:n_t}^{t}\mid x_{1:n_t}^{t},\widetilde{s})p_{\phi}^{(n_t)}(y_{1:n_t}^{t}\mid x_{1:n_t}^{t},\widetilde{s})\,\mathrm{d}y_{1:n_t}^{t}\right]p_{\phi}^{(n_t)}(x_{1:n_t}^{t},\widetilde{s})\,\mathrm{d}\widetilde{s}\,\mathrm{d}x_{1:n_t}^{t}. \tag*{(62)} L NLL priv ( ψ ; ϕ , n t ) = ∫ X n t ∫ S [ ∫ Y n t − log q ψ ( y 1 : n t t ∣ x 1 : n t t , s ) p ϕ ( n t ) ( y 1 : n t t ∣ x 1 : n t t , s ) d y 1 : n t t ] p ϕ ( n t ) ( x 1 : n t t , s ) d s d x 1 : n t t . (62)
By definition of the noise-aware posterior predictive, the conditional law p ϕ ( n t ) ( y 1 : n t t ∣ x 1 : n t t , s ~ ) p_{\phi}^{(n_t)}(y_{1:n_t}^{t}\mid x_{1:n_t}^{t},\widetilde{s}) p ϕ ( n t ) ( y 1 : n t t ∣ x 1 : n t t , s ) is precisely p ϕ ( ⋅ ∣ x 1 : n t t , s ~ ) p_{\phi}(\cdot\mid x_{1:n_t}^{t},\widetilde{s}) p ϕ ( ⋅ ∣ x 1 : n t t , s ) . Therefore the inner integral is the cross-entropy
H ( p ϕ ( ⋅ ∣ x 1 : n t t , s ~ ) , q ψ ( ⋅ ∣ x 1 : n t t , s ~ ) ) . (63) \mathcal{H}\left(p_{\phi}(\cdot\mid x_{1:n_t}^{t},\widetilde{s}),q_{\psi}(\cdot\mid x_{1:n_t}^{t},\widetilde{s})\right). \tag*{(63)} H ( p ϕ ( ⋅ ∣ x 1 : n t t , s ) , q ψ ( ⋅ ∣ x 1 : n t t , s ) ) . (63)
Hence
L N L L p r i v ( ψ ; ϕ , n t ) = ∫ X n t ∫ S H ( p ϕ ( ⋅ ∣ x 1 : n t t , s ~ ) , q ψ ( ⋅ ∣ x 1 : n t t , s ~ ) ) p ϕ ( n t ) ( x 1 : n t t , s ~ ) d s ~ d x 1 : n t t . (64) \mathcal{L}_{\mathrm{NLL}}^{\mathrm{priv}}(\psi;\phi,n_t) = \int_{\mathcal{X}^{n_t}}\int_{\mathcal{S}}\mathcal{H}\left(p_{\phi}(\cdot\mid x_{1:n_t}^{t},\widetilde{s}),q_{\psi}(\cdot\mid x_{1:n_t}^{t},\widetilde{s})\right)p_{\phi}^{(n_t)}(x_{1:n_t}^{t},\widetilde{s})\,\mathrm{d}\widetilde{s}\,\mathrm{d}x_{1:n_t}^{t}. \tag*{(64)} L NLL priv ( ψ ; ϕ , n t ) = ∫ X n t ∫ S H ( p ϕ ( ⋅ ∣ x 1 : n t t , s ) , q ψ ( ⋅ ∣ x 1 : n t t , s ) ) p ϕ ( n t ) ( x 1 : n t t , s ) d s d x 1 : n t t . (64)
Using the identity
H ( p , q ) = H ( p ) + KL ( p ∥ q ) , (65) \mathcal{H}(p,q) = \mathcal{H}(p) + \operatorname{KL}(p\|q), \tag*{(65)} H ( p , q ) = H ( p ) + KL ( p ∥ q ) , (65)
pointwise in ( x 1 : n t t , s ~ ) (x_{1:n_t}^{t},\widetilde{s}) ( x 1 : n t t , s ) , we obtain
L N L L p r i v ( ψ ; ϕ , n t ) = ∫ X n t ∫ S H ( p ϕ ( ⋅ ∣ x 1 : n t t , s ~ ) ) p ϕ ( n t ) ( x 1 : n t t , s ~ ) d s ~ d x 1 : n t t + ∫ X n t ∫ S KL ( p ϕ ( ⋅ ∣ x 1 : n t t , s ~ ) ∥ q ψ ( ⋅ ∣ x 1 : n t t , s ~ ) ) p ϕ ( n t ) ( x 1 : n t t , s ~ ) d s ~ d x 1 : n t t . (66) \begin{aligned}
\mathcal{L}_{\mathrm{NLL}}^{\mathrm{priv}}(\psi;\phi,n_t) ={}& \int_{\mathcal{X}^{n_t}}\int_{\mathcal{S}}\mathcal{H}\left(p_{\phi}(\cdot\mid x_{1:n_t}^{t},\widetilde{s})\right)p_{\phi}^{(n_t)}(x_{1:n_t}^{t},\widetilde{s})\,\mathrm{d}\widetilde{s}\,\mathrm{d}x_{1:n_t}^{t}\\
&+ \int_{\mathcal{X}^{n_t}}\int_{\mathcal{S}}\operatorname{KL}\left(p_{\phi}(\cdot\mid x_{1:n_t}^{t},\widetilde{s})\middle\|q_{\psi}(\cdot\mid x_{1:n_t}^{t},\widetilde{s})\right)p_{\phi}^{(n_t)}(x_{1:n_t}^{t},\widetilde{s})\,\mathrm{d}\widetilde{s}\,\mathrm{d}x_{1:n_t}^{t}. \tag*{(66)}
\end{aligned} L NLL priv ( ψ ; ϕ , n t ) = ∫ X n t ∫ S H ( p ϕ ( ⋅ ∣ x 1 : n t t , s ) ) p ϕ ( n t ) ( x 1 : n t t , s ) d s d x 1 : n t t + ∫ X n t ∫ S KL ( p ϕ ( ⋅ ∣ x 1 : n t t , s ) q ψ ( ⋅ ∣ x 1 : n t t , s ) ) p ϕ ( n t ) ( x 1 : n t t , s ) d s d x 1 : n t t . (66)
Since the KL integrand depends on τ \boldsymbol{\tau} τ only through the target inputs x 1 : n t t \mathbf{x}^{t}_{1:n_t} x 1 : n t t and on the private release through S ~ \widetilde{S} S , another application of the law of the unconscious statistician yields
L N L L p r i v ( ψ ; ϕ , n t ) = const ( ϕ , n t ) + E p ϕ ( n t ) ( τ , S ~ ) [ KL ( p ϕ ( ⋅ ∣ x 1 : n t t , S ~ ) ∥ q ψ ( ⋅ ∣ x 1 : n t t , S ~ ) ) ] . (67) \mathcal{L}^{\mathrm{priv}}_{\mathrm{NLL}}(\psi;\phi,n_t)=\operatorname{const}(\phi,n_t)+\mathbb{E}_{p_{\phi}^{(n_t)}(\boldsymbol{\tau},\widetilde{S})}\left[\operatorname{KL}\left(p_{\phi}(\cdot\mid\mathbf{x}^{t}_{1:n_t},\widetilde{S})\mathrel{\|}q_{\psi}(\cdot\mid\mathbf{x}^{t}_{1:n_t},\widetilde{S})\right)\right]. \tag*{(67)} L NLL priv ( ψ ; ϕ , n t ) = const ( ϕ , n t ) + E p ϕ ( n t ) ( τ , S ) [ KL ( p ϕ ( ⋅ ∣ x 1 : n t t , S ) ∥ q ψ ( ⋅ ∣ x 1 : n t t , S ) ) ] . (67)
The first term depends only on the data-generating process and the fixed mechanism parameters ϕ \phi ϕ , not on ψ \psi ψ . Writing it as
const ( ϕ , n t ) = ∫ X n t ∫ S H ( p ϕ ( ⋅ ∣ x 1 : n t t , s ~ ) ) p ϕ ( n t ) ( x 1 : n t t , s ~ ) d s ~ d x 1 : n t t (68) \operatorname{const}(\phi,n_t)=\int_{\mathcal{X}^{n_t}}\int_{\mathcal{S}}\mathcal{H}\left(p_{\phi}(\cdot\mid\mathbf{x}^{t}_{1:n_t},\widetilde{s})\right)p_{\phi}^{(n_t)}(\mathbf{x}^{t}_{1:n_t},\widetilde{s})\,\mathrm{d}\widetilde{s}\,\mathrm{d}\mathbf{x}^{t}_{1:n_t} \tag*{(68)} const ( ϕ , n t ) = ∫ X n t ∫ S H ( p ϕ ( ⋅ ∣ x 1 : n t t , s ) ) p ϕ ( n t ) ( x 1 : n t t , s ) d s d x 1 : n t t (68)
gives the result.
Differentially Private Transformer Neural Processes
Differentially private transformer neural processes are transformer-based amortised predictors for which the sensitive information is contained in the context dataset. We assume that each individual’s sensitive data corresponds to a single row of the private context set D c \mathcal{D}_c D c . Accordingly, privacy is defined with respect to the substitute adjacency relation defined in Supplement S1.2, so that neighbouring datasets differ in exactly one row. This choice is natural for the tabular setting considered here and is compatible with the sequential representation of the context set used by the transformer architecture.
We instantiate PrivTab shown in Figure E1 . The model receives a private context set D c \mathcal{D}_c D c together with public target queries x 1 : n t t \mathbf{x}^{t}_{1:n_t} x 1 : n t t and proceeds in three parts:
A row embedding model maps context rows { ( x i c , y i c ) } i = 1 n c \{(\mathbf{x}^{c}_{i},y^{c}_{i})\}_{i=1}^{n_c} {( x i c , y i c ) } i = 1 n c and target queries { x j t } j = 1 n t \{\mathbf{x}^{t}_{j}\}_{j=1}^{n_t} { x j t } j = 1 n t to token representations.
A fixed set of learned pseudo-tokens { u i } i = 1 m \{\mathbf{u}_{i}\}_{i=1}^{m} { u i } i = 1 m repeatedly aggregates the private context tokens through DP-MHCA, followed by latent self-attention, to produce privatised summary tokens.
At each layer, target tokens attend to the privatised summaries through multi-head cross-attention; a final MLP predicts y 1 : n t t \mathbf{y}^{t}_{1:n_t} y 1 : n t t . This target-side computation is post-processing and requires no additional privacy protection.
The final privacy guarantee depends on the number of DP-MHCA compositions. The following subsections develop the model in order: row embedding, the private attention mechanism and its guarantees, the reference implementation, and the complete encoder architecture. The corresponding noise-aware pretraining objective and training procedure are developed separately in Supplement S4.
Row-order equivariance of PrivTab. PrivTab uses no positional encodings. Row-wise embeddings, layer normalisation, feed-forward networks, and decoding are applied independently to each row and do not use row order. DP-MHCA is invariant to context-row permutations because it sums bounded per-row contributions; the remaining latent computation is post-processing. Target-side cross-attention is equivariant to target-row permutations. Hence, the predictor is invariant to context-row order and equivariant to target-row order. Once target predictions are combined in the aggregated training loss, the loss is invariant to permutations of both context and target rows.
Row Embedding Model
The row embedding model maps each context row ( x i c , y i c ) (\mathbf{x}^{c}_{i},y^{c}_{i}) ( x i c , y i c ) and each target row x j t \mathbf{x}^{t}_{j} x j t to a token representation in R d t o k \mathbb{R}^{d_{\mathrm{tok}}} R d tok . Let d ≤ d x d\le d_x d ≤ d x denote the number of observed features in a given dataset, and let e p a d ∈ R e_{\mathrm{pad}}\in\mathbb{R} e pad ∈ R denote a learned padding value. For a raw input row x i r a w ∈ R d \mathbf{x}^{\mathrm{raw}}_{i}\in\mathbb{R}^{d} x i raw ∈ R d , we first form a padded vector x ˉ i ∈ R d x \bar{\mathbf{x}}_{i}\in\mathbb{R}^{d_x} x ˉ i ∈ R d x by
x ˉ i , k = { x i , k r a w , k ≤ d , e p a d , k > d , k = 1 , … , d x . (69) \bar{x}_{i,k}=
\begin{cases}
x^{\mathrm{raw}}_{i,k}, & k\le d,\\
e_{\mathrm{pad}}, & k>d,
\end{cases}
\qquad k=1,\ldots,d_x. \tag*{(69)} x ˉ i , k = { x i , k raw , e pad , k ≤ d , k > d , k = 1 , … , d x . (69)
We then define a binary validity mask m i ∈ { 0 , 1 } d x \mathbf{m}_{i}\in\{0,1\}^{d_x} m i ∈ { 0 , 1 } d x by
m i , k = { 1 , k ≤ d , 0 , k > d , k = 1 , … , d x . (70) m_{i,k}=
\begin{cases}
1, & k\le d,\\
0, & k>d,
\end{cases}
\qquad k=1,\ldots,d_x. \tag*{(70)} m i , k = { 1 , 0 , k ≤ d , k > d , k = 1 , … , d x . (70)
and concatenate the padded row with the mask:
x ~ i = [ x ˉ i , m i ] ∈ R 2 d x . (71) \tilde{\mathbf{x}}_i = [\bar{\mathbf{x}}_i, \mathbf{m}_i] \in\mathbb{R}^{2d_x}. \tag*{(71)} x ~ i = [ x ˉ i , m i ] ∈ R 2 d x . (71)
To keep rows with different numbers of observed features on a comparable scale, we rescale by
x ^ i = d x d x ~ i ∈ R 2 d x . (72) \hat{\mathbf{x}}_i = \sqrt{\frac{d_x}{d}}\,\tilde{\mathbf{x}}_i \in\mathbb{R}^{2d_x}. \tag*{(72)} x ^ i = d d x x ~ i ∈ R 2 d x . (72)
Thus, the scaled augmented row itself serves as the x x x -representation. For classification, the label encoder maps each label y ∈ { 1 , … , C } y \in\{1,\ldots,C\} y ∈ { 1 , … , C } , where C ≤ C max = 10 C \le C_{\max} = 10 C ≤ C m a x = 10 , and a dedicated null label y n u l l = C max + 1 y_{\mathrm{null}} = C_{\max} + 1 y null = C m a x + 1 to a learned embedding in R d y \mathbb{R}^{d_y} R d y . Equivalently, it is a learned lookup table
LabelEmbed : { 1 , … , C max + 1 } → R d y , (73) \operatorname{LabelEmbed}: \{1,\ldots,C_{\max}+1\} \to\mathbb{R}^{d_y}, \tag*{(73)} LabelEmbed : { 1 , … , C m a x + 1 } → R d y , (73)
where the final index is reserved for the null label regardless of the number of classes in the current dataset. In the benchmark configuration, d y = 10 d_y = 10 d y = 10 . For context rows, the observed label embedding is concatenated with the row representation,
z i c = RowEmbed ( x ^ i c , LabelEmbed ( y i c ) ) , (74) \mathbf{z}_i^c = \operatorname{RowEmbed}(\hat{\mathbf{x}}_i^c,\operatorname{LabelEmbed}(y_i^c)), \tag*{(74)} z i c = RowEmbed ( x ^ i c , LabelEmbed ( y i c )) , (74)
where RowEmbed ( x , e ) \operatorname{RowEmbed}(\mathbf{x},\mathbf{e}) RowEmbed ( x , e ) concatenates its two arguments as [ x , e ] [\mathbf{x},\mathbf{e}] [ x , e ] and maps the result into the shared token space using an MLP. For target rows, the same construction is used except that the observed label embedding is replaced by the null-label embedding LabelEmbed ( y n u l l ) \operatorname{LabelEmbed}(y_{\mathrm{null}}) LabelEmbed ( y null ) to indicate an unknown label and distinguish target from context tokens, giving
z j t = RowEmbed ( x ^ j t , LabelEmbed ( y n u l l ) ) . (75) \mathbf{z}_j^t = \operatorname{RowEmbed}(\hat{\mathbf{x}}_j^t,\operatorname{LabelEmbed}(y_{\mathrm{null}})). \tag*{(75)} z j t = RowEmbed ( x ^ j t , LabelEmbed ( y null )) . (75)
All previous operations are applied row-wise, which is important both for the privacy analysis and for row-order symmetry. In contrast, the row encoder is not exactly feature-order invariant: a permutation of feature columns permutes coordinates of x ~ i \tilde{\mathbf{x}}_i x ~ i , and the subsequent MLP RowEmbed \operatorname{RowEmbed} RowEmbed has coordinate-specific weights. As with TabPFN and TabICL [14 , 16 ] , we rely instead on the randomised synthetic task prior during pretraining to encourage robustness to the arbitrary ordering and roles of features. This provides approximate feature-order invariance in practice, but not an exact architectural guarantee.
DP-MHCA
The DP-MHCA is the central component of PrivTab. It is a multi-head cross-attention mechanism in which a query sequence attends to the private context tokens, followed by Gaussian perturbation of the resulting representation. In the first private layer, these queries are the learned pseudo-tokens u 1 : m \mathbf{u}_{1:m} u 1 : m ; in later private layers, they are the current summary tokens. Let d t o k d_{\mathrm{tok}} d tok denote the token dimension, H H H the number of heads, and d h d_h d h the per-head dimension, so that the internal attention dimension is H d h Hd_h H d h . Let r 1 : m ∈ ( R d t o k ) m \mathbf{r}_{1:m} \in(\mathbb{R}^{d_{\mathrm{tok}}})^m r 1 : m ∈ ( R d tok ) m denote the query tokens supplied to a given DP-MHCA layer, and let z 1 : n c c ∈ ( R d t o k ) n c \mathbf{z}_{1:n_c}^c \in(\mathbb{R}^{d_{\mathrm{tok}}})^{n_c} z 1 : n c c ∈ ( R d tok ) n c denote the private context tokens. These are first mapped by learned linear projections
W Q ∈ R H d h × d t o k , W K ∈ R H d h × d t o k , W V ∈ R H d h × d t o k , (76) \mathbf{W}_Q \in\mathbb{R}^{Hd_h \times d_{\mathrm{tok}}}, \qquad
\mathbf{W}_K \in\mathbb{R}^{Hd_h \times d_{\mathrm{tok}}}, \qquad
\mathbf{W}_V \in\mathbb{R}^{Hd_h \times d_{\mathrm{tok}}}, \tag*{(76)} W Q ∈ R H d h × d tok , W K ∈ R H d h × d tok , W V ∈ R H d h × d tok , (76)
so that for each query index i i i and context index j j j ,
q i = W Q r i ∈ R H d h , k j = W K z j c ∈ R H d h , v ˉ j = W V z j c ∈ R H d h . (77) \mathbf{q}_i = \mathbf{W}_Q\mathbf{r}_i \in\mathbb{R}^{Hd_h}, \qquad
\mathbf{k}_j = \mathbf{W}_K\mathbf{z}_j^c \in\mathbb{R}^{Hd_h}, \qquad
\bar{\mathbf{v}}_j = \mathbf{W}_V\mathbf{z}_j^c \in\mathbb{R}^{Hd_h}. \tag*{(77)} q i = W Q r i ∈ R H d h , k j = W K z j c ∈ R H d h , v ˉ j = W V z j c ∈ R H d h . (77)
Each projected vector is then reshaped into H H H heads of dimension d h d_h d h . We denote the resulting per-head vectors by
q i ( h ) ∈ R d h , k j ( h ) ∈ R d h , v ˉ j ( h ) ∈ R d h , (78) \mathbf{q}_i^{(h)} \in\mathbb{R}^{d_h}, \qquad
\mathbf{k}_j^{(h)} \in\mathbb{R}^{d_h}, \qquad
\bar{\mathbf{v}}_j^{(h)} \in\mathbb{R}^{d_h}, \tag*{(78)} q i ( h ) ∈ R d h , k j ( h ) ∈ R d h , v ˉ j ( h ) ∈ R d h , (78)
for heads h = 1 , … , H h = 1,\ldots,H h = 1 , … , H , query indices i = 1 , … , m i = 1,\ldots,m i = 1 , … , m , and context indices j = 1 , … , n c j = 1,\ldots,n_c j = 1 , … , n c . In the implementation, the value vectors are normalised after projection, head by head:
v j ( h ) = v ˉ j ( h ) max { ∥ v ˉ j ( h ) ∥ 2 , ε v } , (79) \mathbf{v}_j^{(h)} =
\frac{\bar{\mathbf{v}}_j^{(h)}}{\max\left\{\left\lVert\bar{\mathbf{v}}_j^{(h)}\right\rVert_2,\varepsilon_v\right\}}, \tag*{(79)} v j ( h ) = max { v ˉ j ( h ) 2 , ε v } v ˉ j ( h ) , (79)
where ε v = 10 − 12 \varepsilon_v = 10^{-12} ε v = 1 0 − 12 is the numerical stabiliser used by the implementation. Hence ∥ v j ( h ) ∥ 2 ≤ 1 \lVert\mathbf{v}^{(h)}_j \rVert_2 \le1 ∥ v j ( h ) ∥ 2 ≤ 1 for all h h h and j j j .
For each head, the cross-attention output is computed using a bounded activation applied to the scaled dot products:
Att ( h ) ( q i ( h ) , k 1 : n c ( h ) , v 1 : n c ( h ) ) = ∑ j = 1 n c g ( q i ( h ) , k j ( h ) ) v j ( h ) , (80) \operatorname{Att}^{(h)}\left(\mathbf{q}^{(h)}_i,\mathbf{k}^{(h)}_{1:n_c},\mathbf{v}^{(h)}_{1:n_c}\right) = \sum_{j=1}^{n_c} g\left(\mathbf{q}^{(h)}_i,\mathbf{k}^{(h)}_j\right)\mathbf{v}^{(h)}_j, \tag*{(80)} Att ( h ) ( q i ( h ) , k 1 : n c ( h ) , v 1 : n c ( h ) ) = j = 1 ∑ n c g ( q i ( h ) , k j ( h ) ) v j ( h ) , (80)
where
g ( q , k ) = tanh ( ⟨ q , k ⟩ d h ) . (81) g(\mathbf{q},\mathbf{k}) = \tanh\left(\frac{\langle\mathbf{q},\mathbf{k}\rangle}{\sqrt{d_h}}\right). \tag*{(81)} g ( q , k ) = tanh ( d h ⟨ q , k ⟩ ) . (81)
Unlike standard transformer attention, these coefficients are not normalised across j j j ; they are simply bounded by the tanh nonlinearity. Consequently, each summand in Eq. (80) depends on exactly one context token and hence on exactly one individual’s row in the private context set. Moreover,
∥ g ( q i ( h ) , k j ( h ) ) v j ( h ) ∥ 2 = ∣ g ( q i ( h ) , k j ( h ) ) ∣ ∥ v j ( h ) ∥ 2 ≤ 1. (82) \left\lVert g\left(\mathbf{q}^{(h)}_i,\mathbf{k}^{(h)}_j\right)\mathbf{v}^{(h)}_j \right\rVert_2 = \left|g\left(\mathbf{q}^{(h)}_i,\mathbf{k}^{(h)}_j\right)\right|\left\lVert\mathbf{v}^{(h)}_j\right\rVert_2 \le1. \tag*{(82)} g ( q i ( h ) , k j ( h ) ) v j ( h ) 2 = g ( q i ( h ) , k j ( h ) ) v j ( h ) 2 ≤ 1. (82)
This bounded-contribution property is what makes the representation amenable to DP.
The head outputs are then concatenated across h = 1 , … , H h = 1,\ldots,H h = 1 , … , H into the pre-noise attention output a i \mathbf{a}_i a i , distinct from the complete block output s ~ i ( ℓ ) \widetilde{\mathbf{s}}^{(\ell)}_i s i ( ℓ ) used in the architecture below:
a i = [ a i ( 1 ) , … , a i ( H ) ] ∈ R H d h , (83) \mathbf{a}_i = \left[\mathbf{a}^{(1)}_i,\ldots,\mathbf{a}^{(H)}_i\right] \in\mathbb{R}^{Hd_h}, \tag*{(83)} a i = [ a i ( 1 ) , … , a i ( H ) ] ∈ R H d h , (83)
where
a i ( h ) : = Att ( h ) ( q i ( h ) , k 1 : n c ( h ) , v 1 : n c ( h ) ) (84) \mathbf{a}^{(h)}_i := \operatorname{Att}^{(h)}\left(\mathbf{q}^{(h)}_i,\mathbf{k}^{(h)}_{1:n_c},\mathbf{v}^{(h)}_{1:n_c}\right) \tag*{(84)} a i ( h ) := Att ( h ) ( q i ( h ) , k 1 : n c ( h ) , v 1 : n c ( h ) ) (84)
denotes the h h h -th pre-noise head output for query i i i . Gaussian noise is added to this concatenated representation; the subscript attn distinguishes this intermediate attention output from the saved layer states s ~ i ( ℓ ) \widetilde{\mathbf{s}}^{(\ell)}_i s i ( ℓ ) defined below:
s ~ i , a t t n = a i + ξ i , ξ i ∼ N ( 0 , σ 2 I H d h ) , (85) \widetilde{\mathbf{s}}_{i,\mathrm{attn}} = \mathbf{a}_i + \boldsymbol{\xi}_i,\qquad\boldsymbol{\xi}_i \sim\mathcal{N}\left(\mathbf{0},\sigma^2 I_{Hd_h}\right), \tag*{(85)} s i , attn = a i + ξ i , ξ i ∼ N ( 0 , σ 2 I H d h ) , (85)
where, jointly across the m m m summary tokens, the concatenated noise vector satisfies
ξ 1 : m ∼ N ( 0 , σ 2 I m H d h ) . (86) \boldsymbol{\xi}_{1:m} \sim\mathcal{N}\left(\mathbf{0},\sigma^2 I_{mHd_h}\right). \tag*{(86)} ξ 1 : m ∼ N ( 0 , σ 2 I m H d h ) . (86)
Thus, the noise coordinates, including the blocks associated with distinct summary tokens, are mutually independent. Although each per-row contribution in DP-MHCA is bounded, the aggregated pre-noise summary can still have a norm that varies substantially across inputs. This variability is beneficial for improving the signal-to-noise ratio (SNR) when the context tokens are more informative, but after Gaussian perturbation a normalisation step is useful to stabilise the noisy attention-output norms before the residual and feed-forward computations. For this reason, we first compute the maximum Euclidean norm across the perturbed tokens and then rescale each perturbed token by
s ~ i , a t t n ← G s ~ i , a t t n max k = 1 , … , m ∥ s ~ k , a t t n ∥ 2 + ε s , ε s = 10 − 6 . (87) \widetilde{\mathbf{s}}_{i,\mathrm{attn}} \leftarrow\frac{G\widetilde{\mathbf{s}}_{i,\mathrm{attn}}}{\max_{k=1,\ldots,m}\lVert\widetilde{\mathbf{s}}_{k,\mathrm{attn}}\rVert_2+\varepsilon_s},\qquad\varepsilon_s = 10^{-6}. \tag*{(87)} s i , attn ← max k = 1 , … , m ∥ s k , attn ∥ 2 + ε s G s i , attn , ε s = 1 0 − 6 . (87)
Thus, after this optional step, the largest token norm is strictly below and, when the maximum pre-normalisation norm is large relative to ε s \varepsilon_s ε s , approximately equal to G G G . We set G = 512 G = 512 G = 512 in all reported experiments. Finally, the resulting vector is mapped back to the original token dimension by an output projection
W O ∈ R d t o k × H d h , o i = W O s ~ i , a t t n ∈ R d t o k . (88) W_O \in\mathbb{R}^{d_{\mathrm{tok}}\times Hd_h},\qquad\mathbf{o}_i = W_O\widetilde{\mathbf{s}}_{i,\mathrm{attn}} \in\mathbb{R}^{d_{\mathrm{tok}}}. \tag*{(88)} W O ∈ R d tok × H d h , o i = W O s i , attn ∈ R d tok . (88)
In the benchmark configuration, H d h = d t o k = 256 Hd_h = d_{\mathrm{tok}} = 256 H d h = d tok = 256 and this output map is the identity. Thus, the DP mechanism in DP-MHCA is applied after the bounded cross-attention computation in R H d h \mathbb{R}^{Hd_h} R H d h and before any output mapping back to the token space R d t o k \mathbb{R}^{d_{\mathrm{tok}}} R d tok .
For the following results, we consider the deterministic DP-MHCA map before Gaussian perturbation, optional normalisation, and output projection, conditional on a fixed supplied query sequence r 1 : m \mathbf{r}_{1:m} r 1 : m . Writing
a 1 : m ( D c ; r 1 : m ) = ( a 1 ( D c ; r 1 : m ) , … , a m ( D c ; r 1 : m ) ) ∈ R m H d h , (89) \mathbf{a}_{1:m}(\mathcal{D}_c;\mathbf{r}_{1:m}) = \left(\mathbf{a}_1(\mathcal{D}_c;\mathbf{r}_{1:m}),\ldots,\mathbf{a}_m(\mathcal{D}_c;\mathbf{r}_{1:m})\right) \in\mathbb{R}^{mHd_h}, \tag*{(89)} a 1 : m ( D c ; r 1 : m ) = ( a 1 ( D c ; r 1 : m ) , … , a m ( D c ; r 1 : m ) ) ∈ R m H d h , (89)
we treat a 1 : m ( D c ; r 1 : m ) \mathbf{a}_{1:m}(\mathcal{D}_c;\mathbf{r}_{1:m}) a 1 : m ( D c ; r 1 : m ) as the concatenation of the m m m pre-noise attention outputs defined above.
Privacy and utility guarantees.
Theorem S3.1 (Sensitivity of pre-noise DP-MHCA). Fix any query sequence r 1 : m \mathbf{r}_{1:m} r 1 : m . Under substitute adjacency, the ℓ 2 \ell_2 ℓ 2 -sensitivity of the deterministic pre-noise DP-MHCA map with respect to the private context dataset satisfies
Δ 2 ( a 1 : m ( ⋅ ; r 1 : m ) ) ≤ 2 H m . (90) \Delta_2(\mathbf{a}_{1:m}(\cdot;\mathbf{r}_{1:m})) \le2\sqrt{Hm}. \tag*{(90)} Δ 2 ( a 1 : m ( ⋅ ; r 1 : m )) ≤ 2 H m . (90) Proof. Let D c \mathcal{D}_c D c and D c ′ \mathcal{D}'_c D c ′ be neighbouring context datasets under substitute adjacency, so they differ in exactly one row. Since all operations before the attention sum are applied row-wise, this changes exactly one context token in the sequence z 1 : n c c \mathbf{z}^{c}_{1:n_c} z 1 : n c c . Let this differing token occur at index j ⋆ j^{\star} j ⋆ . For any query index i i i and head h h h , the difference between the two head outputs is
Att ( h ) ( q i ( h ) , k 1 : n c ( h ) , v 1 : n c ( h ) ) − Att ( h ) ( q i ( h ) , k 1 : n c ′ ( h ) , v 1 : n c ′ ( h ) ) \operatorname{Att}^{(h)}\left(\mathbf{q}^{(h)}_i,\mathbf{k}^{(h)}_{1:n_c},\mathbf{v}^{(h)}_{1:n_c}\right)-\operatorname{Att}^{(h)}\left(\mathbf{q}^{(h)}_i,\mathbf{k}^{\prime(h)}_{1:n_c},\mathbf{v}^{\prime(h)}_{1:n_c}\right) Att ( h ) ( q i ( h ) , k 1 : n c ( h ) , v 1 : n c ( h ) ) − Att ( h ) ( q i ( h ) , k 1 : n c ′ ( h ) , v 1 : n c ′ ( h ) ) = g ( q i ( h ) , k j ⋆ ( h ) ) v j ⋆ ( h ) − g ( q i ( h ) , k j ⋆ ′ ( h ) ) v j ⋆ ′ ( h ) , (91) = g\left(\mathbf{q}^{(h)}_i,\mathbf{k}^{(h)}_{j^{\star}}\right)\mathbf{v}^{(h)}_{j^{\star}}-g\left(\mathbf{q}^{(h)}_i,\mathbf{k}^{\prime(h)}_{j^{\star}}\right)\mathbf{v}^{\prime(h)}_{j^{\star}}, \tag*{(91)} = g ( q i ( h ) , k j ⋆ ( h ) ) v j ⋆ ( h ) − g ( q i ( h ) , k j ⋆ ′ ( h ) ) v j ⋆ ′ ( h ) , (91) because all remaining summands are identical and cancel. By the triangle inequality and the bound established above,
∥ Att ( h ) ( q i ( h ) , k 1 : n c ( h ) , v 1 : n c ( h ) ) − Att ( h ) ( q i ( h ) , k 1 : n c ′ ( h ) , v 1 : n c ′ ( h ) ) ∥ 2 \left\|\operatorname{Att}^{(h)}\left(\mathbf{q}^{(h)}_i,\mathbf{k}^{(h)}_{1:n_c},\mathbf{v}^{(h)}_{1:n_c}\right)-\operatorname{Att}^{(h)}\left(\mathbf{q}^{(h)}_i,\mathbf{k}^{\prime(h)}_{1:n_c},\mathbf{v}^{\prime(h)}_{1:n_c}\right)\right\|_2 Att ( h ) ( q i ( h ) , k 1 : n c ( h ) , v 1 : n c ( h ) ) − Att ( h ) ( q i ( h ) , k 1 : n c ′ ( h ) , v 1 : n c ′ ( h ) ) 2 ≤ ∥ g ( q i ( h ) , k j ⋆ ( h ) ) v j ⋆ ( h ) ∥ 2 + ∥ g ( q i ( h ) , k j ⋆ ′ ( h ) ) v j ⋆ ′ ( h ) ∥ 2 ≤ 2. (92) \le\left\|g\left(\mathbf{q}^{(h)}_i,\mathbf{k}^{(h)}_{j^{\star}}\right)\mathbf{v}^{(h)}_{j^{\star}}\right\|_2+\left\|g\left(\mathbf{q}^{(h)}_i,\mathbf{k}^{\prime(h)}_{j^{\star}}\right)\mathbf{v}^{\prime(h)}_{j^{\star}}\right\|_2\le2. \tag*{(92)} ≤ g ( q i ( h ) , k j ⋆ ( h ) ) v j ⋆ ( h ) 2 + g ( q i ( h ) , k j ⋆ ′ ( h ) ) v j ⋆ ′ ( h ) 2 ≤ 2. (92) Thus each head of each summary token changes by at most 2 in ℓ 2 \ell_2 ℓ 2 -norm. Since a 1 : m ( D c ; r 1 : m ) \mathbf{a}_{1:m}(\mathcal{D}_c;\mathbf{r}_{1:m}) a 1 : m ( D c ; r 1 : m ) is obtained by concatenating the m H mH m H head outputs, the squared ℓ 2 \ell_2 ℓ 2 -difference of the full pre-noise representation is at most
∑ i = 1 m ∑ h = 1 H 2 2 = 4 H m . (93) \sum_{i=1}^{m}\sum_{h=1}^{H}2^2=4Hm. \tag*{(93)} i = 1 ∑ m h = 1 ∑ H 2 2 = 4 H m . (93) Taking square roots yields
∥ a 1 : m ( D c ; r 1 : m ) − a 1 : m ( D c ′ ; r 1 : m ) ∥ 2 ≤ 2 H m , (94) \left\|\mathbf{a}_{1:m}(\mathcal{D}_c;\mathbf{r}_{1:m})-\mathbf{a}_{1:m}(\mathcal{D}'_c;\mathbf{r}_{1:m})\right\|_2\le2\sqrt{Hm}, \tag*{(94)} ∥ a 1 : m ( D c ; r 1 : m ) − a 1 : m ( D c ′ ; r 1 : m ) ∥ 2 ≤ 2 H m , (94) which proves the claim.
An important consequence of Theorem S3.1 is that the sensitivity bound does not depend on the context size n c n_c n c . Thus, increasing the number of context rows need not increase the DP noise scale, even though additional informative rows can strengthen the signal accumulated by the attention mechanism.
Theorem S3.2 (μ \mu μ -GDP of the PrivTab Encoder). Let L m a i n ≥ 1 L_{\mathrm{main}}\ge1 L main ≥ 1 and μ > 0 \mu>0 μ > 0 . Under substitute adjacency, if the encoder contains L m a i n L_{\mathrm{main}} L main DP-MHCA layers, and each layer ℓ ∈ { 1 , … , L m a i n } \ell\in\{1,\ldots,L_{\mathrm{main}}\} ℓ ∈ { 1 , … , L main } adds isotropic Gaussian noise with standard deviation σ ℓ = 2 H m L m a i n / μ \sigma_\ell=2\sqrt{HmL_{\mathrm{main}}}/\mu σ ℓ = 2 H m L main / μ to the full concatenated summary representation, with fresh noise independent across layers and of all preceding mechanism randomness, then the overall PrivTab encoder satisfies μ \mu μ -GDP with respect to D c \mathcal{D}_c D c .
Proof. We first note that all row embedding and token encoding operations preceding the DP-MHCA layer are applied point-wise (row-wise) to the private context dataset D c \mathcal{D}_c D c . Under substitute adjacency, two adjacent context datasets D c ≃ D c ′ \mathcal{D}_c\simeq\mathcal{D}'_c D c ≃ D c ′ differ in exactly one row. Because the preprocessing is point-wise, this single-row difference propagates to a difference in at most one context token in the resulting sequence of context tokens z 1 : n c c \mathbf{z}^{c}_{1:n_c} z 1 : n c c .
Fix any private layer ℓ \ell ℓ . Conditional on all previous DP releases, the query sequence supplied to layer ℓ \ell ℓ is fixed, although it may depend adaptively on earlier private outputs. Therefore, by Theorem S3.1, the conditional ℓ 2 \ell_2 ℓ 2 -sensitivity of the pre-noise summary representation at layer ℓ \ell ℓ satisfies Δ 2 ≤ 2 H m \Delta_2\le2\sqrt{Hm} Δ 2 ≤ 2 H m with respect to the private context dataset.
Under the Gaussian mechanism, adding independent Gaussian noise with standard deviation σ ℓ \sigma_\ell σ ℓ to a query with ℓ 2 \ell_2 ℓ 2 -sensitivity Δ 2 \Delta_2 Δ 2 satisfies μ ℓ \mu_\ell μ ℓ -GDP with μ ℓ = Δ 2 σ ℓ \mu_\ell=\frac{\Delta_2}{\sigma_\ell} μ ℓ = σ ℓ Δ 2 [5 ] . Substituting the noise standard deviation, we have:
μ ℓ ≤ 2 H m σ ℓ = 2 H m 2 H m L m a i n μ = μ L m a i n . (95) \mu_\ell\le\frac{2\sqrt{Hm}}{\sigma_\ell}=\frac{2\sqrt{Hm}}{\frac{2\sqrt{HmL_{\mathrm{main}}}}{\mu}}=\frac{\mu}{\sqrt{L_{\mathrm{main}}}}. \tag*{(95)} μ ℓ ≤ σ ℓ 2 H m = μ 2 H m L main 2 H m = L main μ . (95) Apart from the DP-MHCA accesses to the private context, all intermediate computations in the encoder and decoder are post-processing of previous private releases. In particular, standard self-attention, target-side
cross-attention, feed-forward layers, and the MLP decoder do not consume additional privacy budget beyond the DP-MHCA layers themselves. Since the query sequence of a later DP-MHCA layer may depend on earlier private releases, the resulting composition is adaptive.
By the adaptive composition theorem of GDP (Theorem S1.3), the composition of the L m a i n L_{\mathrm{main}} L main private DP-MHCA mechanisms yields an overall privacy parameter of:
μ t o t a l = ∑ ℓ = 1 L m a i n μ ℓ 2 ≤ L m a i n ( μ L m a i n ) 2 = μ . (96) \mu_{\mathrm{total}} = \sqrt{\sum_{\ell=1}^{L_{\mathrm{main}}} \mu_{\ell}^{2}} \le\sqrt{L_{\mathrm{main}}\left(\frac{\mu}{\sqrt{L_{\mathrm{main}}}}\right)^{2}} = \mu. \tag*{(96)} μ total = ℓ = 1 ∑ L main μ ℓ 2 ≤ L main ( L main μ ) 2 = μ . (96)
Therefore, the PrivTab encoder satisfies μ \mu μ -GDP.
This result lifts the per-layer sensitivity bound to an end-to-end privacy guarantee: with the stated noise allocation, the entire encoder satisfies the selected μ \mu μ -GDP budget under substitute adjacency. All subsequent target-side computation is post-processing and therefore incurs no further privacy loss.
Theorem S3.3 (Directional SNR of DP-MHCA). Suppose σ > 0 \sigma> 0 σ > 0 , and suppose there exist a unit vector u ∈ R d h \mathbf{u} \in\mathbb{R}^{d_h} u ∈ R d h , constants c , κ > 0 c, \kappa> 0 c , κ > 0 , an index set I ⊆ { 1 , … , n c } \mathcal{I} \subseteq\{1,\ldots,n_c\} I ⊆ { 1 , … , n c } , and a constant R ≥ 0 R \ge0 R ≥ 0 such that g ( q i ( h ) , k j ( h ) ) ≥ c g(\mathbf{q}_i^{(h)}, \mathbf{k}_j^{(h)}) \ge c g ( q i ( h ) , k j ( h ) ) ≥ c and ⟨ u , v j ( h ) ⟩ ≥ κ \langle\mathbf{u}, \mathbf{v}_j^{(h)} \rangle\ge\kappa ⟨ u , v j ( h ) ⟩ ≥ κ for all j ∈ I j \in\mathcal{I} j ∈ I , and
∑ j ∉ I g ( q i ( h ) , k j ( h ) ) ⟨ u , v j ( h ) ⟩ ≥ − R . (97) \sum_{j \notin\mathcal{I}} g(\mathbf{q}_i^{(h)}, \mathbf{k}_j^{(h)}) \langle\mathbf{u}, \mathbf{v}_j^{(h)} \rangle\ge-R. \tag*{(97)} j ∈ / I ∑ g ( q i ( h ) , k j ( h ) ) ⟨ u , v j ( h ) ⟩ ≥ − R . (97) Then , if Gaussian noise with covariance σ 2 I d h \sigma^2 I_{d_h} σ 2 I d h is added to this head output, the directional signal-to-noise ratio
S N R u : = ∣ ⟨ u , a i ( h ) ⟩ ∣ σ ≥ max { c κ ∣ I ∣ − R , 0 } σ . (98) \mathrm{SNR}_{\mathbf{u}} := \frac{\left|\langle\mathbf{u}, \mathbf{a}_i^{(h)} \rangle\right|}{\sigma} \ge\frac{\max\{c\kappa|\mathcal{I}|-R,0\}}{\sigma}. \tag*{(98)} SNR u := σ ⟨ u , a i ( h ) ⟩ ≥ σ max { c κ ∣ I ∣ − R , 0 } . (98)
Proof. Taking the inner product of Eq. (80) with u \mathbf{u} u gives
⟨ u , a i ( h ) ⟩ = ∑ j = 1 n c g ( q i ( h ) , k j ( h ) ) ⟨ u , v j ( h ) ⟩ = ∑ j ∈ I g ( q i ( h ) , k j ( h ) ) ⟨ u , v j ( h ) ⟩ + ∑ j ∉ I g ( q i ( h ) , k j ( h ) ) ⟨ u , v j ( h ) ⟩ . (99) \begin{aligned}
\langle\mathbf{u}, \mathbf{a}_i^{(h)} \rangle
&= \sum_{j=1}^{n_c} g(\mathbf{q}_i^{(h)}, \mathbf{k}_j^{(h)}) \langle\mathbf{u}, \mathbf{v}_j^{(h)} \rangle\\
&= \sum_{j \in\mathcal{I}} g(\mathbf{q}_i^{(h)}, \mathbf{k}_j^{(h)}) \langle\mathbf{u}, \mathbf{v}_j^{(h)} \rangle+ \sum_{j \notin\mathcal{I}} g(\mathbf{q}_i^{(h)}, \mathbf{k}_j^{(h)}) \langle\mathbf{u}, \mathbf{v}_j^{(h)} \rangle. \tag*{(99)}
\end{aligned} ⟨ u , a i ( h ) ⟩ = j = 1 ∑ n c g ( q i ( h ) , k j ( h ) ) ⟨ u , v j ( h ) ⟩ = j ∈ I ∑ g ( q i ( h ) , k j ( h ) ) ⟨ u , v j ( h ) ⟩ + j ∈ / I ∑ g ( q i ( h ) , k j ( h ) ) ⟨ u , v j ( h ) ⟩ . (99)
For every j ∈ I j \in\mathcal{I} j ∈ I , the corresponding summand is at least c κ c\kappa c κ . Hence
⟨ u , a i ( h ) ⟩ ≥ ∑ j ∈ I c κ − R = c κ ∣ I ∣ − R . (100) \langle\mathbf{u}, \mathbf{a}_i^{(h)} \rangle\ge\sum_{j \in\mathcal{I}} c\kappa- R = c\kappa|\mathcal{I}| - R. \tag*{(100)} ⟨ u , a i ( h ) ⟩ ≥ j ∈ I ∑ c κ − R = c κ ∣ I ∣ − R . (100)
If isotropic Gaussian noise ξ ∼ N ( 0 , σ 2 I d h ) \boldsymbol{\xi} \sim\mathcal{N}(0,\sigma^2 I_{d_h}) ξ ∼ N ( 0 , σ 2 I d h ) is then added, the projected noise satisfies ⟨ u , ξ ⟩ ∼ N ( 0 , σ 2 ) \langle\mathbf{u}, \boldsymbol{\xi} \rangle\sim\mathcal{N}(0,\sigma^2) ⟨ u , ξ ⟩ ∼ N ( 0 , σ 2 ) because ∥ u ∥ 2 = 1 \lVert\mathbf{u}\rVert_2 = 1 ∥ u ∥ 2 = 1 . Therefore,
∣ ⟨ u , a i ( h ) ⟩ ∣ ≥ max { c κ ∣ I ∣ − R , 0 } , (101) \left|\langle\mathbf{u}, \mathbf{a}_i^{(h)} \rangle\right| \ge\max\{c\kappa|\mathcal{I}|-R,0\}, \tag*{(101)} ⟨ u , a i ( h ) ⟩ ≥ max { c κ ∣ I ∣ − R , 0 } , (101)
which yields the stated lower bound on S N R u \mathrm{SNR}_{\mathbf{u}} SNR u .
The theorem formalises when additional context is useful: rows whose values align with the query direction reinforce one another, whereas the remaining rows can contribute only the bounded offset R R R . Thus, the directional signal grows with the number of aligned rows while the noise level is fixed by the privacy mechanism.
Together, the sensitivity and SNR results show that, when a fixed fraction of context rows is aligned with a query and R R R remains bounded independently of n c n_c n c , the directional signal grows linearly with the number of informative rows without increasing the required DP noise scale.
Reference Implementation
The following listing gives the complete private summary module of the current PrivTab implementation, starting from already embedded context rows. The PrivateSummaryModule class initialises 128 learned pseudo-tokens, applies three private cross-attention and latent self-attention blocks, then applies two further latent self-attention blocks. It returns all five summary states used by the target-side predictor. Its DPMHCA class uses one 256-dimensional head with bounded tanh attention, Gaussian perturbation, and optional post-noise normalisation; the noisy output is returned directly without an output projection. The module calibrates the per-layer noise standard deviation from the supplied positive μ \mu μ using Theorems S3.1 and S3.2. The privacy guarantee assumes fixed model weights, independently embedded context rows, and fresh independent standard Gaussian noise at every private layer. Dataset-level preprocessing is outside this listing and must use public or separately privatised statistics. Training uses the default PyTorch noise sampler; private releases supply a secure Gaussian sampler.
"""PrivTab private summary module for already embedded context rows.
The module uses three DP-MHCA layers and two further self-attention layers.
Context embeddings must be row-wise and model weights fixed for the stated
privacy guarantee. The noise sampler must return fresh independent standard
Gaussians on each call. For a private release, pass a secure sampler; the
default PyTorch sampler matches training and benchmark evaluation.
"""
import math
import torch
from torch import nn
from torch.nn import functional as F
class DPMHCA(nn.Module):
"""Bounded cross-attention followed by Gaussian noise."""
def __init__(self):
super().__init__()
self.to_q = nn.Linear(256, 256, bias=False)
self.to_k = nn.Linear(256, 256, bias=False)
self.to_v = nn.Linear(256, 256, bias=False)
def forward(self, xq, xkv, sigma, normalize=False, noise_sampler=torch.randn_like):
"""Return private summaries; ``sigma`` has one entry per batch item."""
q = self.to_q(xq)
k = self.to_k(xkv)
v = F.normalize(self.to_v(xkv), p=2, dim=-1)
out = torch.tanh((q @ k.transpose(-1, -2)) * 256**-0.5) @ v
noise = noise_sampler(out)
out = out + noise * sigma[:, None, None]
if normalize:
norm = torch.linalg.vector_norm(out, dim=-1, keepdim=True).amax(
dim=1, keepdim=True
)
out = out / (norm + 1e-6) * 512
return out
class SelfAttention(nn.Module):
"""Standard four-head attention on the summary tokens."""
def __init__(self):
super().__init__()
self.to_q = nn.Linear(256, 256, bias=False)
self.to_k = nn.Linear(256, 256, bias=False)
self.to_v = nn.Linear(256, 256, bias=False)
self.to_out = nn.Sequential(nn.Linear(256, 256), nn.Dropout(0))
def forward(self, xq, xkv, sigma=None, normalize=False, noise_sampler=None):
def heads(x):
return x.reshape(x.shape[0], x.shape[1], 4, 64).transpose(1, 2)
q = heads(self.to_q(xq))
k = heads(self.to_k(xkv))
v = heads(self.to_v(xkv))
out = F.scaled_dot_product_attention(q, k, v, scale=64**-0.5)
out = out.transpose(1, 2).reshape(xq.shape[0], xq.shape[1], 256)
return self.to_out(out)
class SwiGLU(nn.Module):
def __init__(self):
super().__init__()
self.proj_a = nn.Linear(256, 512)
self.proj_b = nn.Linear(256, 512)
def forward(self, x):
return F.silu(self.proj_a(x)) * self.proj_b(x)
class AttentionLayer(nn.Module):
"""Pre-normalized attention and feed-forward residual block."""
def __init__(self, attention):
super().__init__()
self.attn = attention
self.ff_block = nn.Sequential(SwiGLU(), nn.Dropout(0), nn.Linear(512, 256), nn.Dropout(0))
self.norm1 = nn.LayerNorm(256)
self.norm2 = nn.LayerNorm(256)
def forward(self, xq, xkv=None, sigma=None, normalize=False, noise_sampler=None):
xkv = xq if xkv is None else xkv
xq = xq + self.attn(self.norm1(xq), self.norm1(xkv), sigma, normalize, noise_sampler)
return xq + self.ff_block(self.norm2(xq))
class PrivateSummaryModule(nn.Module):
"""Return the five summary states consumed by the target-side predictor."""
def __init__(self):
super().__init__()
self.latents = nn.Parameter(torch.randn(128, 256))
self.mhca_ctoq_layers = nn.ModuleList([AttentionLayer(DPMHCA()) for _ in range(3)])
self.mhsa_layers = nn.ModuleList([AttentionLayer(SelfAttention()) for _ in range(3)])
self.post_processing_mhsa_layers = nn.ModuleList(
[AttentionLayer(SelfAttention()) for _ in range(2)]
)
def forward(self, context, mu, normalize=False, noise_sampler=torch.randn_like):
"""Summarize embedded context; ``mu`` has one GDP budget per batch item."""
sigma = 2 * math.sqrt(128 * 3) / mu
latents = self.latents.unsqueeze(0).expand(context.shape[0], -1, -1)
states = []
for private, self_attention in zip(self.mhca_ctoq_layers, self.mhsa_layers):
latents = self_attention(
private(latents, context, sigma, normalize, noise_sampler)
)
states.append(latents)
for self_attention in self.post_processing_mhsa_layers:
latents = self_attention(latents)
states.append(latents)
return torch.stack(states, dim=1)
PrivTab Architecture
PrivTab compresses the private context dataset D c \mathcal{D}_c D c into five fixed-size privatised summary states using privacy-preserving attention layers. We denote their collection by S ~ \widetilde{\mathcal{S}} S and the state after layer ℓ \ell ℓ by s ~ 1 : m ( ℓ ) \widetilde{\mathbf{s}}_{1:m}^{(\ell)} s 1 : m ( ℓ ) . The model then classifies public target queries using only non-private post-processing. The detailed architecture is shown in Figure E1 . It has three components: transformer building blocks, a Perceiver-style private encoder, and an output decoder.
Transformer Building Blocks
We use a pre-normalisation configuration (Ba et al. [58 ] ), in which Layer Normalisation (LN) is applied before each attention or feed-forward block and the residual connection is added afterwards.
For standard multi-head self-attention (MHSA) and multi-head cross-attention (MHCA), we use the standard transformer formulation (Vaswani et al. [30 ] ). Let r 1 : m \mathbf{r}_{1:m} r 1 : m denote a sequence of query tokens and let z 1 : n \mathbf{z}_{1:n} z 1 : n denote a sequence of key–value tokens, all in R d t o k \mathbb{R}^{d_{\mathrm{tok}}} R d tok . For multi-head cross-attention, the updated representation for query token i ∈ { 1 , … , m } i \in\{1,\ldots,m\} i ∈ { 1 , … , m } is computed head-by-head and then concatenated:
MHCA ( r i ; z 1 : n ) = W O [ a i ( 1 ) , … , a i ( H ) ] + b O ∈ R d t o k (102) \operatorname{MHCA}(\mathbf{r}_i;\mathbf{z}_{1:n}) = \mathbf{W}_{O}\left[\mathbf{a}_i^{(1)},\ldots,\mathbf{a}_i^{(H)}\right] + \mathbf{b}_{O} \in\mathbb{R}^{d_{\mathrm{tok}}} \tag*{(102)} MHCA ( r i ; z 1 : n ) = W O [ a i ( 1 ) , … , a i ( H ) ] + b O ∈ R d tok (102)
where W O ∈ R d t o k × H d h \mathbf{W}_{O} \in\mathbb{R}^{d_{\mathrm{tok}}\times Hd_h} W O ∈ R d tok × H d h and b O ∈ R d t o k \mathbf{b}_{O} \in\mathbb{R}^{d_{\mathrm{tok}}} b O ∈ R d tok are the learnable output projection parameters. Each head output a i ( h ) ∈ R d h \mathbf{a}_i^{(h)} \in\mathbb{R}^{d_h} a i ( h ) ∈ R d h for h = 1 , … , H h=1,\ldots,H h = 1 , … , H is given by
a i ( h ) = ∑ j = 1 n α i , j ( h ) v j ( h ) , (103) \mathbf{a}_i^{(h)} = \sum_{j=1}^{n}\alpha_{i,j}^{(h)}\mathbf{v}_j^{(h)}, \tag*{(103)} a i ( h ) = j = 1 ∑ n α i , j ( h ) v j ( h ) , (103)
with key, query, and value projections:
q i ( h ) = W Q ( h ) r i , k j ( h ) = W K ( h ) z j , v j ( h ) = W V ( h ) z j , (104) \mathbf{q}^{(h)}_i = \mathbf{W}^{(h)}_Q r_i,\qquad\mathbf{k}^{(h)}_j = \mathbf{W}^{(h)}_K z_j,\qquad\mathbf{v}^{(h)}_j = \mathbf{W}^{(h)}_V z_j, \tag*{(104)} q i ( h ) = W Q ( h ) r i , k j ( h ) = W K ( h ) z j , v j ( h ) = W V ( h ) z j , (104)
using learnable projections W Q ( h ) , W K ( h ) , W V ( h ) ∈ R d h × d t o k \mathbf{W}^{(h)}_Q,\mathbf{W}^{(h)}_K,\mathbf{W}^{(h)}_V \in\mathbb{R}^{d_h \times d_{\mathrm{tok}}} W Q ( h ) , W K ( h ) , W V ( h ) ∈ R d h × d tok . The attention weights α i , j ( h ) \alpha^{(h)}_{i,j} α i , j ( h ) are
α i , j ( h ) = exp ( ⟨ q i ( h ) , k j ( h ) ⟩ d h ) ∑ j ′ = 1 n exp ( ⟨ q i ( h ) , k j ′ ( h ) ⟩ d h ) . (105) \alpha^{(h)}_{i,j} = \frac{\exp\left(\frac{\langle\mathbf{q}^{(h)}_i,\mathbf{k}^{(h)}_j\rangle}{\sqrt{d_h}}\right)}{\sum_{j'=1}^{n}\exp\left(\frac{\langle\mathbf{q}^{(h)}_i,\mathbf{k}^{(h)}_{j'}\rangle}{\sqrt{d_h}}\right)}. \tag*{(105)} α i , j ( h ) = ∑ j ′ = 1 n exp ( d h ⟨ q i ( h ) , k j ′ ( h ) ⟩ ) exp ( d h ⟨ q i ( h ) , k j ( h ) ⟩ ) . (105)
Multi-head self-attention is the special case in which the queries and key-values coincide:
MHSA ( r i ; r 1 : m ) = MHCA ( r i ; r 1 : m ) . (106) \operatorname{MHSA}(r_i; r_{1:m}) = \operatorname{MHCA}(r_i; r_{1:m}). \tag*{(106)} MHSA ( r i ; r 1 : m ) = MHCA ( r i ; r 1 : m ) . (106)
For the token-wise feed-forward network (FFN), we use the SwiGLU variant of the gated linear unit [59 ] . For a token representation x ∈ R d t o k \mathbf{x} \in\mathbb{R}^{d_{\mathrm{tok}}} x ∈ R d tok , the SwiGLU activation and resulting FFN output are
SwiGLU ( x ) = SiLU ( W a T x + b a ) ⊙ ( W b T x + b b ) , (107) \operatorname{SwiGLU}(\mathbf{x}) = \operatorname{SiLU}\left(\mathbf{W}_a^{\mathsf{T}}\mathbf{x} + \mathbf{b}_a\right) \odot\left(\mathbf{W}_b^{\mathsf{T}}\mathbf{x} + \mathbf{b}_b\right), \tag*{(107)} SwiGLU ( x ) = SiLU ( W a T x + b a ) ⊙ ( W b T x + b b ) , (107)
FFN ( x ) = W o T SwiGLU ( x ) + b o , (108) \operatorname{FFN}(\mathbf{x}) = \mathbf{W}_o^{\mathsf{T}}\operatorname{SwiGLU}(\mathbf{x}) + \mathbf{b}_o, \tag*{(108)} FFN ( x ) = W o T SwiGLU ( x ) + b o , (108)
where SiLU ( t ) = t ⊙ sigmoid ( t ) \operatorname{SiLU}(t) = t \odot\operatorname{sigmoid}(t) SiLU ( t ) = t ⊙ sigmoid ( t ) is the sigmoid linear unit, with sigmoid ( t ) = ( 1 + e − t ) − 1 \operatorname{sigmoid}(t) = (1 + e^{-t})^{-1} sigmoid ( t ) = ( 1 + e − t ) − 1 applied coordinate-wise; W a , W b ∈ R d t o k × d f f n \mathbf{W}_a,\mathbf{W}_b \in\mathbb{R}^{d_{\mathrm{tok}} \times d_{\mathrm{ffn}}} W a , W b ∈ R d tok × d ffn and W o ∈ R d f f n × d t o k \mathbf{W}_o \in\mathbb{R}^{d_{\mathrm{ffn}} \times d_{\mathrm{tok}}} W o ∈ R d ffn × d tok are learnable projection matrices, b a , b b ∈ R d f f n \mathbf{b}_a,\mathbf{b}_b \in\mathbb{R}^{d_{\mathrm{ffn}}} b a , b b ∈ R d ffn and b o ∈ R d t o k \mathbf{b}_o \in\mathbb{R}^{d_{\mathrm{tok}}} b o ∈ R d tok are bias vectors, and ⊙ \odot ⊙ denotes the Hadamard product. In all transformer feed-forward networks, we set d f f n = 2 d t o k d_{\mathrm{ffn}} = 2d_{\mathrm{tok}} d ffn = 2 d tok , so the hidden dimension uses a 2× expansion.
Private Perceiver Encoder
The private Perceiver encoder maps the context tokens z 1 : n c c \mathbf{z}^{c}_{1:n_c} z 1 : n c c and initial target tokens z 1 : n t t , ( 0 ) = z 1 : n t t \mathbf{z}^{t,(0)}_{1:n_t} = \mathbf{z}^{t}_{1:n_t} z 1 : n t t , ( 0 ) = z 1 : n t t to updated target representations using L m a i n = 3 L_{\mathrm{main}} = 3 L main = 3 main layers and L p o s t = 2 L_{\mathrm{post}} = 2 L post = 2 post-processing layers. In the benchmark configuration, the latent bottleneck contains m = 128 m = 128 m = 128 learned pseudo-tokens. In standard MHSA and MHCA, we use H s t d = 4 H_{\mathrm{std}} = 4 H std = 4 heads with per-head dimension d h , s t d = 64 d_{h,\mathrm{std}} = 64 d h , std = 64 , so the internal attention width is H s t d d h , s t d = 256 H_{\mathrm{std}}d_{h,\mathrm{std}} = 256 H std d h , std = 256 . In DP-MHCA, we use H D P = 1 H_{\mathrm{DP}} = 1 H DP = 1 head with per-head dimension d h , D P = 256 d_{h,\mathrm{DP}} = 256 d h , DP = 256 , so H D P d h , D P = 256 H_{\mathrm{DP}}d_{h,\mathrm{DP}} = 256 H DP d h , DP = 256 . The generic H H H and d h d_h d h in the DP-MHCA definitions and theorems above refer to H D P H_{\mathrm{DP}} H DP and d h , D P d_{h,\mathrm{DP}} d h , DP , respectively. Because the row embedding model is applied row-wise to the private context dataset D c \mathcal{D}_c D c , a single-row change between adjacent context datasets affects at most one context token in z 1 : n c c \mathbf{z}^{c}_{1:n_c} z 1 : n c c . The DP-MHCA block is therefore the component responsible for controlling the sensitivity of the privatised summary. We initialise the summary representations using the learned pseudo-tokens u 1 : m \mathbf{u}_{1:m} u 1 : m :
s ~ i ( 0 ) = u i , i = 1 , … , m . (109) \tilde{\mathbf{s}}^{(0)}_i = \mathbf{u}_i,\qquad i = 1,\ldots,m. \tag*{(109)} s ~ i ( 0 ) = u i , i = 1 , … , m . (109)
The complete blocks used in Methods are denoted by DP-MHCA b l o c k ( ℓ ) \operatorname{DP\text{-}MHCA}^{(\ell)}_{\mathrm{block}} DP - MHCA block ( ℓ ) , MHSA b l o c k ( ℓ ) \operatorname{MHSA}^{(\ell)}_{\mathrm{block}} MHSA block ( ℓ ) , and MHCA b l o c k ( ℓ ) \operatorname{MHCA}^{(\ell)}_{\mathrm{block}} MHCA block ( ℓ ) . The equations below expand these blocks into attention operations, pre-normalisation, residual updates and feed-forward networks; the attention operators DP-MHCA, MHSA, and MHCA denote only the attention operations.
For each main layer ℓ = 1 , … , L m a i n \ell= 1,\ldots,L_{\mathrm{main}} ℓ = 1 , … , L main , the summary and target tokens are updated in three stages:
DP Cross-Attention Update: The summaries attend to the private context tokens:
o i ( ℓ ) = DP-MHCA ( LN ( s ~ i ( ℓ − 1 ) ) ; LN ( z 1 : n c c ) ) , i = 1 , … , m , (110) \mathbf{o}^{(\ell)}_i = \operatorname{DP\text{-}MHCA}\left(\operatorname{LN}\left(\tilde{\mathbf{s}}^{(\ell-1)}_i\right);\operatorname{LN}\left(\mathbf{z}^{c}_{1:n_c}\right)\right),\qquad i = 1,\ldots,m, \tag*{(110)} o i ( ℓ ) = DP - MHCA ( LN ( s ~ i ( ℓ − 1 ) ) ; LN ( z 1 : n c c ) ) , i = 1 , … , m , (110)
s ^ i ( ℓ ) = s ~ i ( ℓ − 1 ) + o i ( ℓ ) , (111) \hat{\mathbf{s}}^{(\ell)}_i = \tilde{\mathbf{s}}^{(\ell-1)}_i + \mathbf{o}^{(\ell)}_i, \tag*{(111)} s ^ i ( ℓ ) = s ~ i ( ℓ − 1 ) + o i ( ℓ ) , (111)
s i ( ℓ ) = s ^ i ( ℓ ) + FFN d p ( ℓ ) ( LN ( s ^ i ( ℓ ) ) ) . (112) \mathbf{s}^{(\ell)}_i = \hat{\mathbf{s}}^{(\ell)}_i + \operatorname{FFN}^{(\ell)}_{\mathrm{dp}}\left(\operatorname{LN}\left(\hat{\mathbf{s}}^{(\ell)}_i\right)\right). \tag*{(112)} s i ( ℓ ) = s ^ i ( ℓ ) + FFN dp ( ℓ ) ( LN ( s ^ i ( ℓ ) ) ) . (112)
This DP-MHCA block is the only operation that transfers context information into the released summaries.
Latent Self-Attention Update: The summary representations interact in the latent space:
s i , s e l f ( ℓ ) = MHSA ( LN ( s i ( ℓ ) ) ; LN ( s 1 : m ( ℓ ) ) ) , i = 1 , … , m , (113) s^{(\ell)}_{i,\mathrm{self}}=\operatorname{MHSA}\left(\operatorname{LN}\left(s^{(\ell)}_i\right);\operatorname{LN}\left(s^{(\ell)}_{1:m}\right)\right),\qquad i=1,\ldots,m, \tag*{(113)} s i , self ( ℓ ) = MHSA ( LN ( s i ( ℓ ) ) ; LN ( s 1 : m ( ℓ ) ) ) , i = 1 , … , m , (113)
s ^ i ( ℓ ) = s i ( ℓ ) + s i , s e l f ( ℓ ) , (114) \hat{s}^{(\ell)}_i=s^{(\ell)}_i+s^{(\ell)}_{i,\mathrm{self}}, \tag*{(114)} s ^ i ( ℓ ) = s i ( ℓ ) + s i , self ( ℓ ) , (114)
s ~ i ( ℓ ) = s ^ i ( ℓ ) + FFN s e l f ( ℓ ) ( LN ( s ^ i ( ℓ ) ) ) . (115) \tilde{s}^{(\ell)}_i=\hat{s}^{(\ell)}_i+\operatorname{FFN}^{(\ell)}_{\mathrm{self}}\left(\operatorname{LN}\left(\hat{s}^{(\ell)}_i\right)\right). \tag*{(115)} s ~ i ( ℓ ) = s ^ i ( ℓ ) + FFN self ( ℓ ) ( LN ( s ^ i ( ℓ ) ) ) . (115)
Target Cross-Attention Update: The target tokens attend to the updated privatised summaries:
t j ( ℓ ) = MHCA ( LN ( z j t , ( ℓ − 1 ) ) ; LN ( s ~ 1 : m ( ℓ ) ) ) , j = 1 , … , n t , (116) t^{(\ell)}_j=\operatorname{MHCA}\left(\operatorname{LN}\left(z^{t,(\ell-1)}_j\right);\operatorname{LN}\left(\tilde{s}^{(\ell)}_{1:m}\right)\right),\qquad j=1,\ldots,n_t, \tag*{(116)} t j ( ℓ ) = MHCA ( LN ( z j t , ( ℓ − 1 ) ) ; LN ( s ~ 1 : m ( ℓ ) ) ) , j = 1 , … , n t , (116)
z ^ j t , ( ℓ ) = z j t , ( ℓ − 1 ) + t j ( ℓ ) , (117) \hat{z}^{t,(\ell)}_j=z^{t,(\ell-1)}_j+t^{(\ell)}_j, \tag*{(117)} z ^ j t , ( ℓ ) = z j t , ( ℓ − 1 ) + t j ( ℓ ) , (117)
z j t , ( ℓ ) = z ^ j t , ( ℓ ) + FFN t g t ( ℓ ) ( LN ( z ^ j t , ( ℓ ) ) ) . (118) z^{t,(\ell)}_j=\hat{z}^{t,(\ell)}_j+\operatorname{FFN}^{(\ell)}_{\mathrm{tgt}}\left(\operatorname{LN}\left(\hat{z}^{t,(\ell)}_j\right)\right). \tag*{(118)} z j t , ( ℓ ) = z ^ j t , ( ℓ ) + FFN tgt ( ℓ ) ( LN ( z ^ j t , ( ℓ ) ) ) . (118)
After the main layers, L p o s t L_{\mathrm{post}} L post additional post-processing layers refine the representations. These layers do not access the private context set and therefore preserve the privacy guarantee established by the DP-MHCA blocks. For each layer ℓ = L m a i n + 1 , … , L m a i n + L p o s t \ell=L_{\mathrm{main}}+1,\ldots,L_{\mathrm{main}}+L_{\mathrm{post}} ℓ = L main + 1 , … , L main + L post , we perform:
Latent Self-Attention Update:
s i , s e l f ( ℓ ) = MHSA ( LN ( s ~ i ( ℓ − 1 ) ) ; LN ( s ~ 1 : m ( ℓ − 1 ) ) ) , i = 1 , … , m , (119) s^{(\ell)}_{i,\mathrm{self}}=\operatorname{MHSA}\left(\operatorname{LN}\left(\tilde{s}^{(\ell-1)}_i\right);\operatorname{LN}\left(\tilde{s}^{(\ell-1)}_{1:m}\right)\right),\qquad i=1,\ldots,m, \tag*{(119)} s i , self ( ℓ ) = MHSA ( LN ( s ~ i ( ℓ − 1 ) ) ; LN ( s ~ 1 : m ( ℓ − 1 ) ) ) , i = 1 , … , m , (119)
s ^ i ( ℓ ) = s ~ i ( ℓ − 1 ) + s i , s e l f ( ℓ ) , (120) \hat{s}^{(\ell)}_i=\tilde{s}^{(\ell-1)}_i+s^{(\ell)}_{i,\mathrm{self}}, \tag*{(120)} s ^ i ( ℓ ) = s ~ i ( ℓ − 1 ) + s i , self ( ℓ ) , (120)
s ~ i ( ℓ ) = s ^ i ( ℓ ) + FFN s e l f ( ℓ ) ( LN ( s ^ i ( ℓ ) ) ) . (121) \tilde{s}^{(\ell)}_i=\hat{s}^{(\ell)}_i+\operatorname{FFN}^{(\ell)}_{\mathrm{self}}\left(\operatorname{LN}\left(\hat{s}^{(\ell)}_i\right)\right). \tag*{(121)} s ~ i ( ℓ ) = s ^ i ( ℓ ) + FFN self ( ℓ ) ( LN ( s ^ i ( ℓ ) ) ) . (121)
Target Cross-Attention Update:
t j ( ℓ ) = MHCA ( LN ( z j t , ( ℓ − 1 ) ) ; LN ( s ~ 1 : m ( ℓ ) ) ) , j = 1 , … , n t , (122) t^{(\ell)}_j=\operatorname{MHCA}\left(\operatorname{LN}\left(z^{t,(\ell-1)}_j\right);\operatorname{LN}\left(\tilde{s}^{(\ell)}_{1:m}\right)\right),\qquad j=1,\ldots,n_t, \tag*{(122)} t j ( ℓ ) = MHCA ( LN ( z j t , ( ℓ − 1 ) ) ; LN ( s ~ 1 : m ( ℓ ) ) ) , j = 1 , … , n t , (122)
z ^ j t , ( ℓ ) = z j t , ( ℓ − 1 ) + t j ( ℓ ) , (123) \hat{z}^{t,(\ell)}_j=z^{t,(\ell-1)}_j+t^{(\ell)}_j, \tag*{(123)} z ^ j t , ( ℓ ) = z j t , ( ℓ − 1 ) + t j ( ℓ ) , (123)
z j t , ( ℓ ) = z ^ j t , ( ℓ ) + FFN t g t ( ℓ ) ( LN ( z ^ j t , ( ℓ ) ) ) . (124) z^{t,(\ell)}_j=\hat{z}^{t,(\ell)}_j+\operatorname{FFN}^{(\ell)}_{\mathrm{tgt}}\left(\operatorname{LN}\left(\hat{z}^{t,(\ell)}_j\right)\right). \tag*{(124)} z j t , ( ℓ ) = z ^ j t , ( ℓ ) + FFN tgt ( ℓ ) ( LN ( z ^ j t , ( ℓ ) ) ) . (124)
Table S1 summarises the token flow, query/key-value roles, and privacy status of the encoder sub-blocks.
Table S1. Summary of operations and token flow in each layer ℓ \ell ℓ of the PrivTab encoder. Layer Normalisation (LN) is applied before each operation in a pre-normalisation layout.
Output Decoder
Let L = L m a i n + L p o s t L=L_{\mathrm{main}}+L_{\mathrm{post}} L = L main + L post denote the total number of encoder layers. The final target representations z 1 : n t t , ( L ) z^{t,(L)}_{1:n_t} z 1 : n t t , ( L ) are decoded row-wise to obtain predictive logits. The decoder is a multi-layer perceptron with GELU activations [60 ] :
h j ( 1 ) = GELU ( W d , 1 T z j ( L ) + b d , 1 ) , (125) \mathbf{h}^{(1)}_j = \operatorname{GELU}\left(\mathbf{W}_{d,1}^{\mathsf{T}}\mathbf{z}^{(L)}_j + \mathbf{b}_{d,1}\right), \tag*{(125)} h j ( 1 ) = GELU ( W d , 1 T z j ( L ) + b d , 1 ) , (125)
h j ( 2 ) = GELU ( W d , 2 h j ( 1 ) + b d , 2 ) , (126) \mathbf{h}^{(2)}_j = \operatorname{GELU}\left(\mathbf{W}_{d,2}\mathbf{h}^{(1)}_j + \mathbf{b}_{d,2}\right), \tag*{(126)} h j ( 2 ) = GELU ( W d , 2 h j ( 1 ) + b d , 2 ) , (126)
y ^ j = W d , 3 T h j ( 2 ) + b d , 3 , (127) \hat{\mathbf{y}}_j = \mathbf{W}_{d,3}^{\mathsf{T}}\mathbf{h}^{(2)}_j + \mathbf{b}_{d,3}, \tag*{(127)} y ^ j = W d , 3 T h j ( 2 ) + b d , 3 , (127)
where y ^ j ∈ R C max \hat{\mathbf{y}}_j \in\mathbb{R}^{C_{\max}} y ^ j ∈ R C m a x are the raw output logits for target query j j j , W d , 1 ∈ R d t o k × d d e c \mathbf{W}_{d,1} \in\mathbb{R}^{d_{\mathrm{tok}}\times d_{\mathrm{dec}}} W d , 1 ∈ R d tok × d dec , W d , 2 ∈ R d d e c × d d e c \mathbf{W}_{d,2} \in\mathbb{R}^{d_{\mathrm{dec}}\times d_{\mathrm{dec}}} W d , 2 ∈ R d dec × d dec , and W d , 3 ∈ R d d e c × C max \mathbf{W}_{d,3} \in\mathbb{R}^{d_{\mathrm{dec}}\times C_{\max}} W d , 3 ∈ R d dec × C m a x are learnable weight matrices, and b d , 1 , b d , 2 , b d , 3 \mathbf{b}_{d,1}, \mathbf{b}_{d,2}, \mathbf{b}_{d,3} b d , 1 , b d , 2 , b d , 3 are bias vectors. We set d d e c = 512 d_{\mathrm{dec}} = 512 d dec = 512 . If a dataset has C ≤ C max C \le C_{\max} C ≤ C m a x classes, only the first C C C coordinates of y ^ j \hat{\mathbf{y}}_j y ^ j are used.
PrivTab Pretraining
Noise-Aware Pretraining Objective
We pretrain PrivTab by meta-learning across synthetic tabular classification tasks. Each task τ \tau τ comprises a labelled context set D c \mathcal{D}_c D c and a target set D t \mathcal{D}_t D t . The DP-MHCA-based private encoder A ϕ \mathcal{A}_{\phi} A ϕ maps D c \mathcal{D}_c D c to a released privatised summary S ~ \widetilde{S} S , and the predictive network q ψ q_{\psi} q ψ maps ( x 1 : n t t , S ~ ) (x^{t}_{1:n_t}, \widetilde{S}) ( x 1 : n t t , S ) to a distribution over the target labels. We use ϕ \phi ϕ for parameters that determine the private summary and ψ \psi ψ for parameters that determine predictions. The row embedding network is shared between context and query paths, so these parameter collections overlap in those weights and are trained jointly by minimising target cross-entropy, equivalently the population private negative log-likelihood
L N L L p r i v ( ψ ; ϕ ) : = E p ϕ ( τ , S ~ ) [ − log q ψ ( y 1 : n t t ∣ x 1 : n t t , S ~ ) ] . (128) \mathcal{L}^{\mathrm{priv}}_{\mathrm{NLL}}(\psi;\phi) := \mathbb{E}_{p_{\phi}(\tau,\widetilde{S})}\left[-\log q_{\psi}\left(y^{t}_{1:n_t}\mid x^{t}_{1:n_t},\widetilde{S}\right)\right]. \tag*{(128)} L NLL priv ( ψ ; ϕ ) := E p ϕ ( τ , S ) [ − log q ψ ( y 1 : n t t ∣ x 1 : n t t , S ) ] . (128)
As shown in Supplement S2, this is a noise-aware objective: for a fixed private encoder, minimising it fits the posterior predictive distribution conditioned on the privatised summary rather than a predictor that ignores the privacy noise.
Let N t ( τ ) : = ∣ D t ∣ N_t(\tau) := |\mathcal{D}_t| N t ( τ ) := ∣ D t ∣ denote the target-set size, and let p N t p_{N_t} p N t be its induced distribution under the task simulator. For each fixed n t n_t n t , let p ϕ ( n t ) ( τ , S ~ ) p_{\phi}^{(n_t)}(\tau,\widetilde{S}) p ϕ ( n t ) ( τ , S ) denote the joint law of ( τ , S ~ ) (\tau,\widetilde{S}) ( τ , S ) conditional on N t = n t N_t = n_t N t = n t . Applying Theorem S2.1 conditionally on N t = n t N_t = n_t N t = n t and then averaging over N t N_t N t gives
L N L L p r i v ( ψ ; ϕ ) = ∑ n t ≥ 1 p N t ( n t ) ( const ( ϕ , n t ) + E p ϕ ( n t ) ( τ , S ~ ) [ KL ( p ϕ ( ⋅ ∣ x 1 : n t t , S ~ ) ∥ q ψ ( ⋅ ∣ x 1 : n t t , S ~ ) ) ] ) . (129) \mathcal{L}^{\mathrm{priv}}_{\mathrm{NLL}}(\psi;\phi) = \sum_{n_t\geq1} p_{N_t}(n_t)\left(\operatorname{const}(\phi,n_t) + \mathbb{E}_{p_{\phi}^{(n_t)}(\tau,\widetilde{S})}\left[\operatorname{KL}\left(p_{\phi}\left(\cdot\mid x^{t}_{1:n_t},\widetilde{S}\right)\middle\|q_{\psi}\left(\cdot\mid x^{t}_{1:n_t},\widetilde{S}\right)\right)\right]\right). \tag*{(129)} L NLL priv ( ψ ; ϕ ) = n t ≥ 1 ∑ p N t ( n t ) ( const ( ϕ , n t ) + E p ϕ ( n t ) ( τ , S ) [ KL ( p ϕ ( ⋅ ∣ x 1 : n t t , S ) q ψ ( ⋅ ∣ x 1 : n t t , S ) ) ] ) . (129)
Thus, when ϕ \phi ϕ is fixed, optimizing over ψ \psi ψ amounts to fitting q ψ q_{\psi} q ψ to the noise-aware posterior predictive induced by A ϕ \mathcal{A}_{\phi} A ϕ . Joint training is therefore the optimisation problem
min ϕ , ψ L N L L p r i v ( ψ ; ϕ ) , (130) \min_{\phi,\psi}\mathcal{L}^{\mathrm{priv}}_{\mathrm{NLL}}(\psi;\phi), \tag*{(130)} ϕ , ψ min L NLL priv ( ψ ; ϕ ) , (130)
in which ϕ \phi ϕ changes both the distribution of the released summary, through p ϕ ( τ , S ~ ) p_{\phi}(\tau,\widetilde{S}) p ϕ ( τ , S ) , and the corresponding family of conditional noise-aware posterior predictives p ϕ ( ⋅ ∣ x 1 : n t t , S ~ ) p_{\phi}(\cdot\mid x^{t}_{1:n_t},\widetilde{S}) p ϕ ( ⋅ ∣ x 1 : n t t , S ) . A useful equivalent view is the profile objective
J ( ϕ ) : = inf ψ L N L L p r i v ( ψ ; ϕ ) . (131) \mathcal{J}(\phi) := \inf_{\psi}\mathcal{L}^{\mathrm{priv}}_{\mathrm{NLL}}(\psi;\phi). \tag*{(131)} J ( ϕ ) := ψ inf L NLL priv ( ψ ; ϕ ) . (131)
This means that ϕ \phi ϕ is chosen to define a private mechanism whose induced noise-aware posterior predictive is both informative for prediction and well approximated by the predictive family q ψ q_{\psi} q ψ .
In practice, we first update the model jointly and then freeze the entire encoder late in training, including the shared row embedding, private summary blocks and query-side attention. Only the output decoder remains trainable in this final stage, refining predictions for the fixed representations learned earlier.
Simulator, Curriculum, and Optimisation
To instantiate this objective, we draw the synthetic tasks from the mixed structural causal model (SCM) simulator introduced in TabICL [16 ] . Each generated task supplies the labelled context and target sets used by the objective above.
Synthetic Tabular Data Simulator. For each simulated task, we generate a synthetic tabular classification dataset:
D c = { ( x i c , y i c ) } i = 1 n c , (132) \mathcal{D}_c = \left\{(x_i^c,y_i^c)\right\}_{i=1}^{n_c}, \tag*{(132)} D c = { ( x i c , y i c ) } i = 1 n c , (132)
D t = { ( x j t , y j t ) } j = 1 n t , (133) \mathcal{D}_t = \left\{(x_j^t,y_j^t)\right\}_{j=1}^{n_t}, \tag*{(133)} D t = { ( x j t , y j t ) } j = 1 n t , (133)
where the number of active features d d d is sampled uniformly from [ 2 , 120 ] [2,120] [ 2 , 120 ] and the input feature dimension is padded to d x = 120 d_x = 120 d x = 120 . The number of target classes C C C is sampled uniformly up to C max = 10 C_{\max} = 10 C m a x = 10 . The context size n c n_c n c and target size n t n_t n t are sampled independently and uniformly from [ N min , N max ] [N_{\min},N_{\max}] [ N m i n , N m a x ] for each task. To improve optimisation stability and sample efficiency, we employ a two-stage training curriculum that adjusts the range [ N min , N max ] [N_{\min},N_{\max}] [ N m i n , N m a x ] :
Stage 1: For the first 128,000 steps, we set N min = 100 N_{\min} = 100 N m i n = 100 and N max = 2048 N_{\max} = 2048 N m a x = 2048 . In this stage, the scale normalisation in Eq. (87) is disabled.
Stage 2: For training steps 128,000 to 256,000, we set N min = 1024 N_{\min} = 1024 N m i n = 1024 and N max = 8192 N_{\max} = 8192 N m a x = 8192 , and enable the scale normalisation in Eq. (87) .
This curriculum enables the model to first stabilise its representation learning on smaller datasets before adapting to larger context scales.
To optimise performance across different dataset scales, we train two separate model variants: one trained solely on Stage 1 tasks for an additional 256,000 steps (yielding 384,000 total steps on smaller contexts), and another trained sequentially on Stage 1 and Stage 2 tasks. The small-context variant is trained without summary normalisation, which is enabled at inference; the large-context variant enables it during Stage 2 and at inference. At inference time, we route queries dynamically based on the context size: the smaller-context model is used for datasets with n c < 4096 n_c < 4096 n c < 4096 , while the large-context model is used for datasets with n c ≥ 4096 n_c \ge4096 n c ≥ 4096 .
Privacy Parameter Curriculum. To train the model across a wide range of privacy levels, each simulated task is assigned a privacy parameter μ \mu μ according to a log-uniform curriculum during meta-training. The overall range is [ μ min , μ max ] = [ 0.16 , 64.0 ] [\mu_{\min},\mu_{\max}] = [0.16,64.0] [ μ m i n , μ m a x ] = [ 0.16 , 64.0 ] . To ease optimisation at the start of training, we initialise the curriculum with minimal privacy noise by setting the lower bound to μ min ( c u r r ) = 64.0 \mu_{\min}^{(\mathrm{curr})} = 64.0 μ m i n ( curr ) = 64.0 . From steps 256 to 38,400, the lower bound μ min ( c u r r ) \mu_{\min}^{(\mathrm{curr})} μ m i n ( curr ) decreases log-linearly from 64.0 to 0.16, while the upper bound remains fixed at 64.0. Afterwards, the curriculum reaches its final state and μ \mu μ is sampled according to
log μ = u ( log μ max − log μ min ) + log μ min , (134) \log\mu= u\left(\log\mu_{\max} - \log\mu_{\min}\right) + \log\mu_{\min}, \tag*{(134)} log μ = u ( log μ m a x − log μ m i n ) + log μ m i n , (134)
where u ∼ Uniform ( 0 , 1 ) u \sim\operatorname{Uniform}(0,1) u ∼ Uniform ( 0 , 1 ) . Equivalently, in the final regime μ \mu μ is sampled from the density
p ( μ ) = 1 μ ( log μ max − log μ min ) 1 [ μ min , μ max ] ( μ ) . (135) p(\mu) = \frac{1}{\mu\left(\log\mu_{\max} - \log\mu_{\min}\right)}\mathbf{1}_{[\mu_{\min},\mu_{\max}]}(\mu). \tag*{(135)} p ( μ ) = μ ( log μ m a x − log μ m i n ) 1 1 [ μ m i n , μ m a x ] ( μ ) . (135)
The resulting pretraining objective averages the private negative log-likelihood over both target sizes and privacy levels. Applying Theorem S2.1 pointwise in ( μ , n t ) (\mu,n_t) ( μ , n t ) shows that, in the final regime, training minimises the KL divergence to the corresponding noise-aware posterior predictive on average over both tasks and privacy levels. The derivation below makes this averaging explicit. The curriculum therefore exposes the model first to lower-noise tasks and gradually introduces more challenging high-noise settings.
Objective across privacy levels and target sizes. The resulting pretraining objective is
L N L L p r i v ( ψ ; ϕ ) = ∫ μ min μ max ∑ n t ≥ 1 L N L L p r i v ( ψ ; ϕ , μ , n t ) p N t ( n t ) p ( μ ) d μ , (136) \mathcal{L}_{\mathrm{NLL}}^{\mathrm{priv}}(\psi;\phi) = \int_{\mu_{\min}}^{\mu_{\max}} \sum_{n_t \ge1} \mathcal{L}_{\mathrm{NLL}}^{\mathrm{priv}}(\psi;\phi,\mu,n_t)\,p_{N_t}(n_t)p(\mu)\,\mathrm{d}\mu, \tag*{(136)} L NLL priv ( ψ ; ϕ ) = ∫ μ m i n μ m a x n t ≥ 1 ∑ L NLL priv ( ψ ; ϕ , μ , n t ) p N t ( n t ) p ( μ ) d μ , (136)
where
L N L L p r i v ( ψ ; ϕ , μ , n t ) : = E p ϕ , μ ( n t ) ( τ , S ~ ) [ − log q ψ ( y 1 : n t t ∣ x 1 : n t t , S ~ ) ] . (137) \mathcal{L}_{\mathrm{NLL}}^{\mathrm{priv}}(\psi;\phi,\mu,n_t) := \mathbb{E}_{p_{\phi,\mu}^{(n_t)}(\tau,\widetilde{\mathcal{S}})}\left[-\log q_\psi\left(y_{1:n_t}^t \mid x_{1:n_t}^t,\widetilde{\mathcal{S}}\right)\right]. \tag*{(137)} L NLL priv ( ψ ; ϕ , μ , n t ) := E p ϕ , μ ( n t ) ( τ , S ) [ − log q ψ ( y 1 : n t t ∣ x 1 : n t t , S ) ] . (137)
Here P ϕ , μ ( n t ) ( τ , S ~ ) \mathbb{P}_{\phi,\mu}^{(n_t)}(\tau,\widetilde{S}) P ϕ , μ ( n t ) ( τ , S ) denotes the joint law conditional on both the privacy level μ \mu μ and the target size N t = n t N_t=n_t N t = n t . Applying Theorem S2.1 for each fixed pair ( μ , n t ) (\mu,n_t) ( μ , n t ) gives
L N L L p r i v ( ψ ; ϕ ) = ∫ μ min μ max ∑ n t ≥ 1 const ( ϕ , μ , n t ) E P ϕ , μ ( n t ) ( τ , S ~ ) [ KL ( p ϕ , μ ( ⋅ ∣ x 1 : n t t , S ~ ) ∥ q ψ ( ⋅ ∣ x 1 : n t t , S ~ ) ) ] p N t ( n t ) p ( μ ) d μ , (138) \mathcal{L}_{\mathrm{NLL}}^{\mathrm{priv}}(\psi;\phi)=\int_{\mu_{\min}}^{\mu_{\max}}\sum_{n_t\geq1}\operatorname{const}(\phi,\mu,n_t)\,\mathbb{E}_{\mathbb{P}_{\phi,\mu}^{(n_t)}(\tau,\widetilde{S})}\left[\operatorname{KL}\left(p_{\phi,\mu}(\cdot\mid x_{1:n_t}^{t},\widetilde{S})\mathbin{\|}q_{\psi}(\cdot\mid x_{1:n_t}^{t},\widetilde{S})\right)\right]p_{N_t}(n_t)p(\mu)\,\mathrm{d}\mu, \tag*{(138)} L NLL priv ( ψ ; ϕ ) = ∫ μ m i n μ m a x n t ≥ 1 ∑ const ( ϕ , μ , n t ) E P ϕ , μ ( n t ) ( τ , S ) [ KL ( p ϕ , μ ( ⋅ ∣ x 1 : n t t , S ) ∥ q ψ ( ⋅ ∣ x 1 : n t t , S ) ) ] p N t ( n t ) p ( μ ) d μ , (138)
where const ( ϕ , μ , n t ) \operatorname{const}(\phi,\mu,n_t) const ( ϕ , μ , n t ) does not depend on ψ \psi ψ . Equivalently, writing
const ‾ ( ϕ ) : = ∫ μ min μ max ∑ n t ≥ 1 const ( ϕ , μ , n t ) p N t ( n t ) p ( μ ) d μ , (139) \overline{\operatorname{const}}(\phi):=\int_{\mu_{\min}}^{\mu_{\max}}\sum_{n_t\geq1}\operatorname{const}(\phi,\mu,n_t)p_{N_t}(n_t)p(\mu)\,\mathrm{d}\mu, \tag*{(139)} const ( ϕ ) := ∫ μ m i n μ m a x n t ≥ 1 ∑ const ( ϕ , μ , n t ) p N t ( n t ) p ( μ ) d μ , (139)
we obtain
L N L L p r i v ( ψ ; ϕ ) = const ‾ ( ϕ ) + ∫ μ min μ max ∑ n t ≥ 1 E P ϕ , μ ( n t ) ( τ , S ~ ) [ KL ( p ϕ , μ ( ⋅ ∣ x 1 : n t t , S ~ ) ∥ q ψ ( ⋅ ∣ x 1 : n t t , S ~ ) ) ] p N t ( n t ) p ( μ ) d μ . (140) \mathcal{L}_{\mathrm{NLL}}^{\mathrm{priv}}(\psi;\phi)=\overline{\operatorname{const}}(\phi)+\int_{\mu_{\min}}^{\mu_{\max}}\sum_{n_t\geq1}\mathbb{E}_{\mathbb{P}_{\phi,\mu}^{(n_t)}(\tau,\widetilde{S})}\left[\operatorname{KL}\left(p_{\phi,\mu}(\cdot\mid x_{1:n_t}^{t},\widetilde{S})\mathbin{\|}q_{\psi}(\cdot\mid x_{1:n_t}^{t},\widetilde{S})\right)\right]p_{N_t}(n_t)p(\mu)\,\mathrm{d}\mu. \tag*{(140)} L NLL priv ( ψ ; ϕ ) = const ( ϕ ) + ∫ μ m i n μ m a x n t ≥ 1 ∑ E P ϕ , μ ( n t ) ( τ , S ) [ KL ( p ϕ , μ ( ⋅ ∣ x 1 : n t t , S ) ∥ q ψ ( ⋅ ∣ x 1 : n t t , S ) ) ] p N t ( n t ) p ( μ ) d μ . (140)
Optimisation and Loss Function. The model receives the context set D c \mathcal{D}_c D c and target features x 1 : n t t x_{1:n_t}^{t} x 1 : n t t as inputs. The training loss is the cross-entropy, equivalently the negative log-likelihood, computed on the target labels y 1 : n t t y_{1:n_t}^{t} y 1 : n t t for the active classes. We apply label smoothing (Szegedy et al., [61 ] ) with smoothing factor 0.1. The theoretical result in Theorem S2.1 characterises the corresponding unsmoothed NLL objective; label smoothing is used only as a training regulariser.
We optimise with AdamW (Loshchilov and Hutter, [35 ] ) using peak learning rate 10 − 4 10^{-4} 1 0 − 4 , weight decay 10 − 3 10^{-3} 1 0 − 3 , β 1 = 0.9 \beta_1=0.9 β 1 = 0.9 , β 2 = 0.98 \beta_2=0.98 β 2 = 0.98 , and ϵ = 10 − 8 \epsilon=10^{-8} ϵ = 1 0 − 8 . We apply gradient clipping with maximum norm 1.0. The learning rate follows a warmup-cosine-constant schedule: it increases linearly from 0 to 10 − 4 10^{-4} 1 0 − 4 over the first 6400 steps, decays with a cosine schedule to η min = 10 − 5 \eta_{\min}=10^{-5} η m i n = 1 0 − 5 over 51,200 optimiser steps, and remains constant at 10 − 5 10^{-5} 1 0 − 5 thereafter.
The large-context variant is trained for 256,000 total steps with a batch size of 128 tasks (datasets). At step 243,200, we freeze the entire encoder and continue training only the output decoder for the remaining 12,800 steps. The small-context variant is trained for 384,000 total steps; its final encoder-freezing stage starts at step 371,200, also leaving 12,800 steps to refine the decoder. These final stages stabilise the predictive approximation relative to the learned privatised representation.
Baseline Details
Accounting for DP Stochastic Optimisation under Substitute Adjacency
For DP stochastic optimisation ([6 , 7 , 8 ] ), privacy is defined at the row level, so we use the same substitute adjacency relation as in the rest of the paper. Let D = { z i } i = 1 N \mathcal{D}=\{z_i\}_{i=1}^{N} D = { z i } i = 1 N denote the training set, let q q q be the Poisson subsampling rate, let B ‾ = max { 1 , ⌊ q N ⌋ } \overline{B}=\max\{1,\lfloor qN\rfloor\} B = max { 1 , ⌊ q N ⌋} be the normalisation based on the expected minibatch size, let T T T be the number of optimisation steps, let C > 0 C>0 C > 0 be the clipping norm, and let σ > 0 \sigma>0 σ > 0 be the standard deviation of the noise added to the clipped gradient sum. At each step t t t , DP Adam samples a minibatch B t ⊆ D B_t\subseteq\mathcal{D} B t ⊆ D , clips each per-example gradient to have ℓ 2 \ell_2 ℓ 2 -norm at most C C C , and applies Adam to a noisy gradient of the form
g ~ t = 1 B ‾ ∑ z i ∈ B t clip C ( ∇ w ℓ ( w t ; z i ) ) + σ B ‾ ξ t , ξ t ∼ N ( 0 , I ) . (141) \widetilde{\mathbf{g}}_t=\frac{1}{\overline{B}}\sum_{z_i\in B_t}\operatorname{clip}_C\left(\nabla_{\mathbf{w}}\ell(\mathbf{w}_t;z_i)\right)+\frac{\sigma}{\overline{B}}\boldsymbol{\xi}_t,\qquad\boldsymbol{\xi}_t\sim\mathcal{N}(\mathbf{0},I). \tag*{(141)} g t = B 1 z i ∈ B t ∑ clip C ( ∇ w ℓ ( w t ; z i ) ) + B σ ξ t , ξ t ∼ N ( 0 , I ) . (141)
To report privacy in the same form as for PrivTab, we do not use the asymptotic μ \mu μ -GDP approximation for subsampled Gaussian-gradient mechanisms (Bu et al., [62 ] ). Instead, we compute the privacy profile of the Poisson-subsampled Gaussian mechanism under the replace-one neighbouring relation using a numerical privacy-loss-distribution accountant (Gomez et al., [38 ] ), compose it over T T T steps, and then convert the resulting trade-off function T T T to the smallest valid non-asymptotic μ \mu μ -GDP guarantee,
μ ⋆ = inf { μ ≥ 0 : T μ ( α ) ≤ T ( α ) for all α ∈ [ 0 , 1 ] } . (142) \mu^{\star}=\inf\{\mu\geq0:T_{\mu}(\alpha)\leq T(\alpha)\text{ for all }\alpha\in[0,1]\}. \tag*{(142)} μ ⋆ = inf { μ ≥ 0 : T μ ( α ) ≤ T ( α ) for all α ∈ [ 0 , 1 ]} . (142)
where T μ T_\mu T μ is the GDP trade-off function from Eq. (23) . For each target privacy budget μ \mu μ , the DP Adam noise standard deviation is then chosen by numerically inverting this map so that the full training procedure satisfies μ \mu μ -GDP under substitute adjacency.
Hyperparameter Calibration and Private Selection
Search spaces, private learning-rate grids and fixed baseline hyperparameters are reported in Table S2 to Table S4 .
Table S2. Table S2: Baseline hyperparameter search spaces. Bayesian optimisation is run separately for each private baseline.
Table S4. Fixed hyperparameters used for the DP baselines after inspecting the aggregate hyperparameter-selection histograms.
DP baseline hyperparameter selection. Based on Figure S1 and Figure S2 , we fix the main hyperparameters of both baselines and tune only the learning rate under DP. For each method, the learning rate is selected from a small grid using a private validation loss. Concretely, after the outer 80/20 context–target split, we divide the context portion into subtraining and validation sets, using a validation fraction of 0.16 within the context set. Relative to the full dataset, this corresponds approximately to a 67/13/20 split into subtraining, validation and target data. For any single learning-rate candidate, the DP Adam training run acts only on the subtraining subset while the noisy validation-loss evaluation acts only on the validation subset, so these two components compose by parallel composition [63 ] . Across the learning-rate grid, however, the same subtraining subset is reused for the different candidate training runs and the same validation subset is reused for the different candidate validation evaluations, so we also account for composition over all learning-rate candidates, that is, over the grid size. After private learning-rate selection, we perform one additional final DP Adam training run on the union of the subtraining and validation sets using the selected learning rate. In the final protocol, we reserve a fraction 0.5 of the total μ \mu μ budget for private learning-rate selection and use the remaining budget for the final training run through ℓ 2 \ell_2 ℓ 2 -composition in μ \mu μ -GDP. The private validation criterion is the mean cross-entropy loss after clipping each per-example validation loss at 5.0.
Figure S1. Histogram of the hyperparameters selected for DP-LR across all datasets and context–target splits. The selected values are concentrated enough to justify fixing the non-learning-rate hyperparameters in the final experiments.
Figure S2. Histogram of the hyperparameters selected for DP-MLP across all datasets and context–target splits. As for DP-LR, the selected values are concentrated enough to justify fixing the non-learning-rate hyperparameters in the final experiments.
Table S3. Table S3: Learning-rate grids used for private model selection. Only the learning rate is selected under DP; all other hyperparameters are fixed from the aggregate hyperparameter-optimisation results in Figure S1 and Figure S2 .
Additional Experiment Details
Membership-Inference Audit Results
Table S5 reports exact FPC-corrected means and complementary 95th-percentile point estimates, while Figure 5 a emphasises the maximum lower record-wise 95% confidence endpoint. The record-level curves in Figure S3 provide a threshold-specific view of the exposure summarised by the record AUC values.
Figure 5. Record-level membership-inference protection. a, Distribution of the record-wise membership-inference AUC on the Maternal Health Risk dataset. For each record, we compute its AUC and 95% confidence interval, then plot the lower endpoint of that interval. Boxes show the interquartile range and median, whiskers span the central 95%, squares mark the maximum across records, and dotted vertical lines mark the provable AUC upper bound for PrivTab at each privacy level. b, ROC curves for the most vulnerable record at each of the six PrivTab privacy levels and for TabPFN v3 and TabICL v2. Grey dashed lines in a,b denote perfect privacy. PrivTab remains much closer to perfect privacy whereas the most vulnerable rows of the non-private models are highly vulnerable.
Fitted balanced attack accuracy and its uncertainty. For a fixed record i i i , let S i , I N S_{i,\mathrm{IN}} S i , IN and S i , O U T S_{i,\mathrm{OUT}} S i , OUT denote its attack score conditional on the record being a member or a non-member, respectively. We fit separate Gaussian distributions,
S i , I N ∼ N ( μ i , I N , σ i , I N 2 ) , S i , O U T ∼ N ( μ i , O U T , σ i , O U T 2 ) , S_{i,\mathrm{IN}} \sim\mathcal{N}(\mu_{i,\mathrm{IN}},\sigma_{i,\mathrm{IN}}^{2}), \qquad S_{i,\mathrm{OUT}} \sim\mathcal{N}(\mu_{i,\mathrm{OUT}},\sigma_{i,\mathrm{OUT}}^{2}), S i , IN ∼ N ( μ i , IN , σ i , IN 2 ) , S i , OUT ∼ N ( μ i , OUT , σ i , OUT 2 ) ,
where σ i , I N \sigma_{i,\mathrm{IN}} σ i , IN and σ i , O U T \sigma_{i,\mathrm{OUT}} σ i , OUT are the finite-population-corrected standard deviations defined in the Methods. A score above threshold t t t predicts membership, so, writing Φ \Phi Φ for the standard-normal CDF,
TPR i ( t ) = Pr ( S i , I N > t ) = 1 − Φ ( t − μ i , I N σ i , I N ) , TNR i ( t ) = Pr ( S i , O U T ≤ t ) = Φ ( t − μ i , O U T σ i , O U T ) . \operatorname{TPR}_i(t)=\Pr(S_{i,\mathrm{IN}}>t)=1-\Phi\left(\frac{t-\mu_{i,\mathrm{IN}}}{\sigma_{i,\mathrm{IN}}}\right),\qquad\operatorname{TNR}_i(t)=\Pr(S_{i,\mathrm{OUT}}\le t)=\Phi\left(\frac{t-\mu_{i,\mathrm{OUT}}}{\sigma_{i,\mathrm{OUT}}}\right). TPR i ( t ) = Pr ( S i , IN > t ) = 1 − Φ ( σ i , IN t − μ i , IN ) , TNR i ( t ) = Pr ( S i , OUT ≤ t ) = Φ ( σ i , OUT t − μ i , OUT ) .
With P = N = 2,000 P=N=2{,}000 P = N = 2 , 000 IN and OUT draws for each record, ordinary accuracy and balanced accuracy have the same form:
T P + T N P + N = 1 2 ( T P P + T N N ) . \frac{\mathrm{TP}+\mathrm{TN}}{P+N}=\frac{1}{2}\left(\frac{\mathrm{TP}}{P}+\frac{\mathrm{TN}}{N}\right). P + N TP + TN = 2 1 ( P TP + N TN ) .
Replacing the two observed fractions by the fitted Gaussian probabilities gives the fitted balanced accuracy
A i ( t ; ω i ) = 1 2 [ TPR i ( t ) + TNR i ( t ) ] = 1 2 [ Φ ( μ i , I N − t σ i , I N ) + Φ ( t − μ i , O U T σ i , O U T ) ] . A_i(t;\omega_i)=\frac{1}{2}\left[\operatorname{TPR}_i(t)+\operatorname{TNR}_i(t)\right]=\frac{1}{2}\left[\Phi\left(\frac{\mu_{i,\mathrm{IN}}-t}{\sigma_{i,\mathrm{IN}}}\right)+\Phi\left(\frac{t-\mu_{i,\mathrm{OUT}}}{\sigma_{i,\mathrm{OUT}}}\right)\right]. A i ( t ; ω i ) = 2 1 [ TPR i ( t ) + TNR i ( t ) ] = 2 1 [ Φ ( σ i , IN μ i , IN − t ) + Φ ( σ i , OUT t − μ i , OUT ) ] .
Here ω i = ( μ i , I N , μ i , O U T , σ i , I N , σ i , O U T ) T \omega_i=(\mu_{i,\mathrm{IN}},\mu_{i,\mathrm{OUT}},\sigma_{i,\mathrm{IN}},\sigma_{i,\mathrm{OUT}})^{\mathsf{T}} ω i = ( μ i , IN , μ i , OUT , σ i , IN , σ i , OUT ) T contains the score-model parameters; θ \boldsymbol{\theta} θ denotes the foundation-model parameters. We choose t ^ i ∈ arg max t A i ( t ; ω ^ i ) \hat{t}_i\in\operatorname*{arg\,max}_t A_i(t;\hat{\omega}_i) t ^ i ∈ arg max t A i ( t ; ω ^ i ) and write A ^ i ∗ = A i ( t ^ i ; ω ^ i ) \hat{A}_i^*=A_i(\hat{t}_i;\hat{\omega}_i) A ^ i ∗ = A i ( t ^ i ; ω ^ i ) , including the limiting accuracy of 0.5 from predicting a single class.
To quantify uncertainty in this fitted accuracy, let n i , I N n_{i,\mathrm{IN}} n i , IN and n i , O U T n_{i,\mathrm{OUT}} n i , OUT be the numbers of fitted scores, and let s i , I N s_{i,\mathrm{IN}} s i , IN and s i , O U T s_{i,\mathrm{OUT}} s i , OUT be their uncorrected sample standard deviations. The fitted corrected standard deviations are σ ^ i , I N = s i , I N / f \hat{\sigma}_{i,\mathrm{IN}}=s_{i,\mathrm{IN}}/\sqrt{f} σ ^ i , IN = s i , IN / f and σ ^ i , O U T = s i , O U T / f \hat{\sigma}_{i,\mathrm{OUT}}=s_{i,\mathrm{OUT}}/\sqrt{f} σ ^ i , OUT = s i , OUT / f , with f = 0.5 f=0.5 f = 0.5 . Under independent Gaussian IN and OUT score samples, a large-sample diagonal covariance approximation for ω ^ i \hat{\omega}_i ω ^ i is
V ^ i = diag ( s i , I N 2 n i , I N , s i , O U T 2 n i , O U T , σ ^ i , I N 2 2 n i , I N , σ ^ i , O U T 2 2 n i , O U T ) . \hat{V}_i=\operatorname{diag}\left(\frac{s_{i,\mathrm{IN}}^2}{n_{i,\mathrm{IN}}},\frac{s_{i,\mathrm{OUT}}^2}{n_{i,\mathrm{OUT}}},\frac{\hat{\sigma}_{i,\mathrm{IN}}^2}{2n_{i,\mathrm{IN}}},\frac{\hat{\sigma}_{i,\mathrm{OUT}}^2}{2n_{i,\mathrm{OUT}}}\right). V ^ i = diag ( n i , IN s i , IN 2 , n i , OUT s i , OUT 2 , 2 n i , IN σ ^ i , IN 2 , 2 n i , OUT σ ^ i , OUT 2 ) .
The first two entries use the variance of the observed score means; the last two propagate the fixed FPC scaling of the fitted standard deviations. For a fixed threshold, the delta method gives
Var ^ [ A i ( t ; ω ^ i ) ] = g i ( t ) T V ^ i g i ( t ) , g i ( t ) = ∇ ω A i ( t ; ω ^ i ) , \widehat{\operatorname{Var}}[A_i(t;\hat{\omega}_i)]=\boldsymbol{g}_i(t)^{\mathsf{T}}\hat{V}_i\boldsymbol{g}_i(t),\qquad\boldsymbol{g}_i(t)=\nabla_{\omega}A_i(t;\hat{\omega}_i), Var [ A i ( t ; ω ^ i )] = g i ( t ) T V ^ i g i ( t ) , g i ( t ) = ∇ ω A i ( t ; ω ^ i ) ,
and its standard error is the square root of this variance; we obtain the gradient by automatic differentiation. At a unique interior maximum, ∂ A i / ∂ t = 0 \partial A_i/\partial t=0 ∂ A i / ∂ t = 0 , so the envelope theorem gives the first-order gradient of max t A i ( t ; ω i ) \max_t A_i(t;\omega_i) max t A i ( t ; ω i ) by evaluating g i ( t ) \boldsymbol{g}_i(t) g i ( t ) at t ^ i \hat{t}_i t ^ i , without differentiating through the selected threshold. Thus the nominal record-wise 95% interval for the maximised fitted accuracy is
A ^ i ∗ ± 1.96 g i ( t ^ i ) T V ^ i g i ( t ^ i ) . \hat{A}_i^* \pm1.96\sqrt{\boldsymbol{g}_i(\hat{t}_i)^{\mathsf{T}}\hat{V}_i\boldsymbol{g}_i(\hat{t}_i)}. A ^ i ∗ ± 1.96 g i ( t ^ i ) T V ^ i g i ( t ^ i ) .
For Fig. 1e, we clip its lower endpoint at 0.5 and plot the largest lower endpoint across records for each method. These intervals are pointwise for each record; choosing the largest endpoint across records does not provide a simultaneous 95% coverage guarantee.
Verification and Empirical Audits
We verify the private summary mechanism at three complementary levels: implementation, formal verification and empirical auditing. Together, these checks connect the mathematical privacy argument to the code that implements the mechanism. Empirical agreement cannot replace a proof, but it can reveal implementation errors or violated assumptions that the abstract proof alone cannot detect.
Implementation. DP-MHCA localises the sensitivity-critical query, key and value transformations, bounded attention computation and Gaussian perturbation in one module. The noise scale is calibrated from the number of private layers, attention heads and summary tokens according to the sensitivity and composition results in Theorems S3.1 and S3.2. We also check that every transformation before the first DP-MHCA layer is applied independently to each context row, with no positional encoding or cross-row normalisation that could create an unaccounted dependency. A self-contained PyTorch implementation that closely follows the implementation used in our experiments is provided in Supplement S3.3.
Formal verification. We provide a Lean 4 formalisation in DPMHCA.Lean ([22 ] ). It formally verifies the 2 H m 2\sqrt{H_m} 2 H m sensitivity bound for bounded attention and an abstract adaptive μ \mu μ -GDP composition theorem that permits deterministic post-processing between private layers. This complements the manuscript proofs of the single-layer sensitivity bound and the privacy guarantee of the complete private summary mechanism. The correspondence between the formal objects and the running implementation remains subject to implementation review, motivating the additional empirical checks below.
Empirical audits. We perform two empirical checks. First, a gradient audit tests that computation before the first DP-MHCA layer is row-wise and detects unintended dependencies between context rows. Second, a sensitivity audit uses gradient-based optimisation to search for adjacent token sets whose pre-noise summaries are far apart. For each optimised pair, we repeatedly sample privatised outputs and estimate the hypothesis-testing trade-off curve using a likelihood-ratio test with access to the two unnoised means and the calibrated Gaussian variance. This gives the auditor the strongest test available for that pair. Agreement with the intended trade-off curve provides evidence against errors in sensitivity control or noise calibration, but is not a substitute for the formal guarantee. The full mechanism-audit plots across privacy levels are shown in Figure S4 .
Figure S4. Empirical audit of the DP-MHCA mechanism across privacy levels. For each μ \mu μ , the audit optimises a pair of adjacent token sets to maximise the pre-noise output difference and then estimates the trade-off curve from repeated samples of the privatised outputs, using 10 repeated audit runs; shaded bands show pointwise bootstrap 95% CIs over those runs. The resulting curves are compared against the strongest likelihood-ratio attack with access to the unnoised means and the calibrated noise standard deviation. The observed behaviour is consistent with the intended privacy calibration across the full range of μ \mu μ .
TabArena Evaluation Details
Preprocessing and Elo calibration
The purpose of this benchmark is to compare the pure classification performance of the methods under a common preprocessing convention, so we treat z z z -score standardisation by population-level means and standard deviations as an idealised public preprocessing step and apply that convention to PrivTab and the baselines alike. This is also a natural benchmark idealisation because the TabICL simulator standardises each generated dataset using that dataset’s own mean and standard deviation before splitting it into context and target subsets. In the actual evaluation on real datasets, the unknown population means and standard deviations are approximated by the empirical mean and standard deviation of the context set, and those context-set statistics are then used to standardise both context and target features.
The DP-LR and DP-MLP baselines are described in the Methods. We rank PrivTab, DP-LR, DP-MLP and non-private logistic regression using the maximum-likelihood Elo procedure. For interpretability, the fitted ratings are linearly recalibrated so that DP-LR scores 1,000 separately at each privacy level and in the aggregate comparison. This transformation changes the origin of the Elo scale but not the ranking of the methods. We use 1 − A U C 1 - \mathrm{AUC} 1 − AUC as the error metric for binary datasets and log loss for multiclass datasets [20 ] . The dataset-level breakdowns evaluate discrimination on a common scale across all tasks. For dataset d d d , split r r r , privacy level μ \mu μ and baseline b b b , they compute A U C P r i v T a b , d , r , μ − A U C b , d , r , μ \mathrm{AUC}_{\mathrm{PrivTab},d,r,\mu} - \mathrm{AUC}_{b,d,r,\mu} AUC PrivTab , d , r , μ − AUC b , d , r , μ , using macro-averaged one-versus-rest AUC when d d d is multiclass. Marker colours average this difference over the ten splits within a dataset, whereas panel titles average it over all 330 paired splits.
Derived comparison metrics
To interpret the comparison plots, let m m m denote a method, let b b b denote the reference baseline, let d d d denote a dataset, let r r r denote a context–target split, and let μ \mu μ denote the privacy level. Writing A U C m , d , r , μ \mathrm{AUC}_{m,d,r,\mu} AUC m , d , r , μ and ℓ m , d , r , μ \ell_{m,d,r,\mu} ℓ m , d , r , μ for the corresponding target-set AUC and log loss, the split-level AUC improvement over the baseline is
Δ A U C ( m , b ; d , r , μ ) : = A U C m , d , r , μ − A U C b , d , r , μ . (143) \Delta_{\mathrm{AUC}}(m,b;d,r,\mu) := \mathrm{AUC}_{m,d,r,\mu} - \mathrm{AUC}_{b,d,r,\mu}. \tag*{(143)} Δ AUC ( m , b ; d , r , μ ) := AUC m , d , r , μ − AUC b , d , r , μ . (143)
For the non-private logistic-regression reference, we report the relative log-loss reduction
Δ L L n o n D P ( m ; d , r , μ ) : = ℓ n o n − p r i v a t e L R , d , r − ℓ m , d , r , μ ℓ n o n − p r i v a t e L R , d , r , (144) \Delta_{\mathrm{LL}}^{\mathrm{nonDP}}(m;d,r,\mu) := \frac{\ell_{\mathrm{non-private\ LR},d,r} - \ell_{m,d,r,\mu}}{\ell_{\mathrm{non-private\ LR},d,r}}, \tag*{(144)} Δ LL nonDP ( m ; d , r , μ ) := ℓ non − private LR , d , r ℓ non − private LR , d , r − ℓ m , d , r , μ , (144)
so positive values indicate lower loss than the non-private reference. Dividing by the reference loss makes the quantity comparable across datasets with different numbers of classes and hence different natural log-loss scales. For comparisons against DP-LR, we first average over context–target splits within each dataset and then report the relative log-loss reduction
Δ L L r e l ( m , D P - L R ; d , μ ) : = ℓ ˉ D P - L R , d , μ − ℓ ˉ m , d , μ ℓ ˉ D P - L R , d , μ , (145) \Delta_{\mathrm{LL}}^{\mathrm{rel}}(m,\mathrm{DP\text{-}LR};d,\mu) := \frac{\bar{\ell}_{\mathrm{DP\text{-}LR},d,\mu} - \bar{\ell}_{m,d,\mu}}{\bar{\ell}_{\mathrm{DP\text{-}LR},d,\mu}}, \tag*{(145)} Δ LL rel ( m , DP - LR ; d , μ ) := ℓ ˉ DP - LR , d , μ ℓ ˉ DP - LR , d , μ − ℓ ˉ m , d , μ , (145)
where ℓ ˉ m , d , μ \bar{\ell}_{m,d,\mu} ℓ ˉ m , d , μ denotes the average loss over context–target splits. Finally, the win-rate plots summarise the indicator comparisons
W A U C ( m , b ; d , r , μ ) : = { 1 , A U C m , d , r , μ > A U C b , d , r , μ , 0.5 , A U C m , d , r , μ = A U C b , d , r , μ , 0 , A U C m , d , r , μ < A U C b , d , r , μ , (146) W_{\mathrm{AUC}}(m,b;d,r,\mu) :=
\begin{cases}
1, & \mathrm{AUC}_{m,d,r,\mu} > \mathrm{AUC}_{b,d,r,\mu},\\
0.5, & \mathrm{AUC}_{m,d,r,\mu} = \mathrm{AUC}_{b,d,r,\mu},\\
0, & \mathrm{AUC}_{m,d,r,\mu} < \mathrm{AUC}_{b,d,r,\mu},
\end{cases} \tag*{(146)} W AUC ( m , b ; d , r , μ ) := ⎩ ⎨ ⎧ 1 , 0.5 , 0 , AUC m , d , r , μ > AUC b , d , r , μ , AUC m , d , r , μ = AUC b , d , r , μ , AUC m , d , r , μ < AUC b , d , r , μ , (146)
and analogously W L L ( m , b ; d , r , μ ) W_{\mathrm{LL}}(m,b;d,r,\mu) W LL ( m , b ; d , r , μ ) , where smaller log loss is better. Dataset-level win rates are obtained by averaging these quantities over context–target splits.
Table S7: Numerical values underlying the aggregate ELO coordinates in Figure 2 (d), with ratings aggregated over all privacy budgets.
Table S7.
Aggregate Benchmark Comparisons
Elo ratings, comparisons with non-private LR and dataset-level runtimes are reported in Tables S6 to S10.
Table S6: Numerical values underlying the ELO curves in Figure 2 (c).
Table S6.
Table S8: Numerical values underlying Figure 2 (a).
Table S8.
Table S9: Numerical values underlying the relative log-loss improvements in Figure 2 (b).
Table S9. Numerical values underlying the relative log-loss improvements in Figure 2 (b). (continued)
Table S10. Dataset sizes and per-context–target-split runtimes in seconds underlying Figure S8 .
Prediction time on a laptop. We additionally measured post-fit prediction time on a laptop with a 13th-generation Intel Core i5 CPU across the same 33 datasets, six privacy levels and ten context–target splits. Each configuration used one warm-up call followed by three timed runs, with a target batch size of 1,024; we report the mean of the per-configuration median times. Timing covers prediction for all target rows, and excludes preprocessing, model loading, fitting and private-summary construction. These measurements assess prediction cost rather than predictive performance. The dataset-level results are reported in Table S11 and Figure S9 .
The following figure summarises the direct comparisons with DP-LR; the corresponding numerical values are reported in Table S12 to Table S15 .
Table S12. Numerical values underlying Figure S10 (AUC improvement over DP-LR).
(a) Mean AUC improvement.
(b) AUC win rate.
(c) Relative log-loss reduction.
(d) Log-loss win rate.
Figure S10. Performance relative to DP-LR. Results aggregate ten context–target splits per dataset; error bars show bootstrap 95% CIs over datasets. Positive improvements and win rates above 0.5 favour the compared method. Bands are visual guides, not formal privacy thresholds: strong (μ < 0.15 \mu< 0.15 μ < 0.15 ), moderate (0.15 ≤ μ < 0.6 0.15 \le\mu< 0.6 0.15 ≤ μ < 0.6 ) and weak (μ ≥ 0.6 \mu\ge0.6 μ ≥ 0.6 ) formal privacy.
Table S15. Numerical values underlying Figure S10(d) (Log-loss win rate over DP-LR).
Table S13. Numerical values underlying Figure S10(b) (AUC win rate over DP-LR).
Table S14. Numerical values underlying Figure S10(c) (Relative log-loss reduction over DP-LR).
Per-dataset Benchmark Results
Per-dataset AUC and log loss are reported for PrivTab in Tables S16 and S17, DP-LR in Tables S18 and S19, DP-MLP in Tables S20 and S21 and non-private LR in Tables S22 and S23.
Table S16. Per-dataset AUC for PrivTab; entries report the mean and bootstrap 95% CI over context–target splits.
Table S17. Table S17: Per-dataset log loss for PrivTab; entries report the mean and bootstrap 95% CI over context–target splits.
Table S18. Per-dataset AUC for DP-LR; entries report the mean and bootstrap 95% CI over context–target splits.
Table S19. Per-dataset log loss for DP-LR; entries report the mean and bootstrap 95% CI over context–target splits.
Table S20. Per-dataset AUC for DP-MLP; entries report the mean and bootstrap 95% CI over context–target splits.
Table S21. Table S21: Per-dataset log loss for DP-MLP; entries report the mean and bootstrap 95% CI over context–target splits.
Table S22. Per-dataset AUC for Non-private LR; entries report the mean and bootstrap 95% CI over context–target splits.
Table S23 : Per-dataset log loss for Non-private LR; entries report the mean and bootstrap 95% CI over context–target splits. (continued)
Table S23. Per-dataset log loss for Non-private LR; entries report the mean and bootstrap 95% CI over context–target splits.
Table S23 (PDF p. 64). Per-dataset log loss for Non-private LR; entries report the mean and bootstrap 95% CI over context–target splits. (continued)
Private Preprocessing Pipeline Details
This subsection supports the private-preprocessing evaluations in Figure 4 , Figure S11 and Figure S12 with the private moment mechanism, details of LLM-bound inference, numerical results, Elo ratings and per-feature clipping bounds.
Private moment mechanism
Let n c n_c n c be the context size and [ a k , b k ] [a_k, b_k] [ a k , b k ] the fixed clipping interval for input coordinate k = 1 , … , d k = 1, \ldots, d k = 1 , … , d . Coordinates with b k − a k < 10 − 6 b_k - a_k < 10^{-6} b k − a k < 1 0 − 6 are set to zero. Otherwise, we clip and rescale each context input as
c i k = min { 1 , max { 0 , ( x i k − a k ) / ( b k − a k ) } } , (147) c_{ik} = \min\{1, \max\{0, (x_{ik} - a_k)/(b_k - a_k)\}\}, \tag*{(147)} c ik = min { 1 , max { 0 , ( x ik − a k ) / ( b k − a k )}} , (147)
and apply the same transformation to target inputs. We add independent Gaussian noise to the context sums and sums of squares:
m ~ 1 k = ∑ i = 1 n c c i k + ξ 1 , k , m ~ 2 k = ∑ i = 1 n c c i k 2 + ξ 2 , k , ξ 1 , k ∼ N ( 0 , σ 1 2 ) , ξ 2 , k ∼ N ( 0 , σ 2 2 ) . (148) \widetilde{m}_{1k} = \sum_{i=1}^{n_c} c_{ik} + \xi_{1,k}, \qquad\widetilde{m}_{2k} = \sum_{i=1}^{n_c} c_{ik}^{2} + \xi_{2,k}, \qquad\xi_{1,k} \sim\mathcal{N}(0,\sigma_1^2), \qquad\xi_{2,k} \sim\mathcal{N}(0,\sigma_2^2). \tag*{(148)} m 1 k = i = 1 ∑ n c c ik + ξ 1 , k , m 2 k = i = 1 ∑ n c c ik 2 + ξ 2 , k , ξ 1 , k ∼ N ( 0 , σ 1 2 ) , ξ 2 , k ∼ N ( 0 , σ 2 2 ) . (148)
Replacing one context row changes each sum vector by at most d \sqrt{d} d in ℓ 2 \ell_2 ℓ 2 norm. We allocate μ 1 = μ p r e p / 2 \mu_1 = \mu_{\mathrm{prep}}/2 μ 1 = μ prep /2 to the sums and μ 2 = μ p r e p 2 − μ 1 2 \mu_2 = \sqrt{\mu_{\mathrm{prep}}^2 - \mu_1^2} μ 2 = μ prep 2 − μ 1 2 to the sums of squares, with σ 1 = d / μ 1 \sigma_1 = \sqrt{d}/\mu_1 σ 1 = d / μ 1 and σ 2 = d / μ 2 \sigma_2 = \sqrt{d}/\mu_2 σ 2 = d / μ 2 . By GDP composition, the two releases satisfy μ p r e p \mu_{\mathrm{prep}} μ prep -GDP because μ 1 2 + μ 2 2 = μ p r e p \sqrt{\mu_1^2 + \mu_2^2} = \mu_{\mathrm{prep}} μ 1 2 + μ 2 2 = μ prep .
We compute the noisy mean m ~ k = m ~ 1 k / n c \widetilde{m}_k = \widetilde{m}_{1k}/n_c m k = m 1 k / n c and variance v ~ k = m ~ 2 k / n c − m ~ k 2 \widetilde{v}_k = \widetilde{m}_{2k}/n_c - \widetilde{m}_k^2 v k = m 2 k / n c − m k 2 . If v ~ k < 10 − 6 \widetilde{v}_k < 10^{-6} v k < 1 0 − 6 , including when it is negative, or the clipping interval is constant, we set that coordinate to zero for both context and target rows. Otherwise, we obtain the standardised input z i k z_{ik} z ik by clipping ( c i k − m ~ k ) / v ~ k (c_{ik} - \widetilde{m}_k)/\sqrt{\widetilde{v}_k} ( c ik − m k ) / v k to [ − 10 , 10 ] [-10, 10] [ − 10 , 10 ] . The LLM-derived bounds use public descriptions; the oracle-bound workflow is partially private because its empirical dataset minima and maxima are selected without privacy accounting.
LLM Bound-Inference Details
For the end-to-end experiments described in the main-text section on private preprocessing, public clipping bounds for numeric features are inferred with Gemini 2.5 Flash. The Gemini call uses temperature 0, top-k = 1 k = 1 k = 1 , and a maximum output budget of 8192 tokens. The response is constrained by an explicit JSON schema, and the code issues a plain generate_content call without enabling any search or retrieval tool. Accordingly, the model is prompted to rely only on the public dataset context, the public column descriptions, the provided units, and general background knowledge, rather than on any online lookup of the dataset.
The prompt is structured so that the model explicitly separates documented public bounds from suggested clipping bounds . For each numeric feature, the response must contain documented lower and upper bounds, a documented-bound status, an evidence field, suggested lower and upper clipping bounds, a suggested-clip status, a guess-rationale field, and a single confidence label. The documented bounds are allowed to be null when the column description does not justify an exact or semantically implied numeric limit. For example, the prompt may allow the model to infer that a quantity is non-negative, or that an age variable refers to adults, while still leaving one side of the documented range unspecified. The evidence field records why a documented bound is justified from the prompt alone. The confidence field is not attached only to the documented part; it is a single feature-level label for the overall returned assessment.
The suggested clipping bounds are the values actually used by preprocessing, and they must always be finite and form a valid interval. When exact public bounds are available, the suggested clipping bounds can simply inherit them. Otherwise, the suggested clipping interval is chosen conservatively from public semantics, units, and general knowledge about the feature meaning. This is why the response distinguishes “what is justified directly by the public description” from “what is a conservative suggested clipping choice for DP preprocessing.” The distinction matters because many features admit only partial public evidence, so one side of the documented range may remain null even though a finite suggested clipping interval is still required operationally. In the implementation, the single confidence label is then conservatively post-processed: if the documented-bound status is semantic_public_bound or insufficient_information, a returned high confidence is downgraded to medium; likewise, if the suggested-clip status is chosen_clipping_bound, a returned high confidence is also downgraded to medium. In addition, when the documented-bound status is insufficient_information, the validator forces both documented bounds to null.
Only columns that genuinely require semantic reasoning are sent to Gemini. Categorical features and columns with direct public bounds, such as publicly documented ordinal codes, bypass the LLM entirely and are handled deterministically in code. For those columns, the implementation sets both documented and suggested bounds directly from the public definition, marks both statuses as exact_public_bound, and assigns high confidence. The LLM is therefore queried only for non-categorical columns that do not already have direct public bounds. Prompts are cached before inference, and the resulting bounds are also cached and reused unless the cache is explicitly refreshed. The implementation additionally validates that Gemini returns exactly the requested feature names and, if a batch request fails, falls back to retrying one column at a time.
Example Prompt.
SYSTEM:
You are extracting PUBLIC clipping bounds for differentially private preprocessing.
Return strict JSON only.
Do not include markdown.
Do not include explanations outside JSON.
USER:
Rules:
1. Analyze each target column independently.
2. Do NOT claim exact bounds unless they are explicit or follow from definitions.
3. Do NOT use empirical min/max values unless explicitly provided in the public description.
4. If true documented bounds are unavailable, you MUST still provide finite suggested clipping
bounds.
5. The suggested clipping bounds must be conservative and based on public semantics, units, and
dataset context.
6. Clearly distinguish documented bounds from guessed clipping bounds.
7. If a public semantic lower bound is clear, include it even when the upper bound is not
documented.
8. All suggested clipping bounds must be finite numeric values.
9. Do not omit a target column. If uncertain, use
documented_bound_status="insufficient_information"
and suggested_clip_status="chosen_clipping_bound".
10. The top-level JSON value must be an array, not an object wrapper.
11. Use the dataset-specific guidance in the dataset context when it defines units,
special values, or semantic lower/upper bounds.
Return strict JSON only as an array:
[
{
"feature": string,
"unit": string | null,
"documented_lower_bound": number | null,
"documented_upper_bound": number | null,
"documented_bound_status": "exact_public_bound" | "documented_special_value"
| "semantic_public_bound" | "insufficient_information",
"suggested_lower_clip": number,
"suggested_upper_clip": number,
"suggested_clip_status": "exact_public_bound" | "semantic_public_bound"
| "chosen_clipping_bound",
"evidence": string,
"guess_rationale": string,
"confidence": "low" | "medium" | "high"
}
]
Dataset context: Pima Indians Diabetes dataset from OpenML/UCI. The task is binary prediction of diabetes onset from diagnostic measurements. Numeric guidance: pregnancies, glucose, blood pressure, skin thickness, insulin, BMI, diabetes pedigree function, and age are non-negative; age is adult age in years. Use only public medical/column semantics for clipping bounds.
Example Response.
{
"dataset": "Pima Indians Diabetes",
"provider": "gemini",
"model": "gemini-2.5-flash",
"results": {
"preg": {
"documented_lower_bound": 0,
"documented_upper_bound": null,
"documented_bound_status": "semantic_public_bound",
"suggested_lower_clip": 0,
"suggested_upper_clip": 17,
"suggested_clip_status": "chosen_clipping_bound",
"evidence": "Dataset context states that pregnancies are non-negative.",
"guess_rationale": "No explicit upper bound is given, so 17 is chosen as a conservative
medically plausible clipping value.",
"confidence": "medium"
},
"plas": {
"documented_lower_bound": 0,
"documented_upper_bound": null,
"documented_bound_status": "semantic_public_bound",
"suggested_lower_clip": 40,
"suggested_upper_clip": 400,
"suggested_clip_status": "chosen_clipping_bound",
"evidence": "The prompt states that glucose is non-negative.",
"guess_rationale": "The final interval is chosen from general medical knowledge about
physiologically plausible glucose values.",
"confidence": "medium"
},
"age": {
"documented_lower_bound": 18,
"documented_upper_bound": null,
"documented_bound_status": "semantic_public_bound",
"suggested_lower_clip": 18,
"suggested_upper_clip": 100,
"suggested_clip_status": "chosen_clipping_bound",
"evidence": "The prompt states that age is adult age in years.",
"guess_rationale": "The lower bound is inherited from the semantic evidence; the upper
bound is a conservative clipping choice based on general knowledge
about adult human ages.",
"confidence": "medium"
}
}
}
Reading the Bound Tables. The supplement tables of public and LLM-derived bounds use the following column meanings. Feature is the preprocessing feature name. Type distinguishes columns that require LLM-based semantic inference from those that do not: numeric means that the feature was sent to Gemini for bound inference, whereas categorical means that the feature was handled deterministically from public category codes or another direct public definition. Exact min and Exact max are the empirical minimum and maximum values observed in the dataset and are reported only for comparison; they are not treated as public bounds by the end-to-end pipeline. Source records where the operational clipping interval comes from: llm means that the final suggested clipping bounds came from the Gemini response, while categorical means that the LLM was bypassed and the bounds were fixed directly from public information in code. Lower and Upper are the final clipping bounds actually used by preprocessing.
The Confidence column is a feature-level label for the final bound assessment. For rows with Source equal to llm, the values low, medium, and high are taken from the validated Gemini response after the conservative post-processing implemented in end_to_end_cases.py. Concretely, a response does not retain high confidence when the documented part is only semantic rather than exact, when the documented status is insufficient_information, or when the suggested interval is marked as chosen_clipping_bound rather than directly justified by the public description. The label exact appears only for rows with Source equal to categorical; it indicates that the bounds were not inferred by the LLM and instead came directly from an exact public feature definition handled deterministically in code.
Method-level results, Elo ratings and preprocessing comparisons are reported in Table S24 to Table S26 . Per-feature clipping bounds are listed in Table S27 to Table S31 .
Table S24. Numerical values underlying Figure 4(c,d).
Table S26. Numerical values underlying Figure 4(a,b). Entries report means with bootstrap 95% CIs over context–target splits; log loss is in nats/sample.
Table S27. Public and LLM-derived bounds for ACS income.
Table S31. Public and LLM-derived bounds for Pima diabetes.
Table S28. Public and LLM-derived bounds for Bank marketing.
Table S29. Public and LLM-derived bounds for COMPAS.
Table S30. Public and LLM-derived bounds for Maternal health. Continued on next page
Ablations
Results for noise-aware pretraining, the privacy curriculum, layer and head counts, the attention function, and normalisation and model combination are reported in Table S32 to Table S37 , respectively.
Ablation: Noise-Aware Pretraining
We compare PrivTab trained with the same privacy-noise mechanism used at inference against a variant trained without noise-aware pretraining. The noise-aware model ranks substantially higher at every privacy level, which indicates that the effect of privatized summaries should be incorporated during pretraining rather than treated as a perturbation added only at deployment time.
Ablation: μ \mu μ -Range Curriculum
We compare different privacy-range curricula used during PrivTab pretraining. The benchmark configuration with μ ∈ [ 0.16 , 64 ] \mu\in[0.16, 64] μ ∈ [ 0.16 , 64 ] is strongest overall; nearby ranges remain competitive, but shifting the curriculum too far toward either weaker or stronger privacy leads to a measurable degradation in the aggregate ranking.
Table S33. Table S33: ELO rankings for the μ \mu μ -range pretraining ablation.
Ablation: Number of Private Layers
We vary the number of main DP-MHCA layers while keeping the rest of the architecture fixed. Three private layers give the strongest overall ranking; reducing the depth to two layers weakens performance substantially, whereas increasing to four layers does not improve over the benchmark configuration.
Table S34. ELO rankings for the ablation over the number of main DP-MHCA layers.
Ablation: Number of DP-MHCA Heads
We compare different head counts inside DP-MHCA. In this ablation, a single DP-MHCA head performs better overall than using four DP-MHCA heads, especially in the more private regime, which supports the benchmark choice of a single privacy-critical head with the full internal width.
Table S35. ELO rankings for the ablation over the number of DP-MHCA heads.
Ablation: DP-MHCA Interaction Function
We compare alternative bounded interaction functions inside DP-MHCA:
g t a n h ( q , k ) = tanh ( ⟨ q , k ⟩ / d h ) , g_{\mathrm{tanh}}(\mathbf{q}, \mathbf{k}) = \tanh\left(\langle\mathbf{q}, \mathbf{k} \rangle/ \sqrt{d_h}\right), g tanh ( q , k ) = tanh ( ⟨ q , k ⟩ / d h ) ,
g l i n e a r c l i p p e d ( q , k ) = ⟨ clip 1 ( q ) , clip 1 ( k ) ⟩ , g_{\mathrm{linear\ clipped}}(\mathbf{q}, \mathbf{k}) = \langle\operatorname{clip}_1(\mathbf{q}), \operatorname{clip}_1(\mathbf{k}) \rangle, g linear clipped ( q , k ) = ⟨ clip 1 ( q ) , clip 1 ( k )⟩ ,
g l i n e a r n o r m a l i s e d ( q , k ) = ⟨ q / ∥ q ∥ 2 , k / ∥ k ∥ 2 ⟩ , g_{\mathrm{linear\ normalised}}(\mathbf{q}, \mathbf{k}) = \langle\mathbf{q}/\lVert\mathbf{q}\rVert_2, \mathbf{k}/\lVert\mathbf{k}\rVert_2 \rangle, g linear normalised ( q , k ) = ⟨ q / ∥ q ∥ 2 , k / ∥ k ∥ 2 ⟩ ,
g s h i f t e d s o f t s i g n ( q , k ) = 1 2 ( 1 + softsign ( ⟨ q , k ⟩ ) ) . g_{\mathrm{shifted\ softsign}}(\mathbf{q}, \mathbf{k}) = \frac{1}{2}\left(1 + \operatorname{softsign}(\langle\mathbf{q}, \mathbf{k} \rangle)\right). g shifted softsign ( q , k ) = 2 1 ( 1 + softsign (⟨ q , k ⟩) ) .
The benchmark tanh choice is strongest overall and becomes increasingly preferable as privacy weakens, while the alternatives rank lower in aggregate.
Table S36. ELO rankings for the ablation over the DP-MHCA interaction function.
Ablation: Context-Scale Normalization and Model Combination
The small-context model trained on context lengths sampled uniformly from [100, 2048] benefits substantially from enabling the normalisation in Eq. (87) at inference time, and the large-context model trained on context lengths sampled uniformly from [1024, 8192] with normalisation is also strong. The final combination described in Supplement S4, which routes to the small-context normalised model for context lengths below 4096 and to the large-context normalised model otherwise, achieves the best aggregate ranking. This supports the motivation for the final benchmark model as a context-scale-aware combination rather than a single fixed variant.