ToxiSpanSE: An Explainable Toxicity Detection in Code Review Comments
Not on the map. Why?
Abstract (arXiv)
Background: The existence of toxic conversations in open-source platforms can degrade relationships among software developers and may negatively impact software product quality. To help mitigate this, some initial work has been done to detect toxic comments in the Software Engineering (SE) domain. Aims: Since automatically classifying an entire text as toxic or non-toxic does not help human moderators to understand the specific reason(s) for toxicity, we worked to develop an explainable toxicity detector for the SE domain. Method: Our explainable toxicity detector can detect specific spans of toxic content from SE texts, which can help human moderators by automatically highlighting those spans. This toxic span detection model, ToxiSpanSE, is trained with the 19,651 code review (CR) comments with labeled toxic spans. Our annotators labeled the toxic spans within 3,757 toxic CR samples. We explored several types of models, including one lexicon-based approach and five different transformer-based encoders. Results: After an extensive evaluation of all models, we found that our fine-tuned RoBERTa model achieved the best score with 0.88 F1, 0.87 precision, and 0.93 recall for toxic class tokens, providing an explainable toxicity classifier for the SE domain. Conclusion: Since ToxiSpanSE is the first tool to detect toxic spans in the SE domain, this tool will pave a path to combat toxicity in the SE community.
Key facts. Cited by 4 papers in the map (data through 7 Oct 2026). First posted on arXiv 7 Jul 2023.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2025: 2; 2026: 2.
4 papers.
- 2025Combating Toxic Language: A Review of LLM-Based Strategies for Software Engineeringcited by 1
- 2025U-GIFT: Uncertainty-Guided Firewall for Toxic Speech in Few-Shot Scenariocited by 0
- 2026Machine Learning Models for the Early Detection of Burnout in Software Engineering: a Systematic Literature Reviewcited by 0
- 2026Evaluating the Impact of Explainable AI on Trust in AI-Assisted Code Reviewcited by 0
- 2026Evaluating the Impact of Explainable AI on Trust in AI-Assisted Code Review27 Jul 2026
- 2026Machine Learning Models for the Early Detection of Burnout in Software Engineering: a Systematic Literature Review24 Mar 2026
- 2025Combating Toxic Language: A Review of LLM-Based Strategies for Software Engineering21 Apr 2025
- 2025U-GIFT: Uncertainty-Guided Firewall for Toxic Speech in Few-Shot Scenario1 Jan 2025