GGiriBioAI

/ module 01 · Foundations

Neural Network Basics

Every LLM is a neural network: billions of tiny units that multiply, add and squash numbers. Before tokens and transformers, get a feel for one neuron, then watch a small network teach itself to separate patterns a single neuron never could.

By the end you can
  • Explain what a neuron's weights, bias and activation do
  • Say why one neuron can only draw a straight line
  • Describe how gradient descent lowers the loss step by step

Try this first: Drag weight 1 below zero and watch the colored boundary flip.

about 15 min hover ? for help

concept

One neuron, three steps

A neuron takes inputs, multiplies each by a weight, adds a bias, and passes the sum z through an activation function. On a 2D plane, that draws a straight line: one side says "yes", the other "no".

neuron
Multiplies inputs by weights, adds a bias, then applies an activation function.
activation function
The non-linear squash (ReLU, sigmoid, tanh) that lets networks learn curves, not just lines.
gradient descent
Repeatedly nudge every weight a little in the direction that lowers the loss.
Live lab · Single neuron
activation:
z = 1.0·0.5 + 1.0·-0.3 + 0.0 = 0.20
output = sigmoid(z) = 0.550 (range 0 to 1)

Classifying the two clusters: 100% correct. Try making weight 1 negative and watch the boundary flip. Blue dots should sit on blue.

training

Learning = rolling downhill

Nobody sets the weights by hand in a real network. Training measures the error with a loss, uses backpropagation to find which direction each weight should move, then takes a small step: gradient descent. Repeat thousands of times. GPT-style models do exactly this, with billions of weights and next-token loss.

A single neuron can only draw a line, so it fails on XOR and circles. Add a hidden layer and the network can bend the boundary.

Live lab · Train a tiny network
dataset:
class 1 class 0
epoch
0
loss
-
accuracy
46%
loss curve (last 200 updates)

Try: XOR with 0 hidden neurons never passes ~75%. Set 3 or more and press Train. Spiral needs 8 neurons and patience; crank the learning rate to 3 to see training go unstable.

backpropagation
The chain-rule bookkeeping that computes how much each weight contributed to the error.
hidden layer
Neurons between input and output. They build intermediate features the output layer combines.

Check yourself

Tick each one you could explain to a friend. If you can't yet, scroll back up and replay the lab.

Finished exploring?
Progress is saved only in this browser.