THU-BPM / Robust_Watermark

Code and data for paper "A Semantic Invariant Robust Watermark for Large Language Models" accepted by ICLR 2024.
https://arxiv.org/abs/2310.06356
22 stars 3 forks source link

Question about _get_bias method in WatermarkContext class #4

Closed ObsisMc closed 4 months ago

ObsisMc commented 4 months ago

Why does it return a -similarity_array rather than similarity_array? https://github.com/THU-BPM/Robust_Watermark/blob/a076d2672a8cc332d6f45f51aa901066af176582/watermark.py#L145-L150

exlaw commented 4 months ago

Thank you for your attention. Here, the reason for '-similarity_array' is because at line 142, we also used '-float(similarity_array[tokens[0][index]])'. Removing the '-' in both places would also work perfectly.

ObsisMc commented 4 months ago

Thanks a lot.