Source-linked AI summary

UP5: Unbiased Foundation Model for Fairness-aware Recommendation

Wenyue Hua, Yingqiang Ge, Shuyuan Xu, Jianchao Ji, Yongfeng Zhang

arXiv:2305.12090v2cs.IRcs.AIcs.CLcs.LG

TL;DR

LLM-based recommendation raises a user-side fairness problem because sensitive attributes may influence recommendations even when users do not want them used. The paper introduces Counterfactually-Fair-Prompting to mitigate this issue, and experiments show stronger fairness with competitive recommendation performance across the evaluated settings. The study does not address bias affecting historically disadvantaged groups because suitable datasets were unavailable.

  • Problem

    LLM-based recommender systems may use sensitive user attributes such as gender or age, raising a need for user-side counterfactual fairness.

    Source: §1 · pp. 1–2
  • Method

    The paper proposes Counterfactually-Fair-Prompting using adversarial learning and a classifier discriminator to obfuscate sensitive information in LLM-based recommendation.

    Source: §1 · p. 2, §4 · p. 4
  • Results

    CFP outperforms the compared fair matching-based and sequential-based models on AUC and recommendation accuracy, with AUC close to 50%.

    Source: §5.2 · p. 7
  • Takeaways & Limitations

    CFP provides a fairness-aware foundation-model approach that supports single and combined sensitive attributes while maintaining high recommendation performance.

    Source: §1 · p. 2, §5.2 · p. 7

    The study does not examine bias affecting historically disadvantaged groups because suitable datasets containing those sensitive features were unavailable.

    Source: Limitation · p. 9

Abstract

from arXiv · show

Recent advances in Foundation Models such as Large Language Models (LLMs) have propelled them to the forefront of Recommender Systems (RS). Despite their utility, there is a growing concern that LLMs might inadvertently perpetuate societal stereotypes, resulting in unfair recommendations. Since fairness is critical for RS as many users take it for decision-making and demand fulfillment, this paper focuses on user-side fairness for LLM-based recommendation where the users may require a recommender system to be fair on specific sensitive features such as gender or age. In this paper, we dive into the extent of unfairness exhibited by LLM-based recommender models based on both T5 and LLaMA backbones, and discuss appropriate methods for promoting equitable treatment of users in LLM-based recommendation models. We introduce a novel Counterfactually-Fair-Prompt (CFP) method towards Unbiased Foundation mOdels (UFO) for fairness-aware LLM-based recommendation. Experiments are conducted on two real-world datasets, MovieLens-1M and Insurance, and compared with both matching-based and sequential-based fairness-aware recommendation models. Results show that CFP achieves better recommendation performance with a high level of fairness. Data and code are open-sourced at https://github.com/agiresearch/UP5.

1 Introduction

LLM-based recommendation can personalize items through prompts, but may infer sensitive user attributes despite their omission. The paper frames counterfactual fairness as preventing such attributes from influencing recommendations and proposes CFP to mitigate this unfairness while preserving recommendation performance.

  • LLM-based recommendation uses personalized natural-language prompts to generate recommendations from user and item information.Figure 1 illustrates the prompt-driven input-output process.Source: §1 · p. 1, Figure 1 · p. 1
  • The paper targets user-side counterfactual fairness, requiring recommendations to avoid factoring in sensitive attributes users wish to keep undisclosed.Examples include race, gender, and age in movie recommendation.Source: §1 · p. 1
  • Traditional matching and sequential fairness methods do not directly apply because LLM-based recommendation does not consolidate user information into a single embedding or item sequence.The paper therefore explores removing sensitive information from LLM-based recommendation models.Source: §1 · pp. 1–2
  • The paper introduces Counterfactually-Fair-Prompt (CFP), a fairness-aware foundation-model approach that can remove or preserve sensitive attributes according to user preference.The method addresses gender, age, occupation, and related sensitive attributes while targeting high recommendation performance.Source: §1 · p. 2

2 Related Work

Counterfactual fairness requires recommendation outcomes to remain unchanged when sensitive attributes vary while other causally independent user features stay fixed. Existing approaches motivate fairness-aware LLM recommendation but face parameter-efficiency and attribute-combination limitations.

  • Counterfactually fair recommendation requires equivalent recommendation outcomes across factual and counterfactual values of a user’s sensitive attributes.The counterfactual setting holds attributes causally independent of the sensitive attributes constant.Source: §2 · p. 2
  • Removing sensitive information during recommendation generation is a sufficient condition for counterfactual fairness.This connects fairness in recommender systems with methods that suppress attribute information in user representations.Source: §2 · p. 2
  • Prior methods are poorly suited to LLM-based recommendation because one updates all model parameters per feature, while another trains a new prefix prompt and adapter for every attribute combination.The latter limitation becomes problematic as attribute combinations grow exponentially.Source: §2 · pp. 2–3
  • Fairness research for LLMs has examined stereotypes, harmful content, and benchmark evaluation, but recommendation-specific solutions remain an identified gap.The cited work includes fairness testing of ChatGPT on recommendation and other domains without providing solutions.Source: §2 · p. 3

