Repository logo
  • Log In
    Log in via Symplectic to deposit your publication(s).
Repository logo
  • Communities & Collections
  • Research Outputs
  • Statistics
  • Log In
    Log in via Symplectic to deposit your publication(s).
  1. Home
  2. Faculty of Engineering
  3. Computing
  4. Computing
  5. Learning and enforcing context-sensitive control for LLMs
 
  • Details
Learning and enforcing context-sensitive control for LLMs
File(s)
2025.acl-srw.59.pdf (482.85 KB)
Published version
Author(s)
Albinhassan, Mohammad
Madhyastha, Pranava
Law, Mark
Russo, Alessandra
Type
Conference Paper
Abstract
Controlling the output of Large Language Models (LLMs) through context-sensitive constraints has emerged as a promising approach to overcome the limitations of Context-Free Grammars (CFGs) in guaranteeing generation validity. However, such constraints typically require manual specification—a significant barrier demanding specialized expertise. We introduce a framework that automatically learns context-sensitive constraints from LLM interactions through a two-phase process: syntactic exploration to gather diverse outputs for constraint learning, followed by constraint exploitation to enforce these learned rules during generation. Experiments demonstrate that our method enables even small LLMs (1B parameters) to learn and generate with perfect constraint adherence, outperforming larger counterparts and state-of-the-art reasoning models. This work represents the first integration of context-sensitive grammar learning with LLM generation, eliminating manual specification while maintaining generation validity.
Date Issued
2025-07-27
Date Acceptance
2025-07-01
Citation
Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 4: Student Research Workshop), 2025, pp.834-842
URI
https://hdl.handle.net/10044/1/125701
URL
https://doi.org/10.18653/v1/2025.acl-srw.59
DOI
10.18653/v1/2025.acl-srw.59
ISSN
0736-587X
Publisher
Association for Computational Linguistics
Start Page
834
End Page
842
Journal / Book Title
Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 4: Student Research Workshop)
Volume
4
Copyright Statement
Copyright © 2025 ACL. Permission is granted to make copies for the purposes of teaching and research. Materials published in or after 2016 are licensed on a Creative Commons Attribution 4.0 International License.
License URL
https://creativecommons.org/licenses/by/4.0/
Source
The 63rd Annual Meeting of the Association for Computational Linguistics
Publication Status
Published
Start Date
2025-07-27
Finish Date
2025-08-01
Coverage Spatial
Vienna, Austria
About
Spiral Depositing with Spiral Publishing with Spiral Symplectic
Contact us
Open access team Report an issue
Other Services
Scholarly Communications Library Services
logo

Imperial College London

South Kensington Campus

London SW7 2AZ, UK

tel: +44 (0)20 7589 5111

Accessibility Modern slavery statement Cookie Policy

Built with DSpace-CRIS software - Extension maintained and optimized by 4Science

  • Cookie settings
  • Privacy policy
  • End User Agreement
  • Send Feedback