← Open Source
dabochen

spreadsheet-is-all-you-need

A nanoGPT pipeline packed in a spreadsheet.

TutorialsLLM fundamentals
Open on GitHub
Momentum
+0stars in 24 hours0.0%
2.16k
Stars
130
Forks
+-1
This week
3
Contributors
Created 2024-06-08 · Updated 2026-10-10 · #8916 today
Top developers
dabochenfabrie-teamsdodgymike

dabochen/spreadsheet-is-all-you-need is ranked 8,916 with 2,158 stars.

Same-category comparison

dabochen/spreadsheet-is-all-you-need is ranked 8,916 among these 8 peers; codenihar/ml is ranked 8,920.

Same-category comparison
NameRankMetrics
erhwenkuo/deep-learning-with-keras-notebooks8,873
Language:
Jupyter Notebook
Stars:
2,197
Forks:
674
Description:
Jupyter notebooks for using & learning Keras.
Fabsqrt/BitTiger8,885
Stars:
2,187
Forks:
549
yao62995/tensorflow8,904
Stars:
2,168
Forks:
587
km1994/LLMsNineStoryDemonTower8,907
Stars:
2,166
Forks:
205
codenihar/ml8,920
Stars:
2,154
Forks:
61
Description:
This repo contains all the resources related to the massive mass coders machine learning series.
greshake/llm-security8,924
Language:
Jupyter Notebook
Stars:
2,149
Forks:
160
Description:
New ways of breaking app-integrated LLMs.
SharifiZarchi/Introduction_to_Machine_Learning8,925
Language:
Jupyter Notebook
Stars:
2,146
Forks:
410
Description:
Machine Learning Course, Sharif University of Technology.
prabhuomkar/pytorch-cpp8,930
Language:
C++
Stars:
2,142
Forks:
272
Description:
C++ Implementation of PyTorch Tutorials for Everyone.
Key parameters and specifications
Key parameters and specifications
ParameterValue
CategoryTutorials
SubcategoryLLM fundamentals
KeywordsEducation, Math, Model architecture, Visualization
Stars2,158
Forks130
Contributors3
Created date2024-06-08
Updated date2026-10-10
Stars in 1 day0
Stars in 7 days-1
Rank8,916
Previous rank8,974
Rank change58
7-day stars rank16,941
Previous 7-day stars rank16,939
7-day stars rank change-2
Total stars rank5,975
Previous total stars rank5,969
Total stars rank change-6
README summary

Spreadsheet Is All You Need (Excel version added! ) **A nanoGPT pipeline packed in a spreadsheet** This is a project that I did to help myself understand how GPT works. It is pretty fun to play with, especially when you are trying to figure out what exactly is going on inside a transformer. This helped me to visualize the entire structure and the data flow. All the mechanisms, calculations, matrices inside are fully interactive and configurable. While reading about LLMs, I

realised that the internal mechanisms of a transformer is basically a range of matrices calculations being connected in a certain order. I started to wonder if the whole process can be represented in a spreadsheet since all the calculations are fairly simple. I'm a visual thinker, I couldn't think of a better way to do it. Then with some trial and errors, I wrote the full inference pipeline of the nanoGPT architecture into a single spreadsheet. Forget python, it turned

out that **spreadsheet is all you need** . logits It is based on Andrej Karpathy's NanoGPT structure which includes roughly 85000 parameters. It is clearly a very small size, but it is both complex enough for me to understand how it works, and also not too big to crash my computer. In contrast to chatgpt, this project is a character based prediction system, meaning that each token is a character, and to reduce the complexity, only letter A/B/C are

being tokenized. What else is included In the numbers file "nanoGPT. numbers", you will see two tabs, one called "no weights" and one called "random weights". They are essentially the same thing, only that all the parameters in the "random weights" tab is randomly generated and the parameters in the "no weights" tab is very tidy and it shows weird values down the pipeline, but it is also clearer to help you read it. Due to the internal mechanism of

spreadsheet softwares, everytime you update the spreadsheet in the "random weights" tab, all the values will be regenerated again (freezes the computer for a few seconds as it is a lot of calculation which is a bit annoying, but you can avoid it by turning all the values into a static value). The spreadsheet doesn't contain actual trained weights and parameters, so you should not expect it to calculate the correct result for you before you update the parameters. You

might also be wondering if there is an excel or a google sheets version, unfortunately there isn't one yet. It is simply because the whole pipeline is too large and I need multiple tables to organize everything, and only numbers can do this. I will see if I can recreate this in excel in the near future(It is added now, just check the excel file in the list). How to read it/use it Firstly, all the blocks are

the values or parameters that is processed through the GPT architecture, they are being color coded as purple, green and

Frequently asked questions

How many stars and forks are recorded?

dabochen/spreadsheet-is-all-you-need has 2,158 stars and 130 forks.

What is the repository rank?

dabochen/spreadsheet-is-all-you-need is ranked 8,916.

Which repository is closest in rank?

dabochen/spreadsheet-is-all-you-need is compared with codenihar/ml, ranked 8,920 with 2,154 stars.

