Grammar Aligned Decoding: the good and bad

LLMs continue to push the boundaries of content generation, but they can struggle when the output needs to follow very strict rules, like writing code, generating formulas, or creating markup languages (like JSON or HTML). This begs the question: how do we generate highly structured outputs that are both grammatically correct and also contextually meaningful?