A neural network, or neural net, is a type of machine learning model made of layers of connected units, often called neurons, that learns to turn an input into an answer by studying examples. Each connection carries a number called a weight, and training adjusts those weights until the network gives the right answers. Neural networks power most of today’s artificial intelligence, from photo recognition to chat assistants.
The name is a loose comparison with the brain, where neurons pass signals to each other. In software, a neural network is arithmetic: many simple calculations, arranged in layers and repeated at great speed.
How a neural network works
Imagine an online furniture shop that wants its contact form to sort messages automatically. A message arrives: “Can you quote for delivery of a sofa and price the old one’s removal?” The network has to decide whether it is a quote request, a delivery question or a complaint.
The Google machine learning course describes the same three parts:
- The input layer receives the data, here numbers that show which words the network watches for, such as “quote” or “price”, appear in the message.
- Hidden layers sit between input and output. Each neuron takes the values from the layer before, multiplies each one by its weight, adds a value called a bias and passes the result on.
- The output layer gives the answer, here a score for each category. The highest score wins, so this message goes to the sales team as a quote request.
Google’s machine learning glossary calls a network with more than one hidden layer a deep model, which is where the term deep learning comes from.
How a neural network learns
A new network starts with random weights, so its first answers are guesses. Training fixes that:
- The network is shown an example where the right answer is known, such as a past enquiry already labelled as a complaint.
- It makes its prediction, and the difference from the right answer is measured.
- An algorithm called backpropagation works backwards through the layers and adjusts each weight slightly in the direction that reduces the error. Google’s course covers this in its neural networks module.
- This repeats over thousands or millions of examples until the predictions are reliably good.
Then the network is tested on examples it has never seen. If it does well only on its training data, it has memorised the examples without learning the pattern, and it will fail on real messages.
The furniture shop would need a few thousand past enquiries from its database, each labelled correctly, to train a network like this from scratch. The quality of those labels matters as much as the network: if half the complaints were filed as delivery questions, the network learns the same confusion.
Types of neural networks a business is likely to meet
You rarely need to know the architecture, but the names come up when you compare tools:
- Convolutional networks are designed for images. They are used for recognising products in photos, reading text from scanned documents and checking image quality.
- Transformers are the architecture behind large language models. Google’s course on language models states plainly that an LLM is a neural net, trained to predict the next token in a sequence, where a token can be a word, part of a word or a single character. ChatGPT is built on models of this kind.
- Embedding models turn text or images into lists of numbers that capture meaning. Similar items get similar numbers, which is what makes search by meaning and “customers also viewed” suggestions possible.
What this means for a business website
Most businesses do not build or train their own neural network. They use one that a provider has already trained on vast amounts of data, and call it through an API, often a REST API, from their website or system. The furniture shop’s enquiry sorting can often be done this way with no training at all, by giving a language model the categories and a few examples.
Training your own network makes sense when the task is specific to your business, you have plenty of well-labelled data, and a general model does not perform well enough. Even then, the usual route is to adapt an existing model with your examples, which needs far less data than starting from zero.
Two properties of neural networks matter when you plan a feature:
- The answers are probabilities. A network can be 82% sure and wrong. Good systems use the score: act automatically above a threshold, send the rest to a person.
- The reasoning is hard to inspect. A network does not give a list of reasons for its answer. Where a decision affects people, such as approving an application, that limits where it should be used and how it must be checked.
How we approach neural networks on projects
When a project calls for it, we integrate AI into the custom web applications we build on Laravel. Whether a provider’s model is enough or a model has to be trained depends on the task and the data available, so both are settled in the scope of our Laravel development projects.
FAQ
What is the difference between AI and a neural network?
AI is the broad goal of software doing tasks that need something like human judgement, and a neural network is one technique for building it. Many AI systems use other machine learning methods, such as decision trees, which suit tables of business data like sales figures well, and older AI used hand-written rules. Neural networks dominate work with images, sound and language, which is why they get most of the attention.
Does a neural network keep learning after launch?
Usually not on its own. Once training is finished, the weights stay fixed, and the network gives answers with what it has learnt. To improve it, developers retrain or adapt it with new labelled examples and release a new version, which is also why a provider’s model can change behaviour when the provider updates it.
Is ChatGPT a neural network?
Yes. ChatGPT runs on large language models, and a large language model is a very large neural network of the transformer type, trained on huge amounts of text to predict what comes next. The chat interface, safety rules and tools around it are ordinary software built on top.
What are examples of neural networks in everyday life?
Face unlock on a phone, speech recognition in voice assistants, photo apps that find pictures of a dog when you search for “dog”, and translation tools all use neural networks. So do the spam filters in many email services and the recommendation lists in shops and streaming apps.