mlsanityData to 14 Oct 2026

Lost in Space: Finding the Right Tokens for Structured Output

arXiv 2502.14969 ↗First posted 20 Feb 2025cs.CLcited by 1

Not on the map. Why?

Abstract (arXiv)

General-purpose language models are trained to produce varied natural language outputs, but for some tasks, like annotation or classification, we need more specific output formats. LLM systems increasingly support structured output, which enforces formats by sampling tokens according to a grammar -- but also unpredictably reduces downstream performance. Are there systematic differences between grammars that appear semantically (and often visually) similar to humans? To answer this, we test four popular model families with five varying output formats on four common NLP benchmarks. We find all models perform most accurately when guided to use formats respecting convention, such as letters for multiple choice and real numbers for numerical prediction. Performance also improves by 5%-10% when guiding models to return tokens incorporating leading whitespace, with smaller models benefiting the most. We find leading whitespace helps models avoid structural deficiencies in subword token representations. We finally present best practices for researchers using language models as zero-shot classifiers with structured output.

Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 17 of its 37 references that are in the map. First posted on arXiv 20 Feb 2025.

Builds on

17 of 37 references.

References · 17

  1. 2024The Llama 3 Herd of Modelscited by 14,715
  2. 2020Measuring Massive Multitask Language Understandingcited by 7,963
  3. 2019BERTScore: Evaluating Text Generation with BERTcited by 5,512
  4. 2018Think you have Solved Question Answering? Try ARC, the AI2 Reasoning Challengecited by 4,886
  5. 2019HellaSwag: Can a Machine Really Finish Your Sentence?cited by 4,100
  6. 2019BoolQ: Exploring the Surprising Difficulty of Natural Yes/No Questionscited by 2,183
  7. 2018Can a Suit of Armor Conduct Electricity? A New Dataset for Open Book Question Answeringcited by 2,164
  8. 2024Gemma 2: Improving Open Language Models at a Practical Sizecited by 1,998
  9. 2018SentencePiece: A simple and language independent subword tokenizer and detokenizer for Neural Text Processingcited by 1,989
  10. 2018CommonsenseQA: A Question Answering Challenge Targeting Commonsense Knowledgecited by 1,822
  11. 2017SemEval-2017 Task 1: Semantic Textual Similarity - Multilingual and Cross-lingual Focused Evaluationcited by 1,001
  12. 2023ToxicChat: Unveiling Hidden Challenges of Toxicity Detection in Real-World User-AI Conversationcited by 231
5 more
  1. 2023Grammar-Constrained Decoding for Structured NLP Tasks without Finetuningcited by 197
  2. 2021Constrained Language Models Yield Few-Shot Semantic Parserscited by 163
  3. 2024Guiding LLMs The Right Way: Fast, Non-Invasive Constrained Generationcited by 101
  4. 2024How to Compute the Probability of a Wordcited by 36
  5. 2024Leading Whitespaces of Language Models' Subword Vocabulary Pose a Confound for Calculating Word Probabilitiescited by 30

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 1.

1 paper.