Elamur Research

MASTERKEY: Automated Jailbreaking of Large Language Model Chatbots

Paper · 2024 · Gelei Deng, Yi Liu, Yuekang Li et al.

Summary

A chatbot can refuse a request immediately, or it can begin producing an answer that the service later withholds. Both interactions can end with a refusal. From the outside, it can be difficult to tell which part of the service made that decision. MASTERKEY studies this problem for commercial chatbots built on large language models. The authors examine how the services respond to requests that cross their published policy boundaries, what response times can reveal about safeguards, and how the results change when test prompts are generated automatically.

The authors begin with prompts collected from earlier research and an online source. These prompts succeeded on 21.12% of the queries sent to GPT-3.5 in the initial comparison, while the corresponding rates were 0.40% for Bard and 0.63% for Bing Chat. The gap prompted a closer look at how the services handled unsuccessful attempts. In controlled tests, Bard and Bing Chat sometimes returned a decision much earlier than the time normally needed to complete the expected answer. The authors interpret this behavior as evidence that the services could intervene during generation. Other timing observations were consistent with sensitivity to particular words, though several moderation designs could produce similar behavior.

MASTERKEY also evaluates a system that generates new versions of existing test prompts. The authors compare its output with the original prompts and with rewrites from general-purpose systems. MASTERKEY achieved a reported query success rate of 21.58% in the main evaluation, compared with the paper’s headline figure of 7.33% for existing approaches. Its prompt success rate was 26.05%. The metrics count different things. Query success measures how frequently an individual test receives a response that crosses the policy boundary. Prompt success measures how many generated prompts do so at least once. The authors also report query success rates of 14.51% on Bard and 13.63% on Bing Chat, and a 6.45% average in a smaller experiment with translated prompts on Ernie.

The results concern the services as users encountered them. A response counted as a success when the service attempted to answer the prohibited question. The authors left the truth, accuracy, and practical value of such answers outside the evaluation. The timing experiments likewise support inferences about when moderation operated, with the precise implementation remaining private. The authors reported their findings to the providers and withheld the complete training collection.

Deep dive: MASTERKEY: Automated Jailbreaking of Large Language Model Chatbots

MASTERKEY uses chatbot response times and automated testing to study where commercial safeguards intervene and how often they fail. · about 34 minutes to read

The problem and its context

A policy has to be enforced by a service

A commercial chatbot gives users a conversation interface to a text generator. It can also impose rules on what the user asks for and what the service returns. A published policy describes those rules at the level of allowed uses and prohibited content. Enforcement is the separate job of applying the rules to particular interactions. MASTERKEY takes the gap between a stated rule and an observable decision as the starting point for its safety evaluation.

The distinction matters because a chatbot service can make more than one decision before a response reaches the user. The generator can return a refusal on its own. Another component can inspect the incoming request or the generated text. A service can also stop or replace a response. These possibilities make the service, as a whole, the object of the paper’s experiments. A user who receives a refusal observes the outcome of that interaction. Learning which component produced it is a separate problem.

A jailbreak, in the paper’s usage, is an attempt to get a service to answer a request that its safeguards ordinarily prohibit. The attempt takes the form of a specially written prompt. There is a distinction between the underlying question and the surrounding language in which it is presented. A test can therefore keep the policy issue fixed while changing how the request is framed. The scientific question is whether the service’s behavior changes when the request retains its underlying purpose but arrives in a different form.

Judging such a response involves more than noticing that it contains words associated with a sensitive subject. A refusal may name the prohibited subject to explain why it cannot help. Conversely, an answer may cross the boundary even when its claims are false. The paper defines the measured event around the service attempting to answer the prohibited request. This gives the study a criterion that can be applied across services, while placing factual accuracy and downstream consequences outside the reported rates.

The authors also distinguish jailbreaks from prompt injection in their account of prior work. They describe prompt injection as an attempt to redirect the task a system or application was meant to perform. Examples in the related work include efforts to expose information that an application keeps from the user. The jailbreak experiments in MASTERKEY center on the provider’s restrictions on what its chatbot may produce. The distinction identifies the boundary under examination in each kind of study. Ignore Previous Prompt · Indirect Prompt Injection

What earlier prompt research had established

The authors situate jailbreak research within the broader study of prompt engineering. Under ordinary use, prompt wording helps a generator carry out a task without changing its training. Earlier work surveyed by the paper investigated how instructions and examples affect task performance, how recurring prompt patterns can be documented, and how prompts can be improved automatically. These lines of research make wording a variable researchers can study systematically. They also explain why the same policy-relevant question deserves examination under more than one formulation. Prompt Programming · A Prompt Pattern Catalog · Automatic Prompt Optimization

The earlier jailbreak studies discussed by the authors concentrated heavily on ChatGPT. They documented prompt patterns and tested the circumstances in which a chatbot would answer a prohibited question. The authors also describe a privacy study aimed at eliciting personal information through a sequence of interactions. These examples establish the kind of unwanted behavior that motivated MASTERKEY. They leave open how well findings obtained from one service describe the behavior of another. Jailbreaking ChatGPT via Prompt Engineering · Multi-step Jailbreaking Privacy Attacks

