Skip to content

LTBD: Defending Against Prompt Injection with Learnable Trust Boundary Delimiters

Paper Tracker· arXiv:2610.11634· Luman Zhao, Minghui Xu, Yue Zhang, Yijun Yang·Indexed by this site · 2026-10-09· Originally publishedDefenses

Quick read

Defenses

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

LTBD freezes the LLM and learns only four delimiters; the worst-case ASR across four models on AlpacaFarm is 0.00%.

Threat modelAttackers insert malicious instructions into untrusted external data to divert the model from trusted user instructions. In the adaptive setting, the attacker fully knows the four delimiters and LTBD's input structure, forging boundaries to imitate, end, or reopen regions; these variants are also used for training augmentation. The victim system is an LLM that processes both trusted instructions and external data. ASR is the proportion of samples that follow the injected instruction rather than the legitimate task.

Questions
LLMs place trusted instructions and external data that may contain malicious instructions in the same sequence without an explicit representation of trust source, so user intent can be overridden. The authors state that parameter-modifying defenses are often infeasible for closed-source models, and manual prompts can still be broken by strong attacks.
Methods
LTBD trains only four delimiter embeddings, marking the start and end of the trusted instruction region and the untrusted data region, while the base LLM is frozen. The loss is cross-entropy on benign responses plus a preference term relative to attack-induced responses; during training, half the samples are injected with Ignore, Completion, or Delimiter-Spoof.
Experiments and results
The four models' AlpacaFarm ASR is 0.00% each, and TaskTracker is 0.11–0.19%. The authors claim the utility cost is small, and CyberSecEval2 is not the lowest in every cell. In Table 3, adaptive ASR is 0.00% or 0.48%, and the baseline is not specified.
Limitations and future work
The paper does not specifically write limitations or future directions. Experiments cover four open-source instruction models and AlpacaFarm, SEP, TaskTracker, CyberSecEval2; ablations are conducted on two models. Sample sizes, repetitions, ASR judge, and overhead numbers are not reported; Table 3's benchmark is not specified.
Experimental setupLlama3-8B-Instruct、Llama3.1-8B-Instruct et al. · AlpacaFarm、SEP et al. · ASR、WinRate
Evaluated models
Llama3-8B-InstructLlama3.1-8B-InstructFalcon3-7B-InstructQwen2.5-7B-Instruct
Benchmarks
AlpacaFarmSEPTaskTrackerCyberSecEval2AlpacaEval2Cleaned Alpaca
Metrics
ASRWinRate
AI summaryThe paper proposes Learnable Trust Boundary Delimiters (LTBD), a lightweight defense that explicitly encodes trust boundaries in the input without changing LLM parameters, using a small number of learnable delimiters to distinguish trusted user instructions from untrusted external data, enabling the model to better follow the intended trust hierarchy. Experiments show LTBD significantly outperforms inference-time defenses, performs comparably to training-based methods, while maintaining benign task utility and negligible inference overhead. On AlpacaFarm, the attack success rate is 0.00%; on TaskTracker, it is only 0.11-0.19%; it remains effective under adaptive attacks where the attacker fully knows the defense and attempts to bypass it. The paper is 5 pages, 3 tables, 1 figure, categorized under cs.CR and cs.AI, arXiv ID 2610.11634.

The paper proposes Learnable Trust Boundary Delimiters (LTBD), a lightweight defense that explicitly encodes trust boundaries in the input without changing LLM parameters, using a small number of learnable delimiters to distinguish trusted user instructions from untrusted external data, enabling the model to better follow the intended trust hierarchy. Experiments show LTBD significantly outperforms inference-time defenses, performs comparably to training-based methods, while maintaining benign task utility and negligible inference overhead. On AlpacaFarm, the attack success rate is 0.00%; on TaskTracker, it is only 0.11-0.19%; it remains effective under adaptive attacks where the attacker fully knows the defense and attempts to bypass it. The paper is 5 pages, 3 tables, 1 figure, categorized under cs.CR and cs.AI, arXiv ID 2610.11634.

Related events and news

1 events · 1 news mentions

