Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Yes—but only for one part of the problem. An enum-style grammar built from an approved FAR/DFARS registry can prevent a language model from emitting a clause identifier that is not in that registry. In Raihan Sikder’s 2026 case study, fabricated identifiers fell from 57 of 60 prompts under free generation to 0 of 60 with the registry grammar. However, adding a NONE option produced a different failure: the model refused every prompt that named a clause number, including all 15 prompts naming real clauses. The practical lesson is to treat constrained decoding as an identifier-validity control, then add retrieval, semantic matching and verification for relevance and descriptions.

What the grammar actually guarantees

A decoding grammar restricts the tokens the model may emit at a particular field. In this experiment, the allowed field was an enum of canonical FAR and DFARS clause IDs compiled from a registry. The registry had 1,128 raw entries that collapsed to 1,056 distinct canonical clause identifiers. If the decoder selected an ID, that ID had to belong to the enum.

That is a membership guarantee, not a legal or semantic judgment. The grammar does not know whether the selected clause applies to the user’s contract, whether the question asks for a clause or a definition, or whether a generated title describes the selected clause accurately. A model can therefore output a real identifier for the wrong reason, or attach an invented description to it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Registry validity versus answer correctness

  • Registry validity: the emitted identifier appears in the approved set.
  • Relevance: the identifier addresses the user’s topic and contract context.
  • Grounding: titles, thresholds, dates and descriptions come from authoritative text rather than model memory.
  • Decision correctness: the system knows when to return a clause and when to abstain.

The grammar enforces only the first item. The other three require data retrieval, matching and verification.

How the FAR/DFARS test was structured

Sikder’s corrected version-2 test used Qwen2.5-1.5B-Instruct, 75 prompts, five decoding conditions and greedy decoding. The prompts were divided into four stated groups:

Prompt group Count Purpose
Fake topics 30 Absurd subjects with no single correct FAR/DFARS clause, designed to expose fabrication.
Real clauses 15 Questions naming genuine clause numbers.
Absent numbers 15 Questions naming clause numbers not present in the registry.
Obscure real topics 15 Less obvious but genuine subject areas.

The companion dataset records the prompt files, per-condition runs and summary counts. The evaluation was intentionally small: one 1.5B model, one prompt template for each kind, one greedy run, deliberately absurd fake topics, no fine-tuning and one abstention wording. The headline percentages should therefore be read as results for this setup, not as universal FAR/DFARS performance.

What happened with and without constraints

Free generation invented identifiers

On 60 prompts where no single clause was the correct answer, free generation produced fabricated clause numbers in 57 cases. That is the baseline failure the grammar was designed to stop. A model that is allowed to generate an unconstrained string can produce a number that looks like a FAR or DFARS identifier even when the topic has no appropriate clause.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The enum grammar eliminated out-of-registry IDs

With the enum grammar applied to the same class of prompts, fabricated identifiers fell to 0 of 60. Every emitted identifier was a member of the 1,056-ID canonical registry, so the grammar delivered exactly the narrow guarantee it promised: no identifier outside the approved set.

It did not guarantee that the member was relevant. One recorded output selected 52.227-7 and paired it with the invented title “Quantum Cryptography Requirements for Field Radios.” The number was valid in the registry; the title and the implied match to the question were not established by the registry.

Adding NONE improved abstention on fake topics but failed discrimination

The grammar-plus-NONE condition achieved a reported 62% overall good-answer rate across 60 judged prompts. On the 30 fake-topic prompts, it abstained on 22, reported as 73%. That is useful protection against confidently answering absurd requests, but it is not evidence that the model learned a reliable relevance boundary.

The strongest warning is the named-number test: grammar plus NONE answered NONE on all 30 prompts that supplied a clause number. Those 30 consisted of 15 real clause numbers and 15 absent numbers. It therefore scored 15 of 15 on absent-number cases by refusing them, while simultaneously refusing all 15 real-clause cases. The behavior was blanket refusal, not dependable real-versus-missing identification.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

On real-clause prompts, correctness mostly meant copying a number already present in the prompt. Titles were not grounded or graded. Free generation also copied the 15 named real numbers, so the grammar did not demonstrate deeper understanding of those clauses.

Why a valid ID can still be a wrong answer

An enum constrains the output vocabulary, not the reasoning path. Suppose a user asks about a niche cybersecurity requirement. The decoder may select any allowed ID because every member is syntactically legal. Without retrieval or a relevance score, the model has no enforced connection between the user’s words and the registry entry it chooses.

Descriptions are an independent risk. Clause numbers, titles and applicability notes are separate fields, and a valid number does not make a generated title true. A production response should therefore treat every field as requiring its own grounding check. Returning an approved ID alongside an unverified title can be more misleading than refusing to answer.

How to build a safer clause-selection pipeline

