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

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 LLMdriven 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 1 .

Authors

Institutions

Publication Details

Published
2025-01-01
DOI
https://doi.org/10.18653/v1/2025.findings-acl.701
Citations
1
Primary Topic
Natural Language Processing Techniques
Type
article
Field-Weighted Citation Impact
2.48
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

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

Vaishak Belle, Elizabeth Polgreen, Yixuan Li, Weizhi Tang et al.
1 citations
Natural Language Processing Techniques
2.48
article

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

Vaishak Belle, Elizabeth Polgreen, Yixuan Li, Weizhi Tang, Chris Sypherd
article en
1 citations

Abstract

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 LLMdriven 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 1 .

University of Edinburgh (GB)
Quality Education
Openalex Percentile: Top 9%
Natural Language Processing Techniques
2.48
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

HyGenar: An LLM-Driven Hybrid Genetic Algorithm for Few-Shot Grammar Generation — Vaishak Belle, Elizabeth Polgreen, et al. · (2025) | TGRS Research Map | TGRS