You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Feature] Add a command to save all transformed query attacks #348
A command to save all transformed query attacks with their details such as the model output confidence is needed for people who work on attack detection systems especially for the black-box attacks in which they need a sequence of all queries that an attacker makes to fool the model. I'm working on algorithms to detect the attacks and I need sequences of attack queries, so a command for it could be useful.
Hey @threemmm -- thanks for the suggestion! To be specific: you're suggesting a feature in which we save intermediate transformed texts and their scores to a file, not just the last transformation, right?
Hey @jxmorris12 , thank you for your awesome package.
Yes, exactly. I did it by adding "--save-sequences-csv" command, and I tried to follow your structure to save them (adding a new class to logger, and save into a file by flush() at the end of the process). However, it doesn't work well with all search methods, as I return the result of "get_goal_results()" in addition to the final perturbed result in search methods to quickly meet my need.
I tested with textbugger recipe and albert-base-v2-sst2 , and the output was as the photo below --recipe textbugger --model albert-base-v2-sst2 --save-sequences-csv --num-examples 3
This is still a reasonable ask (and @threemmm's prototype comment shows it's mostly a new logger class), but a proper implementation needs to work across all search methods consistently, which @threemmm noted their prototype didn't fully solve. That's real design/engineering work rather than a bounded fix, so leaving this open rather than guessing at an implementation. Anyone interested in picking this up: the natural shape is a new logger (similar to the existing CSV/JSON loggers) that hooks into each search method's intermediate `get_goal_results()` calls rather than just the final result.
Activity
jxmorris12 commentedon Nov 19, 2020
Hey @threemmm -- thanks for the suggestion! To be specific: you're suggesting a feature in which we save intermediate transformed texts and their scores to a file, not just the last transformation, right?
QData#348 Add --save-sequences-csv command to save all intermediate t…
threemmm commentedon Nov 19, 2020
Hey @jxmorris12 , thank you for your awesome package.
Yes, exactly. I did it by adding "--save-sequences-csv" command, and I tried to follow your structure to save them (adding a new class to logger, and save into a file by flush() at the end of the process). However, it doesn't work well with all search methods, as I return the result of "get_goal_results()" in addition to the final perturbed result in search methods to quickly meet my need.
I tested with textbugger recipe and albert-base-v2-sst2 , and the output was as the photo below
--recipe textbugger --model albert-base-v2-sst2 --save-sequences-csv --num-examples 3I'd like to hear your thoughts.
github-actions commentedon Jan 19, 2021
Stale issue message
qiyanjun commentedon Jan 22, 2021
Good enhancement to add.. Will update.
qiyanjun commentedon Aug 13, 2026
This is still a reasonable ask (and @threemmm's prototype comment shows it's mostly a new logger class), but a proper implementation needs to work across all search methods consistently, which @threemmm noted their prototype didn't fully solve. That's real design/engineering work rather than a bounded fix, so leaving this open rather than guessing at an implementation. Anyone interested in picking this up: the natural shape is a new logger (similar to the existing CSV/JSON loggers) that hooks into each search method's intermediate `get_goal_results()` calls rather than just the final result.