PEMTCL: A Prompt-Enhanced Multi-Task Contrastive Learning Framework for Fine-Grained Toxic Language Detection
Electronics · 2026-08-07 · 15 (16) · 3496
DOI: 10.3390/electronics15163496 ↗At a glance
Journal article in Electronics, published online on 2026-08-07. Written by Shan Jin and 3 co-authors. 41 references. The full text is freely available (open access, CC BY 4.0). Funded by: Ministry of Education Humanities and Social Sciences General Project, Xinjiang Normal University Smart Education Engineering Center, Major Science and Technology Special Project of the Xinjiang Uygur Autonomous Region.
Abstract (original language)
Fine-grained toxic language detection aims to assess the harmfulness, expression style, and attack target of textual content, supporting refined content moderation on online platforms. Most existing methods model each subtask independently, failing to exploit semantic correlations among tasks, while conventional contrastive learning is prone to introducing false negative samples under multi-task, multi-label settings. To address these limitations, we propose a Prompt-Enhanced Multi-Task Contrastive Learning framework (PEMTCL). The framework employs a dynamic prompt generation mechanism to construct instance-level soft prompts, enabling the encoder to adaptively capture fine-grained semantic cues required by different subtasks. It then jointly optimizes four subtasks—toxicity identification, toxic type discrimination, expression type detection, and targeted group detection—achieving inter-task knowledge complementarity within a shared representation space. Furthermore, a label-aware multi-head contrastive learning module leverages multi-task label relationships for reliable negative sample selection and incorporates a sample reweighting mechanism, effectively mitigating false negatives and class imbalance. Experiments on two Chinese datasets, ToxiCN and FG-COLD, demonstrate that PEMTCL achieves the best performance on most subtasks, with notable improvements on fine-grained tasks. Ablation studies, training data scale analysis, and case studies further validate the effectiveness and robustness of the proposed model.
Funding
- Ministry of Education Humanities and Social Sciences General Project
- Xinjiang Normal University Smart Education Engineering Center
- Major Science and Technology Special Project of the Xinjiang Uygur Autonomous Region
- Research on Hyperspectral Image Classification Methods Based on Spatial Structure
- Doctoral Research Start-up Fund of Xinjiang Normal University
Cite
APA
Jin, S., Fan, X., He, Z., & Chen, P. (2026). PEMTCL: A Prompt-Enhanced Multi-Task Contrastive Learning Framework for Fine-Grained Toxic Language Detection. Electronics, 15(16), 3496. https://doi.org/10.3390/electronics15163496
Vancouver
Jin S, Fan X, He Z, Chen P. PEMTCL: A Prompt-Enhanced Multi-Task Contrastive Learning Framework for Fine-Grained Toxic Language Detection. Electronics. 2026;15(16):3496. doi:10.3390/electronics15163496
BibTeX
@article{Jin2026,
author = {Jin, Shan and Fan, Xiaochao and He, Zhenzhen and Chen, Peng},
title = {PEMTCL: A Prompt-Enhanced Multi-Task Contrastive Learning Framework for Fine-Grained Toxic Language Detection},
journal = {Electronics},
year = {2026},
volume = {15},
number = {16},
pages = {3496},
doi = {10.3390/electronics15163496}
}
EUVIMED