explainx.ainewsletter3.5k
TrendingNewsPathwaysSkills
Pricing
explainx.ai

Upskill in AI — 16 free pathways, live workshops & bootcamps, and 50+ courses from practitioners. Plus the skills, tools, and MCP servers to practice on.

follow us

corporate training

support@explainx.ai

get started

Find your pathTake Free Evaluation

learn

pathways — start freeworkshopsbootcampscoursescertificationsmock testsexplainx universitycorporate traininglearn skills & mcp

discover

skillsmcp serversexplainx mcptoolsagentsllmsdesignsdictionaryagi trackerranks

company

aboutvisionmissionteaminstructorscommunityhackathonscareers

content

daily AI newsstate of AI — live resultsblogreleasespromptsgeneratorsresource libraryfor LLMsexplainx.ai kids

solutions

all solutionsdeveloper upskillingmarketing upskillingproduct manager upskillingleadership upskilling

newsletter · weekly

Get AI news, tools, and insights in your inbox.

supportprivacytermsdata rightshow we create contentsubmission guidelines

© 2026 AISOLO Technologies Pvt Ltd

  1. Home
  2. /
  3. Dictionary
  4. /
  5. Constrained Decoding
Inference & Deploymentaka Grammar-Constrained Decodingaka GBNF

Constrained Decoding

Constrained decoding restricts token sampling at each generation step so the output cannot violate a supplied grammar or schema.

Ask Melo about this← all terms

At every step the sampler masks out tokens that would break the declared structure, leaving the model to choose only among legal continuations. llama.cpp implements this with GBNF grammar files, a BNF-like notation, which makes malformed JSON, unbalanced quotes, or invalid shell syntax structurally impossible rather than merely improbable. It fixes form, not meaning: a grammatically valid output can still be semantically wrong.

Related terms

Decoding StrategyOutput SchemaInference EngineLogit