Code Models · [ 4 min read ]

IBM's LLMON Markup Nearly Eliminates Prompt-Injection Attacks

Preview Granite 4.1 models trained on the markup block 47% more attacks than the best frontier model and 95% more than the best open-source one.

Key findings

  1. LLMON preview models avoid 47% more injection attacks than the best frontier model tested, 95% more than the best open-source model
  2. Two experimental models released: granite-4.1-3b-LLMON-preview and granite-4.1-8b-LLMON-preview
  3. General capability stays on par with Granite 4.1 Instruct across standard benchmark categories
  4. Training used five GRPO stages plus a final DPO stage on 1,000 on-policy preference pairs from injection attempts
  5. Block IDs are two characters, each encoded as a single token, so addressing any block costs two tokens
IBM's LLMON Markup Nearly Eliminates Prompt-Injection Attacks
libellule789 / pixabay

Attack success rates on the OPI prompt-injection benchmark drop to nearly zero under LLMON, an LLM-native markup language that IBM released today in two experimental preview models, granite-4.1-3b-LLMON-preview and granite-4.1-8b-LLMON-preview. Against the best frontier model the team tested, the LLMON previews avoid 47 percent more attacks; against the best open-source model, 95 percent more.

The premise is structural. A model's context fills with system prompts, retrieved documents, tool responses, requirements and reasoning chains, most of it either implicit or squeezed into JSON, a format designed for parsers. Smaller models grow brittle under that ambiguity, and attackers exploit it through indirect prompt injection: a malicious instruction hidden inside a document or tool response, which the model reads as a command.

LLMON — LLM Object Notation, pronounced "lemon" — marks semantically coherent components with meaningful tags wrapped in reserved special-token delimiters. Unique two-character IDs let any instruction point at the exact data payload it should act on, the way a function call binds to its arguments. Those block IDs come from a fixed set the tokenizer encodes as single tokens, so addressing a block always costs two tokens.

Why not JSON?

JSON encodes structure with characters — braces, quotes, colons — that also appear in ordinary text. To a model, a quotation mark inside a document and a quotation mark closing a field are the same token. Nesting depth is encoded by counting brackets, a task transformers handle poorly over long spans.

LLMON instead uses six delimiters installed in the tokenizer as reserved single tokens, keeping structure and content in separate parts of the vocabulary. Tags appear at the start of each span; nested structures are stated locally, so the model never tracks a hierarchy across long distances. Because most teams already run JSON pipelines, IBM ships lossless converters in both directions, plus example notebooks.

How does it work with chat templates?

LLMONON does not replace chat templates; it enriches them. A standard template says which part belongs to which role. LLMON says what each component means and how components relate, within and across roles.

The preview models ship their own template. You build the same messages list as for any chat model and call apply_chat_template; the difference is that a turn can name its parts — instruction, data, requirement — and mark each one exec: True or False. Parts marked True bind into an exec block at the bottom of the rendered output, which states which instruction to run, on what data, under which constraints, and where the answer goes. Parts marked False stay in context but nothing references them. One user turn becomes five addressable blocks joined by a sixth.

How was it trained?

The models start from Granite 4.1 base checkpoints, not the instruct releases, so LLMON behavior is learned during post-training. The team re-serialized a conventional instruction-tuning corpus — chat, multi-turn, RAG, tool calling — into addressable blocks, each turn carrying an execution block. They augmented the data with decoy instructions and data blocks left deliberately unbound, so the model learns to follow only the dependencies the execution block dictates.

Reinforcement learning follows: five sequential GRPO stages spanning multi-domain reasoning, RLHF, knowledge calibration and math, then a final DPO stage on a thousand on-policy preference pairs built from the model's own responses to injection attempts.

The resulting privilege rule falls out of the layout rather than an added guardrail: an instruction reached through an execution block is authoritative; anything reached as input — documents, tool results, tool schemas — is material to read, not a command to follow. The team stresses this is learned behavior, not an enforced guarantee, and the benchmarks test static injections only; adaptive attacks unfolding over many turns remain active work.

What does it cost in capability?

Across standard benchmark categories, the LLMON models perform on par with the Granite 4.1 Instruct models. Anyone already running Granite 4.1 3B or 8B can swap in the preview with no conversion pipeline — naming the turn's parts is enough, and the chat template renders the blocks. The LLMON-converters library goes deeper: a structured part, such as a JSON document, survives as typed, individually addressable blocks instead of one opaque string.

LLMON is not tied to a fixed schema. On ScienceWorld, a text benchmark where an agent performs elementary science tasks one command at a time, the team defined a domain vocabulary — instr.task.goal, req.planning_policy.rule, data.state.room, data.state.inventory, assistant.next_action — rendered the reference solutions with those tags, and tuned a LoRA on top of a LLMON model. The trained adapter then plays held-out games and writes its actions in the new vocabulary.

Mellea, IBM's agent framework, already has native support and will automatically LLMONize its LLM calls.

The release is an experimental preview, ready for evaluation but not production. The team asks users to report what worked and what broke in GitHub Discussions.

  • Models: granite-4.1-3b-LLMON-preview, granite-4.1-8b-LLMON-preview
  • Repo: github.com/generative-computing/llmon
  • Mellea: github.com/generative-computing/mellea
  • Papers: arxiv.org/abs/2610.38120, arxiv.org/abs/2603.22519
  • LLMON Attention Visualization on Hugging Face Spaces

The fix for prompt injection, IBM argues, is not a guardrail but a grammar.

github.com (Original)

Price tags

Share this article:

More from Grace Kim

Grace Kim

Show full bio

Market editor covering money, funding and market shifts around AI-coding movement at Vibe Coder.

28 articles

Adjacent departments

Next article »