NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Cisco at SemEval-2021 Task 5: What's Toxic?: Leveraging Transformers for Multiple Toxic Span Extraction from Online Comments

Sreyan Ghosh, Sonal Kumar

Abstract

Automated content moderation often relies on binary classification, which lacks explainability and can introduce bias. This paper describes Cisco's submission to SemEval-2021 Task 5, focusing on Toxic Span Detection (TSD). We explore two main architectures: a sequence tagging approach using BiLSTM-CRF with various Transformer embeddings and a dependency parsing approach using a Biaffine classifier. Our best model, based on XLNet-Large with an IO tagging scheme, achieved an $F_1$ score of 0.6922, ranking 7th overall in the competition.

Introduction

Traditional toxicity detection models often act as "black boxes," flagging comments without specifying the cause. This can lead to biases where neutral mentions of protected groups are incorrectly labeled toxic simply because those terms appear frequently in toxic datasets. Toxic Span Detection (TSD) aims to mitigate this by identifying the exact character offsets responsible for toxicity, providing transparency for moderators and developers alike.

Methodology

The research investigated two primary frameworks for span extraction:

Sequence Tagging

This approach treats TSD as a Named Entity Recognition (NER) task. Tokens are labeled using IO (Inside/Outside) or BIO (Beginning/Inside/Outside) schemes. The model integrates contextual word embeddings from the final four layers of Transformers (e.g., BERT, XLNet, RoBERTa, ALBERT, and SpanBERT) with character-level BiLSTM embeddings. These representations are processed through a BiLSTM-CRF layer to determine the optimal tag sequence.

Dependency Parsing (Biaffine Model)

Inspired by reading comprehension and relation extraction tasks, this model uses a Biaffine classifier to score all possible start and end index pairs $(s_i, e_i)$ within a sentence. This global approach identifies non-overlapping spans with the highest scores, offering an alternative to token-level tagging.

Comparison of Sequence Tagging and Dependency Parsing targets for the phrase "Such a scumbag."

Experimental Setup

The models were trained and evaluated on the SemEval-2021 Task 5 dataset, derived from the Civil Comments Dataset. The training set comprised 7,939 sentences containing 10,298 spans, annotated based on crowd-rater agreement. Pre-processing, including whitespace normalization and punctuation splitting, was found to be critical for performance.

Results and Discussion

The XLNet-Large model with an IO tagging scheme emerged as the top performer. Interestingly, the simpler IO scheme consistently outperformed BIO for this task, likely because toxic spans are frequently short and non-contiguous, making the distinction of a "beginning" tag less critical.

Performance comparison of various Transformer models and tagging schemes on Test and Dev sets.

A significant finding was the "cuss word" bias: models excel at identifying context-independent profanities (single-word spans) but struggle with longer, context-dependent toxic phrases. For spans exceeding five words, performance dropped sharply to an $F_1$ of 0.0596, highlighting a major gap in understanding complex, phrase-based toxicity.

Conclusion

While Transformer-based models show strong performance in identifying explicit toxicity, capturing contextual toxicity remains a challenge. Future work will focus on incorporating broader multi-level context and developing more diverse datasets to improve the detection of complex, nuanced toxic spans.

Summary updated

BibTeX
@inproceedings{ghosh2021cisco,
  author = {Sreyan Ghosh and Sonal Kumar},
  title = {{Cisco at SemEval-2021 Task 5: What's Toxic?: Leveraging Transformers for Multiple Toxic Span Extraction from Online Comments}},
  booktitle = {SemEval @ ACL},
  year = {2021},
  doi = {10.18653/v1/2021.semeval-1.29},
}
Figure