To guarantee an LLM outputs one of a fixed set of labels ("positive", "negative", "neutral"), constrained decoding masks out every token that can't lead to a valid answer.
Unlock this and every premium problem across all tracks — plus hidden-test grading, advanced AI engineering modules and new content every week.
Start 7-day free trial