Towards neuro-symbolic constrained decoding for reliable code generation with LLMs
Abstract
Large Language Models (LLMs) are increasingly used for code generation, but their reliability drops in domain-specific languages that require reasoning. We address this limitation with a neuro-symbolic framework that integrates LLM-based generation, token-level syntactic validation, and element-level logical reasoning. The system generates ordered lists of domain-specific elements, encoded as JSON objects, while enforcing syntactic rules and domain constraints. Our method combines grammar-constrained decoding with a symbolic constraint solver that filters valid continuations during inference. We illustrate the approach on data processing pipelines for railway topology queries and outline how the framework can be extended and generalized in future work.
Fields of Study & Subjects
Software Engineering Research
Natural Language Processing Techniques
Topic Modeling
Publication details
- Journal / source
- Gesellschaft für Informatik (GI)
- Publication date
- 1 January 2026
- Language
- EN