Next Article in Journal
Joint Optimization of User Association and Dynamic Multi-UAV Deployment for Maritime Emergency Communications
Next Article in Special Issue
Phase Transitions of the Majority-Vote Model with Inertia on Directed Erdös–Rényi Networks
Previous Article in Journal
Metabolic Saliency as KL-Divergence Estimator: Information-Geometric Attribution of Systemic Stress in JSE Equity Network
Previous Article in Special Issue
Characterizing Information Propagation in Social Media with Branching Processes
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A Deep Prompt-Based Chain-of-Thought Approach to Harmful Euphemism Detection in Social Networks

School of Cyber Science and Engineering, Sichuan University, Chengdu 610207, China
*
Author to whom correspondence should be addressed.
Entropy 2026, 28(5), 560; https://doi.org/10.3390/e28050560
Submission received: 23 March 2026 / Revised: 6 May 2026 / Accepted: 14 May 2026 / Published: 17 May 2026
(This article belongs to the Special Issue Complexity of Social Networks)

Abstract

In recent years, cyberspace governance has become a critical component of national security strategies worldwide. Although social network platforms provide users with convenient channels for expression and information acquisition, unregulated, harmful euphemisms have become increasingly prevalent. These euphemisms disrupt the order of the digital space and trigger secondary harms such as cyberbullying and regional discrimination. Currently, researches on Chinese harmful euphemism detection face three key challenges: the lack of large-scale annotated datasets, the cognitive reasoning deficit in lightweight models, and the latency constraints of Large Language Models (LLMs), which collectively constrain detection performance and real-world generalization. To address these issues, this study first collected a large corpus from social networking platforms and constructed a fine-grained annotated harmful euphemism dataset. Then, a representation learning framework was designed by integrating deep prompt-based chain-of-thought reasoning with multi-head contrastive learning. This framework introduces external knowledge from LLMs to enhance the diversity and precision of semantic representations. Finally, a multi-dimensional semantic perception fusion framework was proposed. It incorporates multiple semantic perception channels and a cross-channel dynamic fusion mechanism, enabling the model to better capture implicit semantics and integrate external contextual knowledge. Experimental results show that our approach significantly outperforms state-of-the-art lightweight models. While large-scale LLMs exhibit superior zero-shot transferability in cross-domain tasks, our proposed model maintains highly competitive performance with substantially lower inference latency and computational overhead. This research provides a novel methodological and technical foundation for detecting harmful euphemisms in social networks.

1. Introduction

The rapid growth of social networking platforms has greatly facilitated information dissemination, but it has also led to a surge in malicious content, posing significant challenges to the online ecosystem [1]. Among various forms of harmful content, harmful euphemisms constitute a particularly elusive category, in which illegal, discriminatory, or violent intentions are conveyed covertly. Such expressions employ linguistic strategies—including homophones, abbreviations, metonymy, and metaphor—to superficially “sanitize” sensitive content and evade both automated moderation and manual review. Harmful euphemisms were initially prevalent in the dark web and underground forums—often referred to as “underground jargon” [2]—where they facilitated illicit activities such as drug trafficking, human exploitation, and the illegal arms trade. However, with the widespread adoption of social media and the increasing “gamification” of online discourse, these expressions have gradually permeated mainstream platforms. They have evolved into more subtle, dynamic, and socially embedded forms.
Against this backdrop, harmful euphemism detection has emerged as a critical research direction in cyberspace content security. Nevertheless, due to their cryptic semantics and rapid evolution, existing detection models struggle to effectively identify such implicit harmful content. These challenges can be summarized as follows:
1.
Data Scarcity: There is a lack of large-scale, fine-grained datasets with contextual semantic annotations, which limits models’ semantic understanding and generalization capabilities.
2.
Cognitive Reasoning Deficit in Lightweight Models: Existing methods largely rely on keywords or explicit features extracted by conventional pre-trained language models (PLMs). However, euphemistic expressions often depend heavily on contextual semantics and sociocultural backgrounds. Current lightweight models possess limited capacity for external knowledge integration and explicit logical deduction. This limitation significantly hinders detection accuracy and robustness when countering complex rhetorical disguises.
3.
Latency Constraints of Large Language Models (LLMs): While modern LLMs possess strong zero-shot reasoning abilities capable of deciphering implicit intents, their large parameter sizes incur prohibitive computational overhead. This renders direct LLM deployment infeasible for the microsecond-level, high-concurrency real-time moderation demanded by modern social networks.
To address these issues, we propose a harmful euphemism detection model based on multi-dimensional semantic-aware fusion. The specific contributions of this work are as follows:
We construct a large-scale Chinese harmful euphemism dataset with fine-grained semantic annotations. The dataset is built from the Bilibili platform and covers multiple dimensions, including topic categories, attack types, euphemistic expressions, and their corresponding explanations. To the best of our knowledge, this is the first dataset to incorporate explicit semantic explanations of harmful euphemisms.
We propose a novel representation learning framework that integrates chain-of-thought (CoT) prompting with multi-head contrastive learning. By leveraging external knowledge from LLMs in an offline manner, the framework enhances the diversity and precision of semantic representations while avoiding the computational overhead of online inference.
We develop a multi-dimensional semantic-aware detection model with dynamic fusion. The proposed architecture captures implicit semantics and contextual dependencies more effectively. It achieves strong performance while maintaining low inference latency.

2. Related Work

With the rapid growth of user bases and information flow on social networks, harmful euphemisms have increasingly exhibited greater concealment, morphological variation, and rapid diffusion across various platforms, which pose severe challenges to automated detection. The existing research has predominantly focused on explicit harmful speech [3], while less attention has been given to implicit and euphemistic harmful expressions disguised through homophones, metaphors, and encoding [4]. Early works mostly relied on keyword- or rule-based detection techniques, such as sensitive lexicons, blocklists, and allowlist/denylist mechanisms [5,6]. These methods struggle to model the deep semantics and contextual dependencies of complex and ever-changing euphemistic expressions, and thus exhibit clear limitations. Subsequent research has gradually evolved from simple vocabulary matching to more comprehensive methodological frameworks, oriented toward semantic representation learning, external knowledge modeling, and multimodal fusion. Table 1 summarizes key existing studies, comparing the datasets, backbone models, and their use of external knowledge. Overall, the existing research follows a clear evolutionary trajectory.

2.1. Semantics-Driven Representation of Harmful Euphemisms

To address the limitations of rule- and lexicon-based methods in handling novel and concealed euphemistic expressions, a line of research has shifted toward distributed semantic modeling. Early works mostly utilized static word embeddings such as Word2Vec to capture word co-occurrence patterns in corpora via distributed representations. Yuan et al. [7] developed neural models based on static word embeddings to analyze dark web illicit trade corpora, identifying euphemisms with significant semantic deviations and inferring their true meanings through semantic mapping. Taylor et al. [8] combined word embeddings with PageRank, using community detection methods to identify novel harmful euphemisms generated by extremist communities. Magu et al. [25] integrated word embeddings with network structure analysis to expand unknown euphemisms and related harmful texts based on known argots, demonstrating a hybrid semantic–graph-based detection paradigm. Targeting Chinese scenarios, Wang et al. [26] systematically evaluated various typical word embedding models, automatically discovering novel harmful euphemisms through semantic similarity measurement. They further introduced features such as pronunciation and glyphs, as well as domain-incremental training strategies.
With the development of deep learning and pre-trained language models, research has gradually shifted from static word embeddings to contextualized representations. Zhu et al. [9] first introduced BERT into the content moderation task, enabling the detection of euphemistic expressions in a self-supervised manner. Huang et al. [10] proposed DJPD, a low-frequency euphemism detection model, leveraging Transformer architectures to better model low-frequency and rare euphemistic expressions. Guan et al. [11] further constructed JargonFM, a multi-mode euphemism interpreter supporting category prediction, similar expression discovery, and representative text selection, thereby forming a unified framework for identifying and interpreting harmful euphemisms.
However, despite the continuous optimization of representation structures in the aforementioned models, the underlying supervised training heavily relies on binary labels and lacks access to fine-grained Chinese datasets with deep semantic annotations. This issue is particularly evident in dynamic social contexts such as Bilibili, which features a unique danmaku (bullet-screen comment) culture, existing datasets lack detailed topic classification and interpretation of true meanings. This results in insufficient prior knowledge of the underlying malicious motives of euphemisms during model learning, limiting the effectiveness of semantic representation learning.

2.2. Contrastive Learning for Implicit Semantics

Although dynamic word representations have significantly improved semantic modeling capabilities, relying solely on supervised learning and traditional sampling strategies often makes it difficult to construct high-quality annotated datasets covering diverse forms of euphemistic expressions [27,28,29]. Therefore, some studies have begun to introduce contrastive, self-supervised, and semi-supervised mechanisms to alleviate the issues of data scarcity and high annotation costs.
Regarding the evolution of general contrastive learning frameworks, in the field of computer vision, MoCo [30] and SimCLR [31] form a representative dual-track paradigm for contrastive learning, where MoCo introduced a momentum contrast mechanism to ensure the feature stability of the negative sample dictionary. The natural language processing field subsequently developed variants based on text characteristics. SimCSE [32] introduces latent space perturbations via dropout to construct positive sample pairs, improving the Spearman correlation coefficient by 23.6% over traditional methods in the STS-B semantic similarity task. Targeting supervised learning scenarios, Gunel et al. [33] proposed a joint loss function that combines cross-entropy and contrastive loss using a weighting coefficient, improving average accuracy by 2.9% on the GLUE benchmark. The more innovative DualCPC framework [34] achieved multi-granularity contrast through a two-level optimization strategy involving instance-level bidirectional prediction and cluster-level inter-cluster contrast, further improving model accuracy.
When applying the aforementioned theories to implicit euphemistic semantic detection, contrastive learning shows strong generalization potential. Kim et al. [12] proposed the contrastive learning method ImpCon, which shortens the representation distance between the “implicit meaning” and the corresponding post, encouraging the model to learn their semantic relationship, thereby enhancing cross-dataset generalization. Lu et al. [13] proposed a dual contrastive learning framework combining self-supervised contrastive learning with supervisory signals to capture high-level semantic information while addressing challenges such as data imbalance, subjectivity, and contextual dependency. Building upon this, Deng et al. [14] constructed the large-scale unsupervised dataset AugCOLD and employed a multi-teacher knowledge distillation method, where multiple independently trained teacher models provide soft labels for the student model, extracting supervisory signals from unlabeled data, thereby improving the model’s robustness and generalization. Meanwhile, some studies focus on the interpretability of the model’s decision-making process and the impact of training data on prediction results. For example, testing with Concept Activation Vectors has been used to evaluate the model’s sensitivity to specific semantic concepts, combined with data augmentation to enhance robustness against novel euphemisms [35]; TrackIn [15], a gradient-based method, was designed to analyze the contribution of training samples to the prediction results of test samples, improving model robustness from a data-centric perspective.
Despite the potential of contrastive learning in alleviating data scarcity, the existing mechanisms are highly susceptible to semantic collapse when processing harmful euphemisms. Because euphemisms exhibit highly similar surface forms but opposite polarities in normal versus malicious contexts, traditional single-view contrastive learning struggles to accurately capture such subtle semantic shifts, leading to semantic collapse and representation homogenization issues.

2.3. Enhancement Methods Fusing External Knowledge

Since the true meaning of text often depends on external background knowledge, domain conventions, and syntactic complexity, various research directions have incorporated external knowledge and explicit structural information to enhance detection performance.
In terms of explicit structure modeling and multimodal fusion, Pavlopoulos et al. [16] constructed the TOXICSPANS dataset, annotating harmful spans within text, and trained sequence labeling models based on this to achieve finer-grained, span-level identification of harmful expressions. Wang et al. [17] introduced adapter modules on top of pre-trained models to fuse multi-source features such as phonology, glyphs, and vocabulary into BERT. Huang et al. [18] proposed a two-stage framework that first generates euphemism candidates based on pre-trained language models, and then models the structural relationships between words using a syntactic dependency graph via syGCN, establishing mappings between euphemisms and their semantic interpretations, effectively improving both identification and interpretation capabilities.
On the other hand, to more fully utilize contextual settings and user-level information, Ghosh et al. [19] proposed CoSyn, a context-synergized neural network that jointly models dialogue context, user history, and social relationships to detect harmful euphemisms in online conversations, significantly improving detection accuracy in complex interactive scenarios. As internet content expands from pure text to modalities like memes, Zhang et al. [20] proposed a topology-aware optimal transport framework to model harmful euphemistic content in Internet memes, highlighting the importance of multimodal information for interpreting implicit expressions.
In expanding implicit reasoning capabilities, Prompt-based Chain-of-Thought (Prompt CoT) provides a promising direction for mining deep semantics. Jason Wei et al. [21] address challenges in complex reasoning tasks by introducing chain-of-thought prompting, confirming that this method is particularly effective on large-scale language models. Zhang et al. [36] explored the application of Automated Chain-of-Thought (Auto CoT) in large language models, aiming to improve reasoning ability by automatically generating reasoning steps; Kojima et al. [22] demonstrated the feasibility of zero-shot reasoning in LLMs to new tasks. However, external knowledge injection alone is insufficient to ensure reasoning accuracy. Zhou et al. [37] pointed out that irrelevant reasoning rationales can affect the model’s robustness; Wu et al. [38] further revealed through structural causal models that biased information in pre-training data might impair the reasoning capabilities of LLMs. To address these challenges, Zhao et al. [23] proposed KG-CoT, an innovative knowledge enhancement paradigm utilizing small-scale step-by-step graph reasoning models to reason over knowledge graphs, generating high-confidence reasoning chains for large-scale LLMs; Mondal et al. [24] proposed the KAM-CoT framework, which deeply integrates CoT reasoning, knowledge graphs, and multimodal features, providing comprehensive support for understanding multimodal harmful content while controlling computational costs. Chen et al. [39] proposed the SCCN framework for fake news detection, which effectively leverages social contextual cues.
Although existing methods attempt to utilize large models for knowledge injection, most remain at the stage of shallow text concatenation. Current research has yet to achieve organic fusion; it is unable to utilize the external knowledge of large models for high-confidence logical reasoning, nor can it adaptively avoid data homogenization in the feature space, which limits the upper bound of representation quality for harmful euphemism detection.