The paper emphasizes variation within a named prompt pattern as well. A category such as role-play describes what a family of prompts has in common. It leaves room for substantial differences in what individual prompts say and how a service treats them. An earlier study identified 10 patterns that could be effective, according to MASTERKEY’s account. The authors observed that instances of the same pattern could behave differently. A taxonomy organizes the examples, while experiments establish how particular examples perform. Role-Play with Large Language Models

Related research on toxic generation and unreliable answers gave the authors a wider context for harmful outputs. A system can generate objectionable or misleading content in ordinary use, and its training data can contribute to those tendencies. Targeted jailbreak testing introduces a different condition. It deliberately presents requests for behavior the provider says it restricts and asks whether the service enforces that boundary. Training informed by human preferences is part of the paper’s account of how developers try to improve behavior. A deployed service can also add moderation around its generator. RealToxicityPrompts · Sources of Hallucination

Why compare policies before comparing responses?

A cross-service study needs a reason to consider a response prohibited in the first place. Applying one provider’s rules to every chatbot would make the comparison depend on a policy that some of those providers had never adopted. The authors therefore start by reading the providers’ policies. They look for publicly accessible services with detailed rules and an explicit statement that the service uses a proprietary generator. They compare the policies associated with OpenAI’s services, Bard, Bing Chat, and Ernie.

The classification begins with restrictions identified for OpenAI in earlier work. The authors map provisions from the other providers to existing categories when they fit and add categories for provisions that require them. The resulting classification contains 10 categories. It gives the study a way to discuss policy areas across providers even when their documents use different names or organize restrictions differently.

Four categories provide the common basis for the main comparisons. They concern illegal activity, harmful or abusive content, violations of rights and privacy, and adult content. The policy comparison also preserves areas where providers differ. The resulting structure lets the authors ask about shared boundaries while recognizing that a broad judgment about policy compliance may depend on the service and the category.

The authors examine observed enforcement alongside documented restrictions. They write questions for each category and check whether the services answer those direct requests. This step matters for interpreting the later comparisons. A policy document is evidence of what a provider says it prohibits. A response is evidence about how the service applied that policy to a particular question. Agreement between the two supports a narrow finding about the tested case. Disagreement identifies a case worth examining without settling how the service behaves across the entire category.

Why use timing at all?

The target services are black boxes in the sense relevant to this study. The researchers can submit a request and observe a response, while the internal rules and execution traces remain private. Some refusal messages explain the policy concern in detail. Others supply little information beyond a decision to decline. Even a detailed explanation may give only the service’s account of the reason, with the implementation that reached the decision still hidden.

The paper looks to prior work on web-application security for the idea that a response can reveal something through its timing. The analogy concerns observable delays when a system’s internal behavior is hidden. In a chatbot, generating more text can take longer. If a normal answer would typically require a substantial amount of generation, a service that reaches a decision much sooner may have taken a different internal path. That possibility motivates the paper’s timing comparisons.

The same reasoning explains why calibration is important. A short wait can reflect an early decision, ordinary variation in how a question is answered, or variation in the service itself. There needs to be a sensible reference for how long ordinary generation takes. The authors begin by investigating that reference. They then ask what the observed departures from it can establish about moderation.

The method, step by step

From provider policy to observable outcomes

The study has a measurement branch and a prompt-generation branch. The measurement branch covers policy comparison, tests of previously collected prompts, and experiments on the timing of moderation. The prompt-generation branch asks whether a specialized rewriting system produces test cases that expose failures more often than general-purpose rewriting systems do. The branches come together in the final evaluation, where the authors judge what the service returned under each condition.

How MASTERKEY studies chatbot safeguard behavior

The steps in order.

How MASTERKEY studies chatbot safeguard behaviorStep 1: Compare published provider policies1. Compare published provider policiesStep 2: Establish common prohibited categories2. Establish common prohibited categoriesStep 3: Measure responses to existing test prompts3. Measure responses to existing test promptsStep 4: Calibrate timing with ordinary requests4. Calibrate timing with ordinary requestsStep 5: Compare observable moderation behavior5. Compare observable moderation behaviorStep 6: Evaluate automatically generated test prompts6. Evaluate automatically generated test promptsStep 7: Report outcomes by query and prompt7. Report outcomes by query and prompt

The policy review sets the scope of what is being measured. The authors write five direct questions per category for the policy check. These questions give them a sample of behavior against which to compare the stated restrictions. They then use the shared categories for the broader jailbreak evaluation. A policy category supplies a reason for treating an attempted answer as a violation in the context of the experiment.

For the initial comparison, the authors assemble 85 prompts from previous research and an online collection. Some were originally written for one provider. The authors adapt provider references where appropriate so that an irrelevant product name need not decide whether a prompt can be understood. This makes the comparison more informative about the behavior the prompts were intended to test. The changes also mean that the experiment concerns the assembled prompts under the authors’ adaptation procedure.

The researchers cross the selected questions with the prompt collection and repeat trials. The observation they classify is the service’s response to a single query. Manual review asks whether that response crossed the boundary for the category being tested. Repetition accommodates variation from one attempt to another. It also makes possible a distinction between a prompt that succeeds occasionally and a pattern that produces violations regularly under the sampled conditions.

Timing as evidence about moderation

