[Paper Review] ToxCCIn: Toxic Content Classification with Interpretability
This paper proposes ToxCCIn, a method to enhance interpretability in transformer-based toxicity detection by modeling a post's toxicity as the maximum toxicity of its spans. By training a multi-task model to predict both overall toxicity and individual span toxicity, the approach generates high-quality, human-preferred explanations that outperform traditional Logistic Regression in interpretability, while maintaining strong classification performance on the Civil Comments dataset.
Despite the recent successes of transformer-based models in terms of effectiveness on a variety of tasks, their decisions often remain opaque to humans. Explanations are particularly important for tasks like offensive language or toxicity detection on social media because a manual appeal process is often in place to dispute automatically flagged content. In this work, we propose a technique to improve the interpretability of these models, based on a simple and powerful assumption: a post is at least as toxic as its most toxic span. We incorporate this assumption into transformer models by scoring a post based on the maximum toxicity of its spans and augmenting the training process to identify correct spans. We find this approach effective and can produce explanations that exceed the quality of those provided by Logistic Regression analysis (often regarded as a highly-interpretable model), according to a human study.
Motivation & Objective
- To address the lack of interpretability in state-of-the-art transformer models for toxicity detection, which hinders trust and manual review in content moderation.
- To develop a method that generates human-understandable explanations for model predictions, especially in high-stakes contexts like social media content moderation.
- To improve model performance and robustness in both in-domain and cross-domain settings through a novel multi-task training approach.
- To evaluate whether model-generated explanations can surpass the interpretability of widely used, inherently interpretable models like Logistic Regression.
Proposed method
- The model is based on the assumption that a post is at least as toxic as its most toxic span, so overall toxicity is determined by max-pooling the toxicity scores of all spans.
- A neural multi-task learning framework is used, jointly training on (1) full-text toxicity classification and (2) per-token toxicity scoring to identify toxic spans.
- The model uses BERT or ELECTRA as the base encoder, with a final layer predicting toxicity scores for each token, which are then aggregated via max pooling to produce the final prediction.
- During training, a mean squared error (MSE) loss is applied to encourage extreme toxicity scores (close to 0 or 1), enhancing interpretability through polarization of predictions.
- The method leverages WordPiece tokenization to preserve morphological variations of toxic terms, even when altered to evade detection.
- Explanations are generated by highlighting the tokens with the highest predicted toxicity scores, providing human-readable justifications for model decisions.
Experimental results
Research questions
- RQ1Can a transformer-based model achieve higher interpretability by modeling toxicity as the maximum of its spans, without sacrificing classification performance?
- RQ2Do explanations generated by the proposed method outperform those from Logistic Regression in human evaluation?
- RQ3How does the model perform in cross-domain settings compared to standard fine-tuned transformers?
- RQ4What are the qualitative strengths and weaknesses of the model’s explanations compared to those from traditional interpretable models?
Key findings
- In a human evaluation, 53.7% of annotators preferred the explanations from BERT-MT (ToxCCIn) over those from Logistic Regression on the combined dataset, with 59.4% preferring them on the CCD dataset.
- BERT-MT outperformed Logistic Regression in interpretability across both the Civil Comments Dataset (CCD) and the Offenseval 2019 Implicit Dataset (OLID), with a significant preference margin.
- The model achieved higher F1 scores than baseline models on both in-domain and cross-domain evaluations, demonstrating improved classification effectiveness.
- BERT-MT was found to be more accurate in identifying toxic spans, especially in cases involving contextually sensitive or altered toxic terms, due to contextual embeddings and WordPiece retention.
- Logistic Regression was preferred in cases where multiple non-toxic terms were collectively indicative of toxicity, as it produced more comprehensive (though less precise) explanations.
- The model struggled with implicitly toxic language, such as negated insults or adversarially modified slurs, where both models performed poorly, indicating a need for future work on implicit toxicity.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.