Conformal Fair Decoding for Large Language Model Recommenders

Ziwei Wu, Jingrui He

Large Language Models (LLMs) have become surprisingly capable "zero-shot" recommenders. You can feed them a user's watch history, and they’ll suggest the next movie without any specific training. However, these models often harbor a subtle bias: if you change a single word in the prompt—like switching "male" to "female"—the recommendations can shift dramatically (e.g., from action movies to rom-coms), even if the user's actual history is identical. This is known as minimal-attribute-change disparity.

A new paper from researchers at the University of Illinois Urbana-Champaign introduces FairRec, a framework designed to fix this bias at the moment of generation, even when the underlying model is a "black box" accessed via an API.

TL;DR

FairRec is a decoding-time framework that ensures LLM recommendations remain semantically stable when protected attributes (like gender) change. By using conformal calibration to set statistical fairness thresholds and an adaptive "soft" penalty during item selection, it significantly reduces counterfactual disparity while maintaining high recommendation quality.

What Problem Does This Paper Address?

Most fairness interventions for LLMs require retraining the model or having access to its internal weights. However, in the real world, developers often access models through APIs (like OpenAI or Anthropic) that only provide text outputs or log-probabilities for specific candidates.

Existing "black-box" fixes, like prompt repair, are reactive: they wait for the model to generate something biased, then ask it to try again with an "avoid" instruction. This is slow, expensive, and clutters the prompt. The authors argue that fairness should be enforced inside the decoding loop—as the recommendation list is being built—rather than after the fact.

Methods

The authors propose FairRec, which operates in two stages:

  1. Offline Conformal Calibration: Before deployment, the system looks at a "calibration set" of users. It identifies "neighborhoods" of similar users who differ only by a protected attribute. It then calculates the "typical" semantic distance (disparity) between their recommendations. Using conformal prediction principles, it sets a threshold ($\delta$) that defines what a "fair" amount of disparity looks like with statistical rigor.
  2. Online Decoding: When generating a list for a new user, FairRec intervenes at the item level. As the LLM proposes candidate items, FairRec evaluates them against the $\delta$ threshold.
  3. Hard FairRec: Simply filters out any item that would push the list's disparity above the threshold.
  4. Soft FairRec (The "Headline" Method): Instead of a hard cut-off, it uses a dual-controlled penalty. It adds a penalty term ($\lambda$) to the item's likelihood score. If the system detects it is violating the fairness target too often, it automatically increases the penalty; if it's being "too fair" at the cost of utility, it relaxes the penalty.

Crucially, this happens at the item level (e.g., choosing "Blade Runner") rather than the token level (choosing the letter "B"), which matches the semantic level where fairness actually matters.

Datasets

The researchers evaluated FairRec using two standard recommendation benchmarks:

  • MovieLens-1M: A classic dataset of movie ratings.
  • Amazon Movies & TV: A sparser dataset used to test performance under limited interaction data.

They tested these using two state-of-the-art open-weights models: Qwen3-8B and Llama3.1-8B-Instruct.

Key Insights and Ideas

  • Fairness as a Moving Target: The "Soft" variant of FairRec is particularly clever because it treats fairness as a dynamic optimization problem. By adapting the penalty ($\lambda$) online, it can handle "adversarial" or unusual sequences of queries that a fixed threshold might struggle with.
  • Statistical Meaning over Heuristics: Instead of picking a random number for a "fairness score," using conformal calibration allows the developer to say, "I want my recommendations to be at least as stable as 95% of typical users."
  • The "Black-Box" Advantage: Because FairRec only needs to score a few candidate items proposed by the LLM, it works perfectly with modern APIs that provide candidate log-probabilities, making it highly practical for industry deployment.

Key Results

The study compared FairRec against several baselines, including standard Zero-Shot LLMs and FACTER (a prompt-repair method).

  • Significant Bias Reduction: Soft FairRec reduced Counterfactual Disparity (CFR) by 36.1% to 65.3% compared to the Zero-shot baseline across different models and datasets.
  • Utility Retention: Unlike many fairness methods that "break" the recommender's accuracy, FairRec maintained competitive HR@10 (Hit Ratio) and NDCG@10 (Ranking quality). In some cases on the Amazon dataset, Soft FairRec actually slightly outperformed the biased Zero-shot model in accuracy.
  • Efficiency: Because it's a single-pass decoding process, it avoids the latency and token-cost penalties of iterative prompt-repair methods.

Limitations and Future Work

  • The "Enforceability" Assumption: The theoretical guarantees of the soft decoder rely on the assumption that the LLM can actually propose a fair item. If the model's candidate pool is 100% biased, no amount of re-weighting can fix it.
  • Coarseness: The method is limited by the "proposer." If the LLM only suggests five items and all five are biased, the "Hard" variant might be forced to abstain from recommending anything at all.
  • Distribution Shift: If the types of users or items change drastically after calibration, the threshold $\delta$ might become outdated, requiring periodic recalibration.

Overall, FairRec represents a shift toward "fairness-by-design" in the generative AI era, moving away from reactive prompting and toward principled, real-time control of model behavior.

Summary updated

Abstract

Large language models (LLMs) can generate personalized recommendations without task-specific training, but changing a protected attribute while holding interaction history fixed can alter the semantic content of recommended items. We study fairness control when model weights and full-vocabulary logits are unavailable. We propose Fair- Rec, an item-level decoding framework that uses an offline-calibrated semantic-disparity threshold and controls candidate selection as recommendation lists are generated. A hard variant filters candidates against the threshold; a soft variant trades off candidate likelihood and disparity while adapting a penalty using observed violations. Under an explicit uniform enforceability assumption, we establish a pathwise O(1/T) upper bound on the excess empirical violation rate of the soft decoder. Experiments on MovieLens-1M and Amazon Movies & TV using Qwen3-8B and Llama3.1-8B-Instruct show that the soft variant lowers measured counterfactual disparity relative to zero- =shot recommendation, UP5, and FACTER, while retaining competitive HR@10 and NDCG@10.
BibTeX
@misc{wu2026conformal,
  author = {Ziwei Wu and Jingrui He},
  title = {{Conformal Fair Decoding for Large Language Model Recommenders}},
  year = {2026},
  eprint = {2611.10285},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.10285},
}
Figure