The timing analysis starts with ordinary requests. The authors take five generative questions from OpenAI’s usage examples, vary the amount of text requested, and measure elapsed time and the number of tokens in the answer. A token is a unit the generator uses to represent text. The paper records both requested length and delivered length because a requested token count is an instruction to the generator. The actual count measures what it produced.

There are two reasons to do this calibration. First, the authors need to see whether changing the requested length produces a corresponding change in actual length. Second, they need to see whether that change is reflected in elapsed time. Only then can timing supply evidence about how much generation might have occurred in tests where the service withholds an answer. The measure recorded at the user interface remains elapsed time. It serves as an indirect indicator of work performed inside the service.

The paper next describes the service as a generator accompanied by a moderator. This abstraction allows the authors to ask several questions separately. One is whether a decision could occur before any answer is written. Another is whether accumulated output can be checked while generation is still underway. A further possibility is that the complete output is inspected when generation finishes. A moderator could also react to individual terms or consider their context. The abstraction identifies plausible places for a check and plausible kinds of evidence that might inform it.

As a reference for ordinary work, the paper considers the combined time of two ordinary responses:

t₁ + t₂

Here t denotes elapsed response time, and the subscripts ₁ and ₂ identify the two ordinary responses. The + sign indicates their combined reference time. The paper uses this as an approximation. Its measurements of ordinary generation show variation, so the baseline serves as a comparison across trials.

The controlled comparisons examine whether elapsed times remain close to the ordinary reference or depart from it in a way consistent with an interruption. If a service seems to spend substantially less time than it would on a completed response, that supports the possibility of intervention while it is still producing text. If a policy-relevant request receives an ordinary-length delay, the timing alone supplies weaker evidence of an immediate pre-generation decision. Each interpretation depends on how the service behaves under the comparison conditions.

The keyword question is more specific than the timing question. A difference in timing can indicate that the decision came before the answer was fully generated. Determining the basis for that decision is harder. A service might use a word-level rule, a classifier that receives the evolving text, or several checks together. The authors examine whether the timing is compatible with a fast response to a particular term. Their interpretation of the results involves both keyword sensitivity and semantic checking. The experiment’s observable quantities are the elapsed times and responses, so the implementation remains an inference.

The paper reports a proof of concept informed by this analysis. Its role in the study is to establish that the services could sometimes return prohibited content even after the initial collection had shown little consistent success on some of them. A successful instance and a timing pattern answer different questions. One establishes that a policy boundary was crossed in an observed interaction. The other gives evidence about how an intervention may have operated in other interactions. The proof of concept leaves the exact organization of the safeguards open.

Generating and assessing new test cases

MASTERKEY frames its generation task as text-style transfer. The intended transformation changes the wording while preserving the original meaning. That matters for the evaluation because the authors want to vary how a request is expressed while keeping the policy issue under test recognizable. If a rewrite changed the underlying request, the target could be responding to a different question altogether.

The original collection is small and heavily oriented toward ChatGPT. The authors broaden it using rewrites generated by ChatGPT and reduce some of the provider-specific wording. The rewritten examples then supply material for specializing Vicuna-13b. The paper describes a stage that exposes the generator to this kind of text and a task-tuning stage that teaches it the relationship between an original prompt and a rewrite. In this context, fine-tuning means continuing training from an existing system on material chosen for a narrower purpose.

A further stage uses observed outcomes to distinguish more effective rewrites from less effective ones. The authors want the generated prompts to be useful test cases across questions and services, so they use a ranking based on observed performance. They relate this part of the method to reward-ranked fine-tuning, an earlier approach that uses reward information to organize examples for training. In MASTERKEY, the rank reflects behavior observed under the authors’ evaluation criterion. Broader performance is favored within that criterion, which concerns receiving a policy-violating answer. RAFT

These stages address distinct parts of the research question. Exposure to examples supplies familiarity with the material. Task tuning connects that material to the requested form of rewriting. The outcome-based stage uses judgments from service interactions to prefer some rewrites over others. The ablation study compares the whole system with versions that omit parts of this specialization. Its results address the contribution of the stages at that level of grouping.

The authors name LMFlow as the software used to train the Vicuna-based system. They identify their project site as the place where materials about the study and its prompt collection are documented. They reserve the original training data containing their manually developed successful prompts. This leaves an important distinction between what readers can learn from the study design and what can be reconstructed from the public artifacts the authors describe.

Measuring success at two levels

The paper’s evaluation uses two rates because prompts and queries are different units. A prompt is a reusable piece of text. A query is one application of a prompt in a trial. The same prompt can be involved in several queries, each of which can receive a different response.

Q = S ÷ T

Q is query success rate. S is the count of queries judged to have crossed the relevant policy boundary. T is the total count of jailbreak queries in the evaluation being described. The equals sign defines the rate, and ÷ indicates division. In the results, the authors report the rate as a percentage. Its interpretation depends on which prompts, questions, services, and trials are included in the denominator.

J = G ÷ P

J is prompt success rate. G is the count of generated prompts that succeeded in at least one query. P is the number of generated prompts considered in that evaluation. The equals sign defines the rate, and ÷ indicates division. Here each generated prompt contributes a single outcome to the numerator, even when it succeeds repeatedly.

