首页 > AI前沿 > Aligning Language Models Towards Counterfactual Invariance

Aligning Language Models Towards Counterfactual Invariance

arXiv机器学习 2026-10-16 13:09 3 阅读 查看原文

Small variations in prompt characteristics can meaningfully alter the semantics, tone, and contextual assumptions of large language model outputs.

Such characteristics can involve group variables such as demographics or other sensitive latent attributes.

Sensitivity to such input variables is undesirable when demographic information is causally irrelevant to the task, but might still be relevant for generation of semantically coherent responses.

This makes the task of enforcing counterfactual invariance while preserving model utility difficult.

To study this problem

We first show that standard model alignment recipes (such as reinforcement learning) increase differences in response quality across demographics, while improving overall response quality, ultimately amplifying what is known as counterfactual bias.

To address this

We develop a policy gradient technique involving a group-level reward function that operates on matched pairs of counterfactual prompts.

For completeness, we build a dataset of controlled counterfactual prompt pairs and design an evaluation that separately measures cases where demographic information is causally relevant to the answer.

Finally

We validate our findings on several fairness benchmarks.

We demonstrate that our methods reduce counterfactual differences while preserving overall response quality and that the models continue to adapt appropriately when such sensitive information is relevant.