SEAIApr 8, 2024

Guiding Large Language Models to Generate Computer-Parsable Content

arXiv:2404.05499v36 citationsh-index: 1
Originality Highly original
AI Analysis

This addresses the challenge of making LLM-generated content more usable for computer programs, representing a novel method for a known bottleneck.

The paper tackles the problem of guiding large language models to generate structured, computer-parsable content without fine-tuning, resulting in improved accuracy by 1.09 to 11.6 times and requiring only about 16.5% of samples for effective JSON generation.

We propose a method to guide Large Language Models (LLMs) in generating structured content adhering to specific conventions without fine-tuning. By utilizing coroutine-based content generation constraints through a pre-agreed context-free grammar (CFG), LLMs are directed during decoding to produce formal language compliant outputs. This enhances stability and consistency in generating target data structures, types, or instructions, reducing application development complexities. Experimentally, error rates of GPT-2 and Gemma exceed 95% for DSLs longer than 36 and 282 tokens, respectively. We introduce YieldLang, a coroutine-based DSL generation framework, and evaluate it with LLMs on various tasks including JSON and Mermaid flowchart generation. Compared to benchmarks, our approach improves accuracy by 1.09 to 11.6 times, with LLMs requiring only about 16.5% of the samples to generate JSON effectively. This enhances usability of LLM-generated content for computer programs.

Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes