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

Introduction

Automated content moderation has traditionally relied on binary classification to determine if a comment is toxic. While effective for broad filtering, this "black box" approach lacks transparency and often inherits biases against specific identity terms. To address this, the SemEval-2021 Task 5 competition focused on Toxic Spans Detection: identifying the specific character offsets within a sentence that trigger a toxicity flag. This granular approach provides a "rationale" for moderation decisions, assisting human reviewers and helping developers identify model biases.

Methodology

The Cisco team explored two primary architectural frameworks for extracting toxic spans: Sequence Tagging and Dependency Parsing.

Sequence Tagging (Primary Approach)

The most successful model utilized a BiLSTM-CRF layer built upon a Transformer backbone. This architecture leverages contextual word embeddings from the final layers of models like XLNet, BERT, or RoBERTa, concatenated with character-level embeddings generated by a separate BiLSTM.

The BiLSTM-CRF architecture used for sequence tagging, incorporating both word and character-level embeddings.

The team compared BIO (Begin, Inside, Outside) and IO (Inside, Outside) tagging schemes, finding that the simpler IO scheme yielded better results for this specific task. The top-performing configuration utilized XLNet-Large, which outperformed BERT and RoBERTa likely due to its permutation-based training objective that captures bidirectional context more effectively.

Dependency Parsing (Alternative Approach)

As an alternative, the authors treated span extraction as a dependency parsing problem. Using a Biaffine Model, they scored all possible start and end index pairs within a sentence. Spans were then ranked by these scores, and a selection algorithm was used to identify the highest-scoring non-overlapping sequences.

Data Characteristics and the "Cuss Word" Trap

The models were trained and evaluated on the SemEval-2021 Task 5 dataset, derived from the Civil Comments Dataset. A critical observation made during the study was the distribution of toxic spans.

Distribution of toxic span lengths across the training, development, and test sets.

As shown in the data distribution, the vast majority of toxic spans are single words—typically common profanities. While the models achieved high performance on these single-word spans (F1 ~0.65), performance dropped significantly for longer sequences (F1 < 0.10 for spans of 5+ words). This suggests that while current models are excellent at identifying explicit cuss words, they still struggle with "toxic phrases" where the toxicity arises from the overall sentiment or intent rather than specific keywords.

Key Results and Insights

The team's best model, XLNet-Large + BiLSTM-CRF (IO scheme), achieved a Test F1 score of 0.6922, securing 7th place in the official competition.

Several key insights emerged from their experiments:

  • Preprocessing is Essential: Simple text cleaning, such as normalizing whitespace and isolating punctuation, provided a massive performance boost, increasing the F1 score by over 16 points.
  • Contextual Disambiguation: The Transformer-based models demonstrated an ability to distinguish between words used as slurs and the same words used in neutral contexts (e.g., identifying "black" as toxic in a threat but ignoring it in a neutral discussion).
  • Structured Prediction Value: Ablation studies confirmed that while the Transformer backbone performs the bulk of the work, the CRF and BiLSTM layers provide measurable improvements in structured prediction.

Conclusion and Future Work

Cisco's approach demonstrates the power of combining Transformer architectures with structured prediction layers for fine-grained toxicity detection. However, the "long-span challenge" remains. Future work should focus on integrating broader post-level context and developing datasets with a more balanced mixture of context-dependent toxic spans to move beyond simple profanity detection toward a more nuanced understanding of online abuse.

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