In recent years, with the fast growth of the internet and the continuous expansion of technological applications such as social media, the health and safety of the online environment has become a matter that requires serious attention. In the Chinese context, due to the complexity and diversity of syntactic expression, the detection of toxic language in Chinese faces unique challenges. This study focuses on the performance of traditional machine learning, deep learning, encoder-based transformation models, and decoder-based transformation models (LLMs) in the identification of toxic comments in Chinese, and compares the performance characteristics of different models. The study combines two main datasets, COLD and TOCAB, into a binary classification task, using accuracy, F1-score, precision, and recall as evaluation metrics to assess all the tested models. The final results show that among the tested models, the decoder-based Qwen1.5-7B (8-bit quantization) has the highest accuracy (94.71%), the traditional machine learning models and encoder-based transformation models perform moderately, while the deep learning models have lower accuracy (77%–80%) due to the limited context understanding, indicating that decoder-based large language models have advantages in the detection of toxic comments in Chinese.