๐ค AI Summary
This work proposes a novel approach to safeguard content quality in the Stack Overflow community by detecting unreliable AI-generated answers. The method integrates a Siamese neural network architecture with the BigBird model, leveraging triplet loss to learn discriminative representations from triplets composed of human-written answers, reference answers, and ChatGPT-generated responses. To the best of our knowledge, this is the first study to combine Siamese networks with BigBird for detecting large language modelโgenerated text in technical Q&A platforms. Evaluated on real-world Stack Overflow data, the proposed approach significantly outperforms existing baselines such as GPTZero and DetectGPT, demonstrating its effectiveness in assisting platform moderators to efficiently identify and remove AI-generated content.
๐ Abstract
Stack Overflow is a popular Q&A platform where users ask technical questions and receive answers from a community of experts. Recently, there has been a significant increase in the number of answers generated by ChatGPT, which can lead to incorrect and unreliable information being posted on the site. While Stack Overflow has banned such AI-generated content, detecting whether a post is ChatGPT-generated remains a challenging task. We introduce a novel approach, SOGPTSpotter, that employs Siamese Neural Networks, leveraging the BigBird model and the Triplet loss, to detect ChatGPT-generated answers on Stack Overflow. We use triplets of human answers, reference answers, and ChatGPT answers. Our empirical evaluation reveals that our approach outperforms well-established baselines like GPTZero, DetectGPT, GLTR, BERT, RoBERTa, and GPT-2 in identifying ChatGPT-synthesized Stack Overflow responses. We also conducted an ablation study to show the effectiveness of our model. Additional experiments were conducted to assess various factors, including the impact of text length, the model's robustness against adversarial attacks, and its generalization capabilities across different domains and large language models. We also conducted a real-world case study on Stack Overflow. Using our tool's recommendations, Stack Overflow moderators were able to identify and take down ChatGPT-suspected generated answers, demonstrating the practical applicability and effectiveness of our approach.