COFT: Counterfactual–Conformal Decoding for Fair Chain‑of‑Thought Reasoning in Large Language Models
Abstract
Large language models (LLMs) can reveal and amplify societal biases during chain-of-thought (CoT) generation. We present COFT (Chain of Fair Thought), a training-free decoding method that applies token-level fairness control at decode time, with distribution-free marginal validity guarantees (under exchangeability) for any frozen causal language model. COFT operates in three stages. First, it creates a masked counterfactual prompt by replacing sensitive spans with neutral tokens. Second, it compares the factual and masked logit distributions through lightweight logit fusion to attenuate attribute-driven biases. Third, it uses dual-branch split-conformal calibration to certify per-step candidate token sets at a user-chosen risk level. We evaluate COFT across six models and multiple bias benchmarks. Our method reduces standard bias metrics by 30–55\% (median 38\%) while preserving task utility and language quality. Reasoning accuracies remain unchanged within run-to-run noise margins. The computational overhead is modest, equivalent to one additional cached forward pass (<=11%). COFT offers a clear, auditable path to safer CoT generation with significant bias reduction, negligible utility loss, and no requirement for retraining, auxiliary classifiers, or weight access.
Lay Summary
Large language models are increasingly used to answer questions, explain decisions, and generate step-by-step reasoning. However, these models can sometimes rely on sensitive attributes such as gender, race, religion, or nationality when producing their reasoning, even when those attributes should not affect the answer. This can lead to biased or unfair reasoning traces and, in some cases, biased final outputs. This paper introduces COFT, a method for making chain-of-thought reasoning in large language models fairer at generation time. Instead of retraining the model, COFT runs the model on both the original prompt and a masked version of the prompt where sensitive information is replaced with neutral tokens. It then compares the two versions and adjusts the next-token probabilities so that the model’s reasoning is less driven by sensitive attributes. COFT also uses conformal prediction, a statistical technique that provides a user-chosen level of risk control, to filter the set of tokens that the model is allowed to generate at each step. The key advantage of COFT is that it is training-free, model-agnostic, and can be applied to frozen language models without changing their weights. Our experiments show that COFT substantially reduces several standard measures of bias while preserving general task performance, reasoning accuracy, and language quality. The method adds only modest computational overhead because it requires one additional masked model pass during decoding. Overall, COFT provides a practical and auditable way to reduce unfair behavior in large language models during step-by-step reasoning, with statistical guarantees under standard conformal prediction assumptions.