Constrained Decoding Can Reverse Which Inputs Look Uncertain

Mayur Parvatikar


Abstract
Systems that must return valid JSON or a well-formed function call can request the format in the prompt or enforce it with constrained decoding, where a grammar blocks any token that would break the format and the remaining probabilities are rescaled to sum to one. Such systems may also read the entropy of that rescaled distribution as a confidence signal. When the grammar blocks the tokens holding most of the model’s probability, what remains had received little, and rescaling it can make a concentrated distribution look diffuse. We show this in an adversarial setting built for the purpose, a safety-aligned model refusing a harmful request the grammar does not let it express, against benign instructions. Reading both entropies at the first generated token on Qwen2.5-7B-Instruct and Llama-3.1-8B-Instruct, 50 prompts per class, the class ordering reverses, at AUROC 0.125 to 0.175 before the grammar and 0.613 to 0.750 after. Within a class the two readings are uncorrelated, so recalibration does not recover the pre-mask ordering. The two entropies measure different things, so systems should state which one they read, use the pre-mask one when the goal is the model’s own preference, and otherwise report how much probability the grammar let through. The reversal is confined to the first generated token and disappears once the prompt asks for the format, although the two readings then need not agree.
Anthology ID:
2026.uncertainlp-main.26
Volume:
The Proceedings of the Third Workshop on Uncertainty-Aware NLP
Month:
October
Year:
2026
Address:
Budapest, Hungary
Editors:
Wilker Aziz, Jonathan Berant, Bryan Eikema, Evgenia Ilia, Marie-Catherine de Marneffe, Barbara Plank, Artem Shelmanov, Swabha Swayamdipta, Jörg Tiedemann, Artem Vazhentsev, Raúl Vázquez, Chrysoula Zerva
Venues:
UncertaiNLP | WS
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
420–426
Language:
URL:
https://aclanthology.org/2026.uncertainlp-main.26/
DOI:
Bibkey:
Cite (ACL):
Mayur Parvatikar. 2026. Constrained Decoding Can Reverse Which Inputs Look Uncertain. In The Proceedings of the Third Workshop on Uncertainty-Aware NLP, pages 420–426, Budapest, Hungary. Association for Computational Linguistics.
Cite (Informal):
Constrained Decoding Can Reverse Which Inputs Look Uncertain (Parvatikar, UncertaiNLP 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.uncertainlp-main.26.pdf