SpectrumEdu

Discoveries and inventions · Lesson 24

Artificial intelligence and neural networks

Full reading material for learners and teachers. Use the top button to return to the experiments.

  1. What is artificial intelligence?
  2. Turing: testing a machine’s behaviour
  3. Dartmouth and the field’s name
  4. Rosenblatt’s perceptron
  5. Learning from examples
  6. Data, features and labels
  7. Why varied examples matter
  8. An image as numbers
  9. Similarity, noise and uncertainty
  10. An artificial neuron’s calculation
  11. How error changes settings
  12. From one unit to a network
  13. Training, validation and final testing
  14. Overfitting: memorising noise
  15. Different kinds of error
  16. Chess and Go
  17. Where a model runs
  18. Language models and tokens
  19. Creating an image and checking its details
  20. Why a confident answer can be wrong
  21. Hopfield, Hinton and the development of ideas
  22. Choosing a tool and the human role
  23. Common misunderstandings
  24. A lesson plan for teachers

1. What is artificial intelligence?

Artificial intelligence is a broad field that develops systems for tasks such as recognition, finding solutions and working with language. There is no single device called “AI”. Some systems use human-written rules, while others learn from examples; real applications often combine approaches. Skill at one task does not imply skill at every other task. A useful starting point is a concrete question: what input does the system receive, what output should it produce and how will we check that output? The lesson uses fruit sorting, digit recognition and checking a historical fact as examples.

2. Turing: testing a machine’s behaviour

In his 1950 paper, Alan Turing approached the question of machine thinking through an “imitation game”: could a written conversation distinguish a machine from a person? This was an influential way to frame a question about observable behaviour. It is not a universal measure of every program’s capabilities and does not establish consciousness. Modern systems undergo many kinds of tests: individual tasks, unseen data, robustness and factual accuracy. Conversation may be persuasive while containing factual errors. That is why our lesson examines the confidence of a sentence separately from the historical date it contains.

3. Dartmouth and the field’s name

The expression “artificial intelligence” appeared in the 1955 proposal for the Dartmouth research project. A workshop held in summer 1956 is associated with the emergence of AI as a field. John McCarthy was among its organisers. Distinguish the document’s year from the meeting’s year: 1955 and 1956 are not contradictory. The archival first page in this lesson belongs to the proposal; the modern building photograph shows the college, not the workshop’s participants. AI was not a single instantaneous discovery. It drew on logic, computation, statistics, learning and search, and developed through the work of many researchers.

4. Rosenblatt’s perceptron

In July 1958, Frank Rosenblatt demonstrated a perceptron on an IBM 704 computer. The system learned to distinguish the positions of marks on cards. Its central idea is simple: compare an answer with the correct label and use the error to change settings. The Mark I Perceptron machine followed; the lesson’s image comes from its 1960 operator’s manual. Do not confuse the early demonstration’s date with that document’s date. The perceptron was historically important but has limitations: one linear-threshold unit cannot separate every possible category. Our experiment uses a solvable task: logical AND.

5. Learning from examples

In ordinary programming, a person might write a rule: “if the shape is round, call it an apple”. In learning, a program selects settings from data. This does not mean that a trained system has no program: people also write the learning algorithm. The teaching sorter chooses only between two predefined rules, colour and shape. It counts each rule’s errors on the training examples and selects the lower-error rule. A tie explicitly favours colour. This small example shows actual rule selection from examples without reproducing the complexity of a modern neural network.

6. Data, features and labels

Data are the examples a system works with: images, sound, numbers or text. Features are characteristics used for a task. In the sorter, they are colour and round or elongated shape. A label is the correct answer against which a prediction is compared: apple or banana. Labels may themselves be wrong; varied data also cannot repair a badly defined task. Modern neural networks often develop useful internal features rather than receiving a list of familiar properties. Our teaching experiment makes features explicit so that we can see which pattern was selected and where it fails.

7. Why varied examples matter

If every training apple is red and every banana yellow, colour and shape rules are equally successful. Those data do not establish which rule is better for new fruit. Our model chooses colour and misclassifies the green and yellow apples. Adding different-coloured apples and a green banana changes the evidence: shape becomes the better training rule. It answers four separate test cases correctly. This result belongs to this simplified task. Actual fruit can be unusual, lighting changes colour and photographs can conceal shape. Claims about a real system require broader testing.

8. An image as numbers