3 Preliminary of LLM-based Recommendation

The paper evaluates P5-based LLM recommendation with T5 and OpenLlama backbones across direct and sequential tasks, then probes whether sensitive attributes are implicitly encoded. Soft probing and classifier methods detect attributes above chance, motivating mitigation.

  • The study uses T5 and OpenLlama backbones within the P5 framework for unfairness-mitigation experiments.P5 is trained for both direct and sequential recommendation.Source: §3 · pp. 3–4
  • Direct recommendation predicts an item without interaction history, whereas sequential recommendation predicts the next item from a user’s watched-item history.Both tasks use prompts that map user information and candidate items to a movie identifier.Source: §3 · p. 4
  • Soft probing prompts and a classifier detect user-sensitive attributes above random prediction levels, while manually designed prompts fail.The evaluated attributes include gender, age, occupation, and marital status on MovieLens and Insurance.Source: §3 · p. 4
  • These probing results indicate that sensitive information can be inferred from LLM-based recommendation models even when it is absent from the training and tuning inputs.This motivates sensitive-information mitigation for counterfactually fair recommendation.Source: §3 · p. 4

4 Counterfactually-Fair Prompting

CFP mitigates sensitive information in LLM-based recommendation through adversarially trained prompts, while Prompt Mixture combines attribute-specific CFPs for user-controlled multi-attribute fairness.

4 Counterfactually-Fair Prompting

  • The method supports personalized fairness because users can select which sensitive attributes should be removed or preserved.For encoder-decoder LLMs, CFP uses encoder and decoder prompts, concatenated with the original input prompt to remove sensitive information from user token embeddings.Source: §4 · p. 4
  • CFP uses adversarial learning to train prompts that mitigate sensitive information while preserving recommendation capability.A discriminator extracts attribute values from embeddings, while CFP training obfuscates that extraction; the model architecture is shown in Figure 4.Source: §4 · p. 4, Figure 4 · p. 5
  • CFP training alternates optimization of the recommendation model and attribute classifier for each sensitive attribute.The recommendation loss encourages the correct item, while the discriminator loss uses cross-entropy to predict an attribute from averaged user-relevant token embeddings.Source: §4 · p. 5
  • The discriminator predicts sensitive attributes from averaged user-relevant token embeddings conditioned on the encoder CFP.The correct attribute value is used as the classifier target, and the adversarial objective is weighted by an attribute-specific discriminator coefficient.Source: §4 · p. 5

4.1 Prompt Mixture

  • Prompt Mixture addresses multi-attribute fairness without training a separate prompt for every exponentially growing attribute combination.It combines embeddings from single-attribute CFPs through an attention layer and supports a variable number of CFPs with potentially different lengths.Source: §4.1 · p. 5, Figure 5 · p. 5
  • Prompt Mixture produces a user-controllable prompt that masks selected sensitive information while preserving other relevant details in hidden states.Users can choose different sensitive-feature combinations without specialized model training for each unique combination; Figure 5 illustrates the mixture over CFPs.Source: §4.1 · p. 5, Figure 5 · p. 5
  • Prompt Mixture is adversarially trained with random attribute combinations to reduce recommendation loss while increasing the summed losses of multiple discriminators.Each optimization step concatenates multiple single-attribute prefix prompts and optimizes the generated prompt for the selected attribute set K.Source: §4.1 · pp. 5–6

5 Experiments

Experiments evaluate CFP on MovieLens-1M and Insurance across recommendation performance and fairness, including single- and multi-attribute settings. CFP outperforms the compared fairness-aware models while maintaining high recommendation performance and fairness.

Experimental Setup

  • The experiments use MovieLens-1M and Insurance, whose user profiles contain sensitive attributes including gender, age, occupation, and marital status.MovieLens includes gender, age, and occupation; Insurance includes gender, marital status, age, and occupation.Source: §5.1 · p. 6
  • Evaluation uses Hit@1, Hit@3, and Hit@10 for recommendation and AUC for sensitive-attribute classification under a leave-one-out protocol.Direct and sequential recommendation predict one correct item among 100 randomly selected negatives.Source: §5.1 · p. 6
  • The study compares CFP with C-PMF, C-SX, S-SAS, and S-B4 fairness-aware baselines, using T5 as the main reported backbone.OpenLLaMA experiments are provided separately in the appendix.Source: §5.1 · p. 6

Single-Attribute Scenario

  • CFP outperforms fair matching-based and sequential-based models in both AUC and recommendation accuracy for single-attribute fairness.Its AUC remains close to 50%, indicating that sensitive attributes are difficult to infer, while recommendation-performance degradation is minimal compared with other models.Source: §5.2 · p. 7, Table 3 · p. 7, Table 4 · p. 7

Multi-Attribute Scenario

  • CFP’s prompt mixture combines single-attribute prefix prompts to remove multiple sensitive attributes while maintaining high recommendation performance.The multi-attribute experiments cover MovieLens and Insurance; sequential fairness baselines are unable to handle multiple attributes.Source: §5.2 · p. 7

