A developer explored using constrained decoding with a grammar to prevent an LLM from fabricating clause numbers from the Federal Acquisition Regulation (FAR). The initial attempt showed a high rate of substitution, but upon revision, it was found that the model primarily abstained or refused to answer when faced with prompts requiring specific clause numbers. While the grammar successfully eliminated fabricated numbers, it did not improve the model's ability to identify the correct clause or distinguish between real and non-existent ones, leading to a high rate of refusal rather than accurate retrieval. AI
IMPACT Constrained decoding can guarantee against invented identifiers but does not ensure accuracy; retrieval augmentation may still be necessary.
RANK_REASON Developer's experiment with constrained decoding on an LLM to prevent fabricated output.
AI-generated summary · Google Gemini · from 1 sources. How we write summaries →