Authors: Basel Shbita, Michael Hind, Chad DeLuca, Nathan Fulton, Shubhi Asthana, Farhan Ahmed, Anisa Halimi, Yada Zhu, Mauro Martino, David Cox, Dan Gutfreund
Organizations: IBM Research, San Jose, CA, USA · IBM Research, Yorktown Heights, NY, USA · IBM Research, Cambridge, MA, USA · IBM Research, Dublin, Ireland
Large Language Models (LLMs) treat all context tokens uniformly, lacking explicit separation between executable instructions and passive data. This leads to prompt injection vulnerabilities, ambiguous instruction binding, and unreliable execution control. We present a post-training methodology using LLMON (LLM Object Notation), a framework that enables separating instructions from data and requires explicit identifier-based execution. We construct a large-scale structured training corpus of 4.6B tokens spanning general, RAG (Retrieval-Augmented Generation), and tool-calling data, augmented with distractor-infused variants in which competing instructions and irrelevant data segments are present in context but not referenced. Post-training two Granite-4.1 base models (3B and 8B) through supervised fine-tuning followed by reinforcement learning, we show that LLMON-structured supervision reduces attack success rates on indirect prompt-injection benchmarks from 53-100% to 0.02-5.6% while preserving general capabilities. We further introduce attention-based interpretability metrics that diagnose failure modes at individual transformer layers for structured inputs, revealing how our approach reshapes internal attention patterns. Our results demonstrate that explicit execution semantics can be taught through standard post-training without architectural modification.
Figures & tables
Model
Training
General
Alignment
Math
Code
Tool-Calling
Multilingual
Safety
Granite-4.1-3B
Instruct
57.91
82.30
75.19
64.19
60.80
59.89
80.89
LLMON
57.16
81.02
73.25
65.45
60.71
62.68
89.64
Granite-4.1-8B
Instruct
64.95
87.06
84.09
72.38
68.27
68.68
84.19
LLMON
63.31
86.69
79.63
71.01
67.93
68.24
90.36
Table 1: LLMON-structured post-training vs. Instruct chat-template baselines under matched full fine-tuning. Each column is the unweighted mean over the benchmarks of that category (Section 4.3.1 ). Capability is broadly preserved (the six-category capability mean is unchanged at 3B and 1.4 points lower at 8B) while Safety improves at both scales. Best per model/category in bold .
Model
Training
OPI ↓
ASB ↓
Granite-4.1-3B
Instruct
100.0
99.2
LLMON
0.1
5.6
Granite-4.1-8B
Instruct
96.3
52.8
LLMON
0.02
3.1
Table 2: LLMON-structured post-training vs. Instruct chat-template baselines, measured by attack success rate (ASR, %) on two published indirect prompt-injection benchmarks: OPI (text-level injection) and ASB (agentic tool-observation injection). Lower is better : ASR is the fraction of adversarial prompts that succeed, so a smaller value means a more robust model. Best (lowest ASR) per model/benchmark in bold .
Model
Training
Indirect
Direct
Multi-turn
Granite-4.1-3B
Instruct
2.8
17.6
15.0
LLMON
84.6
37.1
28.0
Granite-4.1-8B
Instruct
0.7
9.2
15.0
LLMON
79.8
32.7
37.0
Table 3: Adversarial red-teaming with ARES, reported as robustness ( 1−ASR , %) , higher is better , the opposite direction to Table 2 . Indirect attacks use StruQ-style payloads planted in input, averaged over in-distribution and out-of-distribution splits (ID: 90.3/83.6, OOD: 79.0/75.9 for 3B/8B); direct attacks place the adversarial instruction in the user turn; multi-turn is a Crescendo variant with a 20-turn budget. Best per model/column in bold .
IFR ↑
DAS ↑
LEAK ↓
Layer
LLMON
Inst.
LLMON
Inst.
LLMON
Inst.
25
86.5
25.8
59.1
38.0
8.6
44.9
28
87.2
37.7
62.2
36.6
6.3
34.9
31
63.8
15.3
53.9
37.2
12.2
40.6
34
75.8
26.3
57.9
35.6
6.4
47.2
39
28.0
17.2
47.0
40.2
13.7
39.7
Table 4: Attention metrics (%) averaged over the distractor examples, at five representative layers, for Granite-4.1-3B LLMON-trained vs. Instruct . The LLMON model holds higher instruction focus and lower leakage at every layer measured; the gap is widest at layers 25-34 and narrows at the output.
Figure 2: Instruction Focus Ratio (IFR) per transformer layer for the LLMON-trained Granite-4.1-3B (teal) vs. its Instruct counterpart (pink) on a distractor example. The two are indistinguishable through layer 20 and separate sharply from layer 22, with the LLMON model sustaining 55-89% across layers 25-38. Both fall at the final layer.
Figure 3: Distractor leakage (LEAK) per transformer layer. Both models leak heavily in the first six layers; from layer 7 the LLMON-trained model (teal) settles into a 5-25% band while the Instruct model (pink) remains between 20% and 50% and rises again in the late layers.
Figure 4: Attention metrics and per-span attention distribution at layer 31 for the LLMON-trained Granite-4.1-3B (left) vs. its Instruct counterpart (right). The LLMON model divides its attention between the bound target instruction (I-T) and target data (D-T); the Instruct model’s largest single recipient is a distractor instruction (I-D1, 47.5%).
Figure 5: Data Attention Score (DAS) per transformer layer for the LLMON-trained Granite-4.1-3B (teal) vs. its Instruct counterpart (pink). DAS separates in the same region of the stack as IFR and LEAK, rising into a 46-94% band across layers 23-38 for the LLMON model.
Figure 6: Attention correlation weights between each generated token (columns, in decoding order) and the KV-cache spans (rows) for the LLMON-trained Granite-4.1-3B at layer 31. Brighter cells indicate stronger attention. The target data span (D-T) activates while the model quotes the sentence it was asked to count, and the distractor spans (I-D1, I-D2, D-D1) remain near zero throughout decoding.
Large language model post-training adapts pretrained models into more useful, reliable, and specialized assistants through supervised and preference-based learning.
Textual Large Language Models (LLMs) provide a simple and familiar interface: a string of text is used for both input and output. However, the information conveyed to an LLM often has a richer structure and semantics, which is not conveyed in a string. For example, most prompts contain both instructions ("Summarize this paper into a paragraph") and data (the paper to summarize), but these are usually not distinguished when passed to the model. This can lead to model confusion and security risks, such as prompt injection attacks. This work addresses this shortcoming by introducing an LLM-native mark-up language, LLMON (LLM Object Notation, pronounced "Lemon"), that enables the structure and semantic metadata of the text to be communicated in a natural way to an LLM. This information can then be used during model training, model prompting, and inference implementation, leading to improvements in model accuracy, safety, and security. This is analogous to how programming language types can be used for many purposes, such as static checking, code generation, dynamic checking, and IDE highlighting. We discuss the general design requirements of an LLM-native markup language, introduce the LLMON markup language and show how it meets these design requirements, describe how the information contained in a LLMON artifact can benefit model training and inference implementation, and provide some preliminary empirical evidence of its value for both of these use cases. We also discuss broader issues and research opportunities that are enabled with an LLM-native approach.
Michael Hind, Basel Shbita, Bo Wu +5
IBM Research Yorktown Heights, New York · IBM Research San Jose, California · IBM Research Cambridge, Massachusetts
Large Language Models (LLMs) are widely deployed in real-world systems. Given their broader applicability, prompt engineering has become an efficient tool for resource-scarce organizations to adopt LLMs for their own purposes. At the same time, LLMs are vulnerable to prompt-based attacks. Thus, analyzing this risk has become a critical security requirement. This work evaluates prompt-injection and jailbreak vulnerability using a large, manually curated dataset across multiple open-source LLMs, including Phi, Mistral, DeepSeek-R1, Llama 3.2, Qwen, and Gemma variants. We observe significant behavioural variation across models, including refusal responses and complete silent non-responsiveness triggered by internal safety mechanisms. Furthermore, we evaluated several lightweight, inference-time defence mechanisms that operate as filters without any retraining or GPU-intensive fine-tuning. Although these defences mitigate straightforward attacks, they are consistently bypassed by long, reasoning-heavy prompts.
Large Language Models (LLMs) are vulnerable to attacks like prompt injection, backdoor attacks, and adversarial attacks, which manipulate prompts or models to generate harmful outputs. In this paper, departing from traditional deep learning attack paradigms, we explore their intrinsic relationship and collectively term them Prompt Trigger Attacks (PTA). This raises a key question: Given a prompt, can we tell whether a hidden trigger is steering the model's behavior? We propose UniGuardian, to the best of our knowledge the first training-free LLM detector to jointly detect successfully activated prompt injection, backdoor, and adversarial attacks without knowing the attack type. Its shared mechanism measures how structured prompt perturbations shift the model's output distribution. Additionally, we introduce a single-forward strategy to optimize the detection pipeline, enabling simultaneous attack detection and text generation within a shared batched forward pass at each decoding step. Our experiments confirm that UniGuardian accurately and efficiently identifies trigger-activated prompts in LLMs.
Huawei Lin, Yingjie Lao, Tony Geng +2
Rochester Institute of Technology · Tufts University · University of Rochester +1