TL;DR
GPTFuzzer is a fuzzer that mutates seed jailbreak templates to hunt for prompts that break an LLM's safety training. The bottleneck is throughput: every candidate template is a full forward pass, and the more candidates you can run, the more vulnerabilities you find. Working from GPTFuzzer's source, our team found that its mutator generates each new template from the same seed, so the seed's input tokens repeat on every mutation. That means the attention keys and values for those tokens can be computed once and reused.
The catch was the scheduler. The original ran one mutation per seed and then cycled back to the first seed, which would require holding every seed's KV cache resident in GPU memory at once to get any reuse, and a KV cache is large per token. We rescheduled it: give each seed a repetition count equal to the query budget divided by the number of seeds, run all of that seed's mutations consecutively, and never return to it. Each seed's K,V is built once, reused across its mutations, then discarded.
On the optimized fuzzer, processing 1008 queries dropped from about 7000 s to about 4900 s (roughly 7.0 s to 4.9 s per query), about 30% faster per query. With the speedup in hand, we swept the mutation temperature over 2464 runs; the expand method at temperature 0.5 and the generate-similar method at temperature 0.2 each produced 11 successful jailbreaks, the most of any configuration. The project won the Grand Prize (최우수상) at Yonsei's CS Graduation Exhibition.
Fuzzing jailbreaks is slow
A safety-tuned LLM refuses harmful requests, but a wrapper prompt can sometimes talk it into complying anyway. GPTFuzzer automates the search for such wrappers: it starts from a pool of human-written seed templates, mutates them with a helper LLM, tests each mutated template against the target model, and keeps the ones that work. The more candidate templates you can afford to test, the more of the target's safety gaps you surface. Speed is not a nicety here; it is the difference between finding a handful of jailbreaks and finding many.
Every candidate costs a forward pass through the mutator and the target, so the wall-clock budget caps how much of the space you can explore. Our capstone goal was narrow and practical: make GPTFuzzer meaningfully faster so that, in the same time, many more jailbreak prompts could be tried against the target and more of its vulnerabilities found. We chose to attack the cost of generation itself rather than the search policy on top of it.
The idea: KV-cache reuse
Reading through the GPTFuzzer source, the pattern that stood out is how the mutator builds a new template. It takes an existing seed template and asks a helper model to rewrite, expand, shorten, rephrase, or cross over from it. The instruction prefix and the seed body are the same tokens on every mutation of that seed; only the tail the model generates differs. In a transformer, the attention keys and values for a prefix depend only on that prefix, so if the prefix does not change, its K,V does not change either.
That is exactly the situation a KV cache is built for. Compute the seed prefix once, keep its keys and values, and every subsequent mutation of that seed reuses them instead of recomputing attention over the whole prefix. The saving grows with prefix length and with the number of mutations you draw from the same seed. The idea is not new to transformers; the contribution was recognizing that GPTFuzzer's mutation loop is a textbook case of a repeated prefix, and that its scheduling was the thing standing in the way of exploiting it.
Every mutation of one seed shares the same prefix tokens. Their attention K,V is identical across those mutations, so it should be computed once and reused, not recomputed per mutation.
Rescheduling so each cache lives once
Reuse only pays off if the cache is still around when the next mutation of the same seed runs. The original scheduler worked against that. It walked the seed pool round-robin: mutate seed 1 once, seed 2 once, and so on to the last seed, then loop back to seed 1. Under that order, seed 1's next mutation only comes around after every other seed has had a turn, so to reuse seed 1's K,V you would have to keep it, and every other seed's, resident in GPU memory the whole time. KV caches are large per token, and holding all of them at once is prohibitive.
The fix is a scheduling change, not a kernel change. Give each seed a fixed repetition count equal to the total query budget divided by the number of seeds, then run all of that seed's mutations back to back before moving on to the next seed, and never come back. Now a seed's prefix K,V is computed on its first mutation, reused across the rest of its consecutive block, and freed the moment the fuzzer advances to the next seed. Only one seed's cache is resident at any moment. The change saves memory, which was what made reuse feasible at all, and it saves time, because the recomputation the round-robin forced is gone.
rep = query_budget // num_seeds # even split of the budget
for seed in seeds: # never revisit a seed
kv = build_prefix_cache(seed) # compute the seed's K,V once
for _ in range(rep):
mutate(seed, reuse=kv) # every mutation reuses it
free(kv) # discard before the next seed Result: 30% faster per query
Measured on a fixed workload of 1008 queries, the scheduling change cut wall-clock time from about 7000 s to about 4900 s. Per query that is roughly 7.0 s down to 4.9 s, about 30% faster. Same fuzzer, same target, same query budget; the only difference is that seeds are processed in consecutive blocks so each KV cache is built once and reused instead of thrashed. Under the original round-robin, holding every cache at once was infeasible, so in practice the prefix was being recomputed; the reschedule is what turned the reuse from a memory impossibility into a real saving.
Sweeping temperature per method
The speedup was a means, not the end: a faster fuzzer buys more experiments in the same budget. Using the optimized version, we swept the sampling temperature for each mutation method over 2464 runs (77 seeds, each mutated 32 times). The question was which method-and-temperature pairing surfaces the most jailbreaks. Two configurations tied for the lead: the expand method at temperature 0.5 and the generate-similar method at temperature 0.2, each producing 11 successful jailbreaks, more than any other pairing in the sweep.
Team, my role, honest scope
This was a team project. It was built by Team AIS, five members, for CSI4101 Software Capstone Design at Yonsei University in 2024, in the Security System Lab under Prof. Song Dokyung (송도경). This page is my own write-up of that shared work, and I want to be clear about which parts were mine rather than claim the whole.
My contributions were the GPTFuzzer source-code analysis that located the repeated-prefix pattern in the mutator, the KV-cache research behind the reuse idea, and the hyperparameter experiments, including the temperature sweep reported above. The scheduling redesign and the measurements were a group effort on top of that analysis. The report itself is a Korean-language capstone document; the figures on this page are rebuilt from scratch rather than lifted from it.
The project received the Grand Prize (Highest Excellence Award, 최우수상) at Yonsei's CS Graduation Exhibition in Spring 2024. It is built on the open-source GPTFuzzer and on vLLM, and the KV-cache reuse rests on the standard behaviour of transformer attention over a fixed prefix.
Limitations
- The 30% figure is one measured workload of 1008 queries on our setup, not a validated benchmark across models or hardware. The absolute seconds depend on prefix length, seed count, and the target.
- The saving scales with how much of the input is a shared prefix and with the number of mutations per seed. Short prefixes or few repetitions per seed shrink the win.
- The temperature sweep counts successful jailbreaks under one target and one success criterion; 11 is a small count, and the ranking of methods could shift with a different target or a larger budget.
- This is offensive-security tooling for finding safety gaps in a controlled academic setting, not a defence, and the numbers are specific to that setting.
Conclusion
The speedup came from reading the fuzzer carefully rather than from a heavier machine. GPTFuzzer mutates from a fixed seed, so the seed's attention keys and values are computed over and over for no reason; the only thing blocking reuse was a round-robin schedule that would have needed every seed's cache resident at once. Running each seed's mutations consecutively lets one cache live, be reused, and be freed, which is why the same 1008 queries finished about 30% faster. A faster fuzzer then paid for a temperature sweep that a slower one could not have afforded, and the whole effort won the Grand Prize at Yonsei's CS Graduation Exhibition. The lesson generalizes past this fuzzer: when the same tokens keep coming back, the schedule that decides when they come back is often the real bottleneck.