{"type":"ScholarlyArticle","title":"Grammar-State Aware Beam Search for Enhancing Structural Diversity in LLM Generation","authors":[{"name":"Hantao Hua","slug":"hantao-hua","given":"Hantao","family":"Hua","affiliation":""},{"name":"Jiming Su","slug":"jiming-su","given":"Jiming","family":"Su","affiliation":""},{"name":"Yiping Yao","slug":"yiping-yao","given":"Yiping","family":"Yao","affiliation":""},{"name":"Feng Zhu","slug":"feng-zhu","given":"Feng","family":"Zhu","affiliation":""}],"abstract":"In many large language model (LLM) applications, generating structurally diverse candidate outputs is crucial for downstream decision-making and reasoning. However, conventional beam search allocates search budget at the token-prefix level, so multiple beam slots may be occupied by lexically different but structurally similar hypotheses. To address these limitations, we propose Grammar-State Aware Beam Search (GSA-Beam). Our method first organizes search at the constraint state level rather than individual prefix level, enabling explicit control over structural diversity. It further incorporates a dynamic state-level beam regulation mechanism that adaptively adjusts beam allocation based on the branching of constraint states, efficiently exploring the feasible structured solution space. Experiments on JSON-schema constrained generation show that GSA-Beam improves explicit state coverage and final structural diversity while preserving schema validity; across several LLM backbones, it reduces reference latency by 22.5% on average compared with standard constrained beam search. Code is available at https://github.com/Paradozile/GSABeam.","doi":"10.24963/ijcai.2026/639","url":"https://ijcai.org/proceedings/2026/639","pdf":"https://ijcai.org/proceedings/2026/0639.pdf","markdown":"https://ijcai.org/proceedings/2026/639.md","bibtex":"https://ijcai.org/proceedings/2026/bibtex/639","volume":{"slug":"2026","title":"Proceedings of the Thirty-Fifth International Joint Conference on Artificial Intelligence","short_title":"IJCAI 2026","url":"https://ijcai.org/proceedings/2026/","year":2026,"location":"Bremen, Germany","dates":"15-21 August 2026","editors":"Diego Calvanese","isbn":"978-1-956792-09-6","publisher":"International Joint Conferences on Artificial Intelligence Organization","doi_prefix":"10.24963/ijcai.2026"},"section":"Natural Language Processing","track":"Main Track","number":639,"pages":{"first":5739,"last":5747},"keywords":["Natural Language Processing: Language models","Natural Language Processing: Applications","Natural Language Processing: Language generation","Machine Learning: Generative models","Machine Learning: Structured prediction"],"videos":[],"references":[],"license_note":"Copyright International Joint Conferences on Artificial Intelligence."}