6 Detailed Analysis

Detailed analyses examine CFP’s sensitivity to prompt length and discriminator weight, then compare classifier and soft-probing discriminators. Longer prompts and stronger discriminator weights improve fairness but trade off recommendation performance, while classifiers are more effective for training CFP.

Hyperparameter Sensitivity

  • The sensitivity analysis varies prompt lengths of 5, 10, 15, and 30 and discriminator weights of 0.1, 1, 10, and 100.It evaluates Hit@1 for sequential recommendation alongside attribute-detection AUC.Source: §6 · p. 7
  • Longer prefix prompts generally improve recommendation performance but hurt fairness, whereas larger discriminator weights improve fairness but reduce recommendation performance.The trade-off arises because larger fairness weights make the fairness term dominate the loss, so both hyperparameters require careful selection.Source: §6 · pp. 7–8

Soft Probing Prompt as Discriminator

  • The classifier is more effective than soft probing prompts as a CFP discriminator because it detects residual sensitive information that probing prompts cannot extract.On Insurance marital-status experiments, probing AUC stays near 50%, while classifiers retain non-trivial attribute-detection ability and show reduced extraction with longer CFPs.Source: §6 · p. 8, Figure 10 · p. 8

7 Conclusion and Future Work

The paper concludes that probing LLM-based recommendation unfairness and applying CFP can enable a fair recommendation foundation model. Future work targets fairness in explanations and conversational recommendation, plus user-controllable fairness interfaces.

Conclusion and Future Work

  • The paper’s conclusion combines unfairness probing with CFP mitigation to support a fair recommendation foundation model.Future directions include explanation generation, conversational recommendation, and user-responsive fairness controls that preserve performance or user experience.Source: §7 · p. 8

Limitation

The paper did not study bias related to historically disadvantaged groups because suitable datasets with those sensitive features were unavailable.

  • Fairness analysis covered gender, age, and occupation, but not historically disadvantaged groups because the authors lacked suitable datasets.The authors plan to extend the analysis when such datasets become available.Source: Limitation · p. 9

Ethical Consideration

The paper examines whether LLM-based recommender systems leak sensitive user attributes and describes probing methods for detecting such unfairness. Results indicate that learned probing methods can recover attributes, with unfairness varying across datasets and sensitive features.

A Probing Unfairness in LLM-based RS

  • LLM-based recommender systems can implicitly infer and leak sensitive user information even when training data omits explicit sensitive attributes.This motivates probing methods for detecting unfairness in models without consolidated user embeddings.Source: A Probing Unfairness in LLM-based RS · p. 12
  • Three probing strategies use manual discrete prompts, tunable soft prompts, or classifiers trained on user-token embeddings.The classifier uses a multi-class prediction objective, while soft prompts are optimized to elicit attributes.Source: A Probing Unfairness in LLM-based RS · p. 12, §A.2 · p. 13, §A.3 · p. 13

A.1 Manually-Designed Prompt

  • Manual prompting produced AUC near random guessing, suggesting that direct prompts could not elicit encoded sensitive information.The reported AUC was 50% or slightly above 50%.Source: §A.1 · pp. 12–13, Table 7 · p. 13

A.2 Soft Probing Prompt Tuning

  • Soft prompt tuning produced non-trivial attribute predictions, especially on MovieLens, indicating that LLM-based recommendation encodes and leaks user attributes.The experiments used separate train and test user groups in a 9:1 ratio.Source: §A.2 · p. 13, Table 8 · p. 13

A.3 Multi-Class Classifier

  • Classifier probing achieved non-trivial AUC scores and generally exceeded soft prompt tuning, making it the more effective attribute-probing method.The paper attributes this to cross-entropy over multiple classes being better suited than negative log-likelihood over the full vocabulary.Source: §A.3 · p. 13, Table 9 · p. 13
  • MovieLens showed unfairness on gender, age, and slightly occupation, whereas Insurance showed the strongest unfairness on marital status.Unfairness was measured using AUC of label prediction.Source: §A.4 · pp. 13–14

B Results on P5-OpenLlama-3B

The OpenLLaMA-3B appendix reports recommendation performance and fairness results across matching-based, sequential, and multi-attribute prompting experiments. The appendix states that its observations are largely consistent with those obtained using the T5 backbone.

C Pseudo Code for CFP Training

The CFP training procedure alternates recommendation and discriminator updates while optimizing a prefix prompt against recommendation and adversarial objectives.

  • CFP training uses a pretrained LLM4RS, a prefix prompt, a classifier, a discriminator weight, and scheduled update steps.Source: C Pseudo Code for CFP Training · p. 14
  • The classifier is updated using discriminator loss, while the prefix prompt is optimized using recommendation loss minus a weighted discriminator loss.The prompt is also optimized on recommendation loss with the model and classifier fixed.Source: C Pseudo Code for CFP Training · p. 14
Loading 2305.12090v2…