From Rules to Reasoning: How Machine Learning Evolved into LLMs
Today it feels like large language models came out of nowhere. You type a question and get a paragraph back that reads as if a thoughtful person wrote it. They didn't come out of nowhere, though. They are the latest step in a 70-year story of teaching computers to learn from examples instead of following hand-written rules.
This post walks through that story one stage at a time. Each stage fixed a limit of the one before it, and understanding those limits is the easiest way to understand why LLMs work the way they do.
1. Before learning: rules written by hand
Early AI was mostly symbolic. Experts wrote down knowledge as rules: if the patient has a fever and a rash, consider measles. These "expert systems" worked well in narrow domains, but they had two fatal problems:
- They don't scale. Every new situation needs a new rule, and rules start to contradict each other.
- Some knowledge can't be written down. Try writing rules that tell a cat from a dog in a photo. You know the difference, but you can't spell it out.
The alternative was an old idea. In 1959 Arthur Samuel described machine learning as giving computers "the ability to learn without being explicitly programmed." His checkers program improved by playing against itself. A year earlier, Frank Rosenblatt had built the perceptron, a tiny artificial neuron that adjusted its own weights from examples.
The shift in mindset is the foundation for everything that follows: don't write the rules, show examples and let the machine find the rules.
2. Classic machine learning: three ways to learn
By the 1990s and 2000s, machine learning had settled into three main families, sorted by what kind of feedback the model gets.
Supervised learning: learning with an answer key
You give the model inputs and the correct outputs, and it learns the mapping between them.
- Classification: is this email spam or not? Is this tumour benign or malignant?
- Regression: what will this house sell for? How many orders will we get tomorrow?
The workhorses were linear and logistic regression, decision trees and their ensembles (random forests, gradient boosting), and support vector machines (SVMs), which find the widest possible margin between classes. Many of these are still the best tool for tabular business data today.
The catch: supervised learning needs labels, and labels are expensive. Someone has to tag every email and annotate every scan.
Unsupervised learning: finding structure without answers
Here the data has no labels. The model's job is to find structure on its own.
- Clustering (e.g. k-means): group customers by behaviour without being told what the groups are.
- Dimensionality reduction (e.g. PCA): compress hundreds of features into a few that capture most of the variation.
- Anomaly detection: flag the transaction that looks unlike all the others.
Unsupervised learning is cheap on data, since raw data is everywhere, but it's harder to point at a specific goal.
Reinforcement learning: learning from consequences
An agent takes actions in an environment and receives rewards. It learns which actions lead to more reward over time. Q-learning (1989) and TD-Gammon (1992), a backgammon program that reached expert level by playing itself, showed how powerful this could be. Decades later, the same idea powered AlphaGo, and it comes back at the very end of our story.
The hidden bottleneck: features
Classic ML had a quiet limitation. Models were only as good as the features humans engineered for them. To classify images, engineers hand-designed edge detectors and texture descriptors; to classify text, they counted words. The learning part was real, but humans still did much of the seeing.
3. Neural networks and deep learning: learning the features too
Neural networks promised to learn the features themselves. Stack layers of artificial neurons, and early layers learn simple patterns (edges) while deeper layers combine them into complex ones (eyes, faces).
The key algorithm, backpropagation, was popularised in 1986 by Rumelhart, Hinton, and Williams. It tells every weight in the network how to change to reduce the error. But for years, deep networks were too slow to train and too data-hungry to beat SVMs, and interest faded.
Three things changed in the late 2000s:
- Data: the internet produced huge labelled datasets like ImageNet (over a million images in 1,000 categories).
- Compute: GPUs, built for video games, turned out to be ideal for the matrix maths neural networks need.
- Better techniques: ReLU activations, dropout, and better initialisation made deep networks trainable.
In 2012, a convolutional neural network called AlexNet won the ImageNet competition by a huge margin. That moment is usually treated as the start of the deep learning era. Within a few years, deep learning led in image recognition, speech recognition, and translation.
Two architectures dominated:
- Convolutional neural networks (CNNs) for images, which scan small filters across the picture.
- Recurrent neural networks (RNNs) and LSTMs (1997) for sequences like text and audio, which read one step at a time and carry a memory forward.
Meanwhile, word2vec (2013) showed that words could be represented as vectors where meaning becomes geometry: the famous example is king − man + woman ≈ queen. Language was becoming something networks could compute with.
4. The Transformer: attention is all you need
RNNs had a problem: they read text one word at a time. That made them slow to train and bad at connecting words far apart. In a long paragraph, the network had often "forgotten" the beginning by the time it reached the end.
In 2017, a Google paper titled "Attention Is All You Need" introduced the Transformer. Its core mechanism, self-attention, lets every word look at every other word in the sentence at once and decide which ones matter for its meaning.
In the sentence "The animal didn't cross the street because it was too tired," attention lets the model link "it" to "animal" rather than "street". Because all words are processed in parallel, Transformers train far faster on GPUs than RNNs ever could.
This one architecture went on to take over almost all of AI: text, then images, audio, code, and proteins.
5. Self-supervised pretraining: the bridge to LLMs
Remember the big limit of supervised learning: labels are expensive. The breakthrough that made LLMs possible was a clever way around it called self-supervised learning.
The trick: the data labels itself. Take any sentence from the internet, hide a word, and ask the model to predict it. Or, more simply, give it the beginning of a text and ask it to predict the next word. (For a closer look at how that works today, see How AI Language Models Actually Work.) The correct answer is already in the text, so no human labelling is needed.
That turns the entire written internet into training data. It also blends our earlier categories: technically it's supervised (there's a right answer), but it works on unlabelled data like unsupervised learning.
Two families emerged in 2018:
- BERT (Google) learned by filling in masked words, and became excellent at understanding text: search, classification, question answering.
- GPT (OpenAI) learned by predicting the next word, and became excellent at generating text.
The recipe became pretrain, then fine-tune: learn general language from a massive corpus once, then adapt cheaply to specific tasks.
6. Scale: when bigger became different
Researchers then noticed something surprising. As they increased model size, data, and compute, performance improved smoothly and predictably. These became known as scaling laws (2020).
- GPT-2 (2019) had 1.5 billion parameters and could write convincing paragraphs.
- GPT-3 (2020) had 175 billion parameters and could do tasks it was never explicitly trained on, just from a few examples in the prompt. This is called in-context learning.
At this scale, next-word prediction turns out to require a lot more than grammar. To predict the next word of a physics explanation, a legal argument, or a piece of code, the model has to absorb a lot of the knowledge and reasoning behind it.
7. From text predictors to assistants
A raw pretrained model is a brilliant autocomplete, not a helpful assistant. Ask it a question and it might continue with more questions. The final step was teaching it to be helpful, honest, and safe.
This is where reinforcement learning comes back. In Reinforcement Learning from Human Feedback (RLHF), people rank the model's answers, a reward model learns those preferences, and the LLM is tuned to produce answers people prefer. Related approaches such as Anthropic's Constitutional AI use a written set of principles to guide that feedback.
Combined with instruction fine-tuning, this produced the chat assistants that reached the mainstream from late 2022 onward: ChatGPT, Claude, Gemini, and open models like Llama.
Since then, LLMs have kept expanding what they can do:
- Multimodal: reading images, charts, and documents, not just text.
- Tool use: calling APIs, running code, and searching the web.
- Agents: planning multi-step tasks and acting in software environments.
- Reasoning models: spending more computation "thinking" before answering, trained with reinforcement learning on problems with checkable answers.
The thread that ties it all together
Look back at the whole journey and one pattern repeats: each era removed a human bottleneck.
- Expert systems: humans still provided the rules; the machine learned nothing.
- Classic ML: humans still provided features and labels; the machine learned the mapping from features to answers.
- Deep learning: humans still provided labels; the machine learned the features too.
- Self-supervised / LLMs: humans still provided raw data (and feedback for alignment); the machine learned language, knowledge, and much of the reasoning.
LLMs are not a break from machine learning. They are machine learning: supervised, unsupervised, and reinforcement learning ideas, combined with the Transformer and run at enormous scale.
The open questions now are less about can machines learn and more about how do we make what they learn reliable, efficient, and aligned with what people actually need. That's the next chapter, and it's being written right now.
Further reading: Samuel (1959), "Some Studies in Machine Learning Using the Game of Checkers"; Rumelhart, Hinton & Williams (1986), "Learning representations by back-propagating errors"; Krizhevsky et al. (2012), "ImageNet Classification with Deep Convolutional Neural Networks"; Vaswani et al. (2017), "Attention Is All You Need"; Kaplan et al. (2020), "Scaling Laws for Neural Language Models"; Ouyang et al. (2022), "Training language models to follow instructions with human feedback".

