Fostering a collaborative and inclusive environment is crucial for the sustained progress of open source development. However, the prevalence of negative discourse, often manifested as toxic comments, poses significant challenges to developer well-being and productivity. To identify such negativity in project communications, especially within large projects, automated toxicity detection models are necessary. To train these models effectively, we need large software engineering-specific toxicity datasets. However, such datasets are limited in availability and often exhibit imbalance (e.g., only 6 in 1000 GitHub issues are toxic), posing challenges for training effective toxicity detection models. To address this problem, we explore a zero-shot LLM (ChatGPT) that is pre-trained on massive datasets but without being fine-tuned specifically for the task of detecting toxicity in software-related text. Our preliminary evaluation indicates that ChatGPT shows promise in detecting toxicity in GitHub, and warrants further investigation. We experimented with various prompts, including those designed for justifying model outputs, thereby enhancing model interpretability and paving the way for potential integration of ChatGPT-enabled toxicity detection into developer communication channels.
翻译:营造协作与包容的环境对开源开发的持续进步至关重要。然而,负面言论(常表现为毒性评论)的泛滥对开发者的福祉与生产力构成重大挑战。为识别项目交流中的此类负面内容,尤其是在大型项目中,自动化毒性检测模型不可或缺。要有效训练这些模型,我们需要大规模软件工程领域的专用毒性数据集。然而,此类数据集的可用性有限且常存在不平衡问题(例如,每1000个GitHub议题中仅有6个含有毒性),这为训练高效的毒性检测模型带来了挑战。为解决这一问题,我们探索了零样本大语言模型ChatGPT——该模型虽在大型数据集上预训练,但未针对软件相关文本毒性检测任务进行微调。初步评估表明,ChatGPT在检测GitHub毒性方面展现出潜力,值得进一步研究。我们尝试了多种提示词,包括那些旨在解释模型输出的提示,从而提升了模型的可解释性,并为将ChatGPT驱动的毒性检测功能集成至开发者沟通渠道奠定了基础。