Saved in:
Bibliographic Details
Main Authors: Lee, Taehyun, Hong, Seokhee, Ahn, Jaewoo, Hong, Ilgee, Lee, Hwaran, Yun, Sangdoo, Shin, Jamin, Kim, Gunhee
Format: Preprint
Published: 2023
Subjects:
Online Access:https://arxiv.org/abs/2305.15060
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866911941367169024
author Lee, Taehyun
Hong, Seokhee
Ahn, Jaewoo
Hong, Ilgee
Lee, Hwaran
Yun, Sangdoo
Shin, Jamin
Kim, Gunhee
author_facet Lee, Taehyun
Hong, Seokhee
Ahn, Jaewoo
Hong, Ilgee
Lee, Hwaran
Yun, Sangdoo
Shin, Jamin
Kim, Gunhee
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2305_15060
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle Who Wrote this Code? Watermarking for Code Generation
Lee, Taehyun
Hong, Seokhee
Ahn, Jaewoo
Hong, Ilgee
Lee, Hwaran
Yun, Sangdoo
Shin, Jamin
Kim, Gunhee
Computation and Language
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.
title Who Wrote this Code? Watermarking for Code Generation
topic Computation and Language
url https://arxiv.org/abs/2305.15060