Use the grammar as one layer in a multi-stage system rather than as the legal-answer engine.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Normalize the registry. Deduplicate the 1,128 raw entries into canonical IDs, preserve source text and retain aliases or revision metadata. Keep the registry version and effective date with every record.
  2. Retrieve authoritative text. Search the current FAR/DFARS source for the user’s terms and return the clause text, title, scope and relevant paragraphs. Do not ask the model to reconstruct those fields from memory.
  3. Generate a constrained candidate. Make the clause-ID field an enum containing only approved canonical IDs. If the system supports structured output, keep the ID field separate from free-text explanation.
  4. Score semantic fit. Compare the retrieved clause and the user’s stated topic, contract context and requested action. Require evidence of a match rather than accepting membership as relevance.
  5. Verify every displayed field. Check the selected ID, official title, revision and quoted language against the retrieved source. Reject or regenerate any title or description that is not source-grounded.
  6. Handle abstention explicitly. Define when NONE is correct: no registry member matches the topic, the prompt lacks required context, or the available source is ambiguous. Do not let NONE become an unrestricted escape route.
  7. Escalate uncertain cases. For procurement decisions, show the matched source passage and route low-confidence or conflicting results to a qualified reviewer.

This design preserves the grammar’s hard guarantee while supplying the semantic and legal context it cannot provide on its own.

How to test an abstention branch properly

Evaluate answers and refusals separately. A system that says NONE to everything can look strong on a dataset containing many impossible questions, so report both sides of the decision:

  • Abstention precision: among refusals, how many truly lacked a suitable clause?
  • Abstention recall: among cases that should have been refused, how many were refused?
  • Answer precision: among returned IDs, how many were relevant and source-grounded?
  • Answer recall: among cases with a valid applicable clause, how many were answered rather than refused?

Balance the test with real and absent identifiers, straightforward and obscure topics, prompts that omit a clause number, and requests for titles or applicability. Include realistic ambiguity instead of only absurd fake topics. Test multiple phrasings and require the system to cite or quote the retrieved clause text so title hallucinations are visible.

Metrics to use when comparing constrained-decoding systems

Metric What it reveals Why it matters
Invalid-identifier rate How often output falls outside the approved registry. Measures the grammar’s primary guarantee.
Relevance or semantic accuracy Whether the selected clause actually addresses the question. Catches valid-but-irrelevant IDs.
Abstention precision and recall Whether NONE is selective rather than habitual. Separates useful caution from blanket refusal.
Title and field grounding Whether displayed metadata matches authoritative text. Detects invented titles such as the recorded 52.227-7 example.
Robustness Performance across model sizes, prompt styles and domains. Shows whether a result transfers beyond one 1.5B model and template.
Runtime overhead Token speed and latency cost of constrained decoding. Determines whether the control fits an interactive workflow.

The first run reported about a 10% token-speed cost for constrained decoding. That figure is an observed overhead in that run, not a fixed cost for every grammar, hardware setup or model.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Operational cautions for FAR and DFARS data

Clause registries and associated regulations change. A registry that was complete at ingestion can become stale after an amendment, renumbering, or agency-specific update. Record the registry revision, refresh it on a defined schedule, and recheck current regulations before operational use.

Keep the user’s jurisdiction, contract type, agency context and effective date in the retrieval query when those details affect applicability. If that context is missing, the correct response may be a clarifying question rather than either a guessed clause or an automatic NONE.

For auditability, log the prompt, registry version, retrieved passages, constrained candidate, verification result and final response. This makes it possible to distinguish a decoder failure from stale source data or an incorrect semantic match.

What this case study does—and does not—show

The experiment demonstrates a sharp reduction in out-of-registry identifiers: 57 of 60 fabricated numbers under free generation versus 0 of 60 with the enum grammar on the tested no-single-answer prompts. It also demonstrates that an abstention option can raise apparent scores by refusing difficult cases while refusing legitimate ones. The reported 62% good-answer rate is real for the 60 judged prompts, but it is substantially influenced by correct abstention on fake or absent cases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

It does not establish performance for larger models, sampling instead of greedy decoding, other prompt templates, broader clause coverage, fine-tuned systems or independent replications. Sikder’s concise conclusion captures the boundary: “Constrained decoding buys guarantees, not accuracy.”

Implementation checklist

  • Use an enum grammar when the requirement is strictly “never emit an identifier outside this approved set.”
  • Version and deduplicate the registry; preserve authoritative titles and text beside each canonical ID.
  • Retrieve current clause content before generating an explanation.
  • Match the clause to the user’s topic and contract context independently of ID validity.
  • Verify titles, descriptions, revisions and quoted language as separate fields.
  • Measure real-clause answers and absent-clause refusals as distinct outcomes.
  • Test NONE on balanced answerable and unanswerable cases.
  • Report invalid-ID rate, semantic accuracy, abstention precision/recall, grounding, robustness and latency.
  • Refresh FAR/DFARS sources and record the version used for every decision.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.