2.4. Multi-Task Learning and Debiasing Research

Multi-Task Learning (MTL), as an effective learning paradigm, improves model generalization by sharing knowledge across related tasks [40], and has been successfully applied in scenarios such as hate speech classification [41], dialogue system development [42], and sentiment analysis [43].
The core of multi-task learning lies in the design of the parameter sharing mechanism, which currently follows two main paths: hard sharing and soft sharing. Regarding hard sharing, models typically employ a unified bottom network supplemented by task-specific head modules, such as the BERT-based multi-task neural network proposed by Liu et al. [44]. Inspired by ensemble learning, Ma et al. [45] designed a Multi-gate Mixture-of-Experts (MMoE) model, where the shared bottom consists of multiple neural network experts, using gating mechanisms to control knowledge sharing, thereby effectively mitigating conflicts between tasks. Comparatively, soft sharing offers higher flexibility by sharing only a small number of parameters across tasks. For instance, Duong et al. [46] introduced regularization terms between task-specific networks to constrain parameter differences, enabling cross-task knowledge transfer while avoiding negative transfer from over-sharing.
At the task design level, multi-task learning has been introduced to strengthen the model’s modeling of multi-dimensional attributes. Flor et al. [47] found that when harmful category discrimination is jointly trained with related sub-tasks, the model can better distinguish different types of offensive euphemisms, improving overall detection performance across categories. Meanwhile, to alleviate bias issues in harmful content detection, Manzini et al. [48] approached the problem from the perspective of word embedding debiasing, proposing new bias evaluation metrics andconstructing a bias subspace via principal component analysis to robustly reduce bias risks in multi-classification tasks at the representation level. Such works provide a reference for introducing multi-task learning and fairness constraints for harmful euphemism detection.
However, despite current strategies like multi-task learning enriching the reference features of models, existing detection models still suffer from the fundamental limitation of single-dimensional perception in their architectural design. Most existing systems treat text as a single linear sequence for feature extraction, or merely rely on rigid feature concatenation and shallow bottom-layer parameter sharing during fusion. This coarse fusion strategy is prone to spurious correlations, which in turn leads to overfitting on high-frequency lexical patterns.
In summary, although detection models have evolved from static lexicons to dynamic representation learning, contrastive learning mechanisms, and multi-task frameworks, existing paradigms still encounter two fundamental bottlenecks when processing harmful euphemisms:
1.
Single-Dimensional Perception and Shallow Feature Fusion: Existing traditional and lightweight frameworks predominantly rely on single-dimensional text sequences. Even when external features or multi-task sharing mechanisms are introduced, they are typically integrated through rigid and shallow concatenation. When confronted with highly obscure rhetorical disguises, this structural limitation inherently causes the aforementioned cognitive reasoning deficit, inevitably leading to semantic collapse. Consequently, traditional models frequently generate spurious correlations and overfit to high-frequency surface words, rather than structurally decouple underlying syntactic, contextual, and rhetorical anomalies.
2.
Deployment Dilemmas and Shallow Integration of LLMs: Recently, LLMs have shown strong zero-shot reasoning capabilities via CoT prompting. However, current LLM-augmented methods typically inject external knowledge by appending generated reasoning rationales to prompts during online inference. This shallow, text-level fusion fails to organically reshape the model’s latent cognitive space. Furthermore, relying on massive LLMs for direct online inference is highly susceptible to pre-training biases and noisy rationales, while also incurring the prohibitive computational overhead and latency mentioned earlier. This makes them impractical for real-time moderation in dynamic, high-throughput social platforms.

3. Methodology

This section presents the dataset construction module, the representation learning module, and the detection model in detail.
Dataset Construction Module: This module is responsible for collecting comment data from Bilibili and annotating it according to predefined standards, thereby providing data support for subsequent research.
Representation Learning Module: The core function of this module is to effectively extract and model external knowledge from LLMs for harmful euphemisms, using deep prompt CoT and multi-head contrastive learning. This improves the quality of representation learning for harmful euphemisms and strengthens the semantic fidelity and expressiveness of the resulting representations.
Detection Model: This module first converts the input sentences into word vector representations to extract fundamental semantic information. Subsequently, a triple semantic perception module extracts syntactic, contextual, and rhetorical features, respectively. Finally, the extracted multi-dimensional semantic features are adaptively fused, and a classifier is used for final harmful euphemism detection.

3.1. Dataset Construction

During the data construction phase, we selected Bilibili, a major video-sharing platform in China, as the primary source of raw harmful euphemism data. The proposed dataset construction methodology encompasses the following stages:
(1) Seed Keyword Selection. To construct a comprehensive harmful euphemism dataset for social networks, we designed the data collection pipeline based on the principles of topic diversity and category balance. Initially, we manually identified four primary categories of seed keywords: political content, vulgar language, general insults, and targeted group attacks. The representative examples of the initial seed keywords are presented in Table 2.
Subsequently, based on these seed keywords, we used the Bilibili search engine to select seed videos from diverse content categories, ensuring the diversity of comment sources. A web crawler was deployed to collect comments in batches from the corresponding video sections. Simultaneously, video popularity was evaluated using metrics such as view counts, likes, coin donations, comments, and shares, to ensure the representativeness and broad coverage of the dataset.
(2) Data Crawling and Bias Control. We employed a Breadth-First Search (BFS) strategy for data collection. First, to control data bias and avoid bias toward a single “echo chamber”, we implemented stratified sampling across diverse Bilibili video partitions (e.g., news, entertainment, gaming, and lifestyle), extracting comments from target videos and storing them in a database.
Notably, to capture the temporal evolution of emerging harmful content on contemporary internet platforms, we did not rely on a static search strategy. Instead, we dynamically selected and updated seed videos based on popularity metrics such as views, likes, and trending indices. Furthermore, time-sensitive variants, such as meme-based expressions, were incorporated. During BFS traversal, the crawler calculated video popularity and selected the top 10 recommended videos as child nodes for the next iteration, while performing exact-match deduplication to remove redundant nodes. Over four traversal iterations, the crawler collected approximately 8 million comments from 5000 videos. Next, to ensure data quality and establish rigorous inclusion criteria, we filtered the raw comment corpus using the initial seed dictionary and applied a length filter to remove comments shorter than two characters. Ultimately, following rigorous manual annotation and multiple rounds of expert review, we constructed a high-quality Bilibili comment dataset consisting of approximately 26,517 samples.
(3) Data Annotation. To improve annotation accuracy and mitigate subjective bias, we carefully designed the annotation workflow. First, to ensure diversity in perspectives, we recruited annotators of different genders and regional cultural backgrounds, and provided each participant with systematic training on euphemistic contexts. Second, rather than imposing fixed annotation rules, our annotation guidelines were iteratively formulated through progressive analysis of the collected Bilibili corpus. We conducted several rounds of small-scale pilot annotations and intensive discussions of edge cases to refine fine-grained annotation standards.
During the formal annotation phase, three core principles were strictly enforced: (1) annotators must independently execute their tasks based on the established guidelines; (2) post-annotation consistency must be verified by an independent third party; and (3) highly inconsistent annotations require mandatory re-evaluation. Acknowledging that cultural backgrounds induce variations in comprehending harmful euphemisms, annotators were required to interpret euphemistic terms strictly based on their objective contextual scenarios. Furthermore, independent evaluation and tagging of euphemism labels were mandatory. Finally, random spot checks were conducted to enforce quality control and ensure annotation consistency. Major discrepancies in euphemism labels were resolved through collaborative team reviews and consensus discussions. To quantitatively evaluate and verify annotation reliability, we calculated the Fleiss’ Kappa statistic across the entire dataset. The overall coefficient reached 0.82 , indicating substantial agreement among annotators and ensuring the high quality of the dataset.
Based on this rigorous dataset construction strategy, we observed that harmful euphemisms distort normal, healthy discourse through means such as morphological variations, metaphors, and sarcasm to convey harmful information like racial discrimination, child pornography, and group hatred. Based on the analysis of the dataset samples, their characteristics can be summarized as follows: (1) the intent of the comment is inconsistent with its literal interpretation; (2) the use of uncommon phrases or combinations of special characters and numbers; (3) a noticeable shift in tone or emotion compared to the normal context; (4) seemingly illogical yet contextually consistent expressions.
Detailed statistics of the constructed HECD dataset are presented in Table 3. It contains 26,517 samples, covering 4 topic types and 8 different attack methods of harmful euphemisms, providing fine-grained annotations for subsequent research on harmful euphemism detection and identification.
As shown in Table 3, the HECD dataset exhibits a moderate class imbalance between harmful (11,481) and harmless (15,036) samples, with harmless data comprising 56.7% of the corpus. This ratio of approximately 1:1.31 reflects the natural distribution of social media content, where benign expressions are generally more prevalent. This moderate imbalance remains within a controllable range and does not constitute a severe skew that would dominate classifier behavior. Furthermore, an uneven distribution is observed at the topical level, with categories such as “Group Attacks” containing more samples than “Political Content” and “Everyday Insults”. While such topical imbalance may bias training toward high-frequency topics and affect classification accuracy, we deliberately preserved this real-world distribution. Because the topical differences do not represent an order-of-magnitude skew, artificial re-balancing was avoided to prevent the introduction of synthetic noise.

3.2. Representation Learning

To address the issues of inaccurate representation and insufficient generalization of harmful euphemisms, we propose a harmful euphemism Representation Learning Framework via Deep Prompt COT and Multi-head Contrastive Learning (HER-MCL). This framework is a representation learning method for harmful euphemistic semantics that integrates the generalized knowledge of large models with self-supervised learning, enabling a more accurate extraction of semantic representation vectors of harmful euphemisms from pre-trained corpora, as illustrated in Figure 1.

3.2.1. Seed Lexicon Matching Stage

To enhance the ability of LLMs to mine external knowledge of harmful euphemisms, we design a seed word prompt sample selection algorithm based on an adaptive threshold, integrating the semantic relationship between harmful euphemisms and their corresponding explanatory words for harmful meanings.
Suppose the local harmful euphemism lexicon set is O, where o i represents a word in the local harmful euphemism lexicon. Additionally, there are corresponding explanatory words for their harmful meanings, denoted as e i . For each seed word and its corresponding explanatory word, their vector representations are obtained. Cosine similarity is used to measure their similarity, while an adaptive threshold is employed to ensure that the seed words accurately represent their harmful meanings. Based on the calculated adaptive threshold, a set of seed words highly correlated with the target seed words and mapped words is filtered out. Finally, an iteratively optimized seed word set is output, containing seed words that are highly relevant to the target harmful euphemisms and possess diversity, capable of comprehensively covering the semantic space of the selected terms.

3.2.2. Chain-of-Thought Template Generation Stage

The deep prompt CoT refers to a prompt template generated by LLMs, which integrates prior knowledge and encodes a complete and structured reasoning process.
First, an initial CoT template is constructed based on a locally curated harmful euphemism lexicon and its associated metadata. Second, the design of the template incorporates the proposed five cognitive dimensions of harmful euphemisms, namely: topic category, attack strategy, reasoning chain, attack variant, and structured mapping relations. These elements are introduced to ensure that the reasoning process aligns with the cognitive characteristics of euphemistic expressions. Third, the initial template is further refined and expanded through interaction with an open-source LLM API. During this stage, both the extracted local knowledge and the five cognitive dimensions are jointly integrated and enriched, resulting in a more comprehensive and structurally grounded deep CoT template. Finally, the generated deep CoT template guides the LLM in effectively eliciting auxiliary external knowledge from the original harmful euphemistic expressions, thereby enhancing semantic enrichment and implicit intent extraction.
In this section, we define the design principles of the deep CoT template and specify the objective of each reasoning stage. The corresponding template structures for different reasoning stages are presented in Table 4.

3.2.3. Three-Fold Data Augmentation Stage

The goal of this stage is to generate multiple similar samples that are semantically close to the original sentence but differ in surface form, thereby enhancing the model’s robustness against harmful euphemism noise and its variations, and reducing the risk of overfitting during representation training. The specific methods are as follows:
(1)
Mapping-based Augmentation: The original harmful euphemisms in the samples are replaced with their corresponding harmful meaning mapped words from the lexicon, generating similar augmented samples of the original harmful euphemisms.
(2)
Substitution-based Augmentation: Utilizing the morphological variants of harmful euphemisms generated by the deep prompt CoT, the original harmful euphemisms in the sentence samples are replaced with these variants to generate similar augmented samples.
(3)
Randomized Augmentation: Three randomization strategies commonly used in traditional contrastive learning frameworks are comprehensively applied, namely dropout, cutoff (dimensional clipping), and character shuffling.

3.2.4. Multi-Head Contrastive Learning Stage

