Fair-ICD in Tabular In-Context Learning
- Fair-ICD is a framework that ensures fairness in in-context learning by selecting and transforming labeled demonstrations without fine-tuning the underlying model.
- It employs methods like correlation removal, group-balanced selection, and uncertainty-based filtering to reduce sensitive attribute leakage and improve fairness metrics.
- Experimental evidence shows that uncertainty-based selection consistently reduces fairness gaps (e.g., demographic parity) with only minimal decreases in accuracy.
Fair-ICD denotes fairness in in-context demonstrations for tabular foundation models: a preprocessing-centered framework in which group fairness is shaped by how labeled demonstrations are selected or transformed before in-context prediction, without parameter updates or fine-tuning of the underlying foundation model. In the tabular setting, the term is grounded in "Towards Fair In-Context Learning with Tabular Foundation Models" (Kenfack et al., 14 May 2025), where Fair-ICD comprises correlation removal, group-balanced demonstration selection, and uncertainty-based demonstration selection, with experiments indicating that conformal-prediction-based uncertainty filtering consistently improves fairness metrics such as demographic parity and equalized odds with only small accuracy costs.
1. Scope, paradigm, and nomenclature
Fair-ICD arises from the shift from conventional supervised training to in-context learning (ICL) on structured data. Tabular foundation models such as TabPFN and TabICL are transformer-based models pretrained on large, synthetic tabular tasks; at inference time they receive labeled demonstrations in context and predict labels for new rows without parameter updates. In this regime, the context itself becomes the main control surface for both predictive performance and fairness, because the model’s outputs are induced by patterns present in the selected demonstrations rather than by a task-specific fine-tuning stage (Kenfack et al., 14 May 2025).
The core idea is therefore not fairness through retraining, adversarial optimization, or post hoc threshold adjustment, but fairness through context design. This suggests a different causal locus for bias mitigation: if the demonstration set is the object through which the model conditions on the task, then representation bias, leakage of sensitive information, and subgroup imbalance can all be mediated through .
The label “Fair-ICD” is also used more broadly in adjacent literatures. In multimodal medical diagnosis with MLLMs, a related interpretation appears in "Fairness in Multi-modal Medical Diagnosis with Demonstration Selection" (Li et al., 20 Nov 2025), where fairness-aware in-context demonstrations are built through balanced and semantically relevant retrieval. By contrast, fair ICD coding work such as DECI treats ICD as International Classification of Diseases coding and addresses demographic and expert bias in multi-label text classification through causal pathway subtraction rather than demonstration selection (Zhang et al., 2024). These usages share a fairness objective but refer to distinct technical settings.
2. Formal problem setting and fairness criteria
The tabular Fair-ICD formulation considers binary classification on a dataset
where is the non-sensitive feature vector, is the label, and , more generally , is the sensitive attribute . The in-context learner produces predictions
0
with 1 the demonstration set. Group fairness is then defined over the statistical properties of 2 across sensitive groups under the ICL paradigm (Kenfack et al., 14 May 2025).
The study centers evaluation on demographic parity (DP), equalized odds (EO), and equal opportunity (EOP), rather than calibration. The demographic parity difference is
3
with empirical form
4
Equalized odds is decomposed into true-positive-rate and false-positive-rate gaps:
5
6
and the combined EO gap is
7
Equal opportunity uses only the TPR term:
8
A central implication of this formulation is that fairness is attributed to in-context predictions themselves, not merely to a static trained classifier. This suggests that fairness evaluation in ICL must account for the interaction between a query instance and the chosen demonstration context.
3. Preprocessing methods that define Fair-ICD
Fair-ICD explores three model-agnostic preprocessing strategies that act before ICL prediction and do not require parameter updates of the foundation model (Kenfack et al., 14 May 2025).
Correlation removal aims to reduce linear dependence between the sensitive attribute 9 and each non-sensitive feature 0. Linear dependence is measured with Pearson’s 1,
2
Using the Correlation Remover of Feldman et al. and the Fairlearn implementation, the data are decomposed as 3, where 4 is the sensitive column or columns and 5 the non-sensitive features. For each non-sensitive feature vector 6, weights 7 are obtained by least squares on centered 8,
9
The transformed features are then
0
and a trade-off parameter 1 combines transformed and original features as
2
with 3 dropped for modeling. The method targets linear dependence rather than mutual information 4.
Group-balanced demonstration selection mitigates representation bias by enforcing balanced group ratios in the context set 5. The procedure selects 6 demonstrations per group 7, aiming for 8 constant across groups. When context size is constrained, majority groups are downsampled uniformly at random. If 9 is the set of groups, one may set 0 or use a preset budget per group, and construct
1
where 2 is a stratified random sample of size 3 from group 4. This guarantees equal group presence but does not directly alter within-group label distributions or more complex historical or measurement biases.
Uncertainty-based demonstration selection is the key contribution. Its hypothesis is that if the sensitive attribute is hard to infer for the selected demonstrations, the foundation model will encode less group information in context and therefore produce fairer predictions. The sensitive attribute classifier 5 is trained on a held-out 20% split without using task labels 6; the study instantiates two variants, Uncertain+LR and Uncertain+TabPFN. Conformal prediction defines a nonconformity score, for example
7
a calibration threshold 8, and prediction sets
9
Samples with 0 are treated as uncertain because the prediction set contains both sensitive labels. The demonstration rule is
1
where 2 is the training fold. With 3, more samples are uncertain; with 4, fewer are uncertain. The method can optionally cap 5 to model context limits and apply secondary stratification by 6 or 7.
4. Experimental evidence and empirical behavior
The empirical evaluation spans ACSIncome, ACSEmployment, ACSTravelTime, ACSMobility, ACSPublicCoverage, Diabetes, German Credit, and CelebA, with sensitive attributes including gender, race, and age group. For each dataset, 20% is held out to train and calibrate the sensitive-attribute classifier, and the remaining 80% is evaluated with 5-fold cross-validation over 10 random seeds. Demonstration construction varies by method, and ICL is performed with TabPFN and TabICL; baselines are Vanilla random selection, Balanced stratified selection, Correlation Remover, Uncertain+LR, and Uncertain+TabPFN (Kenfack et al., 14 May 2025).
| Setting | Vanilla | Uncertain-based |
|---|---|---|
| ACSIncome (TabPFN) | Acc 80.76%; 8 14.21; 9 5.46; 0 5.89 | Acc 80.13%; 1 8.90; 2 3.33; 3 3.56 |
| ACSEmployment (TabPFN) | Acc 82.18%; 4 1.11; 5 8.17 | Acc 81.69%; 6 0.80; 7 6.99 |
| CelebA (TabPFN) | Acc 80.55%; 8 14.54; 9 12.03 | Acc 79.86%; 0 10.01; 1 3.54; 2 5.46 |
| Diabetes (Vanilla vs Uncertain+LR) | Acc 64.59%; 3 1.74; 4 2.74 | Acc 64.39%; 5 0.77; 6 2.52 |
Across datasets and both foundation models, uncertainty-based selection consistently improves fairness with minimal loss in accuracy. On ACSIncome with TabPFN, for example, 7 decreases by 8, 9 by 0, and 1 by 2, while accuracy changes by 3. On CelebA, the fairness effect is larger: 4 decreases by 5, 6 by 7, and 8 by 9, with a 0 accuracy change.
Two negative or weak findings are equally important. Group-balanced selection shows only marginal fairness gains on most datasets, indicating that representation bias is not the dominant source of unfairness in these experiments. Correlation removal frequently amplifies unfairness when applied to both train and test data: on ACSIncome with TabPFN, 1 rises from 2 to 3, and 4 rises to 5. A variant that applies correlation removal only to training features improves fairness relative to the both-train-and-test condition.
Pareto analysis reinforces the same pattern. Varying 6 for uncertainty-based selection and 7 for correlation removal produces fairness–accuracy frontiers, and uncertainty-based selection yields Pareto-dominant points compared to Vanilla and CR on ACSIncome and ACSMobility, with similar behavior on other datasets. Under Uncertain+TabPFN selection, TabPFN and TabICL show similar fairness, while TabPFN often attains slightly higher accuracy.
5. Mechanisms, trade-offs, and implementation constraints
The main explanatory hypothesis is sensitive-attribute leakage. When demonstrations are chosen so that the sensitive attribute is difficult to infer, the model has less group information available in context, and group-conditioned behavior weakens. On ACSIncome, ICL accuracy for predicting the sensitive attribute on test data falls from approximately 8 to approximately 9 under Uncertain+TabPFN selection, whereas correlation removal applied to transformed test features yields approximately 00 sensitive-attribute reconstruction accuracy. This supports the claim that some preprocessing schemes do not hide 01 from a tabular transformer, but instead create an invertible proxy (Kenfack et al., 14 May 2025).
The fairness–utility trade-off is expressed through
02
for example 03, and
04
Observed behavior is systematic: uncertainty-based selection typically yields substantial positive 05, with 06 reductions of 07–08 points and larger reductions on CelebA and ACSIncome, while 09 usually lies in the range 10 to 11 percentage points. Balanced selection gives small 12 with negligible 13, whereas correlation removal can produce negative 14 despite occasional slight accuracy gains.
Implementation is operationally simple. The recommended pipeline is to choose 15, 16, and features 17; reserve 20% of data for the sensitive-attribute classifier; train 18 with logistic regression or TabPFN; compute 19 using conformal prediction, with 20 as the main default; retain demonstrations with 21; optionally cap 22 to model limits and stratify within the uncertain set; then run ICL with TabPFN or TabICL and evaluate accuracy, 23, 24, and 25. MAPIE supports conformal prediction efficiently, and the added overhead is modest because no foundation-model updates are required.
Context size remains a practical constraint. TabPFN supports up to approximately 26k samples and approximately 27 features in context, whereas TabICL scales to approximately 28k samples. Accuracy improves with larger 29, and fairness saturates beyond approximately 30 demonstrations, so the practical recommendation is to preserve as many uncertain demonstrations as the model permits.
The main limitations are explicit. Uncertainty-based selection requires sensitive labels to train and calibrate 31; in some jurisdictions even that use may be restricted. Very small 32 can shrink 33 excessively and reduce accuracy. Conformal guarantees depend on calibration, so distribution shift between calibration and training folds can affect uncertainty estimates. Most experiments use binary 34, and multi-group extensions, while described as straightforward, may require careful stratification.
6. Broader research landscape and open directions
Fair-ICD in the tabular sense belongs to a broader family of fairness-aware ICL methods. In multimodal medical diagnosis, FADS builds a fairness-aware demonstration set by embedding each labeled case, clustering candidates with k-means, filtering clusters with near-uniform subgroup distributions, and then selecting semantically relevant exemplars under demographic and label balancing constraints. Its primary fairness metric is Accuracy Disparity,
35
and experiments show that conventional demonstration-selection strategies can produce inconsistent fairness, whereas balanced, semantically relevant selection reduces disparities across gender, race, and ethnicity (Li et al., 20 Nov 2025). This suggests that Fair-ICD is not specific to tabular transformers, even though the leakage mechanisms and selection operators differ by modality.
A distinct but related line of work addresses fairness in ICD coding rather than in-context demonstrations. DECI models prediction through three pathways—aggregated knowledge 36, direct demographic influence 37, and irrelevant expert activation 38—and debiases at inference via
39
This is a causal pathway-subtraction approach for multi-label clinical text classification rather than a context-selection method (Zhang et al., 2024). Another neighboring framework, FairICP, is an in-processing adversarial method for equalized odds with multiple sensitive attributes, using inverse conditional permutation to match 40 to 41 without estimating 42 directly (Lai et al., 2024). Together, these works delineate three different fairness loci: context preprocessing, causal path subtraction, and adversarial in-processing.
For tabular Fair-ICD, several open questions remain explicit. Post-processing in ICL and in-processing alternatives such as FairPFN have not been fully compared with preprocessing. Fairness under distribution shift between context and test data remains unresolved. Reweighting-based fairness is limited by the fact that sample weights are currently not supported by TabPFN or TabICL. Extensions to multi-attribute fairness and individual fairness also remain open. The uncertainty-based strategy is described as modality-agnostic and, with appropriate serialization, could be applied to LLM-based ICL; however, tabular transformers outperform LLMs on numeric tables and avoid LLM context-window constraints (Kenfack et al., 14 May 2025).