Chess Engine in 84,688 Regexes

2025-01-07

Nicholas Carlini built a 2-ply minimax chess engine using a mind-bending 84,688 regular expressions as a holiday project. He designed a regex-based virtual machine with a branch-free, conditional-execution, SIMD instruction set. A symbolic execution compiler translates Python code into regex sequences, enabling parallel computation. The engine leverages SIMD to calculate moves for multiple pieces simultaneously, with clever regex optimizations for speed. While limited in depth, it showcases the surprising computational power of regular expressions.

Read more
Development regex chess engine

AI-Generated Website: An Experiment in Skill vs. Knowledge

2024-12-31

Security researcher Nicholas Carlini conducted a twelve-day experiment: rewriting his website homepage and bio daily using a different language model. He found that while models excelled at generating visually stunning webpages, they faltered significantly in factual accuracy. For example, the o1-mini model generated a webpage with 43 statements; 32 were completely false, 9 had major errors, and only 2 were factually correct. This highlights the vast discrepancy between "skill" (generating webpages) and "knowledge" (factual accuracy) in LLMs, underscoring the need for caution when relying on AI-generated content.

Read more

ChatGPT Clone in 3000 Bytes of C

2024-12-12

Developer Nicholas Carlini created a ChatGPT clone using only 3000 bytes of C code, powered by the GPT-2 model. This dependency-free implementation loads GPT-2's weight matrix and BPE file, then performs tokenization, matrix operations, transformer inference, and detokenization. While the output quality is not high, its efficiency is remarkable, producing multiple replies per second on modern hardware. This demonstrates the potential of compact code in implementing complex AI models.

Read more
AI