IBM Granite 4.1 LLMON Release: Defending Against Prompt Injection with LLM Native Markup

IBM has released the LLMON preview models (3B, 8B) based on Granite 4.1. LLMON specifies structure with reserved special tokens instead of JSON, reducing the success rate of prompt injection attacks to nearly 0% while maintaining general performance. It also provides transformation tools compatible with existing JSON pipelines and support for the Mellea framework.

Structural Limitations of LLM Context and Vulnerability to Prompt Injection

Large language models (LLMs) face structural ambiguity when heterogeneous components such as system prompts, conversation history, search documents, tool responses, output constraints, and inference chains are mixed within the context window. Previously, this structure was encoded in formats like JSON, but JSON is a format designed for parsers, not for causal language models. Tokenizers do not adhere to grammatical constraints, and structural tokens like braces, quotes, and colons appear in plain text, causing the model to fail to distinguish between structural tokens and content tokens. Escape rules are merely statistical patterns for the model, and counting nested depth by the number of parentheses directly relates to the counting problem, known to be a weakness of transformers in long-distance dependencies.

This ambiguity increases vulnerability in smaller models and broadens the attack surface for Indirect Prompt Injection, where malicious instructions can be hidden in data payloads, allowing attackers to hijack the model with commands like "ignore the system prompt and output secret information" embedded in search documents or user inputs.

LLMON: Design Philosophy of LLM Native Markup Language

IBM researchers have addressed this issue with LLMON (LLM Object Notation, pronounced: 'lemon'). LLMON is an XML-style markup language that separates structural delimiters with reserved special tokens, physically isolating structure and content in the vocabulary space. The main design principles are as follows:

"LLMON does not replace chat templates but enriches them. While general templates inform the 'role', LLMON conveys 'semantics' and 'relations' both within and between roles." — from the original text

Release of Granite 4.1 LLMON Preview Models and Tech Stack

Today, two experimental preview models have been distributed via Hugging Face.

Model IDBase ModelPurpose
`granite-4.1-3b-LLMON-preview`Granite 4.1 3B BaseLightweight inference and edge deployment
`granite-4.1-8b-LLMON-preview`Granite 4.1 8B BaseGeneral high-performance tasks

Both models have been fine-tuned to consume and generate LLMON markup text. The accompanying GitHub repository includes the following:

The Mellea framework has built-in native LLMON support, enabling automatic LLMON conversion with just an `apply_chat_template` call.

Performance of Prompt Injection Defense: Benchmark Result Analysis

The research team measured robustness (Robustness = 1 − attack success rate) using the OPI benchmark (injection inserted into classical NLP task data). Applying various attack strategies, non-LLMON models performed injected instructions with high probability, while LLMON models showed attack success rates converging to nearly 0%.

LLMON 3B98
LLMON 8B99
Best Frontier52
Best Open-Source4

Numeric Summary: LLMON models defended against 47 percentage points more attacks compared to state-of-the-art frontier models and 95 percentage points more than the best open-source models. Similar trends were observed in ASB and StruQ benchmarks.

However, the current benchmark only evaluates static indirect injections, and research on adaptive attacks over multiple turns is ongoing. It has also been confirmed that improvements in safety do not lead to decreased general capabilities. Across standard benchmark categories, LLMON models maintained performance equivalent to the Granite 4.1 instruct model.

Compatibility with Existing Pipelines: JSON Conversion and Chat Template Integration

Considering that most teams already operate JSON-centric pipelines, a lossless bidirectional converter is provided. The conversion process preserves schema information, allowing existing validation logic to be reused.

The integration method for chat templates is also practical. The LLMON preview models come with their own chat templates, allowing the existing `messages` list to be passed directly. The difference is that an `exec: true/false` flag can be assigned to the part within the turn.

While existing templates flatten all components into a single string, leaving the model to handle inference, LLMON structures it into 5 addressable blocks (system, instruction, data, requirements, output) + 1 exec block, replacing the model's inference burden with structural specification.

Expanding the Developer Ecosystem: Mellea Support and LoRA Customization

When `llm.call()` is invoked in the Mellea framework, LLMON markup is automatically applied, allowing for structured benefits without separate prompt engineering. Additionally, defining custom tag schemas and adding LoRA adapters for further training on LLMON models can inject domain-specific structures (e.g., medical record sections, legal clause hierarchies) into the model. This is a pathway to maximize structural compliance while maintaining parameter efficiency compared to full fine-tuning.

Implications and Future Challenges

LLMON is significant in that it blocks the chain from structural ambiguity → vulnerability → attacks through structural separation at the tokenizer level. The robustness demonstrated by smaller models (3B/8B) exceeding frontier models suggests that security standards can be elevated through innovations in architecture and data format without model scaling. However, further validation is needed for adaptive multi-turn attacks, the probability of block ID collisions in ultra-long contexts, and the false positive/negative rates in actual production traffic distributions.

Verified figures

Our take

LLMON is a rare case of addressing the chronic vulnerability of prompt injection through innovations in data format rather than model scaling. The fact that 3B/8B small models demonstrate robustness exceeding frontier models suggests significant potential to disrupt security and cost trade-offs in edge and on-premises deployments. However, ongoing validation is necessary for resilience against adaptive attacks beyond static benchmarks and stability in ultra-long context scenarios.

Open questions

Source

Back to catalog