Hidden layer
A hidden layer is any layer of a neural network between the input layer and the output layer, where the network computes intermediate values that are neither its input nor its final answer.
A simple neural network has three kinds of layer. The input layer receives the data, the output layer produces the prediction, and the hidden layers sit in between. They are called hidden because their values are not part of what goes in or what comes out; they are the network's internal working. Each neuron in a hidden layer takes a weighted sum of the values feeding into it, adds a bias, and usually passes the result through an activation function.
Google's Machine Learning Crash Course gives a small worked example: a network with 3 inputs, one hidden layer of 4 neurons and 1 output. Each hidden neuron has 3 weights and a bias, 16 parameters in all, and the output node has 4 weights and a bias, 5 more, for a total of 21. The parameter counts of large models in the news are the same arithmetic on a vastly bigger scale.
Hidden layers only add power if their neurons are non-linear. As Google's course points out, linear calculations performed on the output of linear calculations are still linear, so stacking layers of plain weighted sums gains nothing. With non-linear activation functions, hidden layers let a network separate data that no straight line can divide. In their 1969 book Perceptrons, Minsky and Papert showed that a single-layer perceptron cannot learn the simple XOR function; networks with hidden layers overcame that limit.
Training those layers was the hard part. Frank Rosenblatt proposed a multilayer perceptron in 1958, but its hidden layer had random weights that did not learn. Backpropagation, developed independently several times from the early 1970s and popularised by Rumelhart, Hinton and Williams in 1986, made it practical to train hidden layers by working out how each weight contributed to the error.
Deep learning simply means networks with many hidden layers. Each layer can build on the features computed by the one before. What those layers actually represent is hard to read, which is why interpretability research spends so much effort probing the hidden layers of large models.
Because its values are not directly observed. The input layer holds the data you supply and the output layer holds the answer you read, while the layers in between hold intermediate values that the network computes for itself. It depends on the problem. Networks with hidden layers can in theory approximate any continuous function over a bounded range of inputs, but in practice complex tasks such as language and images use many layers. OpenAI's original GPT model in 2018 already stacked 12 transformer blocks. Yes, for it to add anything. Without a non-linear activation function, a hidden layer is just another weighted sum, and any stack of weighted sums collapses into a single linear calculation. The activation function is what lets hidden layers model curved and complex relationships. It learns whatever intermediate features help produce the right output, shaped entirely by training rather than designed by hand. In large models these representations are hard to interpret, which is the focus of mechanistic interpretability research.Common questions
Why is it called a hidden layer?
How many hidden layers does a neural network need?
Does a hidden layer need an activation function?
What does a hidden layer learn?
Search for "hidden layers neural network", "multilayer perceptron" or "why activation functions are needed" to see how layers combine. Reliable sources include introductory machine learning courses such as Google's Machine Learning Crash Course, university lecture notes and encyclopedia articles that cite the original work. Interactive network visualisers are a good way to watch what adding a hidden layer changes.Finding more
Working out what this means for your business?
Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.