Multi-head Contrastive Learning (MCL) utilizes a pre-trained language model and multi-dimensional projection heads to encode harmful euphemisms into token embedding representations. These representations are then projected by multiple heads into low-dimensional vector spaces at different hierarchical levels. Ultimately, contrastive loss is applied across projection subspaces to bring similar samples closer and push dissimilar ones apart. Specifically, MCL constructs positive and negative pairs through a three-part data augmentation scheme. The positive samples consist not only of the original sentences but also substitution-based augmented samples generated via the Deep Prompt Chain of Thought and the generalized knowledge of large language models, mapping-based augmented samples derived from explicit harmful meanings, and randomized augmented samples generated by three randomization strategies. This enables the model to learn consistent semantics across different views. Conversely, negative samples are drawn from other instances within the same mini-batch, which reinforces the model’s discriminative capacity between distinct semantics.
By minimizing distances between positive pairs and maximizing distances to negative samples, MCL achieves self-supervised optimization of semantic representations. A dynamic weight adjustment mechanism is also introduced, enabling semantic differences across various subspaces to be adaptively balanced during training. This ensures that each projection head is fully utilized, yielding representation vectors that are both semantically rich and accurate. The framework is trained end-to-end, jointly optimizing the three types of contrastive samples via backpropagation, thereby improving the model’s accuracy and robustness in capturing the implicit information concealed within harmful euphemisms.
The MCL stage employs a multi-head projection architecture. To maintain structural symmetry with the 12 inherent self-attention heads of the foundational pre-trained textual encoder (RoBERTa), this framework precisely configures 12 projection heads. These 12 projection heads are systematically partitioned into 3 groups of projection subspaces with varying dimensions (4 heads per group), mapping the sentence representation matrices obtained from the pre-trained encoder into multidimensional vector subspaces for contrastive optimization. Let the sentence representation output by the pre-trained encoder be denoted as x R L × d encoder , where d encoder is the hidden layer dimension. For each projection head h { 1 , 2 , , 12 } , a linear projection is applied:
p h = W h x ¯
where x ¯ = 1 L i = 1 L x i represents the sentence-level mean-pooled representation, and the specific projection dimension for a given group is denoted as d h . To ensure training stability and prevent gradient vanishing or exploding during the initial stages of contrastive optimization, the weight matrices W h of all 12 projection heads are strictly initialized using Xavier Uniform initialization.
These 12 projection heads are not pre-assigned to specific data augmentation types (i.e., mapping-based, substitution-based, or randomized augmentations). Instead, all 12 heads globally process the representations of both the original sentence and its three corresponding augmented views simultaneously. This non-assignment strategy is designed: pre-assigning heads would artificially isolate linguistic features and restrict the receptive field of each subspace. By allowing every head to globally compute distances across all three augmentation types, the framework relies entirely on the contrastive loss and the dynamic weight adjustment mechanism to implicitly and organically decouple the multi-dimensional rhetorical disguises across the 12 orthogonal latent subspaces.
Within each projection space, the relationships among samples are evaluated through three distance metrics: heterogeneous similarity distance, homogeneous similarity distance, and homogeneous difference distance. These correspond to the average Euclidean distance between the original sentence and its three augmented samples, the average distance among the three augmented samples themselves, and the average distance between the original sentence and the set of negative samples.
Heterogeneous similarity distance metric:
d het = 1 3 i = 1 3 p orig p sim , i 2
Homogeneous similarity distance metric:
d hom = 1 3 i < j p sim , i p sim , j 2
Homogeneous difference distance metric:
d diff = 1 N n = 1 N p orig p neg ( n ) 2
Since the similarity between the heterogeneous and homogeneous similarity distances should be greater than that between the heterogeneous and homogeneous difference distances, these three distance metrics satisfy the constraint | d hom d het | < | d het d diff | . Therefore, we introduce a dynamic weight function for distance metrics to ensure that the similarity margin among the three different distance metrics is maintained within a reasonable range. This dynamic weight is calculated using the Sigmoid function:
w sim = σ ( α ( d hom d het ) )
w diff = σ ( α ( d het d diff ) )
where α is a scaling coefficient and σ ( · ) represents the Sigmoid function. The contrastive loss for a single projection head is defined as:
Γ ( h ) = E w sim · d hom + w diff · d diff
To achieve multi-dimensional rhetorical features, the final global loss is formulated as the average of the losses from all 12 projection heads aligned with the RoBERTa attention mechanism:
Γ total = 1 12 h = 1 12 Γ ( h )
Using 12 projection heads aligned with the backbone enables contrastive learning to capture representations across multiple dimensions. This architecture allows for the independent fine-tuning of specific attention patterns and the capture of finer-grained semantic nuances. Furthermore, the dynamic weight mechanism guarantees an equilibrium between homogeneous similarity and heterogeneous difference, successfully pulling similar samples closer while effectively discriminating negative samples, thereby constructing a more robust and discriminative representation space.

3.2.5. Representation Learning Training Workflow

This subsection describes the overall representation learning process from data construction to encoder-based representation generation. The overall training procedure of the harmful euphemism representation learning framework, which is based on a deep prompt CoT and multi-head contrastive learning, is summarized as follows:
(1)
Input Preprocessing and Knowledge Matching: We first construct training samples of harmful euphemisms. These samples are matched against a local harmful euphemism dictionary to extract local sensitive vocabulary and related knowledge. This process constructs a structured corpus containing the original sentence, euphemism, and its semantic interpretation.
(2)
Deep Prompt Chain-of-Thought Generation: Based on a cognition-driven prompt design, we construct a CoT template. An LLM is then used to complete the CoT template and leverage external knowledge for the harmful euphemisms based on this final template. Structured auxiliary information is extracted according to this chain, representing the original sentence, euphemism, semantic interpretation, transformed variants, CoT reasoning, and attack type. This stage provides guidance for external knowledge augmentation for subsequent representation learning.
(3)
Contrastive Learning Sample Construction: A pre-trained language model encodes the original sentences to obtain base semantic representations. Subsequently, the acquired auxiliary knowledge of harmful euphemisms is used to construct contrastive pairs.
(4)
Multi-Head Contrastive Learning Training: The enhanced inputs are passed through 12 projection heads, mapping them into sub-spaces of different dimensions. After constructing positive and negative pairs, the multi-head contrastive learning module calculates the contrastive loss within each sub-space. A dynamic weighting mechanism is applied to adjust the various distances, yielding a comprehensive contrastive loss. Next, the Adam optimizer is utilized to optimize this final loss, thereby updating the parameters across all layers of the model. This enables the semantic encoder to achieve optimized representations for euphemism detection.
(5)
Enhanced Semantic Vector Output: After freezing the encoder parameters, the text of harmful euphemisms is fed into the model, and the encoder outputs enhanced semantic vectors through forward propagation. The harmful euphemism feature vectors, optimized through this representation learning process, can be directly used for downstream tasks, such as harmful euphemism detection and harmful word recognition.

3.3. Detection Model

We propose HED-MSP, a harmful euphemism detection framework based on multi-dimensional semantic perception and cross-channel adaptive fusion. Its design is motivated by the linguistic differences between harmful euphemisms and explicit harmful expressions. Unlike explicit content, euphemisms rely on multi-layered semantic obfuscation, posing three key challenges: formal variations (e.g., homophones and abbreviations) that disrupt syntax, contextual ambiguity where malicious intent is hidden beneath neutral semantics, and rhetorical encoding (e.g., metaphors and irony) conveying non-literal malicious intent. To address these challenges, HED-MSP consists of three modules—the Syntactic Semantic Perception Module (SSPM) for dependency modeling, the Contextual Semantic Perception Module (CSPM) for context-aware disambiguation, and the Rhetorical Semantic Perception Module (RSPM) for rhetorical semantic modeling—along with a cross-channel adaptive fusion module. This multi-dimensional design decouples semantic heterogeneity across features, preventing interference and robustness degradation in shallow feature fusion, as illustrated in Figure 2.

3.3.1. Semantic Perception Modules

(1)
Syntactic Semantic Perception Module
The syntactic–lexical semantics of harmful euphemisms capture relationships between euphemistic expressions and normal lexical items, as well as their syntactic structures. In benign texts, syntactic relations typically follow standard grammatical rules. However, harmful euphemisms often deviate from normal word order and grammatical structure. Therefore, a deeper analysis and modeling of syntactic dependency patterns and sentence component features in harmful euphemisms can significantly improve both the accuracy and generalization ability of detection models.
Specifically, SSPM leverages dependency parsing, graph neural networks, and graph attention mechanisms to model syntactic dependencies encoding euphemistic and harmful signals. SSPM consists of an input graph construction layer, a graph neural network layer, a syntactic attention layer, and an output layer.
a. Input Graph Construction Layer. Given an input sentence S = w 1 , w 2 , , w n , a pre-trained model (e.g., BERT) generates word embeddings E = e 1 , e 2 , , e n . A dependency parser (e.g., spaCy) is used to construct a dependency graph:
G = { V , E }
Here, V represents all word nodes within the sentence, including the harmful euphemistic terms. E denotes the set of dependency edges, which serve to characterize the syntactic relationships between words. A dependency parsing tool such as spaCy (zh_core_web_sm) is employed to construct the syntactic dependency graph. We adopt spaCy for dependency parsing due to its efficiency and robustness on social media text. Compared with parsers trained exclusively on formal newswire corpora, spaCy provides more robust baseline performance on heterogeneous and informal textual inputs commonly observed in social media scenarios. In addition, its lightweight design enables efficient large-scale processing, which is critical for real-world toxic content analysis tasks.
Node features are initialized using word embeddings x i , while edge features e i j are represented through dependency relation embeddings.
b. Graph Neural Network Layer. This layer encodes dependency relations of euphemistic expressions using a Graph Attention Network (GAT), where each node aggregates information from its neighbors via learned attention weights:
h i l + 1 = σ j N ( i ) α i j W ( l ) h j ( l )
The attention weight α i j is computed via an attention mechanism. W ( l ) denotes a learnable parameter matrix. N ( i ) denotes the neighborhood of node i.
Subsequently, multi-layer graph neural networks extract both local and global syntactic features, followed by feature concatenation:
h i multi = Concat ( h i 1 , h i 2 , , h i L )
c. Dynamic Syntactic Attention Layer. To better capture key syntactic features, a dynamic syntactic attention mechanism is introduced. This mechanism assigns importance weights to euphemistic nodes based on their roles within the syntactic graph.
β i = softmax ( W syntax h i multi )
The attention layer dynamically adjusts the contribution of each node, and the syntactic–lexical semantic feature vector is updated by combining node features with attention weights.
h syntax = i β i h i multi
d. Output Layer. The syntactic features h syntax are concatenated with contextual embeddings h context to form the final output vector h enhanced :
h enhanced _ syntax = Concat ( h syntax , h context )
This vector encodes syntactic–lexical information of harmful euphemisms, enabling the model to capture discriminative syntactic patterns and improve classification performance.
(2)
Contextual Semantic Perception Module
Contextual semantics refer to surrounding information of harmful euphemisms, including topic and discourse-level cues. On social platforms, harmful meanings are often recognized only when euphemistic expressions deviate from their contextual semantics, leading to a cognitive shift.
To model this phenomenon, CSPM adopts a context-aware dynamic pooling mechanism. By capturing semantic features and contextual variations, this module improves detection accuracy. It consists of an input encoding layer, a dynamic convolution learning layer, a context-aware pooling layer, and an output layer.
a. Input Encoding Layer. Each word in the input text T = w 1 , w 2 , , w n is encoded into a vector representation using a pre-trained encoder:
E = { e 1 , e 2 , , e n }
Here, e i denotes the embedding of the word w i .
b. Dynamic Convolution Learning Layer. Dynamic convolution kernels are generated to capture contextual semantics at different granularities. In CSPM, this layer is implemented as a lightweight multi-scale convolution mechanism.
We use three parallel convolution pathways with kernel sizes w 1 , 3 , 5 . This multi-scale design allows the model to capture features across different linguistic granularities, including unigram-level lexical cues ( w = 1 ), phrase-level syntactic structures ( w = 3 ), and short-context semantic patterns ( w = 5 ).
To ensure efficient inference, each convolution kernel is generated via a Multi-Layer Perceptron (MLP) conditioned on E i :
K i dynamic = MLP ( E i )
Here, K i dynamic denotes generated convolution kernels. E i denotes feature representations. For each kernel size, we adopt a compact configuration of 8 convolution filters, resulting in a total of 24 dynamic convolution filters across the three parallel branches. The convolution operations extract contextual representations:
H conv = i K i dynamic · E i
Here, K i dynamic denotes the extracted features. E i is the original input. H c o n v is the resulting feature vector. This configuration captures semantic shifts in implicit euphemistic expressions while avoiding parameter explosion in standard dynamic convolution, balancing representational capacity and efficiency.
c. Context-Aware Pooling Layer.
This layer introduces an attention-based pooling mechanism that assigns weights to each word:
α i dynamic = softmax ( W att E i + b att )
Here, α i dynamic denotes the attention weight of the i-th word. W att and b att are learnable parameters. Weighted pooling is then applied to obtain a global representation:
H pooled = i α i dynamic · E i
Here, E i denotes the initial input of harmful euphemistic features.
d. Output Layer.
The pooled feature is fed into the output layer as the final representation:
h enhanced _ syntax = softmax ( W out H pooled + b )
This vector h enhanced _ syntax encodes both local and global contextual information, improving the model’s ability to detect harmful euphemisms.
(3)
Rhetorical Semantic Perception Module
Harmful euphemisms often employ rhetorical strategies to disguise their original intent and evade detection systems. This phenomenon, referred to as rhetorical behavior, necessitates enhanced semantic perception capabilities for accurate classification.
The Rhetorical Semantic Perception Module (RSPM) aims to identify and model the impact of rhetorical strategies on textual semantics. This includes implicit semantic transformation and rhetorical device analysis. The module integrates a Rhetoric Identification Network (RIN), a semantic reasoning layer, and multi-level self-attention mechanisms, along with graph neural networks for local structural learning and contrastive learning for improved discriminative power.
The module consists of an input layer, a graph convolutional network layer, a multi-level self-attention layer, a semantic reasoning layer, and a rhetorical feature fusion layer.
a. Input Layer. The input text X = { x 1 , x 2 , , x n } is encoded into embeddings E = { e 1 , e 2 , , e n } . These embeddings are passed through a GCN layer to capture rhetorical structures, a self-attention layer to model word importance, a semantic reasoning layer to extract inferential relations, and a fusion layer to combine features.
b. Graph Convolutional Network Layer. This layer captures local rhetorical structures by modeling syntactic and logical relationships among words. Each word is treated as a node, and their relationships are represented by an adjacency matrix.
The node representation is updated as:
P ( k ) = σ ( A ^ P ( k 1 ) W ( k ) )
Here, P k denotes node features at layer k. A ^ = D 1 2 A D 1 2 is the normalized adjacency matrix. W ( k ) is the learnable weight matrix. σ is the activation function. Through multiple layers, the model captures rhetorical patterns such as irony, metaphor, and exaggeration.
c. Self-Attention Mechanism Layer. This layer models the importance of each word in capturing rhetorical semantics. Query, key, and value representations are computed, and attention weights are applied:
Attention ( Q , K , V ) = softmax Q K T d k V
Here, W Q , W K , and W V are projection matrices, and d k denotes the dimensionality. This enables the model to capture global rhetorical dependencies.
d. Semantic Reasoning Layer. A Graph Attention Network (GAT) is used to model inferential relationships:
α i j = exp ( LeakyReLU ( a T [ W h i     W h j ] ) ) k N ( i ) exp ( LeakyReLU ( a T [ W h i     W h k ] ) )
Attention weights are computed between nodes and their neighbors. Node representations are updated via weighted aggregation:
h i = j N ( i ) α i j W h j
This allows the model to capture reasoning patterns embedded in rhetorical expressions.
e. Rhetorical Feature Fusion Layer. Features from the GCN layer, self-attention layer, and semantic reasoning layer are fused. Let the feature representations be h GCN , h Att and h GAT , respectively. The final representation is computed as a weighted combination:
h enhanced _ rhetoric = α 1 h GCN + α 2 h Att + α 3 h GAT
Here, α 1 , α 2 , and α 3 are all learnable coefficients. Following model training and convergence, these three learnable coefficients ultimately stabilize at: α 1 = 0.35 (GCN features), α 2 = 0.20 (self-attention features), and α 3 = 0.45 (GAT features). This weight distribution possesses a high degree of interpretability. First, the GAT features carry the highest weight, indicating that dynamic structural relationships between nodes are the most discriminative factor when identifying rhetorical disguises such as metaphors and irony. Since rhetorical devices often rely on anomalous syntactic collocations within specific contexts, GAT’s adaptive edge-weighting mechanism is able to precisely capture these localized structural shifts. Second, the GCN features provide the model with globally stable topological structural anchors. Finally, the self-attention features carry the lowest weight. This further suggests that the disguise employed by harmful euphemisms relies heavily on structure rather than on purely lexical semantics. Without the structural constraints provided by graph neural networks, a purely semantic attention mechanism would be highly susceptible to being misled by the superficially innocuous vocabulary of euphemisms. Overall, this fused representation encodes both local and global rhetorical–semantic information, thereby enhancing the model’s capability to classify harmful euphemisms.

