Related Experiment Video
Updated: May 24, 2026

Augmenting Large Language Models via Vector Embeddings to Improve Domain-Specific Responsiveness
Published on: December 6, 2024
Context-Free Grammar-Guided Generation of FHIR Resources Using Large Language Models
1University of Augsburg.
None:
Large Language Models (LLMs) have shown remarkable capabilities in medical information extraction and data transformation tasks. However, their unstructured outputs pose significant challenges for integration into clinical data pipelines. Fast Healthcare Interoperability Resources (FHIR) provides a standardized data model for encoding and exchanging medical information, yet its complexity, involving deeply nested structures, standardized coding systems, and strict syntactical rules, makes reliable generation challenging. While LLMs can be guided by linguistic grammars during token decoding to enforce structured outputs, designing such grammars for complex standards like FHIR remains difficult. We present a pipeline for synthesizing Context-Free Grammars (CFGs) from FHIR-derived JSON Schemas, enabling schema-conformant structured generation with LLMs. Our approach introduces relaxed key ordering to maintain structural validity while avoiding limitations of strict schema-guided approaches. Through systematic evaluation on 17 test cases across 5 categories using FHIR R5 resources, we demonstrate that CFG-guided generation achieves 76.5% validity in producing valid resources, compared to 41.2% for JSON Schema-guided and 17.6% for unguided generation. Furthermore, our approach successfully enforces value constraints (enumerated types, certain UCUM unit codes) and structural compliance that other methods fail to guarantee. We release our grammar synthesis pipeline as open-source to facilitate adoption in healthcare information systems.
Related Concept Videos
Language Development
The critical period for language acquisition suggests that the ability to acquire language is at its peak early in life. As people age, this proficiency decreases. Language development begins very...
Language
Corballis and Suddendorf (2007) and Tomasello and Rakoczy (2003) highlight the role of language in...
Components of Language
Language and Cognition
Genetic Lingo
Improving Translational Accuracy