The query rate answers how frequently a violation occurred across the transactions included in the test. The prompt rate answers how widely even occasional success was distributed across the generated material. Giving a prompt more chances to encounter a favorable question or service can affect its prospect of appearing in G. The number and kinds of trials therefore matter when comparing prompt rates from different studies. The paper’s figures characterize its chosen opportunities for success.

Experiments and results

What the policy comparison showed

The initial policy comparison covers OpenAI, Bard, Bing Chat, and Ernie. The authors identify 10 categories across the providers and inspect whether direct test questions receive answers in each area. Five questions are written for each category. The paper records both what the provider specifies and what the authors observe in their checks. The table’s enforcement entries summarize outcomes on these questions, with each entry’s scope bounded by the questions chosen for that category.

All the providers prohibit illegal activity, harmful or abusive content, rights and privacy violations, and adult content. Those are the categories used for the main comparative trials. The policy review also finds differences in stated restrictions. For instance, among the services reviewed, Ernie alone explicitly prohibits content harmful to national security and unity in the authors’ classification. This is a result of the policy comparison, so its interpretation concerns the categories and documents the authors studied.

The observed responses also show that a clearly stated restriction can be applied unevenly in the sampled questions. The authors give OpenAI’s policy on political campaigning and lobbying as an example where their checks obtained answers in spite of a stated restriction. The evidence supports a claim about the sampled exchanges. It also explains why the authors examine actual behavior before treating a policy statement as a description of how the service responds.

How the original prompt collection performed

The first jailbreak comparison uses GPT-3.5, GPT-4, Bard, and Bing Chat as targets. Ernie is part of the policy review and is evaluated separately in the later translation experiment. The authors cite the scarcity of relevant Chinese-language prompts and the risk of account suspension after repeated unsuccessful attempts as reasons to leave it out of the initial comparison. They also explain that translation could change nuances important to a prompt’s behavior.

The initial benchmark uses 85 prompts, five questions in each of the four common policy categories, and 10 rounds. The paper reports 68,000 queries in total. The researchers manually review the resulting answers and classify whether each query succeeded under the policy criterion. Because this stage uses collected prompts, its results describe the performance of existing material against the chosen services. It also provides the empirical reason for focusing the timing experiments on Bard and Bing Chat.

Average query success by target service on the original prompt collection

The original collection succeeded far more often on the OpenAI services in this comparison.

Average query success by target service on the original prompt collectionBard: 0.40Bard0.40Bing Chat: 0.63Bing Chat0.63GPT-4: 7.13GPT-47.13GPT-3.5 (this paper): 21.12GPT-3.5 (this paper)21.12
The numbers
System or settingquery success %
Bard0.40
Bing Chat0.63
GPT-47.13
GPT-3.5 (this paper)21.12

The stars in the comparison indicate the highest rate under the test metric. For a service provider applying a policy, the preference would run in the other direction. The chart compares the effectiveness of the same collection against different targets. It is not a chart of how well each system generates new prompts.

GPT-3.5 has the highest average success rate for the collected prompts. GPT-4 is lower at 7.13%, with both Bard and Bing Chat below the OpenAI targets. The authors state that they found no existing prompt that worked consistently against either Bard or Bing Chat. Their table nevertheless contains isolated successes on both. This matters when interpreting the stronger language in the paper’s introduction and evaluation about the novelty of the later successes. The earlier table establishes occasional observed violations. The later results establish substantially higher measured rates under the automated generation setup.

Performance also varies with policy category. The average across services is 9.00% for privacy in the initial comparison, while the average for harmful content is 4.87%. The corresponding averages are 7.93% for adult content and 7.49% for illegal activity. These are averages on the test questions selected for each category. Part of the observed difference could reflect the questions sampled within a category, so the ordering describes this benchmark more directly than the relative difficulty of the categories as a whole.

The authors look at unsuccessful queries as well. In their observations, both GPT-3.5 and GPT-4 often identify what policy is implicated and can elaborate when asked. Bard and Bing Chat provide more generic feedback in the interactions described. This variation affects what a researcher can learn from refusal text. A more detailed refusal gives some account of the reason, while a generic outcome leaves more of the interaction unexplained. Neither kind of message records which internal step made the decisive judgment.

What the timing experiments found

The first timing experiment asks whether response length and elapsed time move together. The authors request answers of 50, 100, 150, and 200 tokens, and record the actual lengths and times. The numbers are group means with standard deviations, so the paper captures both typical behavior and the variability around it. A relationship across group averages can help interpret systematic differences while leaving considerable uncertainty about any individual query.

For GPT-3.5, the 50-token condition produces a mean response length of 52.1 tokens and a mean elapsed time of 5.8 seconds. In the 200-token condition, the corresponding means are 231.6 tokens and 9.4 seconds. The variation in generated length is particularly visible in that latter condition, where the standard deviation is 58.3 tokens. These observations show why the authors measure delivered length in addition to recording the requested length.

GPT-4’s means are 48.6 generated tokens and 7.8 seconds in the 50-token condition, and 198.5 tokens and 24.3 seconds in the 200-token condition. The Pearson coefficient measures the direction and strength of the linear association between response length and time. The paper reports 0.567 for GPT-3.5, with a p-value of 0.009, and 0.838 for GPT-4, with a p-value of <0.001. The positive association gives the timing study a basis for expecting longer generation to take longer on average.

