Skip to content

The research proposes the RolePlay framework: using persona conditions to amplify LLM inference costFrom Role Prompt to Infinite Thinking: Exploiting Persona Conditioning for Inference Cost Attacks in LLMs

Paper Tracker· arXiv:2607.25936· Zhiyi Mou, Wangze Ni, Tianfang Xiao, Haoyang LI, Chen Jason Zhang, Hanzhi Ma, Yang Bai, Zhibo Wang, Kui Ren·Indexed by this site · 2026-10-08· Originally publishedAttacks

Quick read

Attacks

Based on the paper PDF (AI-generated); refer to the original

RolePlay uses personas to amplify LLM single-inference overhead, reaching 7.64× on Gemini-3.5-Flash (Table 1).

Threat modelStrictly black-box. The attacker can only modify inputs through the standard interface or public API, and cannot access architecture, weights, gradients, or training data. The goal is to simultaneously lengthen hidden reasoning and visible output within a single interaction, while avoiding high-perplexity strings and explicit lengthening instructions, to bypass rule-based filtering.

Questions
Autoregressive generation allows a single prompt to raise the LLM's single-inference overhead. The authors state that existing suffixes and explicit lengthening instructions are unnatural, do not adapt to the task, and often only lengthen one side of reasoning or output.
Methods
RolePlay extracts domain, subclass, contradiction, bias, knowledge level, and emotion under black-box conditions, then generates a task persona and places it before the original question, using persona consistency to simultaneously lengthen hidden reasoning and visible output.
Experiments and results
On five models, 210 samples, Gemini-3.5-Flash generation multiplier 7.64× (Table 1); DeepSeek maximum 207.64× (Table 3). On GPT-5 Nano, RolePlay is 2.54×, lower than ExtendAttack's 2.73×.
Limitations and future work
The paper does not specifically discuss limitations. The experiments cover 5 models and 7 benchmarks with 210 samples total; the analyzer and persona builder are unnamed, and the number of repetitions and the rule filter interception rate are not reported.
Experimental setupDeepSeek-V4-Pro、Gemini-3.5-Flash et al. · Math-500 Competition、GSM8K et al. · Generate Times、generated tokens et al.
Evaluated models
DeepSeek-V4-ProGemini-3.5-FlashQwen-3.5-PlusGPT-5 NanoLlama-3-8B-Instruct
Benchmarks
Math-500 CompetitionGSM8KSVAMPAIME 2025BigCodeBenchHumanEvalAlpaca
Metrics
Generate Timesgenerated tokensreasoning tokensoutput tokensInput PPLOutput EntropySurprisal Density
AI summaryThe researchers propose RolePlay, a task-aware dynamic persona alignment framework that constructs adaptive personas to naturally induce inefficient but semantically coherent generation behavior, thereby amplifying LLM inference cost. The paper points out that LLM role consistency makes the model maintain the established persona and reproduce corresponding behavior even when it leads to inefficient reasoning and over-generation, constituting a previously unnoticed attack surface. Experiments across multiple LLMs and multiple task datasets show that RolePlay achieves an average token amplification of up to 7.64× and a maximum amplification ratio of 207.64×, consistently outperforming existing reasoning-lengthening methods; unlike methods relying on adversarial suffixes or explicit lengthening instructions, this approach does not introduce clearly detectable behavior.

The researchers propose RolePlay, a task-aware dynamic persona alignment framework that constructs adaptive personas to naturally induce inefficient but semantically coherent generation behavior, thereby amplifying LLM inference cost. The paper points out that LLM role consistency makes the model maintain the established persona and reproduce corresponding behavior even when it leads to inefficient reasoning and over-generation, constituting a previously unnoticed attack surface. Experiments across multiple LLMs and multiple task datasets show that RolePlay achieves an average token amplification of up to 7.64× and a maximum amplification ratio of 207.64×, consistently outperforming existing reasoning-lengthening methods; unlike methods relying on adversarial suffixes or explicit lengthening instructions, this approach does not introduce clearly detectable behavior.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    The authors aim to use persona consistency under black-box conditions to amplify the reasoning and output cost of a single request.

    How to simultaneously lengthen hidden reasoning and visible output according to the task, without changing task semantics and while keeping interaction natural, to amplify the computational cost of a single LLM request.

    • Scenario: The authors state that LLMs are already used in intelligent assistants, code generation, and automated decision-making, and that inference cost and service reliability become issues after deployment. Traditional DoS exhausts resources through request volume and can be mitigated by rate limiting; Inference Cost Attack uses crafted prompts to amplify a single request.
    • Existing shortcomings: The authors categorize them into adversarial suffixes (Engorgio, LoopLLM) and explicit reasoning extension (OverThinking, ExtendAttack). The authors state three shortcomings: unnatural surface forms that are easily caught by rule-based filters; mostly using fixed triggers without considering task semantics; and extending only hidden reasoning or visible output, while total cost is determined by both.
    • Observation: The authors state that instruction fine-tuning and RLHF make persona consistency viable; after specifying a role, the model maintains that role's behavior even if reasoning is inefficient. Figure 1: normal 12 tokens, 3 seconds; with "Act as a novice student" it becomes 141.87 seconds (47.3× latency), with 1589 tokens marked in the figure.
    • Method: Propose RolePlay, which constructs personas according to the task, using soft induction to produce behaviors like repeated verification and supplementary explanations, simultaneously expanding internal reasoning and final output.
    • Threat model:
      • Goal: Maximize reasoning resource consumption within a single interaction, while expanding both hidden reasoning and visible output; prompts must avoid abnormal generation, high-perplexity strings, and explicit malicious extension instructions to pass rule-based filters and maintain natural interaction.
      • Knowledge: The authors state strict black-box, with no access to architecture, weights, gradients, or training data.
      • Capability: Only able to modify the input query, interacting through standard user interfaces or public APIs.
      • Victim system: The queried LLM service; the paper uses DeepSeek-V4-Pro as an example to illustrate the interaction method. Success is measured by tokens and latency of a single request, not by the number of requests.
  2. What related research exists?

    The authors position this paper between inference overhead attacks and persona playing, and state that the two have not been connected before.

    The authors divide related work into two lines: inference cost attacks and persona consistency, and state that using personas for resource exhaustion was previously largely unexplored.

    Inference Cost Attacks

    • Suffix extension: Engorgio (Dong et al. 2025) searches for adversarial suffixes to suppress EOS; LoopLLM (Li et al. 2026) uses suffix optimization to induce low-entropy repetitive generation. The authors state that these often produce meaningless tokens, high-perplexity strings, or repetitive generation, which can be detected by perplexity-based detectors (Alon and Kamfonas 2023; Jain et al. 2023).
    • Inference extension: BadThink (Liu et al. 2026) uses specific triggers to activate redundant reasoning; OverThinking (Kumar et al. 2026) and ExtendAttack (Zhu et al. 2026) use explicit instructions or additional constraints to encourage overly long reasoning. The authors state that these rely on predefined triggers or fixed strategies, limiting stealth and cross-task adaptability, and often extend only one stage of reasoning or output.
    • Traditional DoS: The introduction describes it as exhausting resources through a large number of requests; the authors use it as a comparison to single-request inference cost attacks (Li et al. 2025 is cited only as a reference for this concept).

    Persona Consistency and Role-Playing

    • Instruction fine-tuning: Zhang et al. (2026) is cited to illustrate that instruction fine-tuning and RLHF make persona adoption a capability of LLMs. The paper only makes this description.
    • Persona maintenance: Licato and Steinle (2025) is used by the authors to support that LLMs may maintain persona-consistent behavior even when the persona leads to suboptimal decisions or logical inconsistencies.
    • Role jailbreaks: Zeng et al. (2024) and Liu et al. (2024, AutoDAN) use role instructions to bypass safety alignment. The authors state that the resource exhaustion direction was previously largely unexplored, and claim that this paper establishes the first connection between dynamic persona alignment and LLM resource exhaustion vulnerabilities.

    Baselines and Benchmarks

    • Baseline methods: DA (following ExtendAttack's Direct Attack, adding "Provide step-by-step instructions" before the original question), OverThinking, HGA (Wang et al. 2026, heuristic-guided optimization), ExtendAttack. The comparison also includes Original.
    • Benchmarks: Math-500 Competition, GSM8K, SVAMP, AIME 2025, BigCodeBench, HumanEval, Alpaca. Each with 30 random samples, totaling 210.

    The authors position their work as using task-adaptive persona soft induction to extend both reasoning and output, without relying on fixed triggers or directly requesting longer thinking.

  3. How does the paper address this problem?

    RolePlay first extracts six-dimensional task metadata, then generates a persona and prepends it to the original question.

    RolePlay performs one analysis, one persona generation, and one target-model query per query, without the iterative suffix optimization. The three stages correspond to the three challenges listed by the authors: naturalness, task adaptivity, and simultaneously lengthening reasoning and output.

    Task Metadata

    The cognitive analyzer A reads qi under instruction πana and outputs a six-dimensional profile parsed from JSON:

    mi={di,si,ci,bi,ei,τi}

    namely domain, subclass, core contradiction, cognitive bias trap, knowledge requirement, and emotional tone.

    • Task Context: di follows MMLU's high-level domains (e.g., STEM, humanities); si follows MMLU's subject hierarchy. The authors state this is to make the persona fit the task rather than use a generic template.
    • Reasoning Obstacles: ci identifies the main reasoning obstacle, used to guide repeated consideration; bi is used to induce repeated verification and alternative exploration. The authors cite cognitive dissonance, conceptual change, confirmation bias, and heuristics as the basis for these two dimensions.
    • Persona Cognitive States: ei controls expertise and reasoning style; τi controls persistence and reasoning tendency. Examples visible in Figure 2 include Novice, Intermediat, Advanced, as well as Anxious, Bewildered, Stubborn, Paralyzed.

    If qi is empty, it is skipped. The paper does not state which model A is. Further explanation of the six dimensions is in Appendix C.

    Persona Generation

    The persona builder B generates the task persona:

    pi=B(πper,mi)

    Two mechanisms:

    1. Generation rules: the persona should match the extracted domain, expertise, and emotion; focus on the core contradiction and cognitive bias; encourage inefficient behavior, including repeated verification, self-correction, and deferring conclusions.
    2. one-shot: a mapping from cognitive profile to a concrete character is given, so that B imitates that generation pattern rather than outputting a generic character description. Figure 2 shows an illustration; the example text is not repeated here.

    The paper does not state which model B is, nor does it report sampling settings.

    Prompt Assembly

    The persona is placed before the original task, serving as a behavioral constraint on the entire autoregressive trajectory rather than acting only on one stage. In the main text, the concatenation marker in equation (3) is [TASK/PROBLEM]:; Algorithm 1 writes [TASK / PROBLEM TO EXPLORE]. The paper does not explain the difference between the two notations.

    • Reasoning stage: the authors state that the persona brings repeated verification, self-reflection, and alternative exploration, thereby increasing reasoning tokens.
    • Output stage: the same constraint encourages more detailed explanation, self-justification, and longer answers, thereby increasing visible output tokens.
    • Difference from explicit lengthening: the authors state that no fixed trigger phrases are used, and longer thinking is not directly requested.

    Recording and Judgment

    For the same sample, T(qi) and T(q̃i) are taken separately, extracting reasoning tokens Ri, output tokens Oi, and generated tokens Gi=Ri+Oi. The amplification factor is relative to the original generation. No LLM judge is used. Naturalness is additionally measured with Input PPL, Output Entropy, and Surprisal Density, defined in the experiments section.

  4. What experiments did the paper conduct?

    In Table 1, Gemini-3.5-Flash is 7.64×, GPT-5 Nano is 2.54×.

    In Table 1, RolePlay's Generate Times is 7.64× on Gemini-3.5-Flash and 2.54× on GPT-5 Nano, the latter lower than ExtendAttack in the same table.

    Experimental setup

    • Models: DeepSeek-V4-Pro, Gemini-3.5-Flash, Qwen-3.5-Plus, GPT-5 Nano via API; Llama-3-8B-Instruct deployed locally on four NVIDIA A6000 GPUs. Unless otherwise stated, default inference configurations are used.
    • Data: 30 random samples from each of the seven benchmarks above, 210 total. Math is Math-500, GSM8K, SVAMP, AIME 2025; code is BigCodeBench, HumanEval; general instruction is Alpaca.
    • Baselines: Original, DA, OverThinking, HGA, ExtendAttack.
    • Metrics: input, reasoning, output, generated tokens; Generate Times is the generated token multiplier relative to Original. Behavior metrics are Input PPL, Output Entropy, Surprisal Density. The authors state that lower PPL is more natural, and higher values of the latter two indicate more diverse and structurally complex generation.
    • Judgment: no LLM judge; token counting is used. The paper does not report the number of repetitions, nor the models for analyzer A and builder B. Table 1 does not separately state whether all 210 samples are aggregated.
    • Latency: the authors state that some APIs do not provide reasoning time, client timing is affected by network latency and server-side scheduling, and the main comparison in the text uses tokens; available latency is in Appendix D.

    Main results

    Swipe horizontally to read the table

    ModelOriginal generated tokensRolePlay generated tokensRolePlay multiplier
    Qwen-3.5-Plus4016.5122269.67×5.54
    GPT-5 Nano3339.708477.96×2.54
    Gemini-3.5-Flash1935.5914784.64×7.64
    DeepSeek-V4-Pro4445.0922510.30×5.06
    Llama-3-8B-Instruct699.402230.30×3.19

    Per Table 1. Llama's reasoning column is /, and generated tokens equal output tokens.

    • The authors state that generated tokens are higher than Original for all five models. Among baselines in the same table, on Gemini, HGA is ×4.69, ExtendAttack ×3.59, OverThinking ×2.19; on DeepSeek, ExtendAttack is ×4.26, HGA ×4.04.
    • Exception: on GPT-5 Nano, ExtendAttack is ×2.73, higher than RolePlay. The authors state that RolePlay ranks second among baselines on that model.
    • Llama has no reasoning tokens. The authors state that the multiplier is affected by maximum output length, and that RolePlay's persona prompt is shorter, leaving more generation budget. In the same table, HGA is ×2.86, ExtendAttack ×1.87, DA ×0.84, OverThinking ×0.76; the latter two are lower than Original.

    Relative to Original, on the four models with reasoning tokens, RolePlay's reasoning tokens and output tokens are both higher. Reasoning tokens are not always the highest among methods: on DeepSeek, ExtendAttack is 19082.15, OverThinking 13991.65, RolePlay 11979.08. On Qwen, RolePlay's output tokens are 16847.78 and reasoning tokens 5421.89, the latter lower than ExtendAttack's 8122.23.

    Maximum multiplier and cross-dataset results

    • Table 3 (DeepSeek): RolePlay's Max Times is reasoning 172.781 (119 to 20561), output 143.74 (349 to 50166), generation 207.64 (106 to 22010). In the same table, the maximum generated token multipliers are: OverThinking 140.992, ExtendAttack 139.330, DA 3.160. HGA is not listed in this table. The text writes the maximum reasoning multiplier as 172.78×.
    • Table 2: generated token multipliers for the seven datasets are GSM8K 17.34, HumanEval 15.26, Alpaca 11.45, SVAMP 8.17, BigCodeBench 6.91, Math-500 3.55, AIME2025 2.67. The authors state that tasks with shorter original generation have larger multipliers; AIME2025 still increases from 14044.67 to 37546.30. The paper does not state which model this table uses.
    • Figure 3: the authors state that the distribution overall shifts toward longer generation, and give average amplification multipliers for SVAMP, GSM8K, and HumanEval of 55.48×, 33.42×, and 24.92×. These numbers differ from the Times in Table 2, and the paper does not explain the difference. After text conversion, the positions of individual points are not visible.

    Naturalness, latency, and ablation

    • Table 4 (Llama-3): RolePlay's Input PPL is 9.60, Original's 10.59, OverThinking's 9.79, ExtendAttack's 13.02. RolePlay's Output Entropy is 0.4752 and Surprisal Density 0.5554, the highest in the table; ExtendAttack's are 0.0724 and 0.0901, the lowest in the table. The authors state that the prompt remains natural and the generation is not a simple repetition loop.
    • Appendix D Table 6: DeepSeek-V4-Pro query time goes from 75.74s to 441.87s (5.84×), generated tokens from 4445.09 to 21866.23 (4.92×). Gemini-3.5-Flash time 4.19×, tokens 7.64×. Llama-3-8B-Instruct time 3.15×, tokens 3.19×. Qwen-3.5-Plus time from 135.90s to 491.11s (3.61×), tokens from 5894.49 to 21490.63 (3.64×). GPT-5-Nano tokens from 7107.34 to 8477.96 (1.19×), query time from 94.00s down to 87.03s (0.93×). The authors state that API client latency may be affected by server-side scheduling and streaming responses.
    • Table 5: Original Prompt generated tokens 575 (multiplier 1), Static Persona 2466 (4.29×), Dynamic Persona 7580 (13.18×); reasoning tokens are 120, 245, 445, and output 455, 2221, 7135. The authors state that dynamic personas induce stronger persona-consistent behavior than fixed personas. The paper does not state the model or dataset. In the table, the dynamic row is written as Dynamic Person.

    Other ablations and analyses

    • Table 1: on Qwen, OverThinking output tokens 349.00, lower than Original's 373.76; its Generate Times is ×1.05.
    • Table 1: on GPT-5 Nano, RolePlay output tokens 1384.62, lower than HGA's 1800.20; on DeepSeek, RolePlay output 10531.22, lower than HGA's 11839.78.
    • Some tokens in Table 6 differ from Table 1: DeepSeek's Dynamic is 21866.23, while Table 1's RolePlay is 22510.30; GPT-5-Nano's Direct 7107.34 is the same as Table 1's DA, not Original's 3339.70. The paper does not explain this.
    • Figure 1 does not state the model: normal 12 tokens, 3 seconds; after persona instruction 141.87 seconds (47.3× latency), with 1589 tokens marked in the figure.
    • Appendix E does not state the model. Hidden reasoning is annotated as 20561 tokens, matching the Attack column for RolePlay reasoning tokens in Table 3; the visible response is annotated as 8980 tokens. The authors state that the model obtains the quantitative relationship early, then repeatedly explains the same ambiguity and verifies it. The appendix gives a complete example.
  5. What are some points that can be further explored?

    The paper does not specifically discuss limitations or future directions.

    Limitations and future directions noted by the authors

    The paper does not specifically discuss limitations. The Conclusion only restates the persona consistency attack surface and RolePlay's results, without listing shortcomings or future work.

    Experimental coverage

    • The tested models are DeepSeek-V4-Pro, Gemini-3.5-Flash, Qwen-3.5-Plus, GPT-5 Nano, and Llama-3-8B-Instruct, 5 in total (Section 4.1). Commercial models are accessed via API; Llama-3-8B-Instruct runs locally on four NVIDIA A6000 GPUs.
    • The data are Math-500, GSM8K, SVAMP, AIME 2025, BigCodeBench, HumanEval, and Alpaca, 30 samples each, 210 total. Baselines are Original, DA, OverThinking, HGA, and ExtendAttack.
    • The maximum multiplier is in Table 3, on DeepSeek, without HGA listed. Cross-dataset numbers are in Table 2 and Figure 3; the paper does not state which model is used.
    • Stealth metrics are reported on Llama-3 as Input PPL, Output Entropy, and Surprisal Density (Table 4). The threat model mentions bypassing rule filters, but the paper does not report interception rates on rule filters.
    • The ablation is Original Prompt, Static Persona, and Dynamic Persona (Table 5); the paper does not state the model or dataset. The paper does not report the models for analyzer A and builder B, nor the number of repetitions. Latency is in Appendix D Table 6, covering the above 5 models; the authors state in the experimental setup that API client timing is affected by network latency and server-side scheduling.
  6. Summarize the main content of the paper

    RolePlay uses a persona to simultaneously lengthen reasoning and output, reaching 7.64× on Gemini-3.5-Flash.

    RolePlay is a black-box inference overhead attack: it only changes the user input, using a persona to make the model write a single response longer on its own.

    The problem to address is that suffix optimization and explicit think-more instructions tend to expose abnormal wording or fixed triggers, and often only affect the chain of thought or only the final response. RolePlay first extracts the domain, subcategory, core contradiction, cognitive bias, knowledge requirement, and emotional tone from the task, then adds a one-shot example-generated persona according to rules, placing it before the original question. The paper does not specify the models used for the analyzer and builder. Each sample is processed only once, with no iterative optimization.

    In Table 1, relative to Original, the generated token multipliers are: Gemini-3.5-Flash 7.64× (1935.59 and 14784.64), Qwen-3.5-Plus 5.54×, DeepSeek-V4-Pro 5.06×, Llama-3-8B-Instruct 3.19×, GPT-5 Nano 2.54×. The last one is lower than ExtendAttack's 2.73× in the same table. Table 3 gives RolePlay's maximum generated token multiplier of 207.64 on DeepSeek. Table 4, on Llama-3, shows RolePlay's Input PPL as 9.60 and Original's as 10.59.

    The authors conclude that persona consistency can expand both reasoning and output without explicit lengthening instructions, and becomes an attack surface for inference efficiency.

Related papers

Show 3 more papers
Read originalarxiv.org