arXiv:2603.22519cs.SEcs.AI2026-03

用结构化标记语言让大模型更清楚理解提示中的指令与数据

LLMON: An LLM-native Markup Language to Leverage Structure and Semantics at the LLM Interface

  • 设计专用标记语言LLMON,区分提示中的指令与数据
  • 实验证明可提升模型准确率、安全性和抗注入攻击能力
  • 适合需要高可靠性提示工程的开发者和研究者

文本型大语言模型(LLMs)使用字符串作为输入输出接口,但实际提示中常包含指令(如“总结论文”)和数据(如论文内容),这些信息在传递时未被区分,易引发模型混淆和提示注入攻击等安全风险。本文提出一种面向大模型的标记语言LLMON(LLM Object Notation,读作“Lemon”),以自然方式表达提示的结构与语义元信息。该信息可用于模型训练、提示设计和推理实现,提升准确性、安全性和鲁棒性。其设计类比编程语言类型系统,支持静态检查、代码生成、动态校验与智能提示等功能。文章阐述了设计要求,介绍了LLMON语法,并通过初步实验验证其在训练与推理中的价值,同时探讨了由此带来的新研究方向。

原文摘要 · Abstract (English)

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.

提示工程大模型安全标记语言

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。