★ FOUR BRAND-NEW COURSES ANNOUNCED! ★ Machine Learning End To End  •  Hands-On Deep Learning with Python  •  Generative AI & LLMs with Python  •  AI Agents and Agentic AI with Python  ★  Open the “Educational” menu above to explore them ★  ★  NEW! 5. JOB ASSISTANCE: JD Report • Resume customization • AI Mock Interviews — FREE with course bundles, or just ₹499 / US$5. Single Payment. No Subscription. ★★ FOUR BRAND-NEW COURSES ANNOUNCED! ★ Machine Learning End To End  •  Hands-On Deep Learning with Python  •  Generative AI & LLMs with Python  •  AI Agents and Agentic AI with Python  ★  Open the “Educational” menu above to explore them ★  ★  NEW! 5. JOB ASSISTANCE: JD Report • Resume customization • AI Mock Interviews — FREE with course bundles, or just ₹499 / US$5. Single Payment. No Subscription. ★★ FOUR BRAND-NEW COURSES ANNOUNCED! ★ Machine Learning End To End  •  Hands-On Deep Learning with Python  •  Generative AI & LLMs with Python  •  AI Agents and Agentic AI with Python  ★  Open the “Educational” menu above to explore them ★  ★  NEW! 5. JOB ASSISTANCE: JD Report • Resume customization • AI Mock Interviews — FREE with course bundles, or just ₹499 / US$5. Single Payment. No Subscription. ★★ FOUR BRAND-NEW COURSES ANNOUNCED! ★ Machine Learning End To End  •  Hands-On Deep Learning with Python  •  Generative AI & LLMs with Python  •  AI Agents and Agentic AI with Python  ★  Open the “Educational” menu above to explore them ★  ★  NEW! 5. JOB ASSISTANCE: JD Report • Resume customization • AI Mock Interviews — FREE with course bundles, or just ₹499 / US$5. Single Payment. No Subscription. ★

Neural networks in five minutes: the recap before the transformer

Neural networks in five minutes: the recap before the transformer
12-10-2026  |  By Tejas Desai, Ecube Analytics  |  Generative AI: Transformer on-ramp (Chapter 1)  |  4 min read
READ 1ST OF 8 IN THIS SERIES

Neural networks in five minutes: the recap before the transformer

Transformer on-ramp · Part 1 of 8

Your team lead says: “Before we touch large language models, everyone must be able to read a transformer.” Half the room has never trained a neural network. This five-minute recap is the entry ticket — it is all the neural-network knowledge a transformer quietly assumes.

A neuron is a tiny weighted vote

A neuron takes a few numbers, multiplies each by a weight (how much it should matter), adds them up with a bias (a built-in nudge), and passes the result through a squashing function called the activation. In symbols: z = w·x + b, then a = σ(z). That is the whole idea. Everything bigger is made of copies of this.

One neuron, and the loop that trains it Left: three inputs x1, x2, x3 are multiplied by weights w1, w2, w3, summed with a bias and passed through an activation to give an output a. Right: the training loop of forward pass, loss, backward pass and weight update, repeated. One neuron How a network learns x? x? x? w?w?w? ? + b ? a z = w·x + b a = ?(z) ? Forward passmake a prediction ? Losshow wrong was it? ? Backward passgradients (chain rule) ? Updatew ? w ? ? · gradient repeat
Left: one neuron. Right: the loop that teaches a network by repeating four steps.

Stack them and you get a network

Put many neurons side by side and you have a layer. Feed one layer’s outputs into the next and you have a network. The weights and biases are the network’s memory; they are called its parameters. A large language model is the same recipe with billions of them.

How a network learns: the four-step loop

  1. Forward pass. Push an example through and get a prediction.
  2. Loss. Measure how wrong the prediction was with a single number.
  3. Backward pass. Use the chain rule (backpropagation) to work out, for every parameter, which way and how strongly it should move to reduce the loss. These are the gradients, and one backward sweep produces all of them.
  4. Update. Nudge each parameter a small step against its gradient. That is gradient descent, and the step size is the learning rate.

Repeat that loop over lots of examples and the loss falls. Nothing else is happening.

One real step, in a few lines

Here is a single neuron taking one learning step toward a target of 1. The numbers are small enough to check by hand.

import numpy as np

x = np.array([0.5, -1.0, 2.0])
w = np.array([0.4,  0.3, -0.2]); b = 0.1
sigmoid = lambda z: 1 / (1 + np.exp(-z))

a = sigmoid(w @ x + b)            # forward: a = 0.401
loss = 0.5 * (a - 1.0) ** 2       # loss  = 0.179

dz = (a - 1.0) * a * (1 - a)      # backward: chain rule
w -= 0.5 * dz * x; b -= 0.5 * dz  # update, learning rate 0.5

a2 = sigmoid(w @ x + b)           # forward again: a = 0.512
loss2 = 0.5 * (a2 - 1.0) ** 2     # loss  = 0.119

One step moved the prediction from 0.401 towards the target and cut the loss from 0.179 to 0.119. A real network does this for millions of parameters at once, but the logic is identical.

Why this matters for transformers. Embeddings, the query/key/value projections and the feed-forward layers inside a transformer are all just these neurons and weights, trained with exactly this loop. If you are comfortable with the four steps above, you are ready for the part that is genuinely new: attention.

Takeaways

  • A neuron is a = σ(w·x + b): weigh, add, squash.
  • Layers stack neurons; the weights and biases are the parameters.
  • Learning is a loop: forward, loss, backward, update.
  • Backpropagation gives every parameter’s gradient in one sweep.

Next in the series (Part 2): how text becomes numbers — tokens turning into vectors.

This blog is from chapter 1, course-2-generative-ai of 4 world-class courses on aibits.ecubeanalytics.com
Article 1 of 8 in this series Next →