Abstract
Large language models (LLMs) have been shown to be effective on tabular prediction tasks in the low-data regime, leveraging their internal knowledge and ability to learn from instructions and examples. However, LLMs can fail to generate predictions that satisfy group fairness, that is, produce equitable outcomes across groups. Critically, conventional debiasing approaches for natural language tasks do not directly translate to mitigating group unfairness in tabular settings. In this work, we systematically investigate four empirical approaches to improve group fairness of LLM predictions on tabular datasets, including fair prompt optimization, soft prompt tuning, strategic selection of few-shot examples, and self-refining predictions via chain-of-thought reasoning. Through experiments on four tabular datasets using both open-source and proprietary LLMs, we show the effectiveness of these methods in enhancing demographic parity while maintaining high overall performance. Our analysis provides actionable insights for practitioners in selecting the most suitable approach based on their specific requirements and constraints.
Introduction
The application of Large Language Models (LLMs) to tabular data prediction has gained significant traction, particularly in "low-data regimes" where traditional machine learning models like XGBoost or CatBoost often struggle due to a lack of sufficient training samples. By serializing structured data into text, LLMs can leverage their vast pre-trained world knowledge to make informed predictions. However, this capability comes with a significant risk: LLMs often inherit and amplify societal biases present in their training corpora, leading to unfair outcomes for protected demographic groups.
Achieving group fairness—specifically Demographic Parity (DP), where positive outcomes are distributed equally across groups—is a well-studied problem in traditional machine learning. However, standard debiasing techniques for natural language (e.g., removing gendered stereotypes) are insufficient for tabular group fairness, which is defined by statistical distributions of outcomes. This research explores how to steer LLMs toward fairness using in-context learning (ICL) strategies, avoiding the high cost of model fine-tuning or retraining.
Methodology
The study evaluates four distinct in-context strategies designed to improve Demographic Parity without compromising predictive accuracy.
- Fair Prompt Optimization: This approach utilizes an automated "meta-prompting" loop. A "Meta-LLM" evaluates the performance and fairness metrics of a downstream model's predictions and iteratively rewrites the fairness instructions in the prompt to optimize for both goals.
- Soft Prompt Tuning: Rather than modifying natural language, this method optimizes continuous vector "embeddings" added to the prompt. By incorporating a fairness penalty into the loss function, the model learns prompt representations that minimize group disparities.
- Fair Few-Shot Examples: This strategy involves the strategic selection and labeling of examples provided in the prompt. By manipulating the ratio of positive to negative labels for different demographic groups, the model can be "nudged" toward parity.
- Self-Refinement: Primarily effective for larger models (e.g., Llama-3 70B, Claude), this post-hoc method involves the model reviewing its own batch predictions, calculating fairness statistics, and adjusting its outputs if significant disparities are detected.
Experimental Setup
The methods were tested across four benchmark datasets: Adult Income, German Credit, ACS Income, and ACS Coverage. In each case, gender served as the protected attribute. The evaluation focused on the low-data regime, using only 50 available examples for training/prompting, and compared LLM performance against a "fair" Gradient Boosted Trees baseline (CatBoost + GridSearch).
Results and Discussion
The experimental results demonstrate that in-context learning is a powerful tool for achieving group fairness. Across various models and datasets, the proposed methods consistently improved the Demographic Parity ratio, often bringing it close to the ideal value of 1.0.
Key Findings
- Fairness-Accuracy Synergy: In several instances, automated prompt optimization improved both fairness and accuracy. This suggests that fairness constraints can act as a regularizer, helping the model focus on robust features rather than biased noise.
- The Power of Label Ratios: In few-shot settings, the specific labels provided in the prompt were found to be more influential than the features themselves. Adjusting the positive label ratio for disadvantaged groups proved to be a direct lever for tuning selection rates.
- Model Scale and Self-Correction: A critical insight was that self-refinement capabilities are emergent with model size. While large models could successfully self-correct, smaller models (8B parameters) often struggled to accurately estimate their own statistics, sometimes exacerbating unfairness.
Conclusion
This work demonstrates that LLMs can be effectively steered toward group fairness on tabular tasks through strategic in-context learning. These methods provide a flexible, training-free alternative to traditional debiasing, particularly valuable in data-scarce environments. Future research will explore multi-attribute fairness and the application of these techniques to regression tasks.
Summary updated