3.3.2. Cross-Channel Dynamic Adaptive Fusion Method

We propose a Cross-channel Dynamic Adaptive Fusion (CDAF) method for efficient feature fusion via dynamic channel attention. It extracts multi-level semantic information of harmful euphemisms, improving detection accuracy and generalization.
(1)
Input Layer
The input layer consists of three feature channels: lexical ( U syntax ), contextual ( U context ), and rhetorical ( U rhetoric ) features. These channels encode semantic information from different perspectives.
(2)
Adaptive Multi-channel Attention Mechanism Layer
The adaptive multi-channel attention mechanism includes three components: intra-channel, inter-channel, and aggregation attention. These are used respectively to adjust the weights of features within each channel, adjust relationships between different channels, and adaptively fuse information from the three channels. Taking the lexical semantic feature channel as an example:
Intra-channel attention assigns weights to features within each channel:
ATT intra _ syntax = softmax ( W intra · e syntax )
where W intra is the weight matrix used for intra-channel features, generating the attention weight for each feature vector through an activation function.
Inter-channel attention models the relationship between different channels. By calculating the similarity between channels, it allocates weights to each channel:
ATT context _ syntax = sigmoid ( W inter · [ e context , e syntax ] )
where W inter is the weight matrix used for inter-channel features. The attention value determines the relationship between channels, and the model can adaptively adjust the influence of each channel during fusion based on this information. Channel aggregation attention considers the joint relationship between intra-channel and inter-channel attention, generating the final attention weights for each channel and determining the contribution of each channel to the final fusion result:
ATT syntax _ sum = σ ( ATT syntax + ATT syntax _ context + ATT syntax _ rhetoric )
where σ is the activation function, generating the final weight value based on the adaptive importance of each channel.
(3)
Dynamic Parameter Fusion Layer
The dynamic parameter fusion layer performs weighted fusion of the features based on the three attention weights ATT syntax _ sum , ATT context _ sum , ATT rhetoric _ sum generated by the adaptive multi-channel attention mechanism. The goal of this layer is to adjust the contributions of different channels during the fusion process using the weight information produced by the attention mechanism:
h fusion = [ ATT syntax _ sum · e syntax , ATT context _ sum · h context , ATT rhetoric _ sum · h rhetoric ]
This fusion process adjusts the contribution of different channels based on the attention weight of each channel, generating the final fused feature vector h fusion .
(4)
Output Layer
Finally, the output layer calculates the harmful euphemism loss based on the feature vectors generated by the fusion of the above network structures:
L o s s toxic = 1 N i = 1 N y i euph log p i euph + ( 1 y i euph ) log ( 1 p i euph )
L o s s topic = 1 N i = 1 N t = 1 T y i , t topic log P i , t topic
L o s s rhet = 1 N i = 1 N r = 1 R y i , r rhet log P i , r rhet
where L o s s toxic , L o s s topic , and L o s s rhet are the losses for the harmful euphemism label, the attack topic label, and the rhetorical behavior label, respectively. Among them, the attack topic label and the rhetorical behavior label are annotated through the harmful euphemism seed lexicon and participate in model training as auxiliary features for the harmful euphemism detection task. Therefore, during model testing, only the results of the harmful euphemism label are calculated to compile metrics such as accuracy and recall for the harmful euphemism detection model.

4. Experiments

4.1. Experimental Setup

4.1.1. Dataset

In this study, the HECD dataset is adopted as the benchmark for the harmful euphemism detection task and serves as the evaluation basis for both the representation learning framework HER-MCL and the detection framework HED-MSP. Specifically, HECD is split into training, validation, and test sets with a 7:1:2 ratio, ensuring a standardized and fair evaluation protocol for model training and assessment.
In addition, we construct a semantic textual similarity dataset, HEC-STS (Harmful Euphemism Comment Semantic Textual Similarity), to evaluate the quality of sentence embeddings from a semantic similarity perspective. This dataset is designed to assess how well sentence representations capture semantic information in the embedding space, rather than being used for downstream detection tasks.
HEC-STS is constructed from harmful euphemisms and their corresponding explanatory terms, which capture their underlying toxic meanings. Sentence pairs are generated by combining these euphemisms with their semantic interpretations. Each sample consists of a sentence pair of similar length. The pair is annotated with a semantic similarity score ranging from 0 to 5, which reflects the degree of semantic relatedness between the two sentences.
During evaluation, cosine similarity between sentence embeddings is computed and compared with human-annotated similarity scores. If the model-generated similarity distribution aligns closely with the annotated distribution, it indicates that the model better captures sentence-level semantics and therefore has stronger representation capability. Conversely, larger discrepancies suggest limitations in semantic modeling, leading to weaker representational quality of the learned embeddings.

4.1.2. Baselines

To evaluate the effectiveness of the proposed HED-MSP model, we compare its performance against a diverse set of representative baselines, spanning traditional text classification models, pre-trained language models, and state-of-the-art LLMs.
Commercial APIs & Machine Learning: We include commercial content moderation services, namely Perspective API and Tencent API [49]. Additionally, traditional machine learning algorithms, including Support Vector Machine (SVM), Random Forest (RF), k-Nearest Neighbors (k-NN), and AdaBoost, are utilized as baselines relying on handcrafted features.
Deep Learning Models: For standard neural network architectures, we employ TextFNN [50] and TextCNN [51] for basic text embedding and local n-gram feature extraction. To capture long-range contextual dependencies and sequential patterns, we compare against RNN-based variants: Bi-LSTM [52], BiLSTM-Att (with attention mechanism) [53], BiLSTM-CRF [54], and RCNN [55], which optimally integrates CNNs and RNNs.
PLMs: We utilize prominent Transformer-based models, including BERT [56] and its robustly optimized variant RoBERTa, which excel in context-aware representation learning. We also incorporate DistilBERT, a lightweight, knowledge-distilled variant of BERT designed for fast inference, and DeBERTa, which employs disentangled attention mechanisms to capture fine-grained semantic dependencies. Furthermore, we include SBERT, an efficient Siamese network-based extension for generating high-quality fixed-length sentence embeddings.
LLMs: Finally, to benchmark against contemporary generative models, we select a wide range of LLMs. This includes advanced proprietary models such as GPT-4o, GPT-4-Turbo, and the reasoning-focused OpenAI-o1. Furthermore, we evaluate powerful open-weight bilingual models, encompassing LLaMA3-70B, ChatGLM3-6B, Qwen2-72B, DeepSeek-V3, and DeepSeek-R1, to assess their zero-shot and reasoning capabilities in complex semantic tasks.

4.1.3. Evaluation Metrics

To comprehensively evaluate model performance, this experiment selects Accuracy, Precision, Recall, F1 score, Pearson Correlation (PC), and Spearman’s Rank Correlation (SRC) as evaluation metrics.
Among these, the Pearson Correlation and Spearman’s Rank Correlation are used to measure the linear correlation between two variables, specifically analyzing the linear association between model representations and specific labels, and evaluating the consistency with human judgments, respectively.

4.1.4. Evaluation Settings for LLMs and APIs

To ensure a fair and rigorous comparison between the proposed HED-MSP and baseline methods, we standardize the evaluation conditions across all models. Specifically, all models are evaluated on the same HECD test set using identical input text, without any additional preprocessing or data augmentation.
For traditional machine learning methods and neural classifiers, all models are fully fine-tuned on the training split of the HECD dataset.
For commercial APIs (Perspective API and Tencent API), we query their official endpoints using the same test instances and adopt their default confidence thresholds for binary classification.
For LLMs, to ensure a fair comparison and avoid the instability commonly observed in naive zero-shot settings, we evaluate all LLMs (including GPT-4o, DeepSeek series, and Qwen series) using a unified task-specific prompt template. The system prompt defines the model’s role and provides a clear definition of harmful euphemisms, along with structured output constraints to ensure consistent classification decisions.
To improve reproducibility and reduce randomness, the generation temperature is set to a low value ( T = 0.05 ), ensuring stable and near-deterministic outputs across runs.

4.1.5. Experimental Setup

All experiments were implemented using the PyTorch framework and conducted on a server equipped with dual NVIDIA Tesla V100 GPUs (32 GB VRAM). The HED-MSP model was optimized using the AdamW optimizer with an initial learning rate of 1 × 10 5 . To strike a balance between computational efficiency and GPU memory constraints, the batch size was set to 64. To mitigate overfitting, a dropout rate of 0.5 was applied. The maximum number of training epochs was set to 10, and an early stopping strategy was implemented during the training phase based on the validation set performance. Furthermore, a 10-fold cross-validation strategy was employed to robustly train and evaluate the model. To minimize experimental variance, all experiments were repeated 5 times using different random seeds, with the averaged results reported. For the baseline models, foundational encoders were initialized with their respective publicly available pre-trained weights prior to task-specific fine-tuning, and the best-performing models and hyper-parameters were selected based on the validation set to ensure a fair comparison.

5. Results and Analysis

5.1. Representation Learning Comparative Experiments

In this experiment, comparative representation learning experiments for the HER-MCL framework were conducted on the HECD dataset. The Pearson Correlation and Spearman’s Rank Correlation coefficients are used to calculate the distribution correlation between the sentence pair representation vector similarity and the label similarity. A higher distribution correlation indicates higher representation accuracy, signifying a better representation training method. Conversely, a lower correlation indicates poorer representation accuracy and a less effective training method. The experimental results are shown in Figure 3 and Figure 4.
As shown in the figure, among all the compared methods, HER-MCL consistently achieves higher Pearson and Spearman correlation coefficients, indicating its superiority in learning semantically meaningful representations for harmful euphemism detection.
Specifically, on the DeBERTa backbone network, HER-MCL improves the Pearson correlation coefficient (PC) and Spearman rank correlation coefficient (SRC) compared to the RoBERTa-based Prompt-BERT baseline. These improvements demonstrate that the proposed framework significantly enhances the semantic consistency between representation vectors and annotation labels, particularly in capturing implicit euphemisms. Furthermore, HER-MCL also achieves consistent performance improvements on the lightweight DistilBERT model, further validating the robustness of the proposed method across different backbone network architectures. This indicates that the performance improvement is not dependent on model size but stems from the effectiveness of the proposed representation learning strategy.
Overall, the experimental results demonstrate that HER-MCL effectively improves representation quality while maintaining excellent performance on both large-scale and lightweight backbone models, making it suitable for practical deployment scenarios with stringent efficiency requirements.

