De-biased Attention Supervision for Text Classification with Causality

Yiquan Wu, Yifei Liu, Ziyu Zhao, Weiming Lu, Yating Zhang, Changlong Sun, Fei Wu, Kun Kuang

Abstract

Standard Attention Supervision (AS) aims to improve model interpretability by guiding attention toward human-defined keywords. However, in specialized domains, AS often degrades classification performance due to inherent data biases. This paper introduces De-biased Attention Supervision (DAS), a framework leveraging causal inference to mitigate label- and word-based biases. By applying backdoor adjustment and direct effect subtraction, DAS achieves superior accuracy and alignment with human reasoning, particularly in complex legal and medical text classification tasks.

Introduction

In text classification, attention mechanisms are designed to highlight relevant tokens. Yet, unsupervised models frequently focus on non-informative tokens like punctuation or conjunctions. Attention Supervision (AS) addresses this by providing "gold" keywords for the model to prioritize. While AS enhances interpretability, it frequently leads to a drop in classification accuracy in professional domains such as law or medicine.

The authors identify two primary causal biases hindering AS:

  1. Label-caused bias: Spurious correlations between common words and frequent labels in imbalanced datasets.
  2. Word-caused bias: The failure to distinguish between generally frequent words and those specifically meaningful for a task.

Methodology

The DAS framework employs causal inference to decouple these biases from the learning process.

Causal Modeling

The classification process is modeled as a Directed Acyclic Graph (DAG) involving the Input ($I$), Label Distribution ($D$), Query ($q$), Representation ($R$), and Predicted Label ($Y$). This allows for the identification of "backdoor paths" where bias enters the system.

Causal graph representing the text classification process with potential biases.

De-biasing Techniques

  • Backdoor Adjustment: To eliminate label-caused bias, DAS uses a "do-operation" on the attention representation. Instead of allowing the query $q$ to be influenced by the dataset's label distribution $D$, the model calculates an interventional posterior by averaging attention across all possible labels.
  • Direct Effect Subtraction: To address word-caused bias, the framework calculates the Natural Direct Effect (NDE)—the inherent bias of a word based on its frequency—and subtracts it from the Total Effect (TE). This isolates the "True Importance" of a word for specific classification.

Model Architecture

The adjustments are integrated into a standard attention-based architecture, allowing for end-to-end training via a modified loss function.

Architecture of the De-biased Attention Supervision (DAS) framework.

Experimental Setup

The study evaluates DAS on two large-scale professional datasets:

  • Legal Verdict (CAIL2018): 164,194 factual descriptions of crimes categorized into 138 charges.
  • Medical Triage: Over 1.7 million patient questions across 185 medical departments.

These datasets are characterized by high label imbalance and subtle linguistic distinctions (e.g., "caused" vs. "intended") that significantly impact classification.

Results and Discussion

DAS demonstrates that the performance drop in standard AS is not due to the keywords themselves, but the model's failure to account for distributional context.

Performance and Robustness

  • Accuracy Gains: On the Legal dataset, DAS improved the Macro-F1 score of a BiLSTM model to 82.22%, outperforming both the standard model (80.59%) and standard AS (79.76%).
  • Long-Tail Performance: DAS significantly benefits infrequent labels. For the bottom 25% of labels in the Medical dataset, Macro-F1 improved by nearly 4% compared to standard attention.

Interpretability

Human evaluation confirms that DAS-generated attention maps align better with professional reasoning. In blind tests, annotators preferred DAS attention maps over 70% of the time for legal texts, noting that the model correctly identified "smoking gun" keywords.

Conclusion

De-biased Attention Supervision (DAS) resolves the trade-off between interpretability and accuracy by grounding attention in causal principles. While currently dependent on external keyword selection methods, DAS provides a robust foundation for more reliable AI in critical domains. Future work includes integrating these causal de-biasing techniques into the pre-training phase of Large Language Models (LLMs).

Summary updated

BibTeX
@inproceedings{wu2024de,
  author = {Yiquan Wu and Yifei Liu and Ziyu Zhao and Weiming Lu and Yating Zhang and Changlong Sun and Fei Wu and Kun Kuang},
  title = {{De-biased Attention Supervision for Text Classification with Causality}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i17.29897},
}
Figure