Skip to main content
QUICK REVIEW

[論文レビュー] StructuredRAG: JSON Response Formatting with Large Language Models

Connor Shorten, Charles Pierse|arXiv (Cornell University)|Aug 7, 2024
Topic ModelingComputer Science被引用数 3
ひとこと要約

この論文は、大規模言語モデル(LLM)のゼロショット構造的出力生成能力を評価するための、6つのRAGに類似したタスクからなるベンチマーク「StructuredRAG」を紹介している。主にJSONフォーマットに焦点を当て、Gemini 1.5 ProとLlama 3 8B-instructを用いたf-StringおよびFollow the Format(FF)プロンプティング手法を適用した結果、平均成功率は82.55%であった。タスク間での成功率のばらつきは大きく、0%から100%の範囲に及んでおり、リストや複合オブジェクトといった複雑な出力は、信頼性のある生成が著しく困難であることが判明した。

ABSTRACT

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.

研究の動機と目的

  • 構造的デコード手法を用いずに、LLMのゼロショットでの構造的JSON出力生成能力を評価すること。
  • リストや複合オブジェクトなどの複雑な構造的出力生成におけるパフォーマンスのボトルネックを特定すること。
  • f-StringプロンプティングとFollow the Format(FF)プロンプティングの2つの戦略の有効性を、異なるLLM間で比較すること。
  • モデル選択(Gemini 1.5 Pro 対 Llama 3 8B-instruct)またはプロンプティング戦略が、構造的出力の成功に顕著な影響を与えるかどうかを評価すること。
  • OPROのようなプロンプト最適化技術が、構造的デコードを用いずに構造的出力の信頼性を向上させることの可能性を示すこと。

提案手法

  • リtrieval-Augmented Generation(RAG)ワークフローに基づき、6つの構造的出力タスクからなるベンチマークを開発。テスト対象のJSON型には、プリミティブ値(文字列、整数、論理値)、文字列のリスト(List[string])、および複合オブジェクト(例:'answer' と 'confidence' フィールドを持つ 'AnswerWithConfidence')を含む。
  • RAGシステムの生成部分を孤立させるようにタスクを設計。一貫性のある入力を保証するため、112件のWikipediaベースの質問(56件のタイトルに、回答可能な質問と回答不可能な質問が含まれる)から構成されるキュレート済みデータセットを用いた。
  • Gemini 1.5 Pro(API経由)とLlama 3 8B-instruct(Ollama経由、4ビット量子化)の2つのLLMを評価。両者とも構造的デコードの使用を制限し、ベースラインのゼロショットパフォーマンスを評価した。
  • f-Stringプロンプティング(命令をプロンプト文字列に埋め込む)とFollow the Format(FF)プロンプティング(明示的なフォーマット指示)の2つのプロンプティング戦略を適用。
  • LLM出力を有効なJSONにパースできることを成功と定義。応答は、正しいキーと正しい値型を含んでいなければならない。
  • Llama 3 8B-instructに対してOPROプロンプト最適化を適用し、複雑なタスクでのパフォーマンスを向上。特に、複合オブジェクトのリスト生成タスクで100%の成功率を達成した。
Figure 1: An overview of our experimental results. Across 24 experiments, we achieve an average response format success rate of 82.55%. However, we find high variance in these results, 11 out of the 24 tests achieve 100% success, 2 out of 24 achieve 25% success or lower, and 5 of the tested methods
Figure 1: An overview of our experimental results. Across 24 experiments, we achieve an average response format success rate of 82.55%. However, we find high variance in these results, 11 out of the 24 tests achieve 100% success, 2 out of 24 achieve 25% success or lower, and 5 of the tested methods

実験結果

リサーチクエスチョン

  • RQ1LLMは、プリミティブ値、リスト、複合オブジェクトを含む多様な型において、ゼロショットで構造的JSON出力をどれほどうまく生成できるか?
  • RQ2f-StringプロンプティングとFollow the Format(FF)プロンプティングの違いが、構造的出力の成功確率に与える影響は何か?
  • RQ3モデル選択(Gemini 1.5 Pro 対 Llama 3 8B-instruct)が、構造的出力の信頼性に与える影響は何か?
  • RQ4特にリストやネストされた複合オブジェクトを含むタスクの複雑さが、生成パフォーマンスに与える影響はどの程度か?
  • RQ5OPROのようなプロンプト最適化技術が、構造的デコードを用いずに構造的出力の成功確率を顕著に向上させられるか?

主な発見

  • 24回の実験全体での平均成功率は82.55%であった。成功率のばらつきは大きく、11のタスクで100%の成功、2つのタスクでは25%未満、5つのタスクでは45%〜75%の間であった。
  • Gemini 1.5 ProはLlama 3 8B-instructを上回り、平均成功率は93.4%対71.7%であった。ただし、Llama 3 8B-instructは特定のタスクで競争力のあるパフォーマンスを示した。
  • f-StringプロンプティングとFFプロンプティング戦略の間で、全体の成功率に顕著な差は認められなかった。
  • 複雑な出力ではパフォーマンスが著しく低下した。特に、文字列のリストと複合オブジェクトのリストを生成するタスクで失敗率が最も高かった。Llama 3 8B-instructでは顕著に顕著な傾向が見られた。
  • OPROプロンプト最適化により、Llama 3 8B-instructは困難な「複合オブジェクトのリスト」タスクで100%の成功率を達成した。これはプロンプト工学の価値を示している。
  • 本研究は、構造的出力生成が依然として一貫性がなく、エラーが発生しやすく、特に複雑な型では顕著であることを明らかにした。信頼性の高いゼロショット生成のためのさらなる研究が求められる。
Figure 2: An illustration of the WikiQuestions dataset. Title-Abstract pairs are randomly sampled from Wikipedia. Gemini 1.5 Pro then synthesizes an answerable and unanswerable question for each. These generated questions are validated by a human annotator.
Figure 2: An illustration of the WikiQuestions dataset. Title-Abstract pairs are randomly sampled from Wikipedia. Gemini 1.5 Pro then synthesizes an answerable and unanswerable question for each. These generated questions are validated by a human annotator.

この論文を読む

Nubintのビューアで原文を開き、読みながら気になる箇所をすぐに質問できます。

Nubintでこの論文を読む

このレビューはAIが論文の原文をもとに作成しました。引用する前に原文をご確認ください。