Reinforcement Learning–Guided Adaptive Tuning for Out-of-Distribution Harmful Text Detection
Paper · 2026 · Mengyu Xiang, Tinghao Chen, Boxu Han et al.
Summary
Harmful content online shifts in vocabulary and meaning from one platform to another and over time. Detectors trained once with frozen parameters therefore degrade on out-of-distribution (OOD) inputs. Test-time tuning can help, but updating the model on every incoming batch tends to overfit to local samples. The authors propose RLAT, which they describe as the first use of test-time tuning for harmful text detection. Its core is a joint objective that combines two parts:
- a consistency loss over dropout-perturbed representations;
- a word-level attention constraint that pushes high-attention clauses away from the whole-sentence embedding, so the model leans less on individual trigger words.
An actor-critic reinforcement learning controller manages this tuning. It decides which test data to tune on and when to reset parameters, using semantic, emotional and confidence signals, and it is rewarded by gains in accuracy and F1. The authors build cross-platform and cross-temporal OOD scenarios from public Chinese social media datasets. RLAT beats state-of-the-art baselines, including LLMs, which makes it relevant for detecting harmful language as it evolves.
Key points
- RLAT improves on baselines by up to 8.94% in cross-platform settings and 5.66% in cross-temporal settings.
- The cross-platform transfers cover Bilibili, Weibo, Zhihu and Tieba. Comparisons include LLMs such as GLM-4.6 and Qwen3-Max.
- Ablations on Bilibili→Weibo:
- Removing the RL decision model costs 2.06% accuracy and 1.60% F1.
- Removing the parameter-reset action costs 2.15% accuracy and 1.13% F1.
- A reset threshold of 0.6 works best on Zhihu→Bilibili, reaching 77.61% accuracy and 79.61% F1. The RL-driven reset policy outperforms both "No reset" and "Continuous reset".
- The main limitation is that only binary classification is covered. Multi-class and multimodal shifts are left for future work.
Institutions
Fields, topics and concepts
📚 Shelves 4The field of science this work belongs to (OpenAlex fields).Computer Science · 18,614 worksArtificial Intelligence · 17,965 worksSocial Sciences · 1,954 worksSociology and Political Science · 626 works
🧭 Topics 1Research subjects and languages the work is about.Bias, fairness & safety · 587 works
Cite
Cite as Mengyu Xiang, Tinghao Chen, Boxu Han, Qiudan Li, Shu Wu and Daniel Dajun Zeng. 2026. Reinforcement Learning–Guided Adaptive Tuning for Out-of-Distribution Harmful Text Detection. Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers).
@inproceedings{xiang2026reinforcement,
title = {{Reinforcement Learning–Guided Adaptive Tuning for Out-of-Distribution Harmful Text Detection}},
author = {Mengyu Xiang, Tinghao Chen, Boxu Han, Qiudan Li, Shu Wu and Daniel Dajun Zeng},
booktitle = {Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)},
year = {2026},
doi = {10.18653/v1/2026.acl-long.1623},
url = {https://doi.org/10.18653/v1/2026.acl-long.1623}
}References
- Hyeseon Ahn, Youngwook Kim, Jungin Kim, and Yo-Sub Han. 2024. Sharedcon: Implicit hate speech detection using shared semantics. In Findings of the Association for Computational Linguistics, ACL 2024, Bangkok, Thailand and virtual meeting, August 11-16, 2024, pages 10444–10455. find
- Shai Ben-David, John Blitzer, Koby Crammer, and Fernando Pereira. 2006. Analysis of representations for domain adaptation. In Advances in Neural Information Processing Systems 19, Proceedings of the Twentieth Annual Conference on Neural Information Processing Systems, Vancouver, British Columbia, Ca… find
- Tommaso Caselli, Valerio Basile, Jelena Mitrović, and Michael Granitzer. 2021. HateBERT: Retraining BERT for abusive language detection in English. In Proceedings of the 5th Workshop on Online Abuse and Harms (WOAH 2021), pages 17–25, Online.
- Ying Chen, Yilu Zhou, Sencun Zhu, and Heng Xu. 2012. Detecting offensive language in social media to protect adolescent online safety. In 2012 International Conference on Privacy, Security, Risk and Trust, PASSAT 2012, and 2012 International Confernece on Social Computing, SocialCom 2012, Amsterdam,… find
- DeepSeek-AI, Aixin Liu, Aoxue Mei, Bangcai Lin, Bing Xue, Bingxuan Wang, Bingzheng Xu, Bochao Wu, Bowei Zhang, Chaofan Lin, Chen Dong, Chengda Lu, Chenggang Zhao, Chengqi Deng, Chenhao Xu, Chong Ruan, Damai Dai, Daya Guo, Dejian Yang, and 245 others. 2025. Deepseek-v3.2: Pushing the frontier of open…
- Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. 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: Human Language Technologies,…
- Paula Fortuna and Sérgio Nunes. 2018. A survey on automatic detection of hate speech in text. ACM Comput. Surv., 51(4):85:1–85:30. find
- Njagi Dennis Gitari, Zuping Zhang, Zuping Zhang, Hanyurwimfura Damien, and Jun Long. 2015. A lexicon-based approach for hate speech detection. In International Conference on Multimedia and Ubiquitous Engineering. find
- Yimeng Gu, Mengqi Zhang, Ignacio Castro, Shu Wu, and Gareth Tyson. 2025. Contrastive domain adaptation with test-time training for out-of-context news detection. Pattern Recognit., 164:111530. find
- Aiqi Jiang, Xiaohan Yang, Yang Liu, and Arkaitz Zubiaga. 2022. SWSR: A chinese dataset and lexicon for online sexism detection. Online Soc. Networks Media, 27:100182. find
- Tianming Jiang. 2025. Learn from failure: Causality-guided contrastive learning for generalizable implicit hate speech detection. In Proceedings of the 31st International Conference on Computational Linguistics, COLING 2025, Abu Dhabi, UAE, January 19-24, 2025, pages 8858–8867. find
- Md Tawkat Islam Khondaker, Muhammad Abdul-mageed, and Laks Lakshmanan, V.s. 2023. Cross-platform and cross-domain abusive language detection with supervised contrastive learning. In The 7th Workshop on Online Abuse and Harms (WOAH), pages 96–112. find
- Youngwook Kim, Shinwoo Park, and Yo-Sub Han. 2022. Generalizable implicit hate speech detection using contrastive learning. In Proceedings of the 29th International Conference on Computational Linguistics, pages 6667–6679, Gyeongju, Republic of Korea. find
- Jian Liang, Ran He, and Tieniu Tan. 2025. A comprehensive survey on test-time adaptation under distribution shifts. Int. J. Comput. Vis., 133(1):31–64. find
- Yunsheng Liang and Kai Chen. 2025. Automatic test-time adaptation for heterogeneous contexts in meta-learning. Neural Comput. Appl., 37(18):12631– 12652. find
- Qiang Liu, Xinlong Chen, Yue Ding, Bowen Song, Weiqiang Wang, Shu Wu, and Liang Wang. 2025. Attention-guided self-reflection for zero-shot hallucination detection in large language models. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, pages 21016– 21032. find
- Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. 2019. Roberta: A robustly optimized BERT pretraining approach. CoRR, abs/1907.11692.
- Junyu Lu, Bo Xu, Xiaokun Zhang, Changrong Min, Liang Yang, and Hongfei Lin. 2023. Facilitating fine-grained detection of chinese toxic language: Hierarchical taxonomy, resources, and benchmarks. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Lon… find
- Junyu Lu, Bo Xu, Xiaokun Zhang, Hongbo Wang, Haohao Zhu, Dongyu Zhang, Liang Yang, and Hongfei Lin. 2024. Towards comprehensive detection of chinese harmful memes. In Advances in Neural Information Processing Systems 38: Annual Conference on Neural Information Processing Systems 2024, NeurIPS 2024,… find
- Meta. 2024. The llama 3 herd of models. CoRR, abs/2407.21783.
- Ziqi Qiu, Jianxing Yu, Yufeng Zhang, Hanjiang Lai, Yanghui Rao, Qinliang Su, and Jian Yin. 2025. Detecting emotional incongruity of sarcasm by commonsense reasoning. In Proceedings of the 31st International Conference on Computational Linguistics, COLING 2025, Abu Dhabi, UAE, January 19-24, 2025, pa… find
- Diptanu Sarkar, Marcos Zampieri, Tharindu Ranasinghe, and Alexander G. Ororbia II. 2021. fbert: A neural transformer for identifying offensive content. In Findings of the Association for Computational Linguistics: EMNLP 2021, Virtual Event / Punta Cana, Dominican Republic, 16-20 November, 2021, page… find
- John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. 2017. Proximal policy optimization algorithms. CoRR, abs/1707.06347. find
- Paras Sheth, Tharindu Kumarage, Raha Moraffah, Aman Chadha, and Huan Liu. 2023. PEACE: cross-platform hate speech detection - A causality-guided framework. In Machine Learning and Knowledge Discovery in Databases: Research Track - European Conference, ECML PKDD 2023, Turin, Italy, September 18-22, 2… find
- Paras Sheth, Raha Moraffah, Tharindu S. Kumarage, Aman Chadha, and Huan Liu. Causality guided disentanglement for cross-platform hate speech detection. In Proceedings of the 17th ACM International Conference on Web Search and Data Mining, WSDM 2024, Merida, Mexico, March 4-8, 2024, pages 626– 635. find
- Rohit Sridhar and Diyi Yang. 2022. Explaining toxic text via knowledge enhanced text generation. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 811–826, Seattle, United States. Association for C… find
- Yibo Zhao, Jiapeng Zhu, Can Xu, Yao Liu, and Xiang Li. 2025. Enhancing llm-based hatred and toxicity detection with meta-toxic knowledge graph. In Findings of the Association for Computational Linguistics, ACL 2025, Vienna, Austria, July 27 - August 1, 2025, pages 24747–24760. find
- Gang Zhou, Haizhou Wang, Di Jin, Wenxian Wang, Shuyu Jiang, Rui Tang, and Xingshu Chen. 2025. A toxic euphemism detection framework for online social network based on semantic contrastive learning and dual channel knowledge augmentation. Inf. Process. Manag., 62(5):104143. find
- Jingyan Zhou, Jiawen Deng, Fei Mi, Yitong Li, Yasheng Wang, Minlie Huang, Xin Jiang, Qun Liu, and Helen Meng. 2022. Towards identifying social bias in dialog systems: Framework, dataset, and benchmark. In Findings of the Association for Computational Linguistics: EMNLP 2022, Abu Dhabi, United Arab E… find
- Mengyu Xiang, Yuxuan Song, Qiudan Li, Shu Wu, and Daniel Dajun Zeng. 2025. Dynamic detection of sarcasm topic-target pairs via llm-based knowledge alignment. In Companion Proceedings of the ACM on Web Conference 2025, WWW 2025, Sydney, NSW, Australia, 28 April 2025 - 2 May 2025, pages 1422– 1425. find
- Qi Yang, Jingjie Zeng, Liang Yang, Kai Ma, and Hongfei Lin. 2025. Sarcasm-r1: Enhancing sarcasm detection through focused reasoning. Findings of the Association for Computational Linguistics: EMNLP 2025. find
- Ben Yao, Yazhou Zhang, Qiuchi Li, and Jing Qin. 2025. Is sarcasm detection a step-by-step reasoning process in large language models? In AAAI-25, Sponsored by the Association for the Advancement of Artificial Intelligence, February 25 - March 4, 2025, Philadelphia, PA, USA, pages 25651–25659.
- Jingjie Zeng, Liang Yang, Zekun Wang, Yuanyuan Sun, and Hongfei Lin. 2025. Sheep’s skin, wolf’s deeds: Are llms ready for metaphorical implicit hate speech? In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), ACL 2025, Vienna, Austria,… find
- Zhehao Zhang, Jiaao Chen, and Diyi Yang. 2023. Mitigating biases in hate speech detection from A causal find
Updated
This page in Markdown → https://md.research.elamur.ai/free/en/papers/xiang-2026-reinforcement-learning-guided-adaptive-tuning/