Open GianlucaDeStefano opened 2 months ago
AFAIK, the original algorithm is designed to work with a single prompt. You would have to revise the algorithm to make this work. I am working on something like that:
https://github.com/ceferisbarov/nanoGCG/tree/batch
You can check the README for code samples (other parts of README are not updated). The code is not polished yet, but it should work.
this is something we're thinking about adding. the original codebase released with the paper supports multi-prompt optimization -- this is the "universal" element in the title of the GCG paper.
it wouldn't be difficult to add (we simply need to aggregate gradients over all the prompts in our multi-prompt optimization). there's just added complexity when it comes to, for example, storing prefix caches for all the prompts if using prefix caching. not sure if the feature is worth the added complexity in the code.
@justinwangx Yes, I have seen the original repo, but I think it would also be nice to have a "nano" implementation. Maybe we can keep it as a separate branch for now.
+1. The original repo is too messy and it would be awesome to support multi-prompt optimization here.
Hi, from what I gather, nanoGCG does not yet support multi-promp optimizations. Is this feature going to be implemented?