News that mentions this paper

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    The authors argue that prompt injection stems from a lack of explicit trust boundaries; LTBD encodes this boundary with four learnable delimiters without modifying the LLM.

    The core question is: can we teach an LLM where to trust, rather than only telling it what to ignore, without modifying the LLM itself.

    • Occurrence scenario: The authors argue that current LLMs place trusted instructions and external data that may contain adversarial content into the same sequence, without an explicit representation of trust provenance, so malicious instructions in external data may override user intent.
    • Existing limitations: The authors claim that prompts such as Reminder and Sandwich can still be broken by strong attacks; StruQ requires modifying model parameters, which is often infeasible for closed-source models and may change original behavior; DefensiveToken freezes the base model, but its token is a global control signal and does not explicitly correspond to the boundary between trusted and untrusted regions.
    • Core hypothesis: The authors believe that making the trust boundary a learnable object is sufficient to maintain the authority of trusted instructions and suppress competing instructions in untrusted data.
    • Proposed method: They propose LTBD (Learnable Trust-Boundary Delimiters), which uses a small number of learnable delimiters to mark the two regions, training only these embeddings while the base LLM is completely frozen.
    • Threat model:
      • Goal: Make the model deviate from the user's task and instead follow malicious instructions inserted into external data.
      • Capability: The attacker inserts malicious instructions into external data. In the adaptive setting, the attacker has full knowledge of the four delimiters and the LTBD input structure, and forges boundaries to imitate, end, or reopen regions; these variants are also used as training augmentation.
      • Knowledge: The summary states that the adaptive attacker has full knowledge of the defense; Section 3.4 specifies this as full knowledge of the four delimiters and the input structure. Whether the standard attacker knows the model weights is not stated in the paper.
      • Victim system and evaluation: The victim system is an LLM that processes both trusted instructions and external data. ASR is the proportion of samples where the model follows injected instructions rather than the legitimate task.
  2. What related research exists?

    The introduction compares prompt defenses, StruQ, and DefensiveToken; the authors position LTBD as a learnable trust boundary for frozen LLMs.

    The paper has no separate Related Work; related discussion is concentrated in the introduction, with the experiments section supplementing baselines.

    Prompt-based defenses

    • Reminder ([13]) and Sandwich ([14]) — use hand-crafted prompts asking the model to ignore malicious content. The authors claim they can still be broken by strong attacks, attaching the claim in the introduction to references [15, 12].
    • TextGrad ([20]) — used in experiments as a baseline for optimizing defense prompts. The introduction does not discuss its shortcomings.

    Training-based structural separation

    • StruQ ([11]) — structurally separates instructions and data, and fine-tunes the model to respect that boundary. The authors claim this modifies underlying parameters, which is often infeasible for closed-source models and may alter the original model's behavior. In experiments, StruQ-Full and StruQ-LoRA belong to this category.
    • SecAlign ([12]) — used in experiments as a training-based baseline with SecAlign-LoRA. The authors claim StruQ and SecAlign update the underlying model via full fine-tuning or LoRA to achieve robustness. The introduction does not separately expand on SecAlign's approach.

    Frozen-parameter defense tokens

    • DefensiveToken ([16]) — keeps the base frozen and learns defense token embeddings. The authors claim these tokens act as global control signals rather than tying representations to the source of trusted and untrusted regions.

    Baselines and benchmarks

    • Baseline methods: no defense, as well as Reminder, Sandwich, TextGrad, DefensiveToken, StruQ-LoRA, StruQ-Full, SecAlign-LoRA.
    • Benchmarks: utility reported as WinRate on AlpacaFarm and SEP using AlpacaEval2; safety reported as ASR on AlpacaFarm, SEP, TaskTracker, CyberSecEval2. Training uses Cleaned Alpaca. Injection variant names include Ignore, Completion, Ignore-Completion, and the authors' proposed Delimiter-Spoof.

    The authors position LTBD between the explicit structural separation of training-based methods and the lightweight deployment of parameter-efficient defenses: without changing LLM weights, only the delimiters bound to boundaries learn a trust-related role.

  3. How does the paper address this problem?

    LTBD optimizes only four boundary delimiter embeddings, using cross-entropy plus a preference loss to keep the frozen LLM maintaining trusted instruction authority.

    LTBD frames prompt injection as trust boundary modeling: it trains only four delimiter embeddings, freezes the base model, and enables the model to distinguish trusted instruction regions from untrusted data regions, even when both sides contain instruction-like text.

    Problem Setting

    • Input: The model processes both a trusted task instruction I and external data D. An attack inserts malicious instructions into D, yielding attacked data D′.
    • Expected behavior: Benign inputs should follow I and complete the task on D. Instruction-like content in D′ should remain data, not new authority.
    • Difference from prior work: The authors claim that mere structural separation does not guarantee the model respects boundaries; StruQ still requires fine-tuning. Generic defense tokens can shift behavior without modifying the LLM, but do not bind representations to the source of trusted regions.

    Delimiters and Input

    • Four tokens: tIB, tIE, tDB, tDE, marking the start and end of trusted instruction and untrusted data regions, respectively. The embedding matrix has 4 rows, with width equal to the LLM's token embedding dimension.
    • Concatenation: For benign or attacked external content, the input is xT = [tIB; I; tIE; tDB; D̂; tDE], where semicolons denote sequence concatenation.
    • Trainable scope: LLM parameters are fully frozen; only the four embeddings are optimized. The authors claim each delimiter is tied to a specific structural boundary, so the learned roles are trust-related, not generic defense prefixes.
    • Deployment: No additional defense model, no modification of LLM weights. Figure 1 contrasts undefended input with input wrapped with the four delimiters.

    Training Objective

    • Reference responses: On benign inputs, the frozen base model provides the response y+ to preserve. On attacked inputs, the undefended model provides y−, representing the attack-induced behavior to suppress.
    • Loss: The objective is L = LCE + λ Lpref. Cross-entropy encourages generating y+ on wrapped inputs; the preference term increases the likelihood of y+ relative to y−, taking the negative log of the sigmoid of the scaled log-probability difference (scaled by β). The preference term is set to 0 for benign samples.
    • Values in experiments: Section 3.1 sets λ = 0.3, β = 0.1. The paper does not specify the optimizer name.

    Data and Optimization Process

    • Data: Following StruQ's approach, a defense set is constructed from instruction fine-tuning data. Experiments use Cleaned Alpaca (approximately 51K). Half of the samples are unchanged; for the remaining samples with non-empty external data, one of three injections is applied. Section 2.4 states uniform sampling, Section 3.1 states random injection, naming them Ignore, Completion, and Delimiter-Spoof.
    • Labels: The same y+ is used for benign and attacked inputs; attacked samples additionally have y−, while benign samples have empty y−. The authors claim this maintains original task behavior in the presence of injections.
    • Optimization: The four tokens are added to the vocabulary, embeddings initialized as N(0, I); the base model is frozen, and only delimiter embeddings receive gradient updates. All four models are trained for one epoch with learning rate 0.1. Algorithm 1 summarizes the process. The authors claim the same training set and data construction protocol as training-based baselines.
    • Boundary spoofing augmentation: During training, forged boundary structures are also used as attack augmentation. The specific patterns are part of adaptive attacks and are not elaborated here.

    Inference Usage

    • Wrapping: At inference, inputs are wrapped with the learned delimiters to make the model follow trusted instructions and treat potentially attacked external data as data.
    • Success criteria in the paper: Safety is measured by whether the model still follows trusted instructions; later, ASR is used to measure the proportion of injected instructions followed, and WinRate for benign task utility.
  4. What experiments did the paper conduct?

    In Table 1, LTBD's AlpacaFarm ASR is 0.00% across all four models; the authors state the utility cost is small and remains low under adaptive attacks.

    Experimental Setup

    • Models tested: Llama3-8B-Instruct, Llama3.1-8B-Instruct, Falcon3-7B-Instruct, Qwen2.5-7B-Instruct. Each defense is applied to these models, and results are reported per model.
    • Training: Cleaned Alpaca (about 51K), single epoch, learning rate 0.1, λ = 0.3, β = 0.1. The authors state that the same training set and data construction protocol as the training-based baselines are used; the three injections listed in Section 3.1 include Delimiter-Spoof.
    • Baselines: Prompt-based: Reminder, Sandwich, TextGrad, DefensiveToken; training-based: StruQ-LoRA, StruQ-Full, SecAlign-LoRA; also no defense.
    • Utility: AlpacaEval2, reporting WinRate on AlpacaFarm and SEP. GPT-4o is the judge, comparing against GPT-4 Turbo reference answers.
    • Safety: ASR, defined as the proportion of following the injected instruction rather than the legitimate task. AlpacaFarm evaluates Ignore, Completion, Ignore-Completion, reporting worst-case ASR. SEP uses instance-specific injections. TaskTracker and CyberSecEval2 use benchmark-defined attack settings.
    • Not specified: sample sizes for each benchmark, number of repetitions, and whether ASR is determined by rules or by a model. The paper does not provide inference time.

    Main Results

    The table below only lists the LTBD rows from Table 1. AlpacaFarm ASR is the worst-case across the three attacks.

    Swipe horizontally to read the table

    ModelAlpacaFarm ASRSEP ASRTaskTracker ASRCyberSecEval2 ASRAlpacaFarm WinRate
    Llama3-8B-Instruct0.00%2.04%0.13%7.27%35.73%
    Llama3.1-8B-Instruct0.00%2.00%0.19%7.27%30.98%
    Falcon3-7B-Instruct0.00%1.57%0.11%1.82%36.42%
    Qwen2.5-7B-Instruct0.00%1.86%0.14%12.73%41.71%
    • Authors' safety summary: The authors state that on AlpacaFarm, all four models achieve 0% ASR, outperforming inference-time defenses and matching the strongest training-based methods; relative to DefensiveToken, the four models' SEP ASR drops from 3.20/2.81/6.70/4.40% to the LTBD rows in the table. The authors give a TaskTracker range of 0.11–0.19%. Counterexamples exist on CyberSecEval2: on Llama3-8B-Instruct, TextGrad is 1.8% and DefensiveToken is 3.64%, both lower than the LTBD row in the table; on Qwen2.5-7B-Instruct, StruQ-Full is 3.6%, also lower. The authors only claim Falcon3-7B is best on that benchmark. Also at 0.00% is TextGrad's AlpacaFarm ASR on Llama3-8B-Instruct, but its WinRate is 22.9%.
    • Utility: The authors state that the four models' AlpacaFarm WinRate is the highest among all defenses, and SEP WinRate is the highest on three of the four; 6 of 8 utility metrics are not lower than no defense, 7 are higher than DefensiveToken, and they believe the delimiters may enhance original instruction following rather than trading utility for safety. LTBD SEP WinRate outside the table is 60.55%, 54.92%, 57.09%, 63.90%. The exception is Llama3.1-8B-Instruct: AlpacaFarm WinRate is lower than no defense's 31.37%, and SEP WinRate is lower than no defense's 59.04% and DefensiveToken's 57.90%.
    • Training-based comparison: No-defense AlpacaFarm ASR is 55.29%, 74.52%, 89.9%, 93.75%. On SEP, StruQ-Full on Llama3 and Llama3.1 is 0.4% and 0.2%, lower than the LTBD rows in the table. The authors state that freezing all LLMs and only optimizing four embeddings still achieves or exceeds methods that update the model on TaskTracker and on SEP for Falcon3 and Qwen2.5.

    Ablation: Placement and Preference Loss

    • What was tested: Table 2 only includes Llama3-8B-Instruct and Llama3.1-8B-Instruct. Prefix+CE places all four tokens at the input prefix; Boundary+CE places them at region boundaries but removes the preference loss; the third row is full LTBD.
    • Results: On Llama3.1-8B-Instruct, Prefix+CE's WinRate / AlpacaFarm ASR / SEP ASR is 27.50% / 23.08% / 33.81%; after boundary placement, 30.98% / 0.48% / 3.43%; after adding the preference loss, 30.98% / 0.00% / 2.00%. On Llama3-8B-Instruct, the three are 27.60% / 6.73% / 15.43%, 34.51% / 0.00% / 2.34%, and 35.73% / 0.00% / 2.04%.
    • Authors' interpretation: The authors state that the benefit does not come only from adding trainable tokens; binding tokens to trusted and untrusted regions is the main source; the preference term further reduces SEP ASR and maintains or improves WinRate.

    Adaptive Attacks

    • What was tested: Delimiter-Spoof. The attacker fully knows the four delimiters and input structure, forging delimiters around the injected content to mimic, end, or reopen regions. Five variants are tested separately, reporting worst-case ASR; these variants are also used for training augmentation.
    • Results: Table 3's Plain Injection and Adaptive Attack are: Llama3-8B-Instruct both 0.00%; Llama3.1-8B-Instruct both 0.48%; Falcon3-7B-Instruct both 0.00%; Qwen2.5-7B-Instruct from 0.00% to 0.48%. The paper does not specify the benchmark for this table, nor define Plain Injection. Llama3.1's Plain Injection 0.48% differs from AlpacaFarm's 0.00% in Table 1.
    • Authors' interpretation: The authors state that explicitly forging delimiter syntax is barely more effective than plain injection; the defense encodes trust semantics in embeddings bound to real structural boundaries, so forged text does not automatically receive the same trust semantics, making it harder to bypass.

    Other Ablations and Analyses

    • The paper does not report additional sweeps over learning rate, λ, β, epoch, or number of delimiters.
    • On Llama3-8B-Instruct, Sandwich's AlpacaFarm ASR is 56.7%, higher than no defense's 55.29%; Reminder's TaskTracker ASR is 19.8%, higher than no defense's 16.4%.
    • On Falcon3-7B-Instruct and Qwen2.5-7B-Instruct, TextGrad's AlpacaFarm ASR is 97.1% and 97.6%, higher than no defense's 89.9% and 93.75%; on Llama3-8B-Instruct, its SEP WinRate is 1.1%.
    • SecAlign-LoRA's SEP ASR is 35.4% on Falcon3-7B-Instruct and 14.7% on Qwen2.5-7B-Instruct.
    • On TaskTracker, Llama3.1-8B-Instruct's StruQ-Full is 0.18%, and LTBD is 0.19%. The authors state inference overhead is negligible but do not provide latency or additional token counts.
  5. What are some points that can be further explored?

    The paper does not specifically write limitations or future work in the conclusion or appendix.

    Limitations and future directions noted by the authors

    The paper has no Limitations, Discussion, or Future Work sections. The conclusion only states that learning trust boundaries at the input layer is a simple and effective approach, and claims the inference overhead is negligible, without writing a sentence framed as limitations or future work. The paper does not specifically discuss limitations.

    Experimental coverage

    • Safety and utility experiments use four open-source instruction-tuned models: Llama3-8B-Instruct, Llama3.1-8B-Instruct, Falcon3-7B-Instruct, Qwen2.5-7B-Instruct (Section 3.1, Table 1).
    • Safety benchmarks are AlpacaFarm (Ignore, Completion, Ignore-Completion worst-case ASR), SEP, TaskTracker, CyberSecEval2; utility is WinRate on these two datasets, judged by GPT-4o with GPT-4 Turbo as reference (Section 3.1). The paper does not report sample sizes or number of repetitions per benchmark.
    • Baselines include no defense, Reminder, Sandwich, TextGrad, DefensiveToken, StruQ-LoRA, StruQ-Full, SecAlign-LoRA (Table 1). Training uses Cleaned Alpaca (about 51K), single epoch, learning rate 0.1, λ = 0.3, β = 0.1.
    • Ablations on the first two models compare prefix placement, boundary placement, and whether preference loss is used (Table 2). The adaptive evaluation is the worst-case of five Delimiter-Spoof variants, and these variants are also used for training augmentation (Section 3.4, Table 3). The paper does not state the baseline for Table 3, nor does it report the ASR judge or agreement with humans.
    • The introduction states that modifying parameters on closed-source models is often infeasible, serving as motivation for freezing the LLM; experiments report on the four open-source models above. The paper does not report results on closed-source models or specific numbers for inference overhead.
  6. Summarize the main content of the paper

    LTBD only trains four delimiter embeddings; the authors report an ASR of 0.00% on AlpacaFarm with small utility cost.

    LTBD is a prompt injection defense that does not modify base weights: it only learns four token embeddings used to mark the boundary between trusted instructions and untrusted data.

    • Problem: The authors argue that both types of content enter the same sequence, yet the model has no explicit representation of trust source, so instruction-like text in external data competes for behavioral authority.
    • Method: Delimiters wrap the instruction region and the data region separately; the model is frozen, first generating benign responses and attack-induced responses, then updating only the four embeddings with a cross-entropy plus preference loss. Experiments train for one epoch, learning rate 0.1, λ = 0.3, β = 0.1. Data comes from Cleaned Alpaca (about 51K), half kept as-is, the other half injected with Ignore, Completion, or Delimiter-Spoof when external data is non-empty.
    • Main results: In Table 1, AlpacaFarm worst-case ASR is 0.00% for all four models; TaskTracker ASR is 0.13%, 0.19%, 0.11%, 0.14%. CyberSecEval2 ASR is 7.27%, 7.27%, 1.82%, 12.73%. AlpacaFarm WinRate is 35.73%, 30.98%, 36.42%, 41.71%.
    • Comparison: The authors claim it outperforms inference-time defenses and approaches StruQ and SecAlign which update the model, and most utility evaluations are not lower than no defense. Counterexamples in the table include: TextGrad on CyberSecEval2 for Llama3-8B-Instruct at 1.8%; two WinRates for Llama3.1-8B-Instruct are lower than no defense.
    • Mechanism check: In Table 2, moving the token from pure prefix to boundary changes Llama3.1-8B-Instruct's AlpacaFarm ASR from 23.08% to 0.48%, and with the full objective to 0.00%. In Table 3, the worst-case ASR for forged boundaries is 0.00% or 0.48%, and the paper does not specify the baseline. The authors claim the advantage comes from embeddings bound to real boundaries, not the surface text of delimiters.
    • Authors' conclusion: The authors believe that learning trust boundaries at the input layer without modifying the LLM can defend against prompt injection at small utility cost. The paper does not specifically discuss limitations.

Related papers

Show 3 more papers
Read originalarxiv.org