LLMON: An LLM-Native Markup Language for Granite 4.1 3B and 8B
LLMON: An LLM Native Markup Language for Granite 4.1 3B and 8B Published November 12, 2026 Large language models generate tokens based on their context. Over a long interaction,...
By Software Development Team
LLMON: An LLM-Native Markup Language for Granite 4.1 3B and 8B
Published November 12, 2026
Large language models generate tokens based on their context. Over a long interaction, that context can contain system prompts, previous conversation turns, instructions for retrieved documents, tool responses, user data, output requirements, and reasoning chains.
Much of this structure remains implicit or is represented using formats such as JSON, which were designed for parsers rather than language models. This can make models, especially smaller ones, brittle and prone to unexpected failures. It can also create opportunities for prompt-injection attacks.
LLMON, short for LLM Object Notation and pronounced “lemon,” is an LLM-native markup language designed to make structure and semantics explicit. Semantically related components receive meaningful tags enclosed by reserved special-token delimiters. Schemas, including nesting, are represented in a form intended to be unambiguous to causal language models.
Unique identifiers allow specific instructions to be referenced from anywhere in the context and linked to the data they should process. This resembles how programming languages connect function calls with their arguments.
Two experimental preview models derived from Granite 4.1 base models are available:
The accompanying LLMON GitHub repository includes a toolkit, workflow examples, and templates.
What LLMON enables
LLMON models are designed to provide explicit separation between instructions and data. Reported results include:
- Indirect prompt injections hidden in user data are mostly ignored. On some benchmarks, attack success rates fall to nearly zero, while regular instruction-tuned models are hijacked with high probability.
- Unrelated passages, old conversation turns, and tool outputs are less likely to influence an answer because each instruction is linked to the specific data it should use.
- Instructions, data, and requirements are separately marked, allowing application-level structure and meaning to be represented to the model. Mellea supports LLMON by automatically applying the format to its LLM calls.
- Existing JSON can be converted to LLMON without loss. Developers can also define domain-specific structures and tags, then tune a LoRA adapter on top of an LLMON model.
Why not JSON?
JSON was designed for software parsers, not causal language models. Its grammar is not enforced at the tokenizer level, and structural characters such as {, ", and : may also occur in ordinary text. A quotation mark inside a document and one closing a field are represented by the same token. Parser-level escaping rules therefore appear to a model as statistical patterns.
JSON also represents nesting through bracket counting. Transformer models can struggle with this task, particularly across long spans.
LLMON uses an XML-like format in which structural delimiters are reserved special tokens. Structure and content therefore occupy separate parts of the vocabulary. Each span begins with a tag, and its boundaries are explicit. Nested structures are represented locally, reducing the need to track hierarchy across long passages.
Because many existing systems use JSON, the project provides conversion tools and notebooks that translate between JSON and LLMON without loss.
Relationship to chat templates
LLMON does not replace chat templates. It adds structure to them.
A conventional chat template identifies the roles of messages, such as system, user, and assistant. LLMON also describes what each component means and how components relate within and across those roles.
The preview models include an LLMON-specific chat template. Applications can construct the same messages list used with other chat models and call apply_chat_template. A turn can additionally name its components and mark each one as exec: True or exec: False.
A component marked True is included in the exec block at the bottom of the rendered context. That block specifies which instruction should run and which data it should operate on. A component marked False remains in the context but is not referenced by an execution block.
messages = [
{
"role": "user",
"instruction": [
{"value": "Write a short paragraph about", "exec": True}
],
"data": [
{"value": "IBM Company", "exec": True}
],
"requirement": [
{"value": "Use less than 10 words", "exec": True},
{"value": "Do not use commas", "exec": True}
]
}
]
The model receives the following representation. Newlines and indentation are added for readability, while the template emits them without that formatting:
<|open|>instr<|:|>Ȗ<|close|>Write a short paragraph about<|open_end|>
<|open|>data<|:|>ä¦<|close|>IBM Company<|open_end|>
<|open|>req<|:|>Á¼<|close|>Use less than 10 words<|open_end|>
<|open|>req<|:|>¢¬<|close|>Do not use commas<|open_end|>
<|open|>exec<|:|>ÄÐ<|close|>
<|open|>exec<|.|>instruction<|close|>instr<|:|>Ȗ<|open_end|>
<|open|>exec<|.|>input<|close|>data<|:|>ä¦<|open_end|>
<|open|>exec<|.|>requirement<|close|>req<|:|>Á¼<|open_end|>
<|open|>exec<|.|>requirement<|close|>req<|:|>¢¬<|open_end|>
<|open|>exec<|.|>output<|close|>assistant<|:|>ãø<|open_end|>
<|open_end|>
<|open|>assistant<|:|>ãø<|close|>
The two-character block identifiers come from a fixed set encoded by the tokenizer as single tokens. Referencing a block therefore always costs two tokens, regardless of the identifier used.
The role remains one user turn, but its components become five separately addressable blocks. A sixth block, the execution block, connects them by stating that the model should run the specified instruction on the specified data, follow the two requirements, and write the result to the named assistant block.
A conventional template would flatten these components into one string and require the model to infer which part was the task, which was the subject, and which parts were constraints.
Addressing prompt-injection attacks
Indirect prompt injection occurs when a malicious instruction is hidden inside a data payload, such as a retrieved document, tool response, or user-provided value. LLMON’s explicit separation between instructions and data is intended to address this type of attack.
The LLMON preview models were compared with several open-source and closed-source models using the OPI benchmark. OPI places injections inside the data used for classic natural-language-processing tasks and evaluates several attack strategies.
Robustness is defined as 1 − attack success rate, representing the proportion of attacks in which the model does not follow the injected instruction.
The reported results show that non-LLMON models are highly susceptible, following injected instructions with high probability. On this benchmark, LLMON avoided 47% more attacks than the strongest frontier model tested and 95% more than the strongest open-source model tested.
Similar trends were observed on the ASB and StruQ benchmarks. These evaluations measure resistance to static indirect prompt injections. The instruction/data separation directly targets this category, while adaptive attacks that unfold across multiple chat turns remain an area of ongoing work.
General capability
The reported safety improvements do not reduce general capability. Across standard benchmark categories, the LLMON models perform on par with Granite 4.1 Instruct models.
For applications already using Granite 4.1 3B or 8B, the LLMON previews can be substituted without a conversion pipeline. Naming the parts of a turn, such as instruction, data, and requirement, is sufficient for the supplied chat template to render them as LLMON blocks.
The LLMON converters provide deeper handling for structured components. For example, a JSON document can be converted into typed, individually addressable LLMON blocks instead of being passed as one opaque string.
How the models were trained
The models begin with Granite 4.1 base checkpoints rather than the released instruct models. LLMON behavior was therefore learned during post-training instead of being added to an existing chat format.
LLMON defines six delimiters for marking tag boundaries, nesting structures, and anchoring references. These delimiters are installed in the tokenizer as reserved single tokens.
A conventional instruction-tuning corpus was re-serialized into LLMON. Each prompt component became an addressable block, and each turn received an execution block specifying the instruction, its inputs, and the output location. The task mix remained similar to that used for a conventional instruct model, including chat, multi-turn interactions, retrieval-augmented generation, and tool calling.
The training data also included decoy instruction and data blocks. These blocks appeared in the context but were deliberately left unbound, while the target output remained unchanged. This teaches the model to follow the dependencies specified by the execution block and ignore unrelated content.
Reinforcement learning followed through five sequential GRPO stages covering multi-domain reasoning, RLHF, knowledge calibration, and mathematics. A final DPO stage used 1,000 on-policy preference pairs generated from the model’s own responses to injection attempts.
The resulting privilege rule is learned from the layout rather than added as a separate guardrail:
- Instructions reached through an execution block are authoritative.
- Data, documents, tool schemas, and tool results supplied as inputs are material to read, not commands to follow.
- Instruction and data spans not referenced by the execution block are ignored.
This behavior is learned and is not an enforced guarantee. The LLMON Attention Visualization provides a way to examine how the model handles these relationships.
Domain-specific vocabularies with ScienceWorld
LLMON is not limited to one fixed schema. Developers can select tag names and structures for a particular domain, then fine-tune an adapter to read and produce them.
The project demonstrates this approach with ScienceWorld, a text-based benchmark in which an agent performs elementary science tasks, such as boiling water, one command at a time and receives a score from a simulator.
A vocabulary was defined for the planning trajectories used to solve these tasks. It includes tags such as:
instr.task.goalreq.planning_policy.ruledata.state.roomdata.state.inventoryassistant.next_action
Each step in the ScienceWorld reference solutions was rendered with these tags, and a LoRA adapter was tuned on top of an LLMON model. The resulting model played held-out games and generated its next action using the new vocabulary.
The ScienceWorld LoRA notebook covers the workflow from converting reference trajectories to playing test games and comparing the adapter with the untrained base model. A separate tool-calling agent notebook provides another example.
Experimental preview resources
The LLMON release is an experimental preview intended for exploration and evaluation rather than production use.
- Models: granite-4.1-3b-LLMON-preview and granite-4.1-8b-LLMON-preview
- Visualization: LLMON Attention Visualization
- Repository: github.com/generative-computing/llmon
- Mellea: github.com/generative-computing/mellea
- Papers: arXiv:2610.38120 and arXiv:2603.22519