AI Glossary / Natural language and speech / Intermediate
Hidden units
Definition
Hidden units are computational units inside a neural network, between its inputs and its final outputs. A typical unit combines incoming values with learned weights and a bias, then applies an activation function. Its resulting value contributes to later computation. “Hidden” describes its position within the model, not secrecy or an inability to inspect the value.
What it means
An input might represent words, pixels, or measurements. Hidden units transform those representations into intermediate values that later layers use to make predictions. A network can contain one or many hidden layers, each with multiple units.
It is tempting to name every hidden unit after a human concept, such as “complaint detector.” Sometimes analysis finds useful associations, but a unit need not have one stable, human-readable meaning. Information can be distributed across many units, and a unit's effect depends on its connections and the rest of the model.
How it works
In a simple dense layer, a hidden unit multiplies each incoming feature by a weight, adds the products, adds a bias, and applies an activation function. Training adjusts parameters to improve the chosen objective. The unit's activation is an intermediate result computed for a particular input; its weights and bias are parameters shared across inputs.
Nonlinear activation functions help a stack of layers represent transformations beyond a single affine mapping. If a sequence of ordinary affine layers has no intervening nonlinearity, their composition remains affine. Depth alone therefore does not establish the same expressive behavior as a nonlinear network.
Other architectures organize internal computation differently, so the exact meaning of a unit depends on the model. A dimension of a hidden vector is a computational quantity, not a biological neuron. Inspecting activations can help with analysis, but it does not automatically explain why the complete system made a particular decision.
Three practical examples
1. Text classification: A network transforms a document representation through hidden units before predicting its category. Reviewers evaluate the final classifications rather than assuming the intermediate units correspond neatly to topics.
2. Image recognition: Internal activations respond to patterns in an image. Their role can be studied by changing inputs, while recognizing that a visualized response is only part of the model's computation.
3. Demand prediction: A model combines numerical inputs in hidden layers. Engineers monitor prediction errors and data changes, rather than treating the number of hidden units as a direct measure of forecast quality.
Think of it this way
Think of a workshop with intermediate stations: each station transforms materials before the final product is assembled. A hidden unit is like one small transformation within that process. The analogy illustrates intermediate computation, but neural units usually perform numerical operations in large connected arrays; they are not independent workers with their own understanding or assigned real-world purpose.
Worked example
Take an invented network with inputs x1 = 2 and x2 = −1. It has two hidden units using the rectified linear activation ReLU, which returns the larger of zero and its input. The first unit has weights 0.5 and 1, with bias 0.5. Its pre-activation is 0.5 × 2 + 1 × (−1) + 0.5 = 0.5, so its activation is 0.5.
The second unit has weights −1 and 2, with bias 1. Its pre-activation is −1 × 2 + 2 × (−1) + 1 = −3, so its activation is zero. The hidden vector is therefore [0.5, 0].
Suppose a linear output unit has weights 3 and −2 and bias 0.1. Its output is 3 × 0.5 − 2 × 0 + 0.1 = 1.6. This is a raw numerical output, not automatically a probability. The hidden layer has four weights and two biases; the output layer has two weights and one bias, giving nine parameters in total. A zero activation for this one input does not prove that the second unit is permanently inactive.
Illustrative case study
Fictional case: A small analytics team builds a neural classifier for maintenance notes. One engineer labels an internal unit “urgent repair” after seeing it activate strongly on several urgent examples.
The team checks additional notes and discovers that the unit also responds to a recurring formatting feature. It removes the informal label from the product explanation and evaluates the classifier using held-out examples and targeted input changes. Hidden-unit inspection remains a useful investigation tool, but it is not presented as proof of a reliable concept detector. This is an illustrative case, not a report about an actual model.
Common misconceptions and mistakes
Do not confuse a unit's activation with its weight. The activation varies with the input; a trained weight normally remains fixed during ordinary inference. Likewise, adding hidden units increases potential capacity and resource use but does not guarantee better generalization.
Another mistake is treating an activation plot as a complete explanation. Correlation with a feature does not establish that one unit exclusively represents that feature. Finally, “hidden” does not mean protected: intermediate values may be observable to the system's operator, depending on the implementation and access controls.
Business use
Businesses evaluating neural systems should ask how architecture choices affect task performance, compute requirements, and maintainability. The number of hidden units is a design detail, not a substitute for evidence of useful predictions. When teams use internal activations for monitoring or explanations, validate the interpretation across representative inputs and explain its limits to the intended audience.
People also ask
Are hidden units the same as hidden layers?
No. A layer contains units or vector dimensions organized into a stage of computation.
Does each unit learn one concept?
Not necessarily. Representations can be distributed and depend on context and connections.
Is a zero ReLU activation a deleted unit?
No. It is a result for the current input; other inputs may produce a positive activation.
Check your understanding
How many parameters belong to the hidden layer in the worked example?
Answer: Six: four input weights and two biases. The two computed activations are values, not additional learned parameters.
Related terms
- Hidden layer
- Activation function
- Weight
- Bias
- Representation learning
- Feedforward neural network
- Model Interpretability
- ReLU
Learn next
Change x2 in the worked example from −1 to 2 and recompute both hidden activations and the final output. Then compare a unit's changing activation with its unchanged parameters. Study backpropagation to understand how training updates those parameters.
More in Natural language and speech
- Gricean maxims - Gricean maxims are conversational expectations proposed by philosopher H. Paul Grice to help explain cooperative communication.
- Heaps's law - Heaps's law is an empirical relationship describing how the number of distinct terms in a text collection tends to grow as more word occurrences are observed.
- Hearst patterns - Hearst patterns are recurring word-and-grammar patterns used to identify possible hyponym relationships in text: relationships in which one concept is a...
- Hobbs algorithm - The Hobbs algorithm is a historical, syntax-based method for finding candidate antecedents of pronouns in text.
- Homonymy - Homonymy is the relationship between distinct meanings that share a word form but are not treated as meaningfully related in the analysis being used.
- Hot languages - Hot languages is a label used in some linguistic discussions for languages that tend to express referents more explicitly, rather than leaving many...
Sources
Primary source: Jurafsky and Martin, Speech and Language Processing, chapter 6, neural units and feedforward networks: https://web.stanford.edu/~jurafsky/slp3/6.pdf . The weighted-sum, bias, activation, and dense-layer passages were read. Numerical architecture, parameter counts, analogy, and fictional investigation are original teaching examples.
Previous: Hidden semi-Markov model Next: Hierarchical Bayesian model