What is a neural network?
Short answer: a neural network is a program that learned from examples instead of following rules a person wrote. It is one powerful kind of machine learning, which in turn is part of AI. Language models like ChatGPT, Claude and Gemini are neural networks built for text: they were trained on huge amounts of text and write an answer piece by piece, each time picking the best-fitting continuation.
Free course on this topicAI basics: free courseStart the course →
AI, machine learning, neural networks, LLMs: nesting dolls
Think of four rings, each narrower than the one around it:
- AI is any program that does "smart" things.
- Machine learning (ML) is programs that learn from examples.
- Neural networks are one very powerful way of learning like that.
- Language models (LLMs) are neural networks built for text, like ChatGPT.
More in the lesson: AI, ML, neural nets: what's what
Rules vs examples
A regular program follows rules a person wrote, like "if the order is over $100, give a discount". Machine learning works the other way around: you give the model thousands of examples with the right answers, and it finds the rule itself. The trap: if the examples contain a mistake, the model learns that too.
ML isn't always the right tool. If a task can be described with a couple of clear rules, like "calculate tax at this rate", a hand-written rule is cheaper, easier to understand and never makes random mistakes. ML makes sense when you can't put the rule into words, you have lots of examples, and a rare mistake isn't a disaster.
More in the lesson: AI, ML, neural nets: what's what
Neural networks are already in your phone
- A spam filter learned from emails people marked as spam.
- Your TikTok feed learns from what you watch to the end and what you swipe past.
- Face unlock was trained on a huge number of face photos.
Same recipe every time: lots of examples with labels (the right answers), a pattern found in them, then applied to new cases.
More in the lesson: AI, ML, neural nets: what's what
How a neural network like ChatGPT "thinks"
A language model writes an answer token by token. A token is a piece of text: a short word, part of a longer word or a punctuation mark. After "Bitcoin is often called digital…" the model is far more likely to pick "gold" than "pizza".
- It learned patterns, not pages. Before launch it read a huge amount of books, websites and code, so its writing is smooth, but it can get the exact wording of a source wrong.
- Its knowledge has a date. After the knowledge cutoff the model learns nothing new on its own.
- Confident does not mean correct. It builds a plausible answer and doesn't check a source by itself, so check what matters.
More in the lesson: How a neural network thinks
FAQ
What is a neural network in simple terms?
A program that learned a pattern from lots of examples with right answers, instead of following rules a person wrote. It then applies that pattern to new cases.
Is a neural network the same as AI?
No. AI is the widest ring: any program that does smart things, including simple hand-written rules. Neural networks are one way of doing machine learning inside it.
Is ChatGPT a neural network?
Yes. ChatGPT, Claude and Gemini are language models, meaning neural networks trained on a huge amount of text to guess which piece of text comes next.
Understand AI from the ground up
The free Brainax course «AI basics» has 23 short lessons with animations and quizzes: from what a neural network is to tokens, prompts, AI agents and how to check answers. Start the lesson
Free course on this topicAI basics: free courseStart the course →
Articles on this topic
- What Is RAG in AI? Retrieval-Augmented Generation Explained
- System prompt leakage: how chatbots give away their secrets
- What Is a Token in AI? Tokens and Context Windows Explained
- What is prompt injection? How a chatbot "sold" a car for $1