[Learn](https://codetrain.ai/learn/) / [How LLMs Actually Work](https://codetrain.ai/learn/llm-foundations/)

# Neural-net foundations

History, a trainable neuron, an N-gram model, and the RNN the transformer replaced. A class in How LLMs Actually Work. Free to start, no card.

[Start free, no card](https://codetrain.ai/app/) 10 lessons a month on the free tier.

## Curated lessons in this class

### The road to the Transformer

python · 1 steps · free

How we got from a single neuron to ChatGPT, in seven steps.

1. Sixty years in one map

[Start this lesson](https://codetrain.ai/app/study/?lesson=llm-history)

### A neuron from scratch

python · 5 steps · free

Build and train a single artificial neuron with NumPy.

1. The weighted sum
2. Fire or not: the activation
3. Wrap it in a predict()
4. Learn from one mistake
5. Train the AND gate

[Start this lesson](https://codetrain.ai/app/study/?lesson=llm-perceptron)

### Predict the next word: an N-gram model

python · 4 steps · free

The simplest language model: count what usually comes next.

1. Split into words
2. Count what follows each word
3. Counts into probabilities
4. Predict the next word

[Start this lesson](https://codetrain.ai/app/study/?lesson=llm-ngram)

### An RNN cell, unrolled

python · 3 steps · free

Carry a hidden state across a sequence, the pre-Transformer way.

1. One time step
2. Carry the state across a sequence
3. Read out a prediction

[Start this lesson](https://codetrain.ai/app/study/?lesson=llm-rnn-cell)

## How CodeTrain teaches this

No videos and no multiple-choice quiz at the end. Each lesson is a handful of small steps in a real editor. You type the code yourself, it runs, and the tutor reviews what you actually wrote. It will not hand you the answer, and the step doesn't advance until your code passes. What you get at the end is a record of which steps you wrote unaided, not a completion percentage.

## These curated courses are the starting point, not the product

Everything in this catalog is a **curated** course we wrote by hand. They exist so there is something to start on. What CodeTrain actually does is build a lesson on demand: name **any topic** you want to understand and it writes one for you on the spot, or paste **any public repository** and it teaches you that codebase from the code that is really in it. You are not limited to the list below, and most people stop using it within a session or two.

## The rest of How LLMs Actually Work

[Tokens & embeddings](https://codetrain.ai/learn/llm-foundations/llm-foundations-2/)[The Transformer block](https://codetrain.ai/learn/llm-foundations/llm-foundations-3/)[Training, generation & fine-tuning](https://codetrain.ai/learn/llm-foundations/llm-foundations-4/)

[Start this class free](https://codetrain.ai/app/) [Browse every curated course](https://codetrain.ai/learn/)

---

Source: https://codetrain.ai/learn/llm-foundations/llm-foundations-1/

This is the markdown twin of the page above. Every public CodeTrain page serves one on `Accept: text/markdown`. Start at https://codetrain.ai/llms.txt for the full map, or https://codetrain.ai/developers/ for the API.