The moderation comparisons focus on Bard and Bing Chat. The paper’s ordinary reference times rise with the requested length. In Bard’s ordinary 50-token condition, mean response time is 3.4 seconds, while the ordinary 200-token condition has a mean of 10.5 seconds. The corresponding values for Bing Chat are 10.1 seconds and 20.2 seconds. The services have different timing profiles, which makes the within-service reference the relevant comparison. Bard’s raw elapsed time and Bing Chat’s raw elapsed time can differ even before a policy-relevant request enters the experiment.

The first moderation comparison is the one the authors use to look for evidence of an immediate input decision. They report an average z-value of -1.46 and an average p-value of 0.34. Under the authors’ reasoning, the overall similarity to the ordinary reference weakens the case for immediate input rejection in the tested conditions. Several individual rows show stronger differences than the overall figures suggest. The table therefore supports a more qualified reading than the categorical statement that the services lacked input filtering.

The comparison meant to distinguish intervention during generation from a check after generation produces the clearest separation. The reported average z-score is 29.48, and the reported average p-value is < 0.01. Every displayed row of that comparison has a p-value of < 0.01. The response times are considerably shorter than the ordinary references in the corresponding service and length conditions. Under the paper’s timing assumption, this is evidence consistent with intervention while the answer is being produced.

The final timing comparison examines the authors’ hypothesis about sensitivity to particular words. The paper reports an average z-score of -2.45 and an average p-value of 0.07. Across individual conditions, some differences are marked < 0.01, while the table also includes a p-value of 0.56. The authors read the overall timing pattern as compatible with word-level checking in a service that can also respond to context. The mixed row-level results leave several implementations plausible.

Timing thus contributes evidence at different strengths for different questions. The measured association between response length and time is a calibration result. The especially short times in the comparison concerning intervention during generation are behavioral evidence about when a decision became visible. The claim about the kind of detector is an interpretation of a less direct pattern. Keeping those levels distinct helps explain why the authors can make a case for early intervention while remaining uncertain about the exact safeguard.

How the generated prompts compared with the baselines

The main evaluation distinguishes the system that generates a test prompt from the service against which it is tested. GPT-3.5 and GPT-4 appear in both roles. When one appears as a generator, its job is to rewrite an existing prompt. When it appears as a target, the authors inspect its response for a policy violation. Vicuna is a generator baseline and provides the starting point for MASTERKEY. Bard and Bing Chat appear as targets in the main comparison.

The baselines include the original prompts and rewrites from GPT-3.5, GPT-4, and Vicuna. The original prompts provide a reference for what can be achieved with collected examples. The general-purpose rewriting systems test whether the same broad task already produces effective new cases without MASTERKEY’s specialization. Vicuna is especially useful as a reference because it relates the specialized version to its underlying generator.

Each generation system receives 85 source prompts and produces 10 variants per source prompt. The rewrites are checked against 20 prohibited questions. The main evaluation reports 272,000 queries. The authors say they perform the evaluations with default settings and repeat experiments five times to reduce random variation. They present rates by target and policy category, which lets readers make comparisons within a fixed test setting.

Query success on Bard privacy questions by prompt source in the main evaluation

MASTERKEY’s generated prompts produced the highest query success rate in this target and category.

Query success on Bard privacy questions by prompt source in the main evaluationOriginal prompts: 0.65Original prompts0.65Vicuna rewrites: 0.44Vicuna rewrites0.44GPT-3.5 rewrites: 1.81GPT-3.5 rewrites1.81GPT-4 rewrites: 2.69GPT-4 rewrites2.69MASTERKEY (this paper): 16.60MASTERKEY (this paper)16.60
The numbers
System or settingquery success %
Original prompts0.65
Vicuna rewrites0.44
GPT-3.5 rewrites1.81
GPT-4 rewrites2.69
MASTERKEY (this paper)16.60

The selected comparison fixes both the target service and the category. It compares what happens when the source of the test prompt changes. The larger value for MASTERKEY in this slice illustrates the pattern in the main results table, where its column has the highest value in each displayed target and category. The strength of that result is its consistency across the categories and targets shown. Its domain remains the questions, prompts, and services included in the study.

GPT-4 is the strongest general-purpose rewriting baseline in the authors’ account. For privacy questions directed to GPT-3.5, GPT-4’s rewrites reach 41.43% query success, and MASTERKEY reaches 49.45%. On harmful-content questions directed to GPT-4, the original prompts obtain 4.39% in the main comparison, GPT-4’s rewrites reach 7.25%, and MASTERKEY reaches 11.61%. The values describe distinct target and category conditions. They help explain why a single average can conceal substantial differences in how often a boundary is crossed.

The two services that had resisted the original collection also show higher query success with MASTERKEY. The authors report average query success rates of 14.51% on Bard and 13.63% on Bing Chat. On harmful-content questions, the MASTERKEY entries are 15.20% for Bard and 11.42% for Bing Chat. On privacy questions directed to Bing Chat, the rate is 18.40%. These category-level figures give some sense of the spread that sits behind each service average.

