Lesson 9 of 9 · FoundationsRead
The Artificial Neuron: How a Sum Becomes an Output
What an artificial neuron calculates: weights, bias and a lower limit. Follow the spam-filter example from the first lesson and work through every step by hand.
A model has billions of numbers, and no single one of them holds a sentence. To see how numbers still turn into an answer, start with one small calculation: an artificial neuron. You already know the ingredients, because the spam filter from the first lesson uses them too.
The spam filter already calculates almost like a neuron
Remember the spam filter from the first lesson? It stored one weight for each word. For this example, the weights are made-up numbers chosen by hand, not learned during training: “prize” +3, “free” +2, “invoice” −2. An email contains “prize” and “invoice”. What total does the filter calculate? Make a guess before the next section works through the answer. A sum above 2 meant that the email was spam.
A weight is simply a number that sets how strongly a word counts. A positive weight pushes toward spam, a negative one pushes away from it. For the neuron, each word gets its own input number: 1 if it appears in the email, otherwise 0. The weight is multiplied by this input, so a word that is not in the email gives 0 and does not count.

Think of the neuron as a channel on a mixing desk. Each vertical slider holds the weight of one word and sets how loudly it goes into the sum. The display on the right shows only one number at the end, for the current email: the output of the neuron. In the spam filter, each word has its own slider because the filter knows only these three words. A chatbot also calculates with sums of this kind, only with billions of sliders. Most of them belong to no particular word; their inputs are numbers from earlier calculation steps.
The bias: a number that always counts
The spam filter compared the sum with a threshold of 2. A neuron builds the same threshold into its calculation as a bias, a number that training sets and that is added to the sum. The bias belongs to no word and is the same for every email. Chatbot models, too, multiply inputs by such weights and add them up; there, the weights are called parameters.
In the example, the bias is −2. The email with “prize” and “free” has the sum 5, and the email with “prize” and “invoice” has the sum 1. Neither sum includes the bias yet. It is added afterwards, the same way for every email.
With a bias of −2, the result becomes positive only when the sum is above 2.
−2 means: two less than zero. The calculation step by step is in the box.
One level deeper: the calculation step by step
For “prize” and “free”, the weights +3 and +2 add up. Their sum is 3 + 2 = 5. The bias is added afterwards: 5 + (−2) = 3. The neuron therefore calculates 5 − 2 = 3.
For “prize” and “invoice”, the weights are +3 and −2. Their sum is 3 + (−2) = 1. With the bias, this gives 1 + (−2) = −1.
A negative result is easiest to picture on the number line: −2 means two steps to the left of zero. Starting at 0 and adding −2 lands you at −2. Starting at 3 and adding −2 lands you at 1. The bias pushes every sum downward. Only when the sum is greater than 2 does something positive remain at the end.
You can work out two more emails with the same weights yourself: add the values for their words, then add the bias. The third email contains none of the listed words, the fourth contains “free” and “invoice.” You can check your results in the next section.
Try a calculation of your own: an email with “prize”, “free” and “invoice”. Work it out on paper.
The lower limit: negative values become zero
After the bias, the number can be negative. This happens for three of the four emails: with “prize” and “invoice” it gives −1, and for the other two emails it gives −2.
Behind the sum sits a fixed step, the lower limit. For the second email, the sum after the bias is −1: which output does the neuron give in the end, −1 or 0? Guess first. The rule is simple: if the number is negative, it becomes zero. If it is zero or positive, it stays as it is. In technical language, this step is called an activation function.
In this neuron, the lower limit has no value that training can change. Its rule stays fixed; only the numbers fed into it change. The neuron multiplies each weight by its input (1 or 0), adds the results and the bias, then turns any negative result into zero.
Chatbot models also have steps between their calculations that change incoming numbers. The exact rule depends on the model. The lesson Layers explains why such steps are needed.
The output is a number, not a verdict
The spam filter ended with a yes-or-no decision. The neuron produces only the result of its calculation. The email with “prize” and “free” gets 3; the email with “prize” and “invoice” gets 0.
A chatbot works in a similar way: its model gives a number for every possible next piece of text, which can be a whole word, part of a word or a punctuation mark. A selection step then picks one of these pieces.
In the spam filter, another part uses this number to decide whether the email is spam. A single neuron does not make that decision itself.
Try it before you read on.
Live demo · try it yourself
A neuron computes a number
Invented simulationA spam filter looks at three words. Each word has a weight: if it is in the email, it counts. The question: what does the neuron show when all three words are in the email? Guess first. Afterwards you can change the words and look.
One means: the word is in the email. Zero means: it is not in it. A word counts only once, even if it appears several times.
First choose your guess.
Calculation and lower limit
- First choose your guess.
Solution
With all three words in the email, the weights add up to 3 + 2 − 2 = 3; the −2 here is the weight of “invoice”. Then the bias −2 is added: 3 − 2 = 1. The lower limit leaves the 1 standing, so the neuron shows 1.
All numbers are invented and set by hand. The demo only shows how a single neuron computes, and says nothing about a real spam filter.
The brain picture: the name, not the thing
The term neuron comes from the nerve cell. Something goes in, something happens to it, and something comes out. The calculation borrows only one basic idea from a nerve cell: many inputs, weighted differently, produce one output.
A real nerve cell is far more complicated. The aim of artificial networks is not to copy the brain exactly. A chatbot model, too, consists of numbers and calculation steps, not of nerve cells.
What does a neuron learn in training, and what stays the same?

During training, the numbers change, but the calculation rule stays the same. The neuron in this lesson therefore follows a fixed calculation; only the numbers it uses are set by training. This neuron is simple enough to work out by hand.
The whole calculation
This neuron uses three steps: multiply each weight by its input and add the results, add the bias, then apply the lower limit. In a chatbot, numbers pass through many weighted sums and steps that change them, next to other calculations, before the model predicts the next piece of text.
One number alone does not make a model. In a network, a neuron passes its output on to other neurons; for them it is an input that gets multiplied by a weight. Such a passed-on number is called an intermediate value. So what comes out when many neurons pass their results on like this? The lesson Layers shows this.
Explain it more simply
- Explain more simplyCore idea and an everyday comparison
- With an exampleOne concrete example, step by step
- In more detailEvery step on its own, in plain words
Recall moment
What stayed with you?
Answer without scrolling back. This is not a grade; the point is to retrieve what you learned from memory once. As soon as you pick an answer, you see whether it is right.
Preparing questions …
Questions from the community
Something still unclear? Ask your question about this lesson on the community board. Other learners and the project answer there, and you can see what others have already asked.