A digital image consists of pixels whose values describe the brightness or colour of small areas. Our exercise represents a symbol using 35 cells: five columns and seven rows. Each cell is 0 or 1, so two drawings can be compared by counting mismatched cells. This is not the same as understanding a written number. The algorithm does not know that a one may have a long slanted stroke or a seven a crossbar. Our ten templates are specified by hand. Real handwriting systems train on many variations and are tested on handwriting they have not previously encountered.

9. Similarity, noise and uncertainty

A template has zero distance from itself. Changing a cell increases the mismatch count; the closest template may stay the same or change. Equal best distances produce a tie, and an empty grid is not assigned a digit. A unique nearest template still does not guarantee correctness: a random drawing may be closest to one digit too. Assessing reliability requires additional criteria and new data. Try selecting template 7, adding noise and changing several cells manually. Compare your own judgement with the algorithm’s comparison and explain why the two may disagree.

10. An artificial neuron’s calculation

An artificial neuron receives numbers, multiplies them by weights, adds the results and a bias, then applies an activation function. Our threshold example uses z = 0.4x₁ + 0.8x₂ − 0.6. The output is 1 when z > 0, otherwise 0. The first input represents round shape and the second red colour. For input (1, 0), the sum is −0.2 and the output 0. For (0, 1), the sum is 0.2 and the output 1. This reveals the weights’ different contributions. Here “neuron” means a computational unit, not an exact model of a living brain cell.

11. How error changes settings

The learning exercise solves logical AND: only (1, 1) should produce 1. Let y be the correct answer, ŷ the prediction and e = y − ŷ the error. The update rule is wᵢ ← wᵢ + 0.2exᵢ and b ← b + 0.2e. A correct answer gives e = 0, so nothing changes. A zero input leaves its associated weight unchanged even when there is an error. “Next example” performs one step; the log shows input, prediction, label and updated weights. “Train to a solution” repeats steps until all four combinations are correct, up to 80 steps. Reset restores the initial zero settings.

12. From one unit to a network

A neural network connects multiple computational units. Outputs of one layer become inputs to the next. Our diagram has two inputs, three hidden neurons and one output. In the hidden layer, ReLU preserves a positive sum and replaces a negative one with zero. At the output, a sigmoid maps the sum to a number between 0 and 1. Selecting inputs A, B or C changes actual intermediate calculations. Positive connections are purple and negative connections orange. A value such as 0.56 does not automatically mean “56 percent certainty”: that interpretation needs a defined task and model evaluation. Here it is simply a mathematical result.

13. Training, validation and final testing

Training data change a model’s settings. Separate test data provide evidence about performance on new cases. Real projects commonly distinguish training, validation and test splits. Validation helps choose model variants; the test split is reserved for final evaluation. Repeatedly adjusting decisions to test answers makes that evaluation less independent. Splits must account for data provenance: near-identical photographs of the same object in both splits can inflate performance. In our lesson, training and test points have different markers. The test points are not used to construct either fitted curve.

14. Overfitting: memorising noise

Overfitting occurs when a model adapts too closely to details of its training examples and performs worse on new ones. Our six training points contain small disturbances around a simple relationship. A least-squares line misses individual points but predicts five new values better. A fifth-degree interpolation curve passes through all six training points but deviates more strongly between them. RMSE is the square root of mean squared deviations; a lower value indicates less error on that group. This does not prove that simpler models are always better. Appropriate complexity depends on the task, available data and independent evaluation.

15. Different kinds of error

In “find the cats”, a positive answer means “cat detected”. A miss occurs when a cat is present but the answer is negative. A false alarm occurs when no cat is present but the model reports one. The cautious teaching setting detects two cats and misses two; it does not classify dogs as cats. The sensitive setting detects all four cats but misclassifies two dogs. Both settings are correct on six of eight cases. Overall accuracy hides the difference between their errors. Which setting is useful depends on the task and the costs of errors. Outputs here are predefined to compare their meaning; the program does not recognise actual animal photographs.

16. Chess and Go

In 1997, IBM Deep Blue defeated Garry Kasparov in a chess match. Search and position evaluation were important parts of the system. In 2016, AlphaGo beat Lee Sedol 4–1. It combined neural networks, search and learning, including learning from games and self-play. These achievements show different ways to solve complex, well-defined tasks. Game rules, legal moves and outcomes are known. Everyday human questions can be much less clearly defined. Winning one game does not establish that a system understands every conversation or reliably answers every question.