The headline query success rate is 21.58%, and the headline prompt success rate is 26.05%. The abstract uses 7.33% as its comparison with existing methods. The initial benchmark table separately displays an overall average of 7.32%. The paper presents the figures in different places and supplies no reconciliation of that small reporting discrepancy. Each figure is best read with its own label. The initial table summarizes the earlier comparison of collected prompts, while the abstract states the paper’s headline baseline.

The prompt-level figure gives the aggregate query result a different interpretation. Many individual queries can succeed because a limited portion of the prompt collection performs especially well. A prompt can also contribute to the prompt success rate through a single successful query within many failures. Together, the two rates show frequency across tested interactions and breadth across generated prompts. They leave open how dependable any particular prompt would be when the questions or targets change.

A smaller test in simplified Chinese

Ernie receives a separate cross-language experiment. The authors describe it as a Chinese-oriented service and report a limit of 600 tokens for the setting they used. They translate prompt material and questions into simplified Chinese. The final sample contains 20 prompts from the evaluation material and 20 prohibited questions. The authors keep the experiment small because of rate limits and the risk of account suspension.

The translated test produces an average success rate of 6.45% across the same four policy categories. The observation supports transfer in the sense that material developed for the main experiment still produced policy-violating responses in some translated tests on another service. The experiment changes both language and target, and it uses a smaller selected sample. Those features give it a narrower interpretation than the main comparison. Its result establishes that some transfer occurred under those conditions.

What the ablations show

Specialization and feedback each contributed

The authors compare MASTERKEY with two reduced variants. The version labeled No-Reward omits the reward-ranked stage. The version labeled No-Finetune is presented in the discussion as lacking the fine-tuning process. The evaluation describes each variant as processing 85 source prompts and generating 10 variants per prompt, with the experiment repeated five times. The outcome shown in the paper’s figure is average query success across the chatbots.

The ordering in the figure places the complete MASTERKEY system first. No-Reward is next, and No-Finetune is last. The comparison between the complete system and No-Reward is evidence that the outcome-based stage improved the measured result under the other conditions of the experiment. The comparison with No-Finetune associates the earlier specialization with better performance as well. The figure supports these qualitative conclusions. The paper’s prose does not give numerical values for the plotted bars.

The naming and description of the reduced variants deserve care. An introductory sentence describes the variants together as fine-tuned systems lacking the reward-ranked stage. The discussion of the figure separately identifies No-Finetune as the version without fine-tuning, which agrees with its name. The ordinal findings can be reported with confidence from the discussion. A precise reconstruction of every training operation retained by each variant would require a clearer account of that setup.

Even under the intended interpretation, the ablation works at the level of grouped stages. Exposure to specialized text and instruction tuning are described as parts of the broader specialization procedure. Removing that procedure can show that the package contributed, while the independent contribution of each part remains unresolved. The reward comparison more directly addresses whether performance-based feedback helped after some specialization had already been applied.

The ablation also concerns a particular objective. A better result means the generated prompts caused the target services to answer prohibited requests more frequently under the benchmark. It does not measure whether the prompts were more linguistically diverse, whether they probed more distinct weaknesses, or whether the answers were more substantive. Those are possible properties of a test collection, each requiring its own evaluation.

Rewriting quality and success on the target are separate observations

The generator comparison supplies another analysis of why the complete system performed as it did. The authors describe Vicuna sometimes responding to instructions contained within material it was asked to rewrite. When that happens, the returned text can fail to perform the requested transformation before it even reaches a target service. This is an observation about whether the prompt generator follows the rewriting task.

A generator can also deliver a recognizable rewrite which proves ineffective in the later evaluation. GPT-4’s rewrites generally performed better than the other general-purpose baselines, according to the paper, but remained behind MASTERKEY. The measured difference could involve fidelity to the intended rewrite, properties of the generated wording, or how the target service responds to that wording. The end-to-end success rate incorporates all of these. It does not apportion the score among them.

The authors attribute the weaker performance of GPT-3.5 partly to its smaller parameter size relative to GPT-4. The comparison establishes how these named systems ranked in the benchmark. Parameter count was not varied independently, so the explanation remains the authors’ interpretation. Several system properties can differ at once in a comparison between separately developed generators.

Success was unevenly distributed across prompts

The authors also inspect the performance of individual prompts generated by MASTERKEY. For GPT-3.5 and GPT-4, they report that the most effective prompts account for 38.2% and 42.3% of successful jailbreaks, respectively. Their discussion gives 11.2% for Bard and 12.5% for Bing Chat in describing how the top prompts led to successful queries. The account makes the broad observation that performance depends heavily on which prompt is used. It is less explicit about how the latter percentages are defined relative to the former.

The sound inference is that generated prompts are unequal as test cases. The average query rate summarizes the whole set, and the prompt success rate indicates how many prompts ever succeeded. Neither identifies the distribution of repeat successes among individual prompts. The authors’ additional analysis points to concentration, especially in their interpretation of Bard and Bing Chat, while leaving its exact size hard to compare across all the targets.

They suggest that the services with stronger initial resistance may admit only a narrower set of successful prompts. This would fit the observation that the earlier collection produced few successes and the generated collection had uneven effectiveness. The distribution also depends on the questions and prompts assembled for the experiment. It can indicate where successes are concentrated without independently identifying the mechanism that permitted them.

