Since the remarkable generation performance of large language models raised ethical and legal concerns, approaches to detect machine-generated text by embedding watermarks are being developed. However, we discover that the existing works fail to function appropriately in code generation tasks due to the task's nature of having low entropy. Extending a logit-modifying watermark method, we propose Selective WatErmarking via Entropy Thresholding (SWEET), which enhances detection ability and mitigates code quality degeneration by removing low-entropy segments at generating and detecting watermarks. Our experiments show that SWEET significantly improves code quality preservation while outperforming all baselines, including post-hoc detection methods, in detecting machine-generated code text. Our code is available in https://github.com/hongcheki/sweet-watermark.
Who Wrote the Book? Detecting and Attributing LLM Ghostwriters
School of Computing and Information Systems, The University of Melbourne, Australia(墨尔本大学计算与信息学院);School of Computing, FSE, Macquarie University, Australia(麦考瑞大学计算学院)
Who Wrote This? Identifying Machine vs Human-Generated Text in Hausa
Kalinga University(卡林加大学);Bayero University(巴耶罗大学);Arewa Data Science Academy(阿雷瓦数据科学学院);DSFSI, University of Pretoria(比勒陀利亚大学 DSFSI);Northeastern University(东北大学);Imperial College London(伦敦帝国学院)
Who Wrote This Line? Evaluating the Detection of LLM-Generated Classical Chinese Poetry
College of Computer Science, Inner Mongolia University, China(内蒙古大学计算机学院,中国);National & Local Joint Engineering Research Center of Intelligent Information Processing Technology for Mongolian, China(蒙古语智能信息处理技术国家与地方联合工程研究中心,中国);NLP²CT Lab, Department of Computer and Information Science, University of Macau, China(澳门大学计算机与信息科学学院NLP²CT实验室,中国)
Who Stole Your Data? A Method for Detecting Unauthorized RAG Theft
National Engineering Research Center for Software Engineering, Peking University(软件工程国家工程研究中心,北京大学);City University of Hong Kong(香港城市大学);Fudan University(复旦大学)