# A Framework for Task-Agnostic Counterfactual Fairness in Transformers through Activation Steering

arXiv: https://arxiv.org/abs/2611.00298 · HTML: https://mlsanity.com/paper/2611.00298/

## Key facts

- No citing papers in the map yet (data through 26 Nov 2026).
- Placed in Circuits and mechanistic analysis, one of 13 directions in Mechanistic interpretability.
- Builds on 21 of its 48 references that are in the map.
- Submitted 30 Oct 2026.

## Placed in

- Mechanistic interpretability / [Circuits and mechanistic analysis](https://mlsanity.com/mechinterp/circuits-and-mechanistic-analysis/)

## Builds on (most cited first, 21 of 21)

- [Attention Is All You Need](https://mlsanity.com/paper/1706.03762/) (2017)
- [A Unified Approach to Interpreting Model Predictions](https://mlsanity.com/paper/1705.07874/) (2017)
- [Toy Models of Superposition](https://mlsanity.com/paper/2209.10652/) (2022)
- [Counterfactual Fairness](https://mlsanity.com/paper/1703.06856/) (2017)
- [Mechanistic Interpretability for AI Safety -- A Review](https://mlsanity.com/paper/2404.14082/) (2024)
- [Direct and Indirect Effects](https://mlsanity.com/paper/1301.2300/) (2013)
- [How to use and interpret activation patching](https://mlsanity.com/paper/2404.15255/) (2024)
- [Model-Agnostic Counterfactual Explanations for Consequential Decisions](https://mlsanity.com/paper/1905.11190/) (2019)
- [The Dangers of Post-hoc Interpretability: Unjustified Counterfactual Explanations](https://mlsanity.com/paper/1907.09294/) (2019)
- [A Survey on Large Language Models for Critical Societal Domains: Finance, Healthcare, and Law](https://mlsanity.com/paper/2405.01769/) (2024)
- [A Framework for Human Evaluation of Large Language Models in Healthcare Derived from Literature Review](https://mlsanity.com/paper/2405.02559/) (2024)
- [FairSteer: Inference Time Debiasing for LLMs with Dynamic Activation Steering](https://mlsanity.com/paper/2504.14492/) (2025)
- [LLMs for Generating and Evaluating Counterfactuals: A Comprehensive Study](https://mlsanity.com/paper/2405.00722/) (2024)
- [A Probabilistic Calculus of Actions](https://mlsanity.com/paper/1302.6835/) (2013)
- [Learning for Counterfactual Fairness from Observational Data](https://mlsanity.com/paper/2307.08232/) (2023)
- [Fairness-Accuracy Trade-Offs: A Causal Perspective](https://mlsanity.com/paper/2405.15443/) (2024)
- [FairPFN: Transformers Can do Counterfactual Fairness](https://mlsanity.com/paper/2407.05732/) (2024)
- [Using Causal Analysis for Conceptual Deep Learning Explanation](https://mlsanity.com/paper/2107.06098/) (2021)
- [The Effect of Enforcing Fairness on Reshaping Explanations in Machine Learning Models](https://mlsanity.com/paper/2512.02265/) (2025)
- [Causal Pre-training Under the Fairness Lens: An Empirical Study of TabPFN](https://mlsanity.com/paper/2601.17912/) (2026)
- [Efficient and Interpretable Transformer for Counterfactual Fairness](https://mlsanity.com/paper/2604.26188/) (2026)

## Abstract (arXiv)

Bias in transformer-based models is a growing concern as these architectures become more prevalent in automated decision-making systems, such as prediction models for hiring, lending, and clinical treatment recommendation. Mechanistic interpretability (MI) is a growing body of work that measures meaningful causal effects of activations on model output by identifying human-interpretable features encoded in model activations. When such features correspond to sensitive attributes, they provide a direct way to quantify the bias those attributes introduce and to causally intervene to mitigate it. However, counterfactual fairness (CF) methods have not been systematically adapted to this setting of intervening on interpretable mechanisms in transformers. We propose a framework, Mechanistic Interpretability for Counterfactual Fairness (MICF), that utilizes MI tools to reformulate CF constraints in terms of transformer activations, unifying former approaches into a single pipeline for fairness analysis in transformers. MICF does not require a prior causal model or specific transformer architecture. We evaluate MICF on real-world tabular data and show that CF can be improved across different prediction tasks.