README

Spreadsheet Is All You Need (Excel version added!)

A nanoGPT pipeline packed in a spreadsheet

This is a project that I did to help myself understand how GPT works.

It is pretty fun to play with, especially when you are trying to figure out what exactly is going on inside a transformer.

This helped me to visualize the entire structure and the data flow.

All the mechanisms, calculations, matrices inside are fully interactive and configurable.

While reading about LLMs, I realised that the internal mechanisms of a transformer is basically a range of matrices calculations being connected in a certain order.

I started to wonder if the whole process can be represented in a spreadsheet since all the calculations are fairly simple. I'm a visual thinker, I couldn't think of a better way to do it. Then with some trial and errors, I wrote the full inference pipeline of the nanoGPT architecture into a single spreadsheet.

Forget python, it turned out that spreadsheet is all you need.

This is the full view of the spreadsheet

Zooming into the core of a transformer--self attention

What components will you see

It contains all the transformer components including:

  1. embedding
  2. layer norm
  3. self attention
  4. projection
  5. MLP
  6. softmax
  7. logits

It is based on Andrej Karpathy's NanoGPT structure which includes roughly 85000 parameters.

It is clearly a very small size, but it is both complex enough for me to understand how it works, and also not too big to crash my computer. In contrast to chatgpt, this project is a character based prediction system, meaning that each token is a character, and to reduce the complexity, only letter A/B/C are being tokenized.

What else is included

In the numbers file "nanoGPT.numbers", you will see two tabs, one called "no weights" and one called "random weights".

They are essentially the same thing, only that all the parameters in the "random weights" tab is randomly generated and the parameters in the "no weights" tab is very tidy and it shows weird values down the pipeline, but it is also clearer to help you read it. That's why I kept both.

Due to the internal mechanism of spreadsheet softwares, everytime you update the spreadsheet in the "random weights" tab, all the values will be regenerated again (freezes the computer for a few seconds as it is a lot of calculation which is a bit annoying, but you can avoid it by turning all the values into a static value).

The spreadsheet doesn't contain actual trained weights and parameters, so you should not expect it to calculate the correct result for you before you update the parameters.

You might also be wondering if there is an excel or a google sheets version, unfortunately there isn't one yet.

It is simply because the whole pipeline is too large and I need multiple tables to organize everything, and only numbers can do this.

I will see if I can recreate this in excel in the near future(It is added now, just check the excel file in the list).

How to read it/use it

Firstly, all the blocks are the values or parameters that is processed through the GPT architecture, they are being color coded as purple, green and orange.

Purple: these are parameters that are supposed be replaced by a trained model's parameter.

Green: these are the values that started from the input and gets transformed into the end results.

Orange: these are just intermediate values that are used for the calculation, they are here so it is less confusing.

Secondly, you should start from the top and work all the way down to the bottom, and there are labels on the left of the page showing what stage you are in.

There are three transformers labeled 0/1/2, each have the same structure and should contain different parameters, data will go through all of them in the sequential order.

Lastly, this demo is built with great help from the LLM visualization project (https://bbycroft.net/llm) by Brendan Bycroft which uses 3D animations to explain transformers.

I kept the example it used which is about sorting letters.

If you are using the recently added Excel version, you will note that it might look the same as the attached images, this is due to the limitation of excel not being able to include multiple tables on one page, to make it clearer, I added the "MAP" tab and "Visual Structure of the pipeline" tab, these two will give you a menu and a rought layout of the architecture, you can click on the link to jump to the page and come back using the go back link on the top left of each page.

What else can you do with this

  1. Read through the whole spreadsheet will help you form a visual impression of what a transformer is.
  2. Each cell contains the actual calculation, which you can double click to checkout the details(function).
  3. By selecting the green cells (the values), you can see which other values or parameters are influencing this cell, so that you can get a sense of the mechanism.
  4. Try to make changes to the parameters and see what might happen.
  5. If you happen to have the weights of NanoGPT, you can replace the parameters in this spreadsheet to get it working properly.

Contribution

I wish I could just upload all the tutorials I've watched into chatgpt and ask it to generate this file, but I guess we are not there yet. Anyone is welcomed if they want to build something more complicated than nanoGPT, although I do feel like nanoGPT in a spreadsheet is already a lot for my M2 chip.

Special Thanks

Thanks to the following projects that helped me a lot when creating this spreasheet.

If you are interested in my project, the following links will also be very helpful, much more helpful than spreadsheet is all you need.

  1. Andrej Karpathy's youtube tutorial "Let's build GPT": https://www.youtube.com/watch?v=kCc8FmEb1nY
  2. Andrej Karpathy's NanoGPT project: https://github.com/karpathy/nanoGPT
  3. Brendan Bycroft's 3D visualization of transformers: https://bbycroft.net/llm
  4. 3Blue1Brown's LLM course: https://youtu.be/eMlx5fFNoYc?si=k40zeuPdM_4cB88o
Nearby in the ranking
Similar items