17. Where a model runs

A model is not a cloud detached from the physical world. Its settings reside in memory and processors perform its calculations. Graphics processors are useful for many neural-network operations because they execute similar calculations in parallel. The chip photograph shows a real component; the server-room image is an educational illustration of computing infrastructure. A small model may run on an ordinary computer or phone. Larger models require more memory, time and energy. Training changes parameters, while inference computes an output using current parameters. Talking to a ready-made model does not by itself mean that its weights immediately change.

18. Language models and tokens

A language model can calculate a distribution of possible next tokens given a context. A token need not be a whole word: it may correspond to a word fragment, punctuation or a group of characters. Repeated continuation produces text. Our exercise uses a much simpler counter over predefined continuations. For the fish phrase, “water” appears twice, while “the sea” and “a river” appear once each. The button selects the most frequent continuation. An unknown opening has no examples, so the counter gives no continuation. That refusal is a property of this small rule, not a description of every modern language model.

19. Creating an image and checking its details

Generative models create new versions of text, images and other data using learned patterns and prompt conditions. A plausible image does not necessarily depict an object’s construction or a historical event accurately. Our generated illustrations are distinguished from archival photographs. The apple-and-leaf builder uses written rules: subject, background and style change independently. It demonstrates how conditions affect a result without being presented as a neural network. Check details that must be physically correct, such as part counts, positions and camera, beam or flow directions. Educational beauty and factual accuracy should support each other.

20. Why a confident answer can be wrong

A generative system may produce a persuasive but false fact or citation. NIST identifies fabricated information as a risk of generative AI. Our exercise deliberately states 1988 instead of 1958 for the perceptron demonstration. Adding “this is a well-known fact” does not repair the error. Comparing it with Cornell Chronicle allows the date to be corrected to 1958. Source context matters: who gave the demonstration, what device was used and which event the date refers to. Verification is an opportunity to revise a conclusion, not merely to find text that resembles an existing answer.

21. Hopfield, Hinton and the development of ideas

John Hopfield and Geoffrey Hinton received the 2024 Nobel Prize in Physics for foundational discoveries and inventions enabling machine learning with artificial neural networks. Hopfield’s work includes a network that can reconstruct a stored pattern from incomplete or distorted input. Hinton developed methods for discovering patterns in data. Their ideas belong to a long history rather than being the sole foundation of all modern systems. Distinguish historical contributions from current products. The portraits in this lesson accompany specific descriptions of their work rather than the overly broad label “creator of AI”.

22. Choosing a tool and the human role

Not every task needs learning. A specified timer can be implemented with an ordinary algorithm. Trained models can help recognise different handwriting. A historical date needs a reliable source. Real applications may combine these approaches. People define the goal, choose data, compare results against requirements and are responsible for their use. The lesson’s computations use predefined examples and run locally; it is unnecessary to submit real personal data to its demonstrations. The central skill is to understand which part of a task a system solves and what evidence is required to trust its result in that domain.

23. Common misunderstandings

“Every training answer is correct, so the model is good” omits separate testing. “More parameters are always better” ignores data, the task and overfitting. “A correct answer means understanding everything” transfers success between unrelated tasks. “AI answered confidently, so the fact is established” confuses wording with evidence. “The drawing resembles a real device, so every detail is accurate” replaces factual checking with an impression. Each claim has a short counterexample in this lesson. Ask learners to identify an action as well as the error: which data to add, what to measure, which source to open or which image detail to check.

24. A lesson plan for teachers

Begin by asking how the sorter could distinguish an apple from a banana. Ask learners to predict colour- and shape-based results, then compare the two training collections. Next, change a handwritten digit and explain the mismatch count. Work through one neuron calculation manually before tracing an error-driven update. Reinforce the central conclusion by comparing the curves on new points. Finish with the date-checking exercise and three final choices. For extension work, use the perceptron log and exact network settings. Discuss each demonstration’s limits: what the program actually computes and which more complex phenomenon it helps illustrate.

Sources

  • Dartmouth: AI history
  • Turing: the 1950 paper
  • Cornell: Rosenblatt’s perceptron
  • IBM: Deep Blue
  • DeepMind: AlphaGo
  • The 2024 Nobel Prize
  • Training and test datasets
  • Weights and neural activation
  • NIST: generative AI errors

Images and licences