The strongest timing result answers a narrower question

The timing comparisons provide a related form of controlled evidence. The authors use different conditions to ask about the phase and the basis of moderation. The clearest departure from ordinary response time occurs in the comparison about intervention during generation. The comparisons concerning an immediate input check and sensitivity to particular words have more qualified results. The stronger conclusion is therefore about an observable change in when the service responded.

This is a narrower conclusion than identifying the whole defense. A service can intervene early for several reasons. In particular, evidence of interruption and evidence of a keyword rule involve different inferential steps. The first can follow from a marked change in how long the service takes to respond, given the authors’ controls. The second requires reasoning about what information was available when the decision was made. The timing experiments show how the strength of the evidence changes as the claim moves from behavior to implementation.

Limitations

Limits stated by the authors

The authors acknowledge that the reconstructed safeguard is an approximation. They have access to service behavior and can compare it with predictions about moderation. The providers’ implementations remain private. The paper’s claims about Bard and Bing Chat are therefore about the behavior of those services under the experimental conditions and about designs that could account for it.

The paper gives a concrete reason that an input check could escape the timing inference. A service could identify a problem with the input but still continue to generate before returning a decision. Its elapsed time might then resemble the time expected without an immediate interruption. The inference depends on how the detection result changes work inside the service. Timing can indicate that visible behavior changed, and its ability to locate a check depends on the assumed connection between detection and execution.

The authors also limit what they mean by a successful jailbreak. The response needs to attempt to answer the prohibited question under their evaluation criterion. The truth and correctness of the answer are outside that criterion. A success percentage measures how frequently the tested service appeared to cross a policy boundary. It gives no corresponding percentage for factual answers, usable instructions, or completed real-world actions.

The Ernie experiment is deliberately limited. The authors cite service constraints and the risk of account suspension, and they use a small translated sample. Their initial decision to keep Ernie out of the collected-prompt comparison also reflects uncertainty about how much translation changes a prompt’s effect. The later result provides evidence of some cross-language performance in a particular English-to-simplified-Chinese setting. A broader account of multilingual robustness would require evidence across additional conditions.

There is also a disclosure limit. The authors report their findings to the providers and describe collaborating on testing and potential defenses. They withhold the full training collection and say that their decision is motivated by security and ethical concerns. This constrains independent replication with identical material. The paper supplies comparisons and some training context, while the complete set of examples underlying the trained system remains private.

Limits visible in the study design

The scope of the policy claims follows from the samples used to assess them. The authors write five questions per category for the policy comparison. Such a set can demonstrate that a provider responds in a certain way to specific questions. It leaves many forms of the same policy issue untested. Similarly, the categories common to all providers create a practical basis for comparison while leaving provider-specific restrictions outside the main benchmark.

The assembled prompts also define the population under study. The original collection draws heavily on material directed at ChatGPT. Provider-name adaptations make it easier to try related wording across services, but they leave the inherited assumptions of the collection in place. The relatively weak initial results for Bard and Bing Chat show that the collected prompts traveled poorly to those services under the study design. That observation alone cannot distinguish the influence of stronger moderation from the influence of where the examples came from.

The reported metrics weight their own units. Each submitted trial enters the query-rate denominator, including repetitions of a prompt on the same broad kind of question. Each distinct generated prompt enters the prompt-rate denominator. A different balance of categories, questions, or targets could move either rate. The headline percentages are therefore summaries of the benchmark. They do not express a probability for a randomly chosen request outside it.

The repeated trials improve the description of behavior under the stated settings. The observations still share source prompts and questions, and generated variants can be linguistically related to one another. A large total number of queries gives additional observations of how the tested cases behave. It does not imply a matching number of independent test designs. This is especially important when interpreting a result that may be driven by a small number of productive source prompts or types of question.

Judgment of success depends on manual review. The criterion is intelligible, but boundary cases can arise. A response can contain limited discussion while refusing the main request, or it can appear to comply while giving little meaningful content. The reported results establish what the authors counted under their criterion. The paper’s main presentation leaves open how results would change under stricter judgments of relevance, completeness, or harmful usefulness, and it gives no separate reported estimate of agreement among reviewers.

The timing statistics also require care. Table IV reports values for individual service and length conditions and then gives averages. An average p-value is a summary of the listed values. Its meaning differs from that of a separately specified test that combines all the underlying observations. This distinction matters most where the paper uses its summary to infer the absence of input filtering or to characterize a keyword mechanism. Several rows give different impressions from the averages, particularly in the latter comparison.

Even the clearest timing result admits more than one explanation. A short response is compatible with an early output-layer decision. The public interaction offers limited evidence about how much text the generator produced internally or whether an independent component made the decision. An integrated system that changes its generation behavior under certain conditions could also return sooner. The authors’ abstraction helps reason about these alternatives. Direct observation of the service’s internal execution would be needed to distinguish them decisively.

The comparison of rewriting systems shows higher effectiveness after specialization under the paper’s benchmark. It leaves open how much of that gain would persist on unfamiliar services and questions, or after the providers change their safeguards. The experiments cover a selection of commercial services under their observed configurations. The word “universal,” used in the paper’s account of its objective, is most directly supported here as transfer across several tested services. It is a broader claim if read as reliability for arbitrary services or future deployments.

