StructuredRAG: JSON Response Formatting with Large Language Models

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Shorten, Connor, Pierse, Charles, Smith, Thomas Benjamin, Cardenas, Erika, Sharma, Akanksha, Trengrove, John, van Luijt, Bob
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866916363395661824
author Shorten, Connor
Pierse, Charles
Smith, Thomas Benjamin
Cardenas, Erika
Sharma, Akanksha
Trengrove, John
van Luijt, Bob
author_facet Shorten, Connor
Pierse, Charles
Smith, Thomas Benjamin
Cardenas, Erika
Sharma, Akanksha
Trengrove, John
van Luijt, Bob
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2408_11061
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle StructuredRAG: JSON Response Formatting with Large Language Models
Shorten, Connor
Pierse, Charles
Smith, Thomas Benjamin
Cardenas, Erika
Sharma, Akanksha
Trengrove, John
van Luijt, Bob
Computation and Language
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.
title StructuredRAG: JSON Response Formatting with Large Language Models
topic Computation and Language
url https://arxiv.org/abs/2408.11061