5.2. Ablation Study of the Representation Learning Module

To evaluate the contribution of each module to the enhancement of harmful euphemism representations, we conducted an ablation study on the deep prompt chain-of-thought (DPTC), data augmentation, and multi-head contrastive learning (MCL) components of the HER-MCL framework using the HEC-STS dataset. The specific configurations for the ablated models are as follows:
  • HER-MCL (-DPTC): Removes the deep prompt chain-of-thought module, employing a vanilla contrastive learning mechanism.
  • HER-MCL (-mapping): Removes the mapping-based augmented samples from the three-fold data augmentation module, utilizing only the other two types to construct contrastive learning samples.
  • HER-MCL (-replacing): Removes the replacement-based augmented samples from the three-fold data augmentation module, utilizing only the other two types to construct contrastive learning samples.
  • HER-MCL (-MCL): Removes the multi-head contrastive learning mechanism, relying solely on the SimCSE mechanism.
As shown in Table 5, the complete HER-MCL framework consistently achieves the best performance across all backbone models, demonstrating the effectiveness of jointly integrating DPTC, multi-strategy data augmentation, and multi-head contrastive learning. The results indicate that harmful euphemism representation learning benefits from both external knowledge enhancement and structured representation optimization.
When the DPTC module is removed, the performance drops significantly across all models, suggesting that the structured reasoning process and external knowledge provided by DPTC play a crucial role in enriching semantic representations. Without this module, the model relies solely on surface-level textual information, making it more difficult to capture the implicit and context-dependent nature of harmful euphemisms.
Ablation results on data augmentation strategies further reveal differentiated and complementary contributions. Removing mapping-based augmentation leads to a substantial performance decrease, indicating that linking euphemistic expressions with their underlying harmful meanings is essential for semantic alignment. In contrast, removing replacement-based augmentation results in a relatively smaller but consistent degradation, suggesting that this strategy primarily enhances structural robustness by introducing lexical and contextual variations, allowing the model to learn invariant semantic features under diverse surface forms. Notably, randomized augmentation is treated as a fundamental stochastic regularization baseline (e.g., word dropout and shuffling) rather than an explicit semantic transformation. Its contribution to representation stability and overfitting mitigation is implicitly reflected in the overall system performance; therefore, the ablation study focuses on augmentation strategies that provide task-specific semantic guidance.
In addition, the removal of the multi-head contrastive learning (MCL) mechanism results in one of the most significant performance declines, highlighting its critical role in representation learning. Compared to standard contrastive learning, the multi-head design enables the model to learn complementary semantic structures in multiple subspaces, thereby improving its ability to capture fine-grained semantic relationships.

5.3. Model Comparison Experiment

We tested the proposed HED-MSP model and the baselines on the HECD dataset; the experimental results are shown in Table 6.
This performance demonstrates that HED-MSP achieves a substantial improvement over all categories of baseline methods, including API-based systems, traditional machine learning models, deep neural classifiers, and large language models.
Among API-based systems such as Perspective-API and Tencent-API, we observe limited capability in capturing implicit harmful intent. These methods tend to exhibit relatively high precision but low recall, indicating that rule-based or externally pretrained moderation systems are insufficient for identifying euphemistic expressions with indirect or context-dependent semantics. For traditional machine learning methods, models such as RF and k-NN achieve moderate performance; however, their reliance on shallow lexical and statistical features restricts their ability to generalize to evolving euphemistic patterns. This limitation becomes more pronounced when dealing with semantically dynamic or culturally embedded expressions. Neural network-based toxic content classifiers further improve performance, with RoBERTa-base achieving the strongest baseline F1-score. Nevertheless, these models still struggle to fully capture implicit semantic shifts in euphemistic language, particularly when rhetorical or contextual transformations are involved. Large language models, including GPT-4o and DeepSeek-series models, demonstrate strong semantic understanding and relatively high recall. However, they consistently suffer from lower precision, as they tend to over-interpret semantically ambiguous euphemistic expressions and assign toxic labels to benign or context-dependent content. This limitation arises from their unconstrained generative inference paradigm, which lacks explicit structural constraints during semantic reasoning.
In contrast, HED-MSP achieves a better balance between precision and recall. We attribute this improvement to the proposed Syntactic Semantic Perception Module (SSPM), which introduces explicit syntactic constraints into the semantic reasoning process. By leveraging dependency-aware structural modeling, SSPM imposes hierarchical boundaries on representation learning, thereby reducing spurious semantic associations and mitigating misclassification in neutral or ambiguous contexts. Furthermore, the empirical results suggest that the proposed multi-dimensional semantic perception fusion framework is capable of capturing subtle harmful intentions that are often overlooked by surface-level token-based analysis. By integrating syntactic, contextual, and rhetorical semantic signals, HED-MSP learns more robust and discriminative representations, enabling more effective identification of evolving euphemistic expressions in dynamic content moderation scenarios.
Overall, HED-MSP outperforms all baselines, achieving a 93.23% F1 score. The improvement over the strongest non-LLM baseline (RoBERTa-base) demonstrates the effectiveness of multi-dimensional semantic perception fusion. Moreover, compared to LLM-based methods, HED-MSP achieves not only higher accuracy but also significantly lower inference cost, making it more suitable for real-world high-throughput content moderation systems.

5.4. Real-Time Performance Experiments

The HED-MSP model is designed as a lightweight architecture for harmful euphemism detection under real-time moderation constraints. In such scenarios, low latency and high throughput are critical for handling high-concurrency online requests. To evaluate the deployment feasibility of HED-MSP, we conduct a systematic analysis of its inference efficiency and computational cost.
To comprehensively evaluate the models, we define the following metrics: (1) Latency (ms/sample): The average inference time for a single input sample without batching; (2) Throughput (samples/s): The number of samples processed per second under batched or concurrent inference settings; (3) Memory Usage (GB): Peak GPU memory consumption during inference. (4) Model Parameters (B): The number of model parameters; (5) Inference Cost (Yuan/1M tokens): The estimated monetary cost per million tokens.
It is important to emphasize that LLMs are used exclusively in the offline stage for generating chain-of-thought supervision signals. Therefore, all reported metrics for HED-MSP reflect only its online inference efficiency.
As illustrated in Table 7, the HED-MSP method achieves an effective balance between inference efficiency and computational cost. Compared to strong encoder-based baselines such as BERT and RoBERTa, it provides lower latency and higher throughput with a reduced memory footprint. Compared to generative LLMs, HED-MSP offers orders-of-magnitude improvements in response time and deployment cost. While massive LLMs exhibit strong zero-shot generalization ability, their inference is significantly constrained by high computational overhead and latency. By leveraging LLMs strictly in the offline stage, our framework retains their reasoning capability without sacrificing the millisecond-level online efficiency required for high-concurrency moderation tasks.

5.5. Ablation Study

To evaluate the detection performance improvements brought by the proposed Syntactic Semantic Perception Module (SSPM), Contextual Semantic Perception Module (CSPM), Rhetorical Semantic Perception Module (RSPM), and Cross-channel Dynamic Adaptive Fusion (CDAF) module for harmful euphemisms, this experiment conducts an ablation study on the modules of the HED-MSP framework to demonstrate the contribution of each component and mechanism to the task. The comparative ablation models are set as follows:
  • HED-MSP (-SSPM): Removes the syntactic lexical semantic perception module, retaining the rest.
  • HED-MSP (-CSPM): Removes the contextual background semantic perception module, retaining the rest.
  • HED-MSP (-RSPM): Removes the rhetorical behavior semantic perception module, retaining the rest.
  • HED-MSP (-CDAF): Removes the cross-channel fusion module, retaining the rest.
As shown in Table 8, the complete HED-MSP framework achieves the best overall performance, reaching an F1 score of 93.23%. This result significantly outperforms the representative backbone model RoBERTa-base and is also competitive with advanced large language model baselines such as OpenAI-o1. These empirical findings indicate that relying solely on general-purpose contextual encoders or prompt-based LLM inference is insufficient for effectively disentangling highly complex euphemistic expressions, thereby clearly demonstrating the necessity of the proposed multi-dimensional semantic perception architecture.
Furthermore, the ablation results show that removing any individual module leads to a noticeable performance degradation, although the extent of the decline varies depending on the specific cognitive role of each component. This observation suggests that there exist complex and complementary interactions among different modules in the task of harmful euphemism detection.
Specifically, removing the rhetorical semantic perception module (−RSPM) results in the most significant performance drop. The RSPM is designed to decode non-literal expressions, particularly rhetorical devices such as metaphor, sarcasm, and presupposition. Since rhetorical camouflage is one of the primary mechanisms used in harmful euphemisms, removing this module significantly reduces the model’s sensitivity to implicit malicious intent, making it more vulnerable to being misled by surface-level benign expressions.
The second largest degradation is observed when the contextual semantic perception module (−CSPM) is removed. The CSPM focuses on modeling contextual coherence through a context-aware pooling mechanism, capturing both local and global semantic dependencies. In real-world social media scenarios, isolated sentences may appear neutral or even positive; only when considered within surrounding contextual information can their underlying harmful intent be correctly identified. Without CSPM, the model suffers from fragmented contextual understanding, leading to a substantial drop in recall.
In addition, removing the syntactic semantic perception module (−SSPM) leads to a 1.78% decrease in F1 score. The SSPM captures syntactic structure and lexical-semantic interactions, providing fundamental linguistic constraints for detection. For instance, in sentences involving negation structures, SSPM can accurately identify the scope of negation, preventing neutral statements from being misclassified as offensive content. The absence of SSPM weakens syntactic disambiguation capability and consequently degrades detection accuracy.
Finally, replacing the cross-channel dynamic adaptive fusion (CDAF) mechanism with simple feature concatenation results in a 1.05% drop in F1 score. This highlights that naive feature fusion cannot effectively adaptively prioritize the most informative semantic cues across heterogeneous representations. In contrast, the proposed dynamic fusion mechanism plays a crucial role in integrating multi-dimensional semantic signals, thereby maximizing the overall discriminative power of the model.

5.6. Model Generalization Experiments

We evaluate the generalization capability of HED-MSP under zero-shot conditions using different topic types from the HECD dataset.
In this experiment, all models are trained on the “General Insults” category of the HECD dataset and evaluated on the “Group Attacks” category (and vice versa). The experimental results are shown in Table 9.
As shown, HED-MSP demonstrates competitive cross-topic generalization performance. Compared to traditional lightweight classifiers, HED-MSP achieves significant performance gains across both transfer settings. For instance, in the “Group Attacks → General Insults” setting, HED-MSP’s accuracy surpasses RoBERTa-large by over 15 percentage points. Similar gains are observed in the reverse transfer scenario, indicating that our model possesses superior cross-topic adaptability among specialized, compact architectures.Simultaneously, we observe that advanced LLMs, such as GPT-4o and DeepSeek-R1, achieve superior performance in zero-shot transfer tasks. This underscores the inherent advantage of massive pre-training when encountering entirely unseen topics. Consequently, while HED-MSP does not exceed the performance ceiling set by the strongest LLM baselines, it maintains a highly competitive transfer capability with a relatively narrow performance gap.From a practical deployment perspective, HED-MSP strikes an optimal balance between generalizability and operational efficiency. Compared to massive LLMs, HED-MSP drastically reduces computational overhead and supports faster inference speeds, which is essential for large-scale, real-time content moderation. In summary, these results demonstrate that HED-MSP’s core strength lies in its ability to reconcile robust transfer performance with high real-world deployability.

5.7. Cross-Dataset Experiments

To evaluate the robustness of HED-MSP across diverse linguistic environments, we conducted cross-dataset experiments on three English euphemism datasets: EACL [57], FigLang [58], and JointEDI [59]. These datasets vary significantly from the Chinese-based HECD in terms of domain and annotation style, providing a rigorous testbed for assessing whether the learned detection capabilities can generalize beyond the original linguistic context.
The rationale for this cross-lingual transfer is rooted in the observation that harmful euphemisms across different languages often exhibit congruent high-level semantic and pragmatic characteristics. Specifically, such expressions rely on universal mechanisms like indirect referentiality and intent-driven semantic shifts rather than language-specific lexical markers. Our objective is to investigate whether HED-MSP can capture these language-agnostic linguistic structures. The experimental results are shown in Table 10.
As shown, HED-MSP consistently outperforms all lightweight baselines across the three English datasets. Compared to traditional neural architectures like BiLSTM and RoBERTa variants, HED-MSP achieves a significant performance uplift. This demonstrates that our framework, through Deep Prompt CoT and multi-dimensional semantic modeling, effectively captures generalizable patterns that transcend surface-level linguistic features.
While advanced LLMs like GPT-4o and DeepSeek-R1 demonstrate superior performance in certain cross-lingual settings—reflecting the advantages of massive multilingual pre-training—HED-MSP maintains highly competitive performance. Most importantly, it achieves this while offering substantially lower computational overhead and inference latency, reconciling robust cross-dataset generalizability with the efficiency required for real-world deployment.

5.8. Case Study

