UCSB-NLP-Chang / SemanticSmooth

Implementation of paper 'Defending Large Language Models against Jailbreak Attacks via Semantic Smoothing'
MIT License
9 stars 2 forks source link

Attack String Length for GCG #2

Closed SinHanYang closed 3 months ago

SinHanYang commented 4 months ago

Hi, thanks for updating this repo. In Appendix A.2 of the paper, you mention that the attack string length for GCG is 20 tokens. I was wondering how to control the attack string length for GCG. Thanks!

Question406 commented 4 months ago

Hi, we did not include the GCG attack code in this repo. To change the attack string length and generate new attack strings, please refer to the original GCG repo: https://github.com/llm-attacks/llm-attacks. Thanks.

SinHanYang commented 4 months ago

Thanks for your reply. I can't find the corresponding hyperparameter or function in the GCG codebase to control the attack string length. I am curious about how you did it. Therefore, I will be sincerely grateful if you could provide some information. Thanks.