RLHF sawed off 'Decline': why LLMs hallucinate APIs and the one-line Flores fix
RandalSchwartz · reddit · 2026-10-12
The author argues code hallucination isn't a memory defect but a commitment problem. Ask a fresh chat whether PackageX has a native method and the model correctly says no; yet in a task prompt it reflexively answers "Certainly!" at Token 1, opens a code fence, and by Line 15 must invent a nonexistent method to close the syntax tree.
Key points:
- Framed via Winograd & Flores's 1986 Conversation for Action state machine: a performer has three legal moves—Promise, Counter-Offer, Decline. RLHF preference tuning cut the latter two, forcing an unconditional Promise.
- Because autoregressive generation is append-only, the model can't backspace once committed; its only escape is hallucinating the identifier that would exist if the promise were true.
- Proposed fix: a "Zero-Shot Flores Handshake" prompt that requires Witnessed Assertions (?Assert) first and explicitly authorizes ?Counter-Offer or ?Decline with a testable By-When, stopping the yes-man reflex before code generation starts.
- The author's spew Perl tool (1999), a reversed weighted BNF parser, serves as analogy: an LLM writing code is a multi-billion-parameter BNF un-parser.
More from coding & agent
- AAA studios fear the vibecoder who iterates on one kick 10,000 times, not one-shots — TAbrodi · 2026-10-12
- Opus 5.5 directs Jimeng CLI to auto-generate storyboards for surprisingly polished short films — op7418 · 2026-10-12
- Do you still need code review in the AI era? Testing, canary and rollback vs. human eyes — dotey · 2026-10-12
- Testing AI agents on flight booking: CAPTCHAs remain the biggest blocker — nicolechirps · 2026-10-12
- Meta's ReHarness adds backward revision to agent harnesses, beating memory and reflection baselines — Yuxin Xiao · 2026-10-12
- Free MCP Lets Claude Build and Edit Google Slides 5x Faster With 3x Fewer Tokens — No-Teacher235 · 2026-10-12