While the HED-MSP framework exhibits robust overall performance, analyzing its failure cases and underlying error patterns is essential for guiding future enhancements. We conducted a manual error analysis on several false negative (FN) and false positive (FP) samples, as detailed in Table 11.
As observed, the model misclassified harmful euphemisms such as “animals” and “stick” as harmless. Regarding Case 1, the primary reason is that our methodology relies heavily on textual context. In isolation, the comment appears semantically neutral; however, its toxicity as a racial slur is “activated” only when posted under videos featuring specific minority groups. Similarly, in Case 2, the harmfulness of the euphemism is largely defined by the accompanying non-textual emoticons. These instances reveal a “physical boundary” of the current model, namely the lack of capability to integrate non-textual information such as video frames and visual emojis, allowing such extreme cross-modal implicit toxicity to evade detection.
Conversely, Cases 3 and 4 illustrate false positive scenarios. In Case 3, a specific community utilizes “China aluminum” (Guolü) within a sarcastic structure as a form of humorous self-deprecation rather than an actual attack. From the perspective of detection logic, the inclusion of rhetorical sarcasm may cause the RSPM module to mislead the fusion mechanism into a conservative classification of offensive speech. This suggests that while our approach can detect rhetorical anomalies, it suffers from a “knowledge lag” concerning emerging subcultures. Furthermore, in Case 4, HED-MSP misclassified a harmless comment refuting the term “Woman’s Fist” as a harmful euphemism. For such comments, despite the presence of sensitive terms, the macro-semantic intent—characterized by explicit quotation and refutation—is typically benign. This indicates a limitation in our framework’s ability to comprehend high-level pragmatic intentions.
In future research, we aim to integrate multi-modal perception to process non-textual information like video and emojis. Additionally, we plan to develop dynamic pragmatic reasoning mechanisms to effectively distinguish genuine malicious attacks from harmless quotations or subcultural self-mockery.

6. Conclusions

This paper presents HED-MSP, a multi-dimensional semantic-aware framework for harmful euphemism detection. Unlike prior methods that primarily rely on surface-level lexical matching or single-granularity contextual representations, HED-MSP models euphemistic expressions from three complementary perspectives, namely syntactic structure, contextual semantics, and rhetorical behavior, and integrates them through a cross-channel dynamic adaptive fusion mechanism. Experimental results demonstrate that the proposed framework consistently achieves state-of-the-art performance among specialized lightweight architectures. Moreover, it exhibits strong robustness and generalization ability across different backbone encoders, striking an optimal balance between competitive transferability and real-time operational efficiency when compared to massive LLMs.
The contributions of this work are twofold, including both dataset construction and methodological advances in representation learning. First, we construct the HECD dataset, which provides fine-grained annotations of harmful euphemisms along with topic categories, attack types, and semantic explanations, thereby addressing the lack of structured resources in this research area and supporting fine-grained semantic learning.
Second, from a methodological perspective, we propose a multi-dimensional semantic modeling framework with two key innovations. On the one hand, we demonstrate that cognitive reasoning signals encoded by large language models (LLMs) through Chain-of-Thought (CoT) prompting can be effectively transferred to lightweight encoders via offline knowledge-enhanced contrastive learning. This design enables the incorporation of external reasoning capabilities into compact models while avoiding the computational overhead of direct LLM inference. On the other hand, we show that effective euphemism understanding requires unified representation learning that jointly captures syntactic dependency relations, contextual coherence, and rhetorical transformation patterns. This multi-granularity modeling paradigm provides a more structured and interpretable way to represent implicit harmful semantics.
Beyond performance improvements, HED-MSP also provides practical implications for real-world deployment. By decoupling computationally expensive representation enhancement from online inference, the proposed framework enables efficient deployment in large-scale and low-latency content moderation systems. Moreover, since the model focuses on language-agnostic semantic structures rather than surface lexical cues, it exhibits strong potential for multilingual and cross-domain extension.
In future work, we will further investigate robust learning strategies under noisy and imbalanced data distributions, and explore cross-lingual adaptation mechanisms to improve generalization across diverse linguistic environments. In addition, we plan to incorporate external knowledge resources and investigate model compression techniques to further enhance scalability and efficiency for real-world high-throughput moderation scenarios.

Author Contributions

S.X. conceived the study, proposed the original idea, shaped the conceptual framework, conducted the experiments, and wrote the original draft. G.Z. contributed to the study’s conceptualization and collaborated on the experimental design. H.W. provided essential technical guidance during the experimental phase, and contributed significantly to manuscript optimization, language refinement, and the final proofreading. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Ethical review and approval were waived for this study. The rationale for stating that ethics approval is not applicable is as follows: (1) the research exclusively utilizes pre-existing, publicly accessible text data from social media platforms, collected strictly in accordance with their Terms of Service; (2) all data underwent rigorous anonymization to completely remove Personally Identifiable Information (PII) prior to analysis, rendering the identification of individual users impossible; (3) the study is purely computational, involving no clinical trials or physical interventions on human subjects. Furthermore, regarding the human annotation process, all annotators were trained researchers. To ensure annotator safety and mitigate psychological risks associated with exposure to harmful content, annotators were warned prior to participation, granted the unconditional right to opt-out at any time, and subjected to strict workload limits.

Informed Consent Statement

Not applicable. The study did not involve human subjects requiring informed consent, as all text data was anonymized and sourced from public domains.

Data Availability Statement

