用语义类型提示让大模型更准地生成结构化数据
Meaning Typed Prompting: A Technique for Efficient, Reliable Structured Output Generation
- 将类型、含义和抽象概念融入提示,提升输出清晰度
- 在多个基准上准确率与一致性显著优于现有方法
- 适合需要稳定结构化输出的开发场景
将大语言模型扩展到高级应用,需要可靠的结构化输出生成。现有方法常依赖严格的JSON模式,导致输出不可靠、推理能力下降及计算开销增加,限制了大模型在复杂任务中的适应性。我们提出语义类型提示(MTP),一种高效结构化输出生成技术,将类型、语义及抽象概念(如变量、类)融入提示过程。通过使用丰富的类型定义,MTP增强了输出清晰度,减少了对复杂抽象的依赖,简化了开发流程,提升了实现效率。这使大模型能更好理解关系并生成结构化数据。在多个基准上的实证评估表明,MTP在准确率、可靠性、一致性和令牌效率方面均优于现有框架。我们还提出了实现MTP的Semantix框架,提供了实际应用的深入见解。
原文摘要 · Abstract (English)
Extending Large Language Models (LLMs) to advanced applications requires reliable structured output generation. Existing methods which often rely on rigid JSON schemas, can lead to unreliable outputs, diminished reasoning capabilities, and increased computational overhead, limiting LLMs' adaptability for complex tasks. We introduce Meaning Typed Prompting (MTP), a technique for efficient structured output generation that integrates types, meanings, and abstractions, such as variables and classes, into the prompting process. By utilizing expressive type definitions, MTP enhances output clarity and reduces dependence on complex abstractions, simplifying development, and improving implementation efficiency. This enables LLMs to understand relationships and generate structured data more effectively. Empirical evaluations on multiple benchmarks demonstrate that MTP outperforms existing frameworks in accuracy, reliability, consistency, and token efficiency. We present Semantix, a framework that implements MTP, providing practical insights into its application.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。