MarkTechPost@AI 2024年09月21日
Sketch: An Innovative AI Toolkit Designed to Streamline LLM Operations Across Diverse Fields
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

Sketch是一个创新工具包,旨在简化LLM操作,确保格式化输出生成。它通过引入一组针对各种NLP任务的任务描述模式来解决LLM在生成结构化输出方面的挑战,例如JSON格式。Sketch使LLM能够轻松部署到未知任务中,同时保持输出格式的正确性和一致性。

🤔 Sketch的核心贡献在于简化了LLM的操作,通过预定义的模式,用户可以轻松地定义任务目标、标签系统和输出格式等特定要求,从而使LLM能够更灵活地适应各种NLP任务。

🚀 Sketch通过基于LLaMA3-8B-Instruct的模型微调和数据集创建来优化性能。它结合了约束解码框架,确保输出格式的精确控制,从而提高了LLM输出的可靠性和准确性。

⚙️ Sketch的架构包括四个关键步骤:模式选择、任务实例化、提示打包和生成。用户首先从一组预定义的模式中选择一个适合其NLP任务需求的模式。在任务实例化期间,用户将任务特定细节填充到所选模式中,创建一个JSON格式的任务实例。提示打包步骤将任务输入自动转换为结构化的提示,用于LLM交互,其中包含任务描述、标签架构、输出格式和输入数据。

📊 Sketch-8B在各种任务中增强了LLaMA3-8B-Instruct生成符合JSON模式约束的结构化数据的能力。微调过程侧重于两个关键方面:确保严格遵守JSON模式约束和培养强大的任务泛化能力。为了实现这一点,构建了两个目标数据集:NLP任务数据和模式遵循数据。

📈 评估结果表明,Sketch-8B-w.o.-ner在未知格式、领域和任务中表现出强大的泛化能力。在模式遵守方面,Sketch-8B-w.o.-ner在无约束条件下实现了96.2%的平均合法输出率,显著优于基线LLaMA3-8B-Instruct的64.9%。这种改进在20NEWS等复杂格式中尤为显著,Sketch-8B-w.o.-ner保持了高性能,而LLaMA3-8B-Instruct则完全失败。

🏆 与DeepSeek、ChatGLM和GPT-4o等主流模型相比,Sketch-8B-w.o.-ner在各种解码策略和数据集上表现出优异的性能。这表明Sketch是一个强大的工具,可以用于各种NLP任务,并有潜力彻底改变LLM在不同领域的操作。

🌟 Sketch的独特之处在于它能够在不牺牲响应质量和泛化能力的情况下,确保精确的格式化输出。这为需要结构化LLM输出的AI驱动应用程序开辟了新的可能性,并为各种NLP任务提供了可靠的解决方案。

💯 Sketch是一个有前途的框架,它通过简化LLM操作并确保格式化输出生成来解决LLM在生成结构化输出方面的挑战。它为各种NLP任务提供了可靠的解决方案,并有可能彻底改变LLM在不同领域的操作。

🎉 Sketch的贡献是显著的,它为LLM操作提供了一个强大的工具包,能够促进结构化输出生成,简化复杂任务,并提高LLM在各种NLP应用中的可靠性和准确性。

💪 Sketch的出现为LLM在各种领域中的应用开辟了新的可能性,并为研究人员和开发人员提供了一个强大的工具,用于构建更高效、更可靠的AI驱动应用程序。

🧠 Sketch的未来发展值得期待,它有潜力进一步增强LLM的性能,并为各种NLP任务提供更强大的解决方案。

💯 Sketch的出现标志着LLM操作的重大进步,它为研究人员和开发人员提供了强大的工具,用于构建更高效、更可靠的AI驱动应用程序。

🌟 Sketch的贡献是显著的,它为LLM操作提供了一个强大的工具包,能够促进结构化输出生成,简化复杂任务,并提高LLM在各种NLP应用中的可靠性和准确性。

🎉 Sketch的出现为LLM在各种领域中的应用开辟了新的可能性,并为研究人员和开发人员提供了一个强大的工具,用于构建更高效、更可靠的AI驱动应用程序。

🧠 Sketch的未来发展值得期待,它有潜力进一步增强LLM的性能,并为各种NLP任务提供更强大的解决方案。

💯 Sketch的出现标志着LLM操作的重大进步,它为研究人员和开发人员提供了强大的工具,用于构建更高效、更可靠的AI驱动应用程序。

Large language models (LLMs) have made significant leaps in natural language processing, demonstrating remarkable generalization capabilities across diverse tasks. However, due to inconsistent adherence to instructions, these models face a critical challenge in generating accurately formatted outputs, such as JSON. This limitation poses a significant hurdle for AI-driven applications requiring structured LLM outputs integrated into their data streams. As the demand for controlled and structured outputs from LLMs grows, researchers are confronted with the urgent need to develop methods that can ensure precise formatting while maintaining the models’ powerful language generation abilities.

Researchers have explored various approaches to mitigate the challenge of format-constrained generation in LLMs. These methods can be categorized into three main groups: pre-generation tuning, in-generation control, and post-generation parsing. Pre-generation tuning involves modifying training data or prompts to align with specific format constraints. In-generation control methods intervene during the decoding process, using techniques like JSON Schema, regular expressions, or context-free grammars to ensure format compliance. However, these methods often compromise response quality. Post-generation parsing techniques refine the raw output into structured formats using post-processing algorithms. While each approach offers unique advantages, they all face limitations in balancing format accuracy with response quality and generalization capabilities.

Researchers from the Beijing Academy of Artificial Intelligence, AstralForge AI Lab, Institute of Computing Technology, Chinese Academy of Sciences, University of Electronic Science and Technology of China, Harbin Institute of Technology, College of Computing and Data Science, Nanyang Technological University have proposed Sketch, an innovative toolkit designed to enhance the operation of LLMs and ensure formatted output generation. This framework introduces a collection of task description schemas for various NLP tasks, allowing users to define their specific requirements, including task objectives, labeling systems, and output format specifications. Sketch enables out-of-the-box deployment of LLMs for unfamiliar tasks while maintaining output format correctness and conformity. 

The framework’s key contributions include:

These advancements enhance the reliability and precision of LLM outputs, making Sketch a versatile solution for diverse NLP applications in both research and industrial settings.

Sketch’s architecture comprises four key steps: schema selection, task instantiation, prompt packaging, and generation. Users first choose an appropriate schema from a predefined set aligned with their NLP task requirements. During task instantiation, users populate the chosen schema with task-specific details, creating a JSON-format task instance. The prompt packaging step automatically converts the task input into a structured prompt for LLM interaction, integrating task description, label architecture, output format, and input data.

In the generation phase, Sketch can directly produce responses or employ more precise control methods. It optionally integrates the lm-format-enforcer, using context-free grammar to ensure output format compliance. In addition to that, Sketch uses the JSON-schema tool for output validation, resampling or throwing exceptions for non-compliant outputs. This architecture enables controlled formatting and easy interaction with LLMs across various NLP tasks, streamlining the process for users while maintaining output accuracy and format consistency.

Sketch-8B enhances LLaMA3-8B-Instruct’s ability to generate structured data adhering to JSON schema constraints across various tasks. The fine-tuning process focuses on two key aspects: ensuring strict adherence to JSON schema constraints and fostering robust task generalization. To achieve this, two targeted datasets are constructed: NLP task data and schema following data.

The NLP task data comprises over 20 datasets covering text classification, text generation, and information extraction, with 53 task instances. The schema following data includes 20,000 pieces of fine-tuning data generated from 10,000 diverse JSON schemas. The fine-tuning method optimizes both format adherence and NLP task performance using a mixed dataset approach. The training objective is formulated as a log-probability maximization of the correct output sequence given the input prompt. This approach balances improving the model’s adherence to various output formats and enhancing its NLP task capabilities.

The evaluation of Sketch-8B-w.o.-ner demonstrates its strong generalization capabilities across unknown formats, domains, and tasks. In schema adherence, Sketch-8B-w.o.-ner achieves an average legal output ratio of 96.2% under unconstrained conditions, significantly outperforming the baseline LLaMA3-8B-Instruct’s 64.9%. This improvement is particularly notable in complex formats like 20NEWS, where Sketch-8B-w.o.-ner maintains high performance while LLaMA3-8B-Instruct completely fails.

Performance comparisons reveal that Sketch-8B-w.o.-ner consistently outperforms LLaMA3-8B-Instruct across various decoding strategies and datasets. Compared to mainstream models like DeepSeek, ChatGLM, and GPT-4o, Sketch-8B-w.o.-ner shows superior performance on unknown format datasets and comparable results on unknown domain datasets. However, it faces some limitations on unknown task datasets due to its smaller model size.

The evaluation also highlights the inconsistent effects of constrained decoding methods (FSM and CFG) on task performance. While these methods can improve legal output ratios, they don’t consistently enhance task evaluation scores, especially for datasets with complex output formats. This suggests that current constrained decoding approaches may not be uniformly reliable for real-world NLP applications.

This study introduces Sketch, a significant advancement in simplifying and optimizing the applications of large language models. By introducing a schema-based approach, it effectively addresses the challenges of structured output generation and model generalization. The framework’s key innovations include a comprehensive schema architecture for task description, a robust data preparation and model fine-tuning strategy for enhanced performance, and the integration of a constrained decoding framework for precise output control.

Experimental results convincingly demonstrate the superiority of the fine-tuned Sketch-8B model in adhering to specified output formats across various tasks. The effectiveness of the custom-built fine-tuning dataset, particularly the schema following data, is evident in the model’s improved performance. Sketch not only enhances the practical applicability of LLMs but also paves the way for more reliable and format-compliant outputs in diverse NLP tasks, marking a substantial step forward in making LLMs more accessible and effective for real-world applications.


Check out the Paper. All credit for this research goes to the researchers of this project. Also, don’t forget to follow us on Twitter and join our Telegram Channel and LinkedIn Group. If you like our work, you will love our newsletter..

Don’t Forget to join our 50k+ ML SubReddit

FREE AI WEBINAR: ‘SAM 2 for Video: How to Fine-tune On Your Data’ (Wed, Sep 25, 4:00 AM – 4:45 AM EST)

The post Sketch: An Innovative AI Toolkit Designed to Streamline LLM Operations Across Diverse Fields appeared first on MarkTechPost.

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

Sketch LLM AI工具包 格式化输出 NLP 自然语言处理 人工智能
相关文章