←back to thread

688 points crescit_eundo | 10 comments | | HN request time: 0.67s | source | bottom
Show context
snickerbockers ◴[] No.42144943[source]
Does it ever try an illegal move? OP didn't mention this and I think it's inevitable that it should happen at least once, since the rules of chess are fairly arbitrary and LLMs are notorious for bullshitting their way through difficult problems when we'd rather they just admit that they don't have the answer.
replies(2): >>42145004 #>>42145793 #
1. sethherr ◴[] No.42145004[source]
Yes, he discusses using a grammar to restrict to only legal moves
replies(4): >>42147380 #>>42148708 #>>42150800 #>>42152205 #
2. topaz0 ◴[] No.42147380[source]
Still an interesting direction of questioning. Maybe could be rephrased as "how much work is the grammar doing"? Are the results with the grammar very different than without? If/when a grammar is not used (like in the openai case), how many illegal moves does it try on average before finding a legal one?
replies(3): >>42147422 #>>42150017 #>>42151815 #
3. Jerrrrrrry ◴[] No.42147422[source]
an LLM would complain that their internal model does not refelct their current input/output.

Since LLM's knows people knock off/test/run afoul/mistakes can be made, it would then raise that as a possibility and likely inquire.

replies(1): >>42149652 #
4. ◴[] No.42148708[source]
5. causal ◴[] No.42149652{3}[source]
This isn't prompt engineering, it's grammar-constrained decoding. It literally cannot respond with anything but tokens that fulfill the grammar.
6. int_19h ◴[] No.42150017[source]
A grammar is really just a special case of the more general issue of how to pick a single token given the probabilities that the model spits out for every possible one. In that sense, filters like temperature / top_p / top_k are already hacks that "do the work" (since always taking the most likely predicted token does not give good results in practice), and grammars are just a more complicated way to make such decisions.
7. yshui ◴[] No.42150800[source]
I suspect the models probably memorized some chess openings, and afterwards they are just playing random moves with the help of the grammar.
replies(1): >>42151787 #
8. gs17 ◴[] No.42151787[source]
I suspect that as well, however, 3.5-turbo-instruct has been noted by other people to do much better at generating legal chess moves than the other models. https://github.com/adamkarvonen/chess_gpt_eval gave models "5 illegal moves before forced resignation of the round" and 3.5 had very few illegal moves, while 4 lost most games due to illegal moves.
9. gs17 ◴[] No.42151815[source]
I'd be more interested in what the distribution of grammar-restricted predictions looks like compared to moves Stockfish says are good.
10. thaumasiotes ◴[] No.42152205[source]
> he discusses using a grammar to restrict to only legal moves

Whether a chess move is legal isn't primarily a question of grammar. It's a question of the board state. "White king to a5" is a perfectly legal move, as long as the white king was next to a5 before the move, and it's white's turn, and there isn't a white piece in a5, and a5 isn't threatened by black. Otherwise it isn't.

"White king to a9" is a move that could be recognized and blocked by a grammar, but how relevant is that?