In-Context Bias Propagation in LLM-Based Tabular Data Generation
Organizations: Barcelona Supercomputing Center (BSC), Spain · Universitat Politècnica de Catalunya (UPC), Spain · IBM Research Ireland
Abstract
Large Language Models (LLMs) are increasingly used for synthetic tabular data generation through in-context learning (ICL), offering a practical solution for data augmentation in data scarce scenarios. While prior work has shown the potential of LLMs to improve downstream task performance through augmenting underrepresented groups, these benefits often assume access to a subset of unbiased in-context examples, representative of the real dataset. In real-world settings, however, data is frequently noisy and demographically skewed. In this paper, we systematically study how statistical biases within in-context examples propagate to synthetic tabular data, showing that even mild in-context biases lead to global statistical distortions. We further introduce an adversarial scenario where a malicious contributor can inject bias into the synthetic dataset via a subset of in-context examples, ultimately compromising the fairness of downstream classifiers for a targeted and protected subgroup. Finally, we evaluate prompt-side mitigation strategies based on preprocessing in-context examples and instruction-based defenses, demonstrating that while such techniques can attenuate disparity, the inherent sensitivity of LLMs to adversarial prompts remains a persistent challenge. Our findings highlight a critical new vulnerability in LLM-based data generation pipelines within sensitive domains.
Figures & tables
| Dataset | Null 95% CI | |||
|---|---|---|---|---|
| Adult | 0.3 | -0.325 | [0.043, 0.369] | 0.002 |
| 0.6 | -0.609 | [0.021, 0.349] | 0.002 | |
| Compas | 0.3 | -0.395 | [-0.350, 0.112] | 0.024 |
| 0.6 | -0.358 | [-0.352, 0.091] | 0.042 | |
| Diabetes | 0.3 | -0.256 | [0.076, 0.513] | 0.002 |
| 0.6 | -0.318 | [0.079, 0.484] | 0.002 |
| Dataset | Protected Attr | Target Label | Feature-Aligned Values |
|---|---|---|---|
| Compas | Race: African-American | Recidivism (1) | Priors: 3–8 Age: 18–45 Juv. Felonies: 0 Charge Degree: M or F (Random) |
| Adult | Gender: Female Marital-status: Married-civ-spouse Native-country: United-States | Income: 50K | Age: 30–55 Education: HS-grad or Some-college Hours/Week: 38–41 Capital Loss: 0–50 |
| Diabetes | Age: 21–30 | Diabetes (1) | Glucose: 120–155 BMI: 27.0–33.0 Insulin: 80–180 Pedigree: 0.6–1.2 |
| Thyroid | Age: 20–35 | High Risk (2) | Goiter: 0 or 1 (Random) Family History: 0 or 1 (Random) Fatigue: 0 or 1 (Random) Gender: 0 (Female) |
| Model | Adult | Compas | Diabetes | Thyroid | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ↑ | ↓ | ↓ | ↑ | ↓ | ↓ | ↑ | ↓ | ↓ | ↑ | ↓ | ↓ | ||
| Real oracle | – | ||||||||||||
| TVAE | 0.0 | ||||||||||||
| CTGAN | 0.0 | ||||||||||||
| NFLOW | 0.0 | ||||||||||||
| DDPM | 0.0 | ||||||||||||
| Model | Adult | Compas | Diabetes | Thyroid | ||||
|---|---|---|---|---|---|---|---|---|
| JSD ↓ | TVC ↑ | JSD ↓ | TVC ↑ | JSD ↓ | JSD ↓ | TVC ↑ | ||
| Granite-8B | 0.0 | 0.096 | 0.790 | 0.258 | 0.895 | 0.340 | 0.183 | 0.971 |
| 0.3 | 0.122 | 0.754 | 0.366 | 0.890 | 0.342 | 0.221 | 0.911 | |
| 0.6 | 0.201 | 0.724 | 0.484 | 0.824 | 0.377 | 0.269 | 0.819 | |
| Mistral-7B | 0.0 | 0.161 | 0.716 | 0.318 | 0.871 | 0.263 | 0.232 | 0.927 |
| 0.3 | 0.186 | 0.622 | 0.411 | 0.905 | 0.297 | 0.242 | 0.873 | |
| Model | Adult | Compas | |||||||
|---|---|---|---|---|---|---|---|---|---|
| Asc. | MMD | Asc. | MMD | ||||||
| D | T | D | T | D | T | D | T | ||
| Granite-8B | 0.0 | 0.054 | 0.052 | 0.012 | 0.001 | 0.058 | 0.025 | 0.079 | 0.007 |
| 0.3 | 0.082 | 0.249 | 0.013 | 0.023 | 0.061 | 0.062 | 0.076 | 0.004 | |
| 0.6 | 0.094 | 0.434 | 0.025 | 0.091 | 0.064 | 0.191 | 0.075 | 0.012 | |
| Mistral-7B | 0.0 | 0.146 | 0.038 | 0.028 | 0.021 | 0.094 | 0.102 | 0.093 | 0.011 |
| Classifier | F1 R ↑ | SPD D ↓ | F1 R ↑ | SPD D ↓ |
|---|---|---|---|---|
| Random Forest | 0.58 | -0.52 | 0.61 | -0.41 |
| Logistic Regression | 0.53 | -0.43 | 0.55 | -0.53 |
| Gradient Boosting | 0.58 | -0.34 | 0.57 | -0.38 |
| TabPFN [ 10 ] | 0.61 | -0.15 | 0.62 | -0.25 |
| Dataset | before | after | Biased drop | Clean drop |
|---|---|---|---|---|
| Adult | -0.839 | -0.944 | 0.938 | 0.438 |
| Compas | -0.358 | -0.133 | 1.000 | 0.469 |
| Diabetes | -0.318 | -0.188 | 0.771 | 0.531 |
| Thyroid | -0.517 | -0.433 | 0.875 | 0.500 |
| Model | Mitigation | Adult | Compas | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| F1↑ | ↓ | ↓ | F1↑ | ↓ | ↓ | ||||||
| Granite-8B | No mitigation | ||||||||||
| Random subset | |||||||||||
| Group-balanced | |||||||||||
| Fair-SPD | |||||||||||
| Correlation filtering | |||||||||||
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
| Dataset | Task | Attributes | Target | Protected group |
|---|---|---|---|---|
| Adult | Income prediction | age, workclass, fnlwgt, education, educational-num, marital-status, occupation, relationship, race, gender, capital-gain, capital-loss, hours-per-week, and native-country. | income: income K | Female, married-civ-spouse, United-States. |
| COMPAS | Two-year recidivism prediction | sex, age, juv_fel_count, juv_misd_count, juv_other_count, priors_count, age-category indicators, race indicators, and charge-degree indicators. The prepared dataset also contains id as an identifier. | y: recidivism | African-American |
| Diabetes | Diabetes diagnosis | Pregnancies, Glucose, BloodPressure, SkinThickness, Insulin, BMI, DiabetesPedigreeFunction, and Age. | Outcome: diabetes diagnosis | Age between 21 and 30 |
| Thyroid | Thyroid-risk classification | Age, Gender, Pregnancy, Family_History_of_Thyroid, Goiter, Fatigue, Weight_Change, Hair_Loss, Heart_Rate_Changes, Sensitivity_to_Cold_or_Heat, Increased_Sweating, Muscle_Weakness, Constipation_or_More_Bowel_Movements, Depression_or_Anxiety, Difficulty_Concentrating_or_Memory_Problems, and Dry_or_Itchy_Skin. | Thyroid_Risk_Level: no, moderate, or high risk | Age between 20 and 35 |
| Bank | Term-deposit subscription prediction | age, job, marital, education, default, balance, housing, loan, contact, day, month, duration, campaign, pdays, previous, and poutcome. | y: subscribed to term deposit | Age between 18 and 30 |
| Model | Adult | Compas | Diabetes | Thyroid | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 95% CI | 95% CI | 95% CI | 95% CI | ||||||||||
| Granite-8B | 0.3 | -0.677 | [-0.770, -0.549] | 0.002 | -0.038 | [-0.079, -0.001] | 0.060 | -0.119 | [-0.158, -0.076] | 0.002 | -0.278 | [-0.330, -0.221] | 0.002 |
| 0.6 | -0.728 | [-0.807, -0.600] | 0.002 | -0.174 | [-0.213, -0.136] | 0.002 | -0.244 | [-0.293, -0.202] | 0.002 | -0.322 | [-0.374, -0.271] | 0.002 | |
| Mistral-7B | 0.3 | -0.276 | [-0.412, -0.117] | 0.005 | -0.191 | [-0.226, -0.152] | 0.002 | -0.122 | [-0.166, -0.075] | 0.002 | -0.217 | [-0.278, -0.152] | 0.002 |
| 0.6 | -0.378 | [-0.491, -0.263] | 0.002 | -0.219 | [-0.255, -0.181] | 0.002 | -0.263 | [-0.307, -0.214] | 0.002 | -0.303 | [-0.357, -0.250] | 0.002 | |
| Mixtral-8x7B | 0.3 | -0.195 | [-0.381, -0.000] | 0.017 | -0.098 | [-0.136, -0.056] | 0.002 | -0.130 | [-0.173, -0.085] | 0.002 | -0.153 | [-0.207, -0.100] | 0.002 |
Synthetic Data Generation
Synthetic data generation creates artificial examples, simulations, and datasets to train, test, or protect machine-learning systems.
See all 623 papers