Closed liwii closed 3 months ago
@yosukehigashi
Ping on this!!
Wait did I miss this?! I don't remember seeing this before 😨
Ah wait I forgot to assign you as a reviewer... Sorry for the confusion!!
Haha ok phew 😮💨
For the jailbreak template augmentation, we introduced the additonal
seed
parameter, but seemingly for all the other augmentations the seed is given from outside implicitly by callingrandom.seed(seed)
. I used this style to add the seed to these new augmentations. Should we change thejailbreak_template
or all the other augmentations for consistency?
I personally prefer it when the seed
is an additional parameter, since it makes it clear that fixing the seed is a valid thing to do. It's also unclear sometimes how a seed should be set when it's from the outside, since it could be random, numpy, or torch's random number generator.
That said, I think we should allow the user to set the seed outside if they want to. So we should also update the code here to be
if seed is not None:
random.seed(seed)
Your suggestion for seed
looks good to me, added the parameter in that way.
Ready for review again!!
Added seed parameters to all the augmentations that use random
. Let me merge the change now!!
Implemented more augmentations that could be useful for adversarial testing.
langcheck.augment.en.to_full_width
: Convert ascii characters into full-width characters defined in UTF-8langcheck.augment.ja.conv_kana
: Convert hiragana to different types of characters (katakana, romaji alphabet)langcheck.augment.{ja,en}.payload_splitting
: Payload splitting augmentation introduced by https://arxiv.org/pdf/2302.05733.Discussion
For the jailbreak template augmentation, we introduced the additonal
seed
parameter, but seemingly for all the other augmentations the seed is given from outside implicitly by callingrandom.seed(seed)
. I used this style to add the seed to these new augmentations. Should we change thejailbreak_template
or all the other augmentations for consistency?