3 ms·
It should be impossible for an LLM to generate invalid code, as long as you force it to only generate tokens that the language allows.
by WithinReason 9mo ago
It should be impossible for an LLM to generate invalid code, as long as you force it to only generate tokens that the language allows.
- measurablefunc 9mo agoTokens do not encode semantics.
- WithinReason 9mo agoYou can choose which token to sample based on language semantics. You simply don't sample invalid ones. So the language should be restrictive on what tokens it allows enough that invalid code is impossible.
- SkiFire13 9mo ago> You can choose which token to sample based on language semantics Can you though? > the language should be restrictive on what tokens it allows This is a restriction on the language syntax, not its semantics.