Playing Chess Against LLMs And The Mystery Of Instruct Models

At first glance, trying to play chess against a large language model (LLM) seems like a daft idea, as its weighted nodes have, at most, been trained on some chess-adjacent texts. It has no concept of board state, stratagems, or even whatever a ‘rook’ or ‘knight’ piece is. This daftness is indeed demonstrated by [Dynomight] in a recent blog post (Substack version), where the Stockfish chess AI is pitted against a range of LLMs, from a small Llama model to GPT-3.5. Although the outcomes (see featured image) are largely as you’d expect, there is one surprise: the gpt-3.5-turbo-instruct model, which seems quite capable of giving Stockfish a run for its money, albeit on Stockfish’s lower settings.

Each model was given the same query, telling it to be a chess grandmaster, to use standard notation, and to choose its next move. The stark difference between the instruct model and the others calls investigation. OpenAI describes the instruct model as an ‘InstructGPT 3.5 class model’, which leads us to this page on OpenAI’s site and an associated 2022 paper that describes how InstructGPT is effectively the standard GPT LLM model heavily fine-tuned using human feedback.

Continue reading “Playing Chess Against LLMs And The Mystery Of Instruct Models”

White pieces on a teal and white chess board. The line of pawns shows three segmented queens in the foreground, one piece being pressed by a man's hand from above in a state between queen and pawn, and the remainder of the pawns in the background in the pawn state.

Transforming Pawn Changes The Game

3D printing has allowed the hobbyist to turn out all sorts of interesting chess sets with either intricate details or things that are too specialized to warrant a full scale injection molded production run. Now, the magic of 3D printing has allowed [Works By Design] to change the game by making pawns that can automatically transform themselves into queens.

Inspired by a CGI transforming chess piece designed by [Polyfjord], [Works By Design] wanted to make a pawn that could transform itself exist in the real world. What started as a chonky setup with multiple springs and a manually-actuated mechanism eventually was whittled down to a single spring, some pins, and four magnets as vitamins for the 3D printed piece.

We always love getting a peek into the trial-and-error process of a project, especially for something with such a slick-looking final product. Paired with a special chess board with steel in the ends, the magnets in the base activate the transformation sequence when they reach the opposite end.

After you print your own, how about playing chess against the printer? We’d love to see a version machined from metal too.

Thanks to [DjBiohazard] on Discord for the tip!

Continue reading “Transforming Pawn Changes The Game”

Playing Chess Against Your Printer, With PostScript

Can you play chess against your printer? The answer will soon be yes, and it’s thanks to [Nicolas Seriot]’s PSChess. It’s a chess engine implemented in PostScript, of all things. It’s entirely working except for one last hurdle, but more on that in a moment.

What’s it like to play PSChess? Currently, one uses a PostScript interpreter (such as GhostScript) to run it, much like one would use the Python interpreter to run Python code. The user inputs moves by typing in commands like d2d4 (representing a piece’s source coordinate and a destination coordinate on the 2D board). Then the program makes a move, and outputs an updated board state to both the console and a PDF document. Then it’s the user’s turn again, and so on until somebody loses.

The chess parts are all working, but there’s one last feature in progress. The final step of the project is to enable PSChess to be run directly on a printer instead of using GhostScript as the interpreter. Intrigued? You can find the code at the project’s GitHub repository.

So why PostScript? While it is a Turing-complete stack-based interpreted language, it was never intended to be used directly by humans. There are no meaningful development tools to speak of. Nevertheless, [Nicolas] finds PostScript an appealing tool for programming projects and provides tips and techniques for like-minded folks. One of the appeals is working within constraints to solve a problem, just like implementing a chess engine in only 4k, or draw poker in 10 lines of BASIC.

Hackaday Links Column Banner

Hackaday Links: January 7, 2024

Oh, perfect — now our cars can BSOD. At least that’s how it looks from a forum post showing a Blue Screen of Death on a Ford Mustang Mach E, warning that an over-the-air software update failed, and now the car can’t be driven. The BSOD includes a phone number to reach Ford’s Customer Relationship Center and even presents a wall of text with specific instructions to the wrecker driver for loading the bricked vehicle onto a flatbed. Forum users questioned the photo’s veracity, but there are reports of other drivers getting bricked the same way. And we’ve got to point out that even though this specific bricking happened to an EV, it could just have easily happened to an ICE vehicle too; forum members were particularly prickly about that point. It would be nice if OTA software updates on vehicles could always roll back to the previous driveable state. Still, we suppose that’s not always possible, especially if memory gets corrupted during the update. Maybe the best defense against a bricked vehicle would be to keep a beater around that doesn’t need updates to keep running.

Continue reading “Hackaday Links: January 7, 2024”

The Quaint History Of The Commodore ChessMate

The Commodore International of the 1970s was a company which dabbled in a bit of everything when it came to consumer electronics, with the Commodore ChessMate being a prime example of the circuitous way that some of its products came to be. Released in 1978, its existence was essentially the result of MOS Technology releasing the KIM-1 single board computer in 1976. In May of that year, [Peter Jennings] traveled all the way from Toronto, Canada to Cleveland, USA to attend the Midwest Regional Computer Conference and acquire a KIM-1 system and box of manuals for a mere $245. On this KIM-1 he’d proceed to develop his own chess game, called MicroChess, implemented fully in 6502 ASM to fit within the 1 kB of RAM.

As one of the first major applications to run on the KIM-1, it quickly became an international hit, which caught the attention of Commodore – which had acquired MOS Technology by then – who ended up contacting [Peter] about a potential chess computer project. This turned out to based on the custom MOS 6504 CPU, while sharing many characteristics with the KIM-1 SBC. Being a MicroChess-only system, the user experience was optimized for more casual users, with the user manual providing clear instructions on how to start a new game and how to enter the position of a newly moved piece, along with no less than eight difficulty settings.

If you’re feeling like making your own ChessMate, or want to dig into the technical details, this excellent article by [Hans Otten] has got you covered.

Top image: Commodore ChessMate Prototype in 1978. (Credit: Peter Jennings)

(Thanks to [Stephen Walters] for the tip)

The Chess Computer From 1912

Who was [Leonardo Torres Quevedo]? Not exactly a household name, but as [IEEE Spectrum] points out, he invented a chess automaton in 1920 that would foreshadow the next century’s obsession with computers playing chess.

Don’t confuse this with the infamous Mechanical Turk, which appeared to be a chess computer but was really a guy hiding inside a fake chess computer. The Spanish engineer’s machine really did play a modified end game. The chessboard was vertical, and pegs represented pieces. There were mechanical arms to move the pegs. The device actually dates back to 1912, with a public demonstration in Paris in 1914. Given [Quevedo’s] native language, the machine was called El Ajedrecista.

Continue reading “The Chess Computer From 1912”

A Chess AI In Only 4K Of Memory

The first computer to ever beat a reigning chess world champion didn’t do so until 1996 when a supercomputer built by IBM beat Garry Kasparov. But anyone who wasn’t a chess Grandmaster could have been getting beaten by chess programs as early as 1979 when Atari released one of the first ever commercially-available chess video games for the Atari 2600. The game was called Video Chess and despite some quirky gameplay it is quite impressive that it was able to run on the limited Atari hardware at all as [Oscar] demonstrates.

The first steps of getting under the hood of this program involved looking into the mapping of the pieces and the board positions in memory. After analyzing some more of the gameplay, [Oscar] discovered that the game does not use trees and nodes to make decisions, likely due to the memory limitations, but rather simulates the entire game and then analyzes it to determine the next step. When the game detects that there are not many pieces left on the board it can actually increase the amount of analysis it does in order to corner the opposing king, and has some unique algorithms in place to handle things like castling, finishing the game, and determining valid movements.

Originally it was thought that this engine couldn’t fit in the 4K of ROM or work within the 128 bytes of system memory, and that it was optimized for the system after first developing a game with some expanded capabilities. The game also has a reputation for making illegal moves in the higher difficulty settings although [Oscar] couldn’t reproduce these bugs. He also didn’t get into any of the tricks the game employed just to display all of the pieces on the screen. The AI in the Atari game was a feat for its time, but in the modern world the Stockfish open-source chess engine allows for a much more expanded gameplay experience.