Finally, the authors’ mitigations are proposals. They discuss stronger training for adherence to policy, more thorough moderation, input sanitization, contextual analysis, and stress testing. Their experiments reveal situations in which a provider’s safeguards can fail and motivate these lines of defense. The reported evaluation does not establish how much any proposed change would reduce violations. It also leaves open how such changes would affect legitimate questions that use similar language.

What came after

The works that cite MASTERKEY range from surveys to focused studies of automated testing, judging responses, and the boundaries that a deployed system has to enforce. The citation record includes works dated 2023 as well as work from later years. Their topics establish connections to the paper’s questions. A citation alone leaves open whether a work adopted MASTERKEY’s data, its timing method, or its training procedure.

Tree of Attacks takes up automatic jailbreak testing when a target is a black box. Its title identifies a tree as the organizing structure for the attack study. It belongs alongside MASTERKEY’s effort to move beyond a fixed collection of prompts and assess generated test cases through observable behavior. The shared question is how automation changes what a researcher can observe from a service whose implementation is hidden.

A StrongREJECT for Empty Jailbreaks places the quality of an apparent success at the center of the evaluation. This connects directly to MASTERKEY’s decision to count an attempt to answer and leave the truth or correctness of the answer outside the criterion. A response can look compliant while supplying little substance. The later work’s focus on empty jailbreaks identifies a reason to examine what a successful-looking answer actually contains.

R-Judge makes safety risk awareness the object of a benchmark for agents. The connection is through measurement. MASTERKEY evaluates the returned responses of a chatbot service under prohibited requests. R-Judge’s stated subject brings the recognition of risk in an agent setting into view. The unit of interest in a safety benchmark can therefore shift from adherence to a content boundary in a response to awareness of risk in a broader task.

WildTeaming at Scale links jailbreaks observed in the wild with work on improving safety. MASTERKEY begins its empirical study with collected examples and uses them as the starting material for further testing. WildTeaming’s stated emphasis on scale and on learning from in-the-wild cases extends that connection between observed attempts and safety research. The titles and citation establish this shared direction, while the specific relationship between their procedures remains open.

Revisiting Jailbreaking from a Representation Engineering Perspective approaches jailbreaks through internal representations. That puts the emphasis on a different kind of evidence from the elapsed times and returned text available in MASTERKEY’s commercial service experiments. Vulnerability of LLMs to Vertically Aligned Text Manipulations takes up the presentation of text as a vulnerability question. Its subject is close to the issue raised by MASTERKEY’s rewriting experiments, where changing the form of a request can change how a safeguard handles it.

PoisonedRAG and LogicPoison investigate another boundary around generated answers. PoisonedRAG concerns knowledge corruption in retrieval-augmented generation, and LogicPoison addresses logical attacks in systems using graph retrieval. Their connection to MASTERKEY is at the level of the deployed system. The security of a generated answer can depend on components that determine what information reaches the generator as well as on components that review what comes out.

LLM-VA names the tradeoff between jailbreak resistance and overrefusal as its problem. This addresses an outcome outside MASTERKEY’s main success rates. Those rates record answers to prohibited requests. Measuring the other side of the tradeoff requires legitimate requests and a way to judge when denying them is unwarranted. The later work’s stated focus makes both kinds of decision part of the safety question.

Adaptive Instruction Composition returns to automated red-teaming through its stated focus on composing instructions adaptively. It shares MASTERKEY’s interest in using generated inputs to examine an evolving service. Two citing surveys place these questions in broader settings. A Survey on Large Language Model Security and Privacy covers security and privacy, while From Attack Surfaces to Actual Operations focuses specifically on modern jailbreaks and their operational setting.

Taken together, the citing topics show how far apart the questions grouped under jailbreak research can be. One asks whether a service returns a policy-violating answer. Another asks whether an apparent answer has substance. Others ask about internal representations, the information supplied through retrieval, or the cost of refusing benign requests. MASTERKEY supplies evidence for the service-level question through policy comparisons, response timing, and measured outcomes on generated prompts. Those observations give later work a point of comparison even when it studies a different part of the system.

Cite

Cite as Gelei Deng, Yi Liu, Yuekang Li, Kailong Wang, Ying Zhang, Zefeng Li, Haoyu Wang, Tianwei Zhang and Yang Liu. 2024. MASTERKEY: Automated Jailbreaking of Large Language Model Chatbots. Network and Distributed System Security Symposium.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.14722/ndss.2024.24188

@inproceedings{deng2024masterkey,
  title = {{MASTERKEY: Automated Jailbreaking of Large Language Model Chatbots}},
  author = {Gelei Deng, Yi Liu, Yuekang Li, Kailong Wang, Ying Zhang, Zefeng Li, Haoyu Wang, Tianwei Zhang and Yang Liu},
  booktitle = {Network and Distributed System Security Symposium},
  year = {2024},
  doi = {10.14722/ndss.2024.24188},
  url = {https://doi.org/10.14722/ndss.2024.24188}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/deng-2024-masterkey-automated-jailbreaking-large-language/