TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Chess-LLM, using constrained-generation to force LLMs to battle it out

7 pointsby arkanoabout 1 year ago
As I was playing with the Outlines library (<a href="https:&#x2F;&#x2F;outlines-dev.github.io&#x2F;outlines&#x2F;" rel="nofollow">https:&#x2F;&#x2F;outlines-dev.github.io&#x2F;outlines&#x2F;</a>), I discussed with my friend Maxime how funny it would be if we set up a way to pair LLMs in chess matches till one wins. The first time I tried it, it required substantial prompt engineering to get some of those LLMs to propose valid moves. Large language models can mostly stay focused and even play rather well; see <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=37616170">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=37616170</a> for example. However small language models aren&#x27;t as easy to convince.<p>Some of those LLMs have seen very little chess notation and so after the first few opening moves there aren&#x27;t any valid tactics, let alone strategy, so they would end up either repeating the same move, or hallucinate moves that are not valid (Kxe5, but there would be a queen on e5!)<p>Then Outlines came along and we could force them to pick valid moves with little cost! Maxime worked super fast and got a first version of this idea as a gradio space.<p>I think it is pretty fun to see the (mostly terrible, but otherwise valid) chess that those LLMs play. Maybe it will even be instructive to how we can create small LLMs that can play much better than the ones on the leaderboard.<p>Anyway, you can check it out here:<p><a href="https:&#x2F;&#x2F;huggingface.co&#x2F;spaces&#x2F;mlabonne&#x2F;chessllm" rel="nofollow">https:&#x2F;&#x2F;huggingface.co&#x2F;spaces&#x2F;mlabonne&#x2F;chessllm</a><p>What is interactive about it: you can pick the LLMs from available models on HuggingFace (within reason, small LLMs are preferable so that the space does not crash) or push one of your own small models to HF and have it fight with others. At the end of the game the leaderboard is updated.<p>Hope you find it fun!

no comments

no comments