Andrej Karpathy ने इस सप्ताह microgpt.py को चुपचाप GitHub Gists पर डाला — एक single Python file जो standard library के सिर्फ़ `os`, `math` और `random` से एक GPT को train करती और inference चलाती है। न PyTorch, न NumPy, न TensorFlow, न GPU। gist कुछ ही दिनों में 5,000 stars और 2,400 forks पार कर गई। Karpathy की docstring में framing असामान्य रूप से दृढ़ है: "pure, dependency-free Python में GPT को train करने और inference चलाने का सबसे atomic तरीक़ा। यह file पूरा algorithm है। बाक़ी सब सिर्फ़ efficiency है।" No Priors podcast interview में उन्होंने मूल कहानी जोड़ी: उन्होंने यह पूरी तरह हाथ से लिखी क्योंकि उनके आज़माए किसी भी LLM agent ने GPT training का सार एक स्पष्ट single file में नहीं निकाला।
architecture GPT-2 का अनुसरण करती है, पर तीन जान-बूझकर सरलीकरणों के साथ: LayerNorm की जगह RMSNorm, किसी भी linear layer पर bias नहीं, GeLU की जगह ReLU। default hyperparameters छोटे हैं — 1 layer, 16-dim embeddings, 4 attention heads (हर एक 4-dim), block size 16 — Karpathy की classic makemore वाली `names.txt` पर character-level training के लिए। autograd एक 40-line वाला `Value` class है (मूलतः micrograd का pattern), topological sort वाला backward pass, और inline Adam optimizer linear LR decay के साथ 1,000 steps तक। inference 20 hallucinated नाम sample करता है। पूरा कुछ एक screen में आ जाता है अगर monitor काफ़ी चौड़ा हो। forks पहले ही एक NumPy port पैदा कर चुके हैं जो scalar autograd से लगभग 250× तेज़ चलता है, एक Julia matrix संस्करण, एक JavaScript port जो browser में ~4000 parameters के साथ चलता है, और एक microgpt-denovo project जो दिखाता है कि एक agent अब इस file को high-level spec से दोबारा बना सकता है — Karpathy की शुरुआत में कही "मेरे agents इसे बंद नहीं कर पा रहे" वाली loop को बंद करते हुए।
यहाँ ecosystem संकेत है: pedagogy ही moat है। आज के अधिकांश pretraining infrastructure abstraction की परतें हैं — CUDA पर PyTorch, hardware-specific kernels पर CUDA — जो algorithm को उन practitioners से छिपा देते हैं जो उस पर निर्भर हैं। microgpt.py de-abstraction है: यह एक साथ दिखाता है transformer का forward pass, backward chain rule, RMSNorm scaling, multi-head attention, KV-cache append, max-subtract trick वाला softmax, और Adam के moment buffers। जो कोई Llama fine-tune कर रहा है, training run debug कर रहा है, या custom CUDA kernels लिख रहा है — उसके लिए यह एक screen transformers पर manual के आधे chapters से ज़्यादा काम की है। community fork pattern — benchmarks, alt-language ports, agent-reconstructions — एक live experiment भी है कि LLM-related educational code अब अपने आप में एक coordination layer है या नहीं।
सोमवार सुबह के builder के लिए: gist clone करो, `python microgpt.py` चलाओ, और CPU पर कुछ मिनटों में देखो कि एक transformer character-level name generation पर converge कर रहा है। अगर तुमने कभी OpenAI या Anthropic API के ख़िलाफ़ कोड भेजा है बिना end-to-end एक forward pass trace किए, तो यह उसे ठीक करने का सबसे सस्ता तरीक़ा है। अगर तुम models train करते हो, अपने junior engineers को इसे reading exercise के तौर पर दो — यह वह framework का परदा हटा देता है जो "यह loss क्या कर रहा है?" का जवाब देना मुश्किल बनाता है। साथ का no-priors interview वही जगह है जहाँ Karpathy समझाते हैं कि क्यों उन्हें लगता है कि current agent capability अब भी इस file को बिना prompt के शुरू से लिखने की सीमा से नीचे है — एक उपयोगी capability marker।
