HyGenar: An LLM-Driven Hybrid Genetic Algorithm for Few-Shot Grammar Generation

要約

文法は、構文の定義、パーサーの作成、および構造化された出力を導くことにより、自然言語処理とテキスト/コード生成において重要な役割を果たします。
大規模な言語モデル(LLM)はドメイン全体で印象的な機能を示していますが、文法を推測して生成する能力はまだ徹底的に調査されていません。
このホワイトペーパーでは、少数のショット文法生成のLLMSの能力を研究および改善することを目指しています。ここでは、少数の肯定的および否定的な例のセットから文法が推測され、バックスナウの形で生成されます。
これを調査するために、540の構造化された文法生成の課題で構成される新しいデータセットを導入し、6つのメトリックを考案し、それに対して8つのさまざまなLLMを評価しました。
私たちの調査結果は、既存のLLMが文法生成で最適に機能することを明らかにしています。
これに対処するために、文法生成を最適化するために、LLM駆動型のハイブリッド遺伝的アルゴリズム、つまりHygenarを提案します。
Hygenarは、LLM全体で生成された文法の構文と意味の両方の正確性の両方で大幅な改善を達成します。

要約(オリジナル)

Grammar plays a critical role in natural language processing and text/code generation by enabling the definition of syntax, the creation of parsers, and guiding structured outputs. Although large language models (LLMs) demonstrate impressive capabilities across domains, their ability to infer and generate grammars has not yet been thoroughly explored. In this paper, we aim to study and improve the ability of LLMs for few-shot grammar generation, where grammars are inferred from sets of a small number of positive and negative examples and generated in Backus-Naur Form. To explore this, we introduced a novel dataset comprising 540 structured grammar generation challenges, devised 6 metrics, and evaluated 8 various LLMs against it. Our findings reveal that existing LLMs perform sub-optimally in grammar generation. To address this, we propose an LLM-driven hybrid genetic algorithm, namely HyGenar, to optimize grammar generation. HyGenar achieves substantial improvements in both the syntactic and semantic correctness of generated grammars across LLMs.

arxiv情報

著者 Weizhi Tang,Yixuan Li,Chris Sypherd,Elizabeth Polgreen,Vaishak Belle
発行日 2025-05-22 17:52:31+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.AI, cs.PL パーマリンク