Skip to content

Non-Halting Queries: using LLM fixed points to make models never haltNon-Halting Queries: Exploiting Fixed Points in LLMs

arXiv· arXiv:2410.06287· SaTML 2025· Ghaith Hammouri, Kemal Derya, Berk SunarVernam Lab; Worcester Polytechnic InstituteIndexed by this site · 25 days ago· Originally publishedSelected AttacksSelectedAttention40

Quick read

Attacks

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

The authors propose a non-halting attack exploiting fixed points in autoregressive models: a single prompt makes an LLM never stop outputting, with a success rate of 19%–97% in the 100-random-word experiment.

Threat modelThe target system has no software vulnerabilities; the attacker has no physical access, but can inject (or partially modify) prompts into the victim LLM. A single crafted query can put the LLM into a non-halting state, with no need for a sustained attack. Victim systems include LLM-powered applications and RAG systems.

Questions
The authors propose non-halting queries: by exploiting fixed points in autoregressive models, an LLM never samples <eos> while never stopping output. A single query can cause DoS, which the authors say can keep backend services running and incurring costs.
Methods
First, a formal proof: at temperature 0, once the loop output exceeds the context window w plus the loop length c, it never stops. Then a Recipe is given: find a loop in the base model, use a prompt structure of "compose a meaningless answer from words randomly selected from the Context" to bypass alignment; and use ARCA to invert three-token prompts.
Experiments and results
100-random-word experiment: ChatGPT-4o and Llama-3.1-8B-it have a 97% success rate, Gemini Pro 1.5 has 19% (Table I). ARCA inverts 10,000 three-token prompts, 15% trigger non-halting. In the RAG experiment, about 0.1% of random questions trigger it naturally.
Limitations and future work
The authors say the prompt structure is fragile, and changing a space or wording may make it fail; the paper has no dedicated Limitations section. The experiments report no statistical tests or repetition counts; the RAG experiment covers only 20 systems and 200 questions; the defenses discuss only directions for countermeasures, with no adaptive attack evaluation.
Experimental setupMeta-Llama-3-8B、Meta-Llama-3-8B-Instruct et al. · Enron Email Corpus(RAG 实验知识库)、100 个随机选取的词/token · non-halting query 成功率(Non-Halting %)、所需循环重复次数(# Repetitions)
Evaluated models
Meta-Llama-3-8BMeta-Llama-3-8B-InstructChatGPT-4o (gpt-4o-2024-05-13)gpt4-0613gemma-2-9b-itGemini 1.5 ProGemini 1.5 Pro Exp 0827Claude-3.5-SonnetClaude-3-opusClaude-3-sonnetClaude-3-haikuMeta-Llama-3.1-8B-InstructLlama 3.2Microsoft Phi3-3B-In
Benchmarks
Enron Email Corpus(RAG 实验知识库)100 个随机选取的词/token
Metrics
non-halting query 成功率(Non-Halting %)所需循环重复次数(# Repetitions)
AI summaryand selection rationaleResearchers at Worcester Polytechnic Institute propose a new attack, Non-Halting Queries, that exploits fixed points of autoregressive models to construct queries that make large language models never sample <eos> and output an infinite loop; a single query can cause an LLM backend to fall into denial of service. The paper proves that at temperature zero, if a looping token sequence still appears in the output after it exceeds the context window, the model will not halt; based on this, the authors design a prompt recipe that induces aligned models to generate this loop on their own under the instruction to “randomly pick words from the context to form a meaningless answer,” bypassing alignment. Tests on 100 random words show that the recipe achieves a success rate of 97% on ChatGPT-4o and Llama-3.1-8B-it, and 19% on Gemini Pro 1.5; in ARCA inversion experiments, 1,512 (15%) of 10,000 three-token prompts for Llama-3.1-8B-Instruct constitute non-halting queries.

Researchers at Worcester Polytechnic Institute propose a new attack, Non-Halting Queries, that exploits fixed points of autoregressive models to construct queries that make large language models never sample <eos> and output an infinite loop; a single query can cause an LLM backend to fall into denial of service. The paper proves that at temperature zero, if a looping token sequence still appears in the output after it exceeds the context window, the model will not halt; based on this, the authors design a prompt recipe that induces aligned models to generate this loop on their own under the instruction to “randomly pick words from the context to form a meaningless answer,” bypassing alignment. Tests on 100 random words show that the recipe achieves a success rate of 97% on ChatGPT-4o and Llama-3.1-8B-it, and 19% on Gemini Pro 1.5; in ARCA inversion experiments, 1,512 (15%) of 10,000 three-token prompts for Llama-3.1-8B-Instruct constitute non-halting queries.

Why it was selectedThe paper proves that at temperature zero, a looping sequence in the output that extends beyond the context window means the model will not halt; teams deploying LLM services can draw on its mitigation ideas of hard limits in the sampler and loop detection.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    The authors propose non-halting queries: exploiting LLM fixed points to make the model never stop outputting, constituting a single-query DoS.

    Core problem: fixed points exist in autoregressive LLMs and can be used to construct queries that never stop outputting (never sample <eos>), which the authors call non-halting queries.

    • Problem scenario and importance: the authors state that such anomalies can let a malicious party insert a query that makes the backend service run indefinitely, incurring costs and potentially disrupting the service network; in RAG scenarios, random or meaningless questions naturally trigger the anomaly, causing the LLM server to hang and the frontend to report timeouts or length errors.
    • Difference from existing DoS: the authors state that traditional DoS requires sustained investment to overwhelm the victim, whereas non-halting requires only one crafted query; and the prompt does not directly ask the model to output an infinitely repeating sequence (aligned models have been hardened to refuse such requests).
    • Core observation: the authors found in a RAG system that the model falls into looped output for random meaningless queries; the analysis holds that the loop is the model's intrinsic fixed-point behavior, and alignment can only prevent the model from "entering" such prompts, not change the underlying behavior.
    • Paper contributions: formally analyze the conditions under which non-halting occurs (a decision theorem at temperature 0); give a simple Recipe for aligned models; validate on multiple mainstream models; directly search for non-halting prompts using ARCA inversion; discuss the RAG scenario and potential countermeasures.
    • Threat model (Section II):
      • Goal: make the victim LLM enter a non-halting state and stop responding.
      • Knowledge: the paper does not require internal knowledge of the model; the Recipe's cycle identification stage uses an unaligned base model, and the authors claim the loop can transfer to different aligned models.
      • Capability: no physical access; can inject (or partially modify) prompts into the victim LLM.
      • Victim system: LLM-driven applications (such as customer service chat) and RAG systems; assumes the target system has no software vulnerabilities.
  2. What related research exists?

    Related work falls into three groups: degenerate text, gradient attacks, and DoS; the authors say this paper's single-query DoS exploiting fixed points differs from them.

    Degenerate Text

    • Holtzman et al [15] — observed that likelihood-maximization sampling leads to degeneration (repetitive loops, etc.), and proposed nucleus sampling (top-p) to truncate the unreliable tail.
    • [16]–[18] — study the relationship between information loss and degenerate text and propose controlled generation techniques; [19] is a survey.
    • Ivgi et al [20] — classify the fallback behavior (sequence repetition, degenerate text, hallucination) of models in the same family; the authors state that they revealed the pattern that as models become more advanced, fallback shifts from repetition to hallucination.

    Gradient attack techniques

    • Ebrahimi et al [21] (HotFlip) — gradient optimization to manipulate discrete text; Jones et al [22] propose ARCA, jointly optimizing input and output for model auditing; Section VI of this paper directly uses ARCA for inversion.
    • Zou et al [2] — a jailbreak attack that automatically generates adversarial suffixes using greedy plus gradient search; the paper notes that their adversarial prompts transfer well to closed-source models, and the loop transfer in this paper's Recipe draws on this observation.

    DoS and prompt injection

    • Shumailov et al [13] — sponge examples, designing inputs that maximize inference energy consumption and latency; OWASP lists Model Denial of Service as one of the top ten LLM risks (LLM04) [12].
    • Prompt injection and jailbreak directions: [1], [6] extract application prompts, [7], [8] extract training data, [3]–[5] bypass safety filters; [8], [10] advocate adversarial alignment.

    Baselines and benchmarks: this paper has no comparison baseline methods; the experiments use 100 randomly selected words/tokens and the Enron Email Corpus (RAG knowledge base), all of which are experimental materials built by the authors.

    Positioning: the authors state that the non-halting anomaly differs from traditional DoS — it requires no sustained investment, a single query suffices; and it differs from degenerate-text research in that this paper gives formal conditions and turns it into a transferable attack Recipe.

  3. How does the paper address this problem?

    First prove that at temperature 0, a loop exceeding w+c never stops, then present two attack paths: the Recipe for bypassing alignment and ARCA inversion.

    Overall idea: attribute non-halting to fixed points of autoregressive models, formally give the decision condition, then use a prompt structure to "transfer" the loops observed in base models to aligned models.

    Formalization and core theorem

    • Language model M : T* → D, sampler S samples token by token until <eos>; the w-context model Mw takes only the most recent w tokens as input (Definitions 1, 2, 4).
    • (b, c, ℓ) cyclic-anomaly: the output enters a loop of length c after the b-th token (Definition 3); non-halting cyclic-anomaly means the loop continues indefinitely (Definition 5).
    • Theorem 1 (Non-Halting LLM): q is a non-halting cyclic anomaly of Mw at temperature 0 if and only if q is a (b, c, ℓ) cyclic-anomaly, where ℓ = b + c + w. Meaning: at temperature 0, as long as the loop output continues to the context window plus the loop length, it necessarily never stops.
    • Corollaries 1 and 2 give the form for constructing (0, c) non-halting inputs from a loop; Fact 2 notes that when k̂ = 1 or p̂ = 0, sampling is likewise deterministic and the theorem still holds.

    Effect of temperature and sampling parameters

    • At temperature 0 the output is deterministic; as τ → ∞ the distribution tends to uniform, and the probability of observing a non-halting loop tends to zero.
    • Authors' analysis: top-k only shrinks the support set and has little effect; in top-p, if some token's probability exceeds p̂ then sampling is equivalent to deterministic, so when p̂ < 1, a loop token probability exceeding p̂ suffices to maintain non-halting.
    • Typical defaults τ ∈ [0.7, 1], p̂ ∈ [0.8, 1]; the authors argue that once a loop starts it self-reinforces (already-sampled tokens raise the probability of the next token).

    Recipe 1 (for aligned models)

    • Cycle Identification: pick unrelated tokens and concatenate them into a Cycle → repeat into a Cycle-Pattern → test on an unaligned model → if non-halting is observed, it is a Valid Cycle.
    • Query Generation: the Context Prompt is composed of repetitions of the Valid Cycle; the Instruction Prompt asks the model to randomly pick words from the Context to form a "meaningless answer".
    • Authors' rationale: training data is limited while token combinations are exponential, so the model has no prior to follow for unseen meaningless inputs, because in-context learning favors continuing patterns in the input; alignment only teaches the model to avoid such inputs and does not change the underlying fixed-point behavior. The authors claim the loop can transfer to different aligned models.

    ARCA inversion

    • Use ARCA [22]'s pure inversion capability (removing the audit constraint), set the target output to two repeated tokens (the minimum length for detecting a loop), and search for three-token inputs on Meta-Llama-3.1-8B-Instruct.
    • Procedure: randomly select 100 tokens (vocabulary of 128,000) → construct 100 two-token outputs each → invert 100 three-token inputs for each output, 10,000 in total.
    • By Theorem 1, the output only needs to fill the context window plus the loop length to be judged non-halting, turning the infinite-output problem into finite inversion.

    RAG experiment design

    • The knowledge base is the Enron Email Corpus; 10 users are taken, each user's emails with others form a vector store, for 10 RAG systems in total; each system is paired with two LLMs (Meta Llama3-8B-Instruct, Microsoft Phi3-3B-In), for 20 RAG systems in total.
    • Queries consist of meaningless questions made of randomly drawn words, an instruction requiring answers chosen from the Context (limited to within 100 tokens), and the 5 nearest vector text chunks automatically retrieved by RAG, concatenated; temperature 0, 200 meaningless questions in total.
  4. What experiments did the paper conduct?

    Recipe validated on 14 models; 100-random-word success rate 19%–97%; ARCA inversion triggers 15%; 0.1% occurs naturally in RAG.

    Experimental Setup

    • Models tested: the main text says 14 models in total, including gpt-4o (gpt-4o-2024-05-13), gpt4-0613, Meta-Llama-3-8B, Meta-Llama-3-8B-Instruct, llama3.1-8b(-instruct), gemma-2-9b-it, Gemini 1.5 Pro, Gemini 1.5 Pro Exp 0827, Claude-3.5-sonnet, Claude-3-opus, Claude-3-sonnet, Claude-3-haiku, Llama 3.2, Microsoft Phi3-3B-In (RAG).
    • Access methods: Gemma/Llama via HuggingFace Transformers, OpenAI via API, Gemini via Google AI Studio, Claude via Anthropic Console.
    • Materials: single-token loop (Adam) scanning temperature 0–1 (step 0.1); 100 random words, repetition cap 1000, temperature 0; ARCA inverting 10,000 three-token inputs; RAG using the Enron Email Corpus and 200 meaningless questions.
    • Determination: gpt-4o's API output is truncated by the 4096-token limit, and the authors determine it by finish_reason being "length" (<eos> not sampled); the paper reports no statistical significance tests or repetition counts.

    Main Results

    Recipe results with 100 random words, temperature 0, repetition cap 1000 (Table I):

    ModelNon-Halting %Average repetitions
    Gemini Pro 1.519685.2
    Claude-3.5-Sonnet4493.9
    Gemma-2-9B-it9130.3
    ChatGPT-4o975.8
    Llama-3.1-8B-it975.2
    • The authors say Recipe can turn any word into a potential non-halting query, and the same prompt facilitates cross-model comparison of robustness; the authors thereby speculate that alignment against non-halting may be difficult.
    • The authors say Gemini-1.5 Pro is harder to attack than other models in terms of time and computation.

    Temperature Scan (Figure 9)

    • With a single token (Adam), all tested models enter non-halting at temperature 0; most models can still exhibit it at higher temperatures, but the required number of repetitions increases with temperature.
    • Exceptions: Gemini 1.5 Pro Exp 0827 never triggers for Adam at any temperature (it occurs for MGUSA@ at temperature 0 with more than 500 repetitions); Gemini 1.5 Pro only up to 0.2; Claude-3-opus and Claude-3-sonnet no longer trigger after 0.6; Claude-3-haiku triggers across the full temperature range, with at most 36 repetitions, which the authors call the most attackable in the Claude family; Gemma2-9b does not trigger at temperature 1.
    • The authors say gpt4-0613 requires more input tokens than gpt4-o; Llama 3.2, released after the experiments were completed, is also vulnerable at temperature 0.

    ARCA Inversion (Section VI)

    • Of 10,000 three-token inputs, 1,512 are non-halting queries, which the authors report as an average of 15%; each successfully inverted output has at least 1 non-halting inversion.
    • Figure 10 is a histogram of the number of non-halting among 100 inversions for each of 100 tokens; the maximum for a single output is 50/100 (token Mej). The authors believe non-halting queries exist in large numbers in the input space.

    RAG Experiment (Section VII)

    • 20 RAG systems, 200 random meaningless questions, temperature 0: about 0.1% of questions trigger non-halting on one of the RAG systems.
    • The authors observe that when triggered, the retrieved Context always contains repeated sentences or repeated token sequences (such as email headers and pleasantries), and believe similar text chunks naturally bring repetition.

    Other Ablations and Analysis

    • gpt-4o temperature 0: MGUSA@ triggers with 3 repetitions, observable at temperature 0.5; Adam triggers with 3 repetitions (Fig. 1, 4, 5).
    • Meta-Llama-3-8B (base): MGUSA@ with 2 repetitions (6 tokens), John/Adam trigger with 3 repetitions (Fig. 3).
    • Meta-Llama-3-8B-Instruct: MGUSA@ requires 17, John at least 45, Adam at least 38, ADAM (two tokens) at least 14.
    • gemma-2-9b-it: John triggers with 4 repetitions (temperature 0, observable at 0.2); John@ requires 55, still occurring with high probability at temperature 0.6 (Fig. 8).
    • LogProbs observations (Fig. 6, 7): the authors say the LogProb of the looping token converges to 0, and the model's attempts to escape the loop are progressively suppressed.
    • Observations reported by the authors: the prompt structure is fragile (changing spaces or wording may make it fail or change the required number of repetitions); long loops over 20 tokens require only a few repetitions but are harder to find; at temperature 1, one experiment enters the loop with about 4/10 probability, and the loop persists beyond 250,000 tokens (context 8,096).
  5. What are some points that can be further explored?

    The authors suggest stronger alignment and sampler-side countermeasures; the experiments report no statistical tests, and the RAG and inversion scales are limited.

    Limitations noted by the authors and future directions

    • Stronger alignment: the authors suggest more thorough fine-tuning to force termination after a fixed length, and defenses against the Recipe's context sampling technique, but consider it unable to cover the entire input space, and the model may fail on non-natural-language inputs (Section VIII).
    • Further fine-tuning direction: the authors propose fine-tuning on long repeated English/non-English token sequences with strictly terminating answers, which may further mitigate it (Section VIII).
    • Eliminating fixed points is unrealistic: the authors consider eradicating fixed points from base models theoretically desirable but impractical (Section VIII).
    • Sampler-side countermeasures: the authors discuss hard limits, loop detection (including detection with a small model), and controlled generation techniques, but note these only eliminate non-halting behavior and cannot prevent alignment from being bypassed (Section VIII).
    • Further research: the authors state that the existence of the anomaly can still break alignment, requiring further research and stronger forms of alignment (Section IX).
    • Prompt fragility: the authors state that the prompt structure is fragile; adding or removing spaces, line breaks, or rewording may make the Recipe fail or change the required number of repetitions (Section V-F).

    Experimental coverage

    • The main text states 14 models were tested, covering models from OpenAI, Meta, Google, Anthropic, and Microsoft (Section V).
    • The 100-random-word experiment was conducted only at temperature 0, with a repetition cap of 1000, on 5 models (Table I); the temperature sweep used only the single token Adam (Figure 9).
    • ARCA inversion was done only on Meta-Llama-3.1-8B-Instruct, with the target output fixed to two repeated tokens and the input to three tokens (Section VI).
    • The RAG experiment was 20 systems, 200 questions, temperature 0, with the knowledge base being only the Enron Email Corpus (Section VII).
    • The paper reports no statistical significance tests or number of experimental repetitions; the defenses section only discusses countermeasure directions, without implementing or evaluating defenses, and no adaptive attack experiments were done (Section VIII).
  6. Summarize the main content of the paper

    The authors propose and validate non-halting queries: by exploiting LLM fixed points, a single prompt can make mainstream models never stop outputting.

    An attack paper: the authors propose non-halting queries, exploiting fixed points in autoregressive LLMs to make the model never sample <eos>, constituting a DoS that requires only a single query.

    • Problem: the authors state that the anomaly can make backend services run indefinitely and incur costs, and in RAG scenarios random meaningless questions can naturally trigger it, causing the server to hang.
    • Method: prove Theorem 1 — at temperature 0, looped output continuing to b + c + w (context window plus loop length) never stops; Recipe 1 finds a loop in a base model, then uses a prompt structure of "randomly pick words from the Context to form a meaningless answer" to bypass alignment; ARCA inversion is also used to directly search for three-token prompts.
    • Main results: with 100 random words at temperature 0, ChatGPT-4o and Llama-3.1-8B-it have a success rate of 97% (average repetitions 5.8, 5.2), Gemma-2-9B-it 91%, Claude-3.5-Sonnet 44%, Gemini Pro 1.5 only 19% (average 685.2 repetitions) (Table I).
    • Other findings: of 10,000 inputs in ARCA inversion, 1,512 (15%) triggered non-halting; in the RAG experiment about 0.1% of random questions naturally triggered it; most models can still be triggered at temperatures above 0, but Gemini 1.5 Pro Exp 0827 is immune to Adam at all temperatures.
    • Authors' conclusion: non-halting queries are widespread in existing models and easy to find; the authors conjecture that alignment against it may be difficult, suggest sampler-side countermeasures such as hard limits, and state they have disclosed to OpenAI, Google, and Meta.
Read originalSaTML 2025