Discover and explore top open-source AI tools and projects—updated daily.
milanmPure C# GPT implementation for learning
New!
Top 85.6% on SourcePulse
A complete GPT language model implementation in pure C#, covering both training and inference, with zero external dependencies. It serves as an educational tool for developers and researchers aiming to understand the core algorithms behind models like ChatGPT, offering a faithful port of Andrej Karpathy's microgpt.py. The primary benefit is demystifying complex ML concepts through a self-contained, understandable codebase.
How It Works
The project implements a character-level GPT model using a custom autograd engine (Value class) for automatic differentiation via backpropagation. It employs a modern transformer architecture featuring a pre-norm design with RMSNorm, multi-head attention (Q·K/√d), and a feed-forward MLP utilizing squared ReLU activation. Weight tying is used between input token embeddings and output projections. Unlike production systems, it processes data serially (one number at a time) to illustrate fundamental concepts, making it an accessible learning resource.
Quick Start & Requirements
src/AutogradEngine and run dotnet run.Highlighted Details
Maintenance & Community
No specific details regarding maintainers, community channels (e.g., Discord, Slack), or project roadmap are present in the README.
Licensing & Compatibility
Limitations & Caveats
This project is explicitly an educational tool, not production-ready code. Its scalar, single-number processing approach makes it orders of magnitude slower and less scalable than industrial GPT implementations. The example trains a very small model on a limited dataset with a small context window.
1 week ago
Inactive
huggingface
dair-ai