Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEAT: Add repeated token attack converter #224

Merged
merged 3 commits into from
Jun 3, 2024

Conversation

jl8771
Copy link
Contributor

@jl8771 jl8771 commented May 28, 2024

Description

Add a converter based on this paper that repeats a specified token a specified number of times in one of four modes:

  1. Prepend repeated tokens to prompt
  2. Append repeated tokens to prompt
  3. Add repeated tokens after first sentence of prompt (after first '.' '!' or '?' character). Remainder of prompt appended after repeated tokens.
    • default option, if no punctuation will prepend repeated tokens to prompt.
  4. Ignore prompt, repeat tokens only

Tests and Documentation

Added tests to test_prompt_converter.py, one for each insert mode, repeats 'test' three times.

@romanlutz romanlutz merged commit 837e585 into Azure:main Jun 3, 2024
5 checks passed
@jl8771 jl8771 deleted the converters/repeat branch July 1, 2024 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants