StructuredRAG:大型语言模型的JSON响应格式化
StructuredRAG: JSON Response Formatting with Large Language Models
AI总结:
本文提出StructuredRAG基准,评估LLM生成JSON等结构化输出的能力,发现平均成功率82.55%且性能波动大,强调需提升可靠性与一致性。
摘要:
大型语言模型(LLMs)生成结构化输出(如JSON)的能力对于其在复合AI系统中的应用至关重要。然而,评估和改进这一能力仍然具有挑战性。在这项工作中,我们引入了StructuredRAG,一个包含六项任务的基准测试,旨在评估LLMs遵循响应格式指令的熟练程度。我们使用两种不同的提示策略,评估了两个最先进的LLMs:Gemini 1.5 Pro和经过4比特量化的Llama 3 8B-instruct。我们将这些提示策略命名为f-String和Follow the Format(FF)提示。在24项实验中,我们发现平均成功率为82.55%。我们进一步发现,不同任务、模型和提示策略之间的性能差异很大,成功率从0%到100%不等。我们发现Llama 3 8B-instruct通常与Gemini 1.5 Pro表现相当。我们观察到任务复杂性显著影响性能,涉及列表或复合对象输出的任务更具挑战性。我们的研究结果强调,需要进一步研究以提高LLMs结构化输出生成的可靠性和一致性。我们已在github.com/weaviate/structured-rag开源了我们的实验代码和结果。
英文摘要:
The ability of Large Language Models (LLMs) to generate structured outputs, such as JSON, is crucial for their use in Compound AI Systems. However, evaluating and improving this capability remains challenging. In this work, we introduce StructuredRAG, a benchmark of six tasks designed to assess LLMs' proficiency in following response format instructions. We evaluate two state-of-the-art LLMs, Gemini 1.5 Pro and Llama 3 8B-instruct with 4-bit quantization using two distinct prompting strategies. We introduce these prompting strategies as f-String and Follow the Format (FF) prompting. Across 24 experiments, we find an average success rate of 82.55%. We further find a high variance in performance across tasks, models, and prompting strategies with success rates ranging from 0 to 100%. We find that Llama 3 8B-instruct often performs competitively with Gemini 1.5 Pro. We observe that task complexity significantly influences performance, with tasks involving lists or composite object outputs proving more challenging. Our findings highlight the need for further research into improving the reliability and consistency of structured output generation in LLMs. We have open-sourced our experimental code and results at github.com/weaviate/structured-rag.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。