What is This?
Experience GPT2 (an early precursor to ChatGPT) running entirely in your browser. This project reimagines the "Spreadsheets-are-all-you-need" Excel implementation as an interactive web experience, making LLM architecture more accessible to a wider audience, especially web developers.
See It In Action
Watch how GPT2 works in your browser:
Why This Matters
The original "Spreadsheets-are-all-you-need" Excel project evolved into:
- A keynote track presentation at a major AI conference
- A highly rated online course on LLMs
- Core material in a university machine learning class
This browser-based version takes the next step in accessibility. Just as the web's "View Source" feature democratized web development, this project aims to demystify AI by letting anyone peek under the hood of a real language model. No Python or even Excel required, just your browser. You don't even need a server since everything runs locally (i.e. "offline first").
Want to dive deeper? Check out my highly rated AI course on Maven to master the inner workings of language models. We use this tool plus Google Sheets, Excel, and Python notebooks to provide a gentle introduction to how AI and LLMs work.
It's perfect for web developers, technical product managers, and engineering managers who need to get up to speed on AI quickly.
How It Works
The entire implementation uses web components ("cells") to perform GPT2's inference calculations right in your browser:
- The
sheet
components contain the mathematical formulas that power GPT2 - The
code
components define the JavaScript functions that support these calculations
This layered approach lets you explore the model at different levels of abstraction:
- Start with high-level
sheet
formulas to grasp the basic concepts - Dive into the
code
components to understand the detailed implementation
Built with web components, the implementation is:
- Easy to edit and enhance with additional educational content
- Compatible with learning management systems (LMS)
- Prepared for future features like AI-powered copilots that provide learning assistance (hopefully coming soon)
Current Limitations
- Developed and tested on desktop Chrome browser
- Does not currently support mobile devices (including iPhone)
Getting Started
To run GPT2 in your browser, you'll need to load the model parameters:
- Download the gpt2-small-csv.zip (~500MB) file to your computer.
- Extract the ZIP file
- Drag and drop all the extracted CSV files into the upload area below.
The model weights (about 1.5GB) will be stored in your browser's local database. You won't need to reload them unless you clear your browser data.
Enter Your Prompt
Now you're ready to run the model.
- Enter a prompt below or use the one predefined for you (our canonical "Mike is quick. He moves").
- Then just click the Run button and watch the model go to work!
Define Basic Matrix Operations
This section defines some basic matrix operations. Matricies are just simple 2D JavaScript arrays.
Tokenization Steps
This section tokenizes the prompt you entered into token using the Byte Pair Encoding (BPE) algorithm.
This step simply takes the prompt and parses it into separate words and punctuation.
Tokens to token embeddings steps
Positional Embedding Steps
Block (aka "Layer") Steps
The numbering of each step is designed to match the original Spreadsheets-are-all-you-need.ai Excel sheet. However, the numbering and breakdown of steps is arbitrary and can be rearranged.