To prevent the potential misuse of the harmful content and euphemism techniques detailed in the HECD dataset by malicious actors, the raw dataset is not deposited in a fully public repository. However, the fully anonymized dataset is available on request from the corresponding author for non-commercial academic purposes, subject to a data-sharing agreement ensuring ethical usage.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Liu, Z.; Shao, Z.; Wang, H.; Li, B. DDML: Multi-Student Knowledge Distillation for Hate Speech. Entropy 2025, 27, 417. [Google Scholar] [CrossRef] [PubMed]
  2. Founta, A.; Djouvas, C.; Chatzakou, D.; Leontiadis, I.; Blackburn, J.; Stringhini, G.; Vakali, A.; Sirivianos, C.; Kourtellis, N. Large Scale Crowdsourcing and Characterization of Twitter Abusive Behavior. In Proceedings of the 12th International Conference on Web and Social Media, Stanford, CA, USA, 25–28 June 2018; pp. 491–500. [Google Scholar]
  3. Fortuna, P.; Nunes, S. A Survey on Automatic Detection of Hate Speech in Text. ACM Comput. Surv. 2018, 51, 1–30. [Google Scholar] [CrossRef]
  4. ElSherief, M.; Ziems, C.; Muchlinski, D.; Rezvan, M.; Paasch, C.; Stork, J.; Glass, J.; Walentowska, M.; Zhuravskaya, M.; Yang, D. Latent Hatred: A Benchmark for Understanding Implicit Hate Speech. In Proceedings of the 18th Conference on Empirical Methods in Natural Language Processing (EMNLP), Punta Cana, Dominican Republic, 7–11 November 2021; pp. 345–363. [Google Scholar]
  5. Davidson, T.; Warmsley, D.; Macy, M.; Weber, I. Automated Hate Speech Detection and the Problem of Offensive Language. In Proceedings of the 11th International Conference on Web and Social Media (ICWSM), Montréal, QC, Canada, 15–18 May 2017; pp. 512–515. [Google Scholar]
  6. Waseem, Z.; Hovy, D. Hateful Symbols or Hateful People? Predictive Features for Hate Speech Detection on Twitter. In Proceedings of the 14th NAACL Student Research Workshop, San Diego, CA, USA, 12–17 June 2016; pp. 88–96. [Google Scholar]
  7. Yuan, K.; Lu, H.; Liao, X.; Wang, X. Reading Thieves’ Cant: Automatically Identifying and Understanding Dark Jargons from Cybercrime Marketplaces. In Proceedings of the 27th USENIX Security Symposium, Baltimore, MD, USA, 15–17 August 2018; pp. 1027–1041. [Google Scholar]
  8. Taylor, J.; Peignon, M.; Chen, Y.S. Surfacing Contextual Hate Speech Words within Social Media. arXiv 2017, arXiv:1711.10093. [Google Scholar] [CrossRef]
  9. Zhu, W.; Gong, H.; Bansal, R.; Wu, J.; Li, S.; Liu, J. Self-Supervised Euphemism Detection and Identification for Content Moderation. In Proceedings of the 42nd IEEE Symposium on Security and Privacy (SP), San Francisco, CA, USA, 24–27 May 2021; pp. 229–246. [Google Scholar]
  10. Huang, L.; Wang, S.; Liu, C.; Zhang, X. Low-Frequency Aware Unsupervised Detection of Dark Jargon Phrases on Social Platforms. In Proceedings of the 20th Pacific Rim International Conference on Artificial Intelligence (PRICAI), Jakarta, Indonesia, 15–19 November 2023; pp. 198–209. [Google Scholar]
  11. Guan, Z.; Zhang, P.; Gu, H.; Wang, X. JargonFM: A Framework With Multiple Interpretation Modes for Jargon Understanding in Online Communities. IEEE Trans. Comput. Soc. Syst. 2024, 11, 1853–1864. [Google Scholar] [CrossRef]
  12. Kim, Y.; Park, S.; Han, Y.S. Generalizable Implicit Hate Speech Detection using Contrastive Learning. In Proceedings of the 29th International Conference on Computational Linguistics (COLING), Gyeongju, Republic of Korea, 12–17 October 2022; pp. 6667–6679. [Google Scholar]
  13. Lu, J.; Lin, H.; Zhang, X.; Xu, B.; Yang, L.; Luo, J. Hate Speech Detection via Dual Contrastive Learning. IEEE/ACM Trans. Audio Speech Lang. Process. 2023, 31, 2787–2795. [Google Scholar] [CrossRef]
  14. Deng, J.; Zhou, J.; Sun, H.; Zhang, C.; Zheng, F.; Min, L.; Zheng, H. COLD: A Benchmark for Chinese Offensive Language Detection. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, Abu Dhabi, United Arab Emirates, 7–11 December 2022; pp. 11580–11599. [Google Scholar]
  15. Hartvigsen, T.; Gabriel, S.; Palangi, H.; Sap, M.; Ray, V.; Kamar, E. ToxiGen: A Large-Scale Machine-Generated Dataset for Adversarial and Implicit Hate Speech Detection. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics, Dublin, Ireland, 22–27 May 2022; pp. 3309–3326. [Google Scholar]
  16. Pavlopoulos, J.; Laugier, L.; Xenos, A.; Kougia, V.; Androutsopoulos, I. From the Detection of Toxic Spans in Online Discussions to the Analysis of Toxic-to-Civil Transfer. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics, Dublin, Ireland, 22–27 May 2022; pp. 3721–3734. [Google Scholar]
  17. Wang, Y.; Su, H.; Wu, Y.; Zhang, X. SICM: A Supervised-Based Identification and Classification Model for Chinese Jargons Using Feature Adapter Enhanced BERT. In Proceedings of the 20th Pacific Rim International Conference on Artificial Intelligence (PRICAI), Shanghai, China, 10–13 November 2022; pp. 297–308. [Google Scholar]
  18. Huang, X.; Zhao, J.; Shi, J.; Wang, Z. Syntactic Enhanced Euphemisms Identification Based on Graph Convolution Networks and Dependency Parsing. In Proceedings of the 8th International Conference on Data Science in Cyberspace (DSC), Hefei, China, 20–22 October 2023; pp. 172–180. [Google Scholar]
  19. Ghosh, S.; Suri, M.; Chiniya, P.; Singhania, S.; Singh, R.K. CoSyn: Detecting Implicit Hate Speech in Online Conversations Using a Context Synergized Hyperbolic Network. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, Singapore, 6–10 December 2023; pp. 6159–6173. [Google Scholar]
  20. Zhang, L.; Jin, L.; Sun, X.; Zhao, Y. TOT: Topology-Aware Optimal Transport for Multimodal Hate Detection. In Proceedings of the 37th AAAI Conference on Artificial Intelligence, Washington, DC, USA, 7–14 February 2023; pp. 4884–4892. [Google Scholar]
  21. Wei, J.; Wang, X.; Schuurmans, D.; Maeda, M.; Zhao, F.; Xia, Y.; Le, Q.V.; Zhou, D. Chain-of-Thought Prompting Elicits Reasoning in Large Language Models. Adv. Neural Inf. Process. Syst. 2022, 35, 24824–24837. [Google Scholar]
  22. Kojima, T.; Gu, S.S.; Reid, M.; Matsuo, Y.; Iwasawa, Y. Large Language Models are Zero-Shot Reasoners. Adv. Neural Inf. Process. Syst. 2022, 35, 22199–22213. [Google Scholar]
  23. Zhao, R.; Zhao, F.; Wang, L.; Zhang, X. KG-CoT: Chain-of-Thought Prompting of Large Language Models over Knowledge Graphs for Knowledge-Aware Question Answering. In Proceedings of the 33rd International Joint Conference on Artificial Intelligence (IJCAI), Jeju, Republic of Korea, 3–9 August 2024; pp. 6642–6650. [Google Scholar]
  24. Mondal, D.; Modi, S.; Panda, S.; Singh, A. KAM-CoT: Knowledge Augmented Multimodal Chain-of-Thoughts Reasoning. In Proceedings of the 38th AAAI Conference on Artificial Intelligence, Vancouver, BC, Canada, 20–27 February 2024; pp. 18798–18806. [Google Scholar]
  25. Magu, R.; Luo, J. Determining Code Words in Euphemistic Hate Speech Using Word Embedding Networks. In Proceedings of the 2nd Workshop on Abusive Language Online (ALW2), Brussels, Belgium, 31 October 2018; pp. 93–100. [Google Scholar]
  26. Wang, C.; Shen, Y.; Li, Y.; Liu, J.; Zhang, Y. A Systematic Empirical Study on Word Embedding Based Methods in Discovering Chinese Black Keywords. Eng. Appl. Artif. Intell. 2023, 125, 106775. [Google Scholar] [CrossRef]
  27. Wiegand, M.; Ruppenhofer, J.; Eder, E. Implicitly Abusive Language—What does it actually look like and why are we not getting there? In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Online, 6–11 June 2021; pp. 576–587. [Google Scholar]
  28. Wiegand, M.; Ruppenhofer, J.; Kleinbauer, T. Detection of Abusive Language: The Problem of Biased Datasets. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Minneapolis, MN, USA, 2–7 June 2019; pp. 602–608. [Google Scholar]
  29. Breitfeller, L.; Ahn, E.; Jurgens, D.; Tsvetkov, Y. Finding Microaggressions in the Wild: A Case for Locating Elusive Phenomena in Social Media Posts. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), Hong Kong, China, 3–7 November 2019; pp. 1664–1674. [Google Scholar]
  30. He, K.; Fan, H.; Wu, Y.; Xie, S.; Girshick, R. Momentum Contrast for Unsupervised Visual Representation Learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Seattle, WA, USA, 14–19 June 2020; pp. 9726–9735. [Google Scholar]
  31. Chen, T.; Kornblith, S.; Norouzi, M.; Hinton, G. A Simple Framework for Contrastive Learning of Visual Representations. In Proceedings of the 37th International Conference on Machine Learning (ICML), Online, 13–18 July 2020; pp. 1575–1585. [Google Scholar]
  32. Gao, T.; Yao, X.; Chen, D. SimCSE: Simple Contrastive Learning of Sentence Embeddings. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, Online, 7–11 November 2021; pp. 6894–6910. [Google Scholar]
  33. Gunel, B.; Du, J.; Conneau, A.; Stoyanov, V. Supervised Contrastive Learning for Pre-trained Language Model Fine-tuning. In Proceedings of the 9th International Conference on Learning Representations (ICLR), Online, 3–7 May 2021. [Google Scholar]
  34. Lin, Y.; Gou, Y.; Liu, X.; Bai, J.; Lv, J.; Peng, X. Dual Contrastive Prediction for Incomplete Multi-View Representation Learning. IEEE Trans. Pattern Anal. Mach. Intell. 2023, 45, 4447–4461. [Google Scholar] [CrossRef] [PubMed]
  35. Nejadgholi, I.; Fraser, K.; Kiritchenko, S. Improving Generalizability in Implicitly Abusive Language Detection with Concept Activation Vectors. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), Dublin, Ireland, 22–27 May 2022; pp. 5517–5529. [Google Scholar]
  36. Zhang, Z.; Zhang, A.; Li, M.; Smola, A. Automatic Chain of Thought Prompting in Large Language Models. arXiv 2022, arXiv:2210.03493. [Google Scholar] [CrossRef]
  37. Zhou, Z.; Tao, R.; Zhu, J.; Liu, Y. Can Language Models Perform Robust Reasoning in Chain-of-thought Prompting with Noisy Rationales? Adv. Neural Inf. Process. Syst. 2024, 37, 123846–123910. [Google Scholar]
  38. Wu, J.; Yu, T.; Chen, X.; Wang, S. DeCoT: Debiasing Chain-of-Thought for Knowledge-Intensive Tasks in Large Language Models via Causal Intervention. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (ACL), Bangkok, Thailand, 11–16 August 2024; pp. 14073–14087. [Google Scholar]
  39. Chen, W.; Dang, Y.; Zhang, X. A Multimodal Semantic-Enhanced Attention Network for Fake News Detection. Entropy 2025, 27, 746. [Google Scholar] [CrossRef] [PubMed]
  40. Zhang, Y.; Yang, Q. A Survey on Multi-Task Learning. IEEE Trans. Knowl. Data Eng. 2021, 34, 5586–5609. [Google Scholar] [CrossRef]
  41. Liu, H.; Burnap, P.; Alorainy, W.; Williams, M.L. Fuzzy Multi-task Learning for Hate Speech Type Identification. In Proceedings of the World Wide Web Conference (WWW), San Francisco, CA, USA, 13–17 May 2019; pp. 3006–3012. [Google Scholar]
  42. Bendjoudi, I.; Vanderhaegen, F.; Hamad, D.; Dornaika, F. Multi-label, Multi-task CNN Approach for Context-based Emotion Recognition. Inf. Fusion 2021, 76, 422–428. [Google Scholar] [CrossRef]
  43. Zhang, Y.; Wang, J.; Liu, Y.; Zhang, X. A Multitask Learning Model for Multi-modal Sarcasm, Sentiment and Emotion Recognition in Conversations. Inf. Fusion 2023, 93, 282–301. [Google Scholar] [CrossRef]
  44. Liu, X.; He, P.; Chen, W.; Gao, J. Multi-Task Deep Neural Networks for Natural Language Understanding. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, Florence, Italy, 28 July–2 August 2019; pp. 4487–4496. [Google Scholar]
  45. Ma, J.; Zhao, Z.; Yi, X.; Chen, J.; Lichman, M.; Chi, E.H. Modeling Task Relationships in Multi-task Learning with Multi-gate Mixture-of-Experts. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, London, UK, 19–23 August 2018; pp. 1930–1939. [Google Scholar]
  46. Duong, L.; Cohn, T.; Bird, S.; Cook, P. Low Resource Dependency Parsing: Cross-lingual Parameter Sharing in a Neural Network Parser. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics, Beijing, China, 26–31 July 2015; pp. 845–850. [Google Scholar]
  47. Zhou, J.; Deng, J.; Mi, F.; Li, Z.; Zheng, H.; Yao, X. Towards Identifying Social Bias in Dialog Systems: Framework, Dataset, and Benchmark. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, Abu Dhabi, United Arab Emirates, 7–11 December 2022; pp. 3576–3591. [Google Scholar]
  48. Manzini, T.; Yao Chong, L.; Black, A.W.; Tsvetkov, Y. Black is to Criminal as Caucasian is to Police: Detecting and Removing Multiclass Bias in Word Embeddings. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics, Minneapolis, MN, USA, 2–7 June 2019; pp. 615–621. [Google Scholar]
  49. Wang, W.; Huang, J.; Chen, C.; Zhang, X. Validating Multimedia Content Moderation Software via Semantic Fusion. In Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA), Vienna, Austria, 17–21 July 2023; pp. 576–588. [Google Scholar]
  50. Pérez, J.M.; Luque, F.M. Atalaya at SemEval-2019 Task 5: Robust Embeddings for Tweet Classification. In Proceedings of the 13th International Workshop on Semantic Evaluation, Minneapolis, MN, USA, 6–7 June 2019; pp. 64–69. [Google Scholar]
  51. Li, J.; Du, T.; Ji, S.; Zhang, R.; Lyu, M.R. TextShield: Robust Text Classification Based on Multimodal Embedding and Neural Machine Translation. In Proceedings of the 29th USENIX Security Symposium, Online, 12–14 August 2020; pp. 1381–1398. [Google Scholar]
  52. Dessì, D.; Recupero, D.R.; Sack, H. An Assessment of Deep Learning Models and Word Embeddings for Toxicity Detection within Online Textual Comments. Electronics 2021, 10, 779. [Google Scholar] [CrossRef]
  53. Neog, M.; Baruah, N. A Deep Learning Framework for Assamese Toxic Comment Detection: Leveraging LSTM and BiLSTM Models with Attention Mechanism. In Proceedings of the 2nd International Conference on Advances in Data-Driven Computing and Intelligent Systems (ADCIS), Singapore, 21–23 September 2023; pp. 485–497. [Google Scholar]
  54. Huang, Z.; Xu, W.; Yu, K. Bidirectional LSTM-CRF Models for Sequence Tagging. arXiv 2015, arXiv:1508.01991. [Google Scholar] [CrossRef]
  55. Lai, S.; Xu, L.; Liu, K.; Zhao, J. Recurrent Convolutional Neural Networks for Text Classification. In Proceedings of the 29th AAAI Conference on Artificial Intelligence, Austin, TX, USA, 25–30 January 2015; pp. 2267–2273. [Google Scholar]
  56. Devlin, J.; Chang, M.W.; Lee, K.; Toutanova, K. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics, Minneapolis, MN, USA, 2–7 June 2019; pp. 4171–4186. [Google Scholar]
  57. Lee, P.; Trujillo, A.C.; Plancarte, D.C. MEDs for PETs: Multilingual Euphemism Disambiguation for Potentially Euphemistic Terms. arXiv 2024, arXiv:2401.14526. [Google Scholar] [CrossRef]
  58. He, W.; Vieira, T.K.; Garcia, M. Investigating Idiomaticity in Word Representations. Comput. Linguist. 2025, 51, 505–555. [Google Scholar] [CrossRef]
  59. Hu, Y.; Li, J.; Wang, T. A Unified Generative Framework for Bilingual Euphemism Detection and Identification. In Proceedings of the Findings of the Association for Computational Linguistics: ACL 2024, Bangkok, Thailand, 11–16 August 2024; pp. 6753–6766. [Google Scholar]
Figure 1. Schematic diagram of the harmful euphemism representation learning framework based on deep prompt chain-of-thought and multi-head contrastive learning.
Figure 1. Schematic diagram of the harmful euphemism representation learning framework based on deep prompt chain-of-thought and multi-head contrastive learning.
Entropy 28 00560 g001
Figure 2. Harmful Euphemism Detection Framework Based on Multi-dimensional Semantic Perception Fusion.
Figure 2. Harmful Euphemism Detection Framework Based on Multi-dimensional Semantic Perception Fusion.
Entropy 28 00560 g002
Figure 3. Pearson Correlation Coefficient Results for Representation Learning Comparative Experiments.
Figure 3. Pearson Correlation Coefficient Results for Representation Learning Comparative Experiments.
Entropy 28 00560 g003
Figure 4. Spearman’s Rank Correlation Coefficient Results for Representation Learning Comparative Experiments.
Figure 4. Spearman’s Rank Correlation Coefficient Results for Representation Learning Comparative Experiments.
Entropy 28 00560 g004
Table 1. Comprehensive Comparison of State-of-the-Art Harmful Euphemism Detection Methods.
Table 1. Comprehensive Comparison of State-of-the-Art Harmful Euphemism Detection Methods.
CategoryReferenceSpecific DatasetBackbone ModelExternal Knowledge
Lexicon LLM/CoT
Rules & Static Rep.Davidson [5]Twitter tweetsLR, SVM, Random Forest×
Waseem [6]Twitter tweetsLR, SVM×
Yuan [7]Dark WebWord2Vec×
Taylor [8]DailyStormer, TwitterWord2Vec + PageRank×
Dynamic Rep.Zhu [9]Reddit, GabBERT××
Huang [10]Tieba, Sina WeiboTransformer××
Guan [11]Online CommunitiesRoBERTa××
Contrastive LearningKim [12]IHC, SBIC, DynaHateDual-Encoder (BERT)××
Lu [13]OffensEval, HatEvalDual-Encoder (RoBERTa)××
Deng [14]AugCOLDMulti-teacher Distillation××
Hartvigsen [15]ToxiGenHateBERT, RoBERTa××
Structure & MultimodalPavlopoulos [16]TOXICSPANSSequence Labeling××
Wang [17]CBKDFeature Adapter BERT×
Huang [18]WeiboGCN××
Ghosh [19]RedditHyperbolic Network××
Zhang [20]MultiOFF, MemotionOptimal Transport Framework××
LLM ReasoningWei [21]GSM8K, SVAMPPaLM, GPT-3 (CoT)×
Kojima [22]MultiArithGPT-3 (Zero-shot)×
Zhao [23]CSQA, OpenBookQALLM + GNN×
Mondal [24]ScienceQALLM + Vision + KG×
Note: √ in “Lexicon” indicates reliance on curated sensitive vocabularies or phonetic/glyph rules; √ in “LLM/CoT” denotes utilizing LLMs for generation or reasoning. × indicates that the corresponding feature or mechanism is not utilized. Literature under “LLM Reasoning Paradigms” represents foundational semantic reasoning frameworks in general NLP tasks, serving as our methodological basis.
Table 2. The initial keyword list for the toxic euphemism comment crawler.
Table 2. The initial keyword list for the toxic euphemism comment crawler.
Topic CategorySeed Keyword List (Examples in Chinese)
Group Attacks猩猩  [Lit: “Gorilla”, a racist slur for people of African descent], 幕刃  [Lit: “Twilight Blade”, a homophonic derogatory term for women].
Vulgar Speech金针菇  [Lit: “Enoki Mushroom”, denoting male genitalia], 菊花  [Lit: “Chrysanthemum”, denoting the anus].
Political Content大毛  [Lit: “Big Fur”, implying Russians], 棒子  [Lit: “Stick”, a derogatory slur for Koreans].
General Insults鸡 [Lit: “Chicken”, a metaphor for sex workers], 孙子  [Lit: “Grandson”, an insult to one’s lineage].
Note: Given the highly offensive, vulgar, and politically sensitive nature of certain terms, and in strict compliance with standard academic ethical guidelines for toxic language research, we have redacted the most extreme raw vocabulary from the manuscript. We present only representative examples categorized by semantic domain.
Table 3. Statistics of the HECD Dataset.
Table 3. Statistics of the HECD Dataset.
Topic TypeAttack TypeHarmfulHarmless
HP PS VS Meme Abbrev. MP Irony CP
Group Attacks35637051458649963377158943185594
Vulgar Speech49641229412359948032233130573356
Political Content14623512816421758928818619532913
General Insults230188941129841649941721533173
Total122812051030884161321181880152311,48115,036
Note: In this table, HP denotes homophone, PS denotes polysemy, VS denotes visual similarity, MP denotes metaphor, CP denotes compound.
Table 4. Deep Prompt CoT Template Across Reasoning Stages.
Table 4. Deep Prompt CoT Template Across Reasoning Stages.
Stage & ObjectiveDeep Prompt CoT Template
Phase I: Task Definition Obj: Understand requirements and task formulation.At this stage, I assume the role of a linguistics and cognitive science expert with specialized knowledge in harmful euphemism analysis. The input consists of: (i) a target sample or text segment containing potential harmful euphemisms, (ii) identified euphemistic expressions, (iii) corresponding semantic interpretation labels, and (iv) auxiliary prompt seed words. The expected output includes: (i) cognitive reasoning analysis of the input sample, (ii) semantically similar samples, (iii) extracted euphemistic expressions, (iv) mapped harmful semantic interpretations, and (v) refined cognitive reasoning chains. A step-by-step reasoning process is required, integrating all relevant linguistic and contextual factors to produce a structured analytical output.
Phase II: Cognitive Understanding Obj: Formulate structured understanding of euphemisms.In this stage, I establish a formal understanding of harmful euphemisms. From a semantic perspective, harmful euphemisms refer to textual expressions in which discriminatory, violent, or illegal intents are concealed through euphemistic transformations. From a structural perspective, they may appear as either short phrases or long-form discourse units, while euphemistic expressions typically exist at lexical or phrasal levels with context-dependent meanings. Furthermore, harmful euphemism interpretation is guided by five core cognitive dimensions, including eight types of attack strategies: homophony, polysemy, visual similarity, meme-based transformation, abbreviation, metaphor, irony, and compound structures.
Phase III: Prompt Alignment Obj: Analyze semantic alignment with examples.Given the current input sample and provided prompt examples, I analyze their semantic relationships and describe how both jointly contribute to fulfilling the task objective. In particular, I evaluate semantic similarity between the target sample and reference examples, and identify key divergences in linguistic expression and intent encoding.
Phase IV: Cognitive Reasoning Obj: Derive structured reasoning chains.I conduct a detailed analysis of how harmful euphemistic expressions are manifested within the input text and how they are interpreted as implicit harmful meanings. Based on the defined cognitive framework, I identify specific attack strategies and construct a structured reasoning chain explaining the detection process. This includes linguistic interpretation grounded in cognitive linguistics principles and logical inference over euphemistic transformations.
Phase V: Target Generation Obj: Generate new samples with semantic mappings.Based on the task description and cognitive analysis, I generate semantically similar harmful euphemistic expressions. I further identify corresponding euphemistic terms and their mapped harmful meanings. A structured representation is required in the form: euphemistic term–attack strategy–semantic interpretation. Additionally, generated samples must be consistent with reference examples and cognitive reasoning constraints.
Phase VI: Output Evaluation Obj: Ensure quality and task compliance.Finally, I evaluate whether the generated outputs satisfy all task constraints. This includes assessing semantic correctness, structural consistency, and alignment with prior definitions. If the outputs do not meet the requirements, the process returns to Stage 2 for iterative refinement. Otherwise, the final results are accepted and output.
Table 5. The results of the ablation experiment for HER-MCL.
Table 5. The results of the ablation experiment for HER-MCL.
MethodPre-Trained ModelPearson CorrelationSpearman’s Rank Correlation
HER-MCL (-DPTC)BERT0.79240.7948
DeBERTa0.75430.7689
DistilBERT0.72560.7327
RoBERTa0.78230.7839
HER-MCL (-mapping)BERT0.80670.8135
DeBERTa0.76290.7812
DistilBERT0.73590.7416
RoBERTa0.81140.8032
HER-MCL (-replacing)BERT0.82390.8297
DeBERTa0.77840.7928
DistilBERT0.75230.7584
RoBERTa0.83370.8219
HER-MCL (-MCL)BERT0.75320.7536
DeBERTa0.76890.7886
DistilBERT0.71870.7353
RoBERTa0.79760.7951
HER-MCL (Ours)BERT0.83870.8463
DeBERTa0.85740.8643
DistilBERT0.79870.8073
RoBERTa0.86930.8765
Note: In this table, DPTC denotes deep prompt chain-of-thought, mapping denotes mapping-based augmented samples, replacing denotes replacement-based augmented samples, and MCL denotes multi-head contrastive learning.
Table 6. Performance comparison of HED-MSP with baseline methods.
Table 6. Performance comparison of HED-MSP with baseline methods.
CategoryModelAcc. (%)Pre. (%)Rec. (%)F1 (%)
API-based SystemsPerspective-API61.3385.8916.7528.04
Tencent-API62.6466.6733.8444.89
Machine Learning MethodsRF81.4279.5778.9779.27
SVM69.9866.6366.6766.65
k-NN75.4969.6580.6774.76
AdaBoost67.5864.1563.3363.74
Toxic Content ClassifiersTextFNN84.0184.0781.0482.53
TextCNN73.1071.2367.3969.25
RCNN83.2082.5080.1081.25
BiLSTM87.9687.8885.6786.76
BiLSTM-Att88.1988.3585.7987.05
BiLSTM-CRF88.3088.2086.5087.30
BERT-base88.8186.6988.9987.60
BERT-large88.3781.3692.0686.14
RoBERTa-base89.9787.5690.6188.90
RoBERTa-large89.0185.6690.6787.95
SBERT86.5384.4385.4384.92
Large Language ModelsGPT-4o72.5463.0693.9775.48
GPT-4-Turbo77.2670.6784.4876.96
OpenAI-o185.3585.1285.4885.30
Qwen2-72B70.1761.8687.8272.59
LLaMA3-70B55.1351.454.167.69
ChatGLM3-6B56.5264.327.4913.42
DeepSeek-V383.6483.2782.9283.15
DeepSeek-R184.8584.6385.1284.88
HED-MSP (Ours)93.9493.0993.3693.23
Table 7. Comprehensive comparison of real-time efficiency and computational cost.
Table 7. Comprehensive comparison of real-time efficiency and computational cost.
ModelLatencyThroughputMemoryParamsCost
(ms/Sample)(Samples/s)(GB)(B)(Yuan/1M)
BERT-large5–10150–2508–100.34∼0
RoBERTa-large5–10150–2508–100.25∼0
ChatGLM3-6B50–10040–8015–206.0∼0
LLaMA3-70B1000–20005–1570–8070.0∼0
Qwen2-72B1000–20005–1560–8072.03–5
DeepSeek-V31500–300020–50N/AN/A2–8
DeepSeek-R12000–400020–50N/AN/A4–16
GPT-4o (API)1000–250050–100N/AN/A35–105
GPT-4-Turbo1500–3000∼50N/AN/A70–210
HED-MSP (Ours)2–5300–5004–90.23∼0
Note: “N/A” indicates not applicable, as commercial API models are accessed remotely, making local memory and parameter counts unavailable. Latency and throughput for API-based models are measured under concurrent request settings. Throughput may vary depending on batching and service-side rate limits, and is therefore reported as a range or approximation.
Table 8. Results of the Ablation Study with Baseline References.
Table 8. Results of the Ablation Study with Baseline References.
ModelAccuracy (%)Precision (%)Recall (%)F1 (%)
RoBERTa-base89.9787.5690.6188.90
OpenAI-o185.3585.1285.4885.30
HED-MSP (-SSPM)92.1591.3291.5891.45
HED-MSP (-CSPM)91.7390.8591.1290.98
HED-MSP (-RSPM)91.3590.4790.7490.60
HED-MSP (-CDAF)92.8492.0592.3292.18
HED-MSP (Ours)93.9493.0993.3693.23
Table 9. Results of Generalization Experiments.
Table 9. Results of Generalization Experiments.
Baseline TypeBaseline NameGroup Attacks → General InsultsGeneral Insults → Group Attacks
Acc. (%)Pre. (%)F1 (%)Acc. (%)Pre. (%)F1 (%)
Harmful Content ClassifierTextFNN56.8553.9152.5055.2855.2052.08
TextCNN55.1452.3750.8853.5753.4650.56
RCNN55.5053.3151.5654.3352.7049.49
BiLSTM56.9354.0556.0254.4651.1047.13
BiLSTM-Att55.7653.5753.5953.9750.9248.85
BiLSTM-CRF57.8355.5254.2756.3353.5452.81
BERT-base61.8558.6159.0660.0655.8057.68
BERT-large62.8960.1857.4357.2153.4553.64
RoBERTa-base60.2759.2952.8957.1153.9054.91
RoBERTa-large64.6362.6459.2758.4354.9755.10
SBERT50.7348.3740.7253.7651.0654.75
LLMsGPT-4o84.0576.6286.1372.0065.4477.02
GPT-4-Turbo83.2075.0484.5470.5163.8475.67
Qwen2-72B80.1773.5582.9168.9563.9973.80
LLaMa3-70B47.8441.677.5849.9051.4312.00
ChatGLM3-6B46.5514.291.5751.6263.1615.84
DeepSeek-V368.5065.0066.8062.0056.3060.50
DeepSeek-R179.2072.5081.0069.8064.2072.50
Our ModelHED-MSP79.9675.2478.4366.0563.1665.55
Table 10. Performance comparison on EACL, FigLang, and JointEDI datasets.
Table 10. Performance comparison on EACL, FigLang, and JointEDI datasets.
Baseline TypeModelEACLFigLangJointEDI
Pre.Rec.F1Pre.Rec.F1Pre.Rec.F1
Harmful Content ClassifierTextCNN80.8585.3182.9971.9577.7374.6986.7489.9088.28
BiLSTM80.8683.4282.1265.0464.7564.8683.2385.2684.21
BiLSTM-Att80.3380.4580.2072.5872.8772.7186.4086.5186.45
BiLSTM-CRF81.3082.0581.6473.8971.7872.7485.5487.1786.31
RCNN80.8683.4282.1272.5872.8772.7186.4086.5186.45
BERT-base83.9188.1585.9372.7181.8376.8686.4890.8788.60
BERT-large84.1286.7585.3978.6980.3879.3887.5487.7887.63
RoBERTa-base81.4590.9985.8570.1487.0877.5885.8283.6984.71
RoBERTa-large82.1893.5687.4772.4882.4076.8085.1188.4486.66
LLMsLLaMa3-70B77.4273.9775.6666.8882.2473.7779.9250.7662.09
ChatGLM3-6B71.5650.0058.8767.3472.1369.6690.7968.8478.31
Qwen2-72B83.7579.4581.5568.4395.3579.6879.9558.5767.61
DeepSeek-V384.5091.0087.5077.8584.2080.8986.3090.7588.44
DeepSeek-R185.6591.2588.3579.1285.4082.1389.7089.1589.42
GPT-4o84.0988.7086.3372.6392.0881.2086.8358.3869.82
GPT-4-Turbo83.4075.6879.3573.0587.4379.6092.0043.1458.89
Our ModelHED-MSP85.1690.4187.7177.4783.6180.4289.4888.7989.13
Table 11. Failure cases analysis of HED-MSP.
Table 11. Failure cases analysis of HED-MSP.
Euphemisms (Connotation)CommentsTrue LabelPrediction
Animals (Black people)
动物(黑人)
Case 1. I can only say, Humans and animals cannot mix together.
案例1. 我只能说,人跟动物[猴子表情]就不能混在一起
HarmfulHarmless
Stick (Korean & Korea)
棒子(韩国人及韩国)
Case 2. Seriously, who actually likes those sticks? Can’t you tell your “oppas” to hit the gym a bit more?
案例2. 到底谁喜欢棒子啊,让你家哥哥多练练好吗[恶心表情*3]
HarmfulHarmless
China aluminum (Chinese females)
国铝(中国女性)
Case 3. Sorry, we domestic aluminum, who are short in height and low in education, are simply not good enough for you.
案例3. 不好意思,我们身高矮、学历低的国铝根本配不上您。
HarmlessHarmful
Woman’s Fist (Feminism)
女拳(女权)
Case 4. You cannot just say “woman’s fist” the moment you see a woman. Isn’t it better for everyone to get along peacefully?
案例4. 你们不能看到一个女的就说女拳,大家和平相处不好嘛
HarmlessHarmful
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Xie, S.; Zhou, G.; Wang, H. A Deep Prompt-Based Chain-of-Thought Approach to Harmful Euphemism Detection in Social Networks. Entropy 2026, 28, 560. https://doi.org/10.3390/e28050560

AMA Style

Xie S, Zhou G, Wang H. A Deep Prompt-Based Chain-of-Thought Approach to Harmful Euphemism Detection in Social Networks. Entropy. 2026; 28(5):560. https://doi.org/10.3390/e28050560

Chicago/Turabian Style

Xie, Siyu, Gang Zhou, and Haizhou Wang. 2026. "A Deep Prompt-Based Chain-of-Thought Approach to Harmful Euphemism Detection in Social Networks" Entropy 28, no. 5: 560. https://doi.org/10.3390/e28050560

APA Style

Xie, S., Zhou, G., & Wang, H. (2026). A Deep Prompt-Based Chain-of-Thought Approach to Harmful Euphemism Detection in Social Networks. Entropy, 28(5), 560. https://doi.org/10.3390/e28050560

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop