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