AI Glossary / Natural language and speech / Intermediate

Fully-connected

Definition

Fully-connected describes a neural-network layer in which each output unit has a weight for every input feature supplied to that layer. Such a layer is also commonly called dense. It computes weighted combinations of the input values, usually with biases, and may be followed by an activation function. The term describes connectivity, not the quality or knowledge of the model.

What it means

If a layer receives three features and produces two outputs, each output can use all three input features. It therefore has six connection weights. The weights need not be equal, positive, or nonzero; the architecture makes the connections available, while training determines their values.

The relevant input is the vector presented to that layer. Fully-connected does not mean that every word, record, or neuron in the entire system connects directly to every other one. In sequence models, a dense transformation may be applied independently to each position's feature vector without itself mixing information between positions.

How it works

For an input column vector x, a typical layer computes z = Wx + b. Each row of W contains the weights for one output, and b supplies one bias per output when biases are enabled. An activation such as ReLU may then produce h = ReLU(z).

With n input features and m output units, the weight matrix contains m times n parameters. Adding one bias per output gives mn + m parameters. The same learned weights are normally reused across examples; processing a larger batch does not create a separate parameter set for every example.

Training adjusts the parameters through the chosen loss and optimization procedure. Connectivity alone does not guarantee useful learning. Input representation, data quality, regularization, activation choices, and the surrounding architecture all affect performance. Without intervening nonlinear operations, composing affine dense layers remains an affine transformation.

Three practical examples

1. Text classification: A dense output layer can convert a document representation into class scores, which a later operation interprets for the classification task.

2. Speech modeling: A layer can transform an acoustic feature vector into a different representation, provided its input and output dimensions match the model design.

3. Architecture budgeting: Engineers can calculate how widening a dense layer changes its parameter count before evaluating memory requirements and task performance.

Think of it this way

Think of two mixing desks, each receiving the same three audio channels. Each desk has its own gain control for every channel and produces a separate mix. A fully-connected layer similarly gives each output its own weighted access to every input feature.

The analogy is limited: neural features need not be audio, weights can be negative, and a later nonlinearity changes the result beyond ordinary mixing. It does not imply human-like interpretation of the features.

Worked example

Take an original example with input x = [2, -1, 3]. Let the first output's weights be [0.5, 1, -1] with bias 0.5. Its pre-activation is 0.5 times 2 plus 1 times -1 minus 1 times 3 plus 0.5, giving -2.5.

Let the second output's weights be [1, -2, 0.5] with bias -1. Its pre-activation is 1 times 2 minus 2 times -1 plus 0.5 times 3 minus 1, giving 4.5. The affine layer therefore returns [-2.5, 4.5]. Applying ReLU separately produces [0, 4.5].

There are three inputs and two outputs, so the layer has 3 times 2 = 6 weights and 2 biases: 8 learned parameters in total. Evaluating ten input vectors still uses these same 8 parameters; it does not require 80 separately learned values.

The zero after ReLU does not mean that the first output lacked connections. Its weighted sum was negative, and the chosen activation clipped that value. These numbers demonstrate a forward calculation only; no training run or classification result is implied.

Illustrative case study

Fictional case: A help-desk team adds a dense classification layer to an existing text encoder. Engineers initially propose making the layer much wider because more connections seem likely to improve accuracy.

They calculate the resulting parameter count and compare several widths on held-out messages. They also inspect whether errors arise from poor labels or missing information in the input. The team chooses based on measured performance and operating constraints, treating layer width as one design choice rather than a direct measure of intelligence.

Common misconceptions and mistakes

Fully-connected does not mean all weights are identical or all inputs influence every output equally. A learned weight can be zero even when the architecture includes that connection.

A dense layer is not automatically a complete deep network. It can be one component, and an affine layer by itself has limited functional form. Additional layers without nonlinearities do not automatically provide nonlinear modeling power.

The term also does not guarantee mixing across time or token positions. A feature-wise linear projection applied independently at every position remains distinct from attention or another operation that exchanges information between positions.

Business use

For businesses, dense-layer dimensions help explain model size and some computational costs. A layer mapping 1,000 features to 100 outputs has 100,000 weights, or 100,100 parameters with biases. Doubling only the output width doubles those counts, but it does not establish a corresponding accuracy gain.

Ask whether the proposed representation and model capacity match the data and task. Parameter estimates support planning, while real latency, memory, and quality require measurement in the complete system. Training also uses resources beyond the stored weights, so parameter count is not a complete memory budget.

People also ask

Is fully-connected another name for dense?

Commonly, yes, when describing this all-input-to-each-output layer connectivity.

Must a dense layer include an activation?

Not necessarily. Some software layers implement the affine transformation alone, with activation added separately.

Does a bigger batch add learned parameters?

No. The same layer parameters are reused across batch examples, although intermediate data and computation increase.

Check your understanding

A dense layer maps five input features to four outputs and includes biases. How many learned parameters does it have?

Answer: Twenty weights plus four biases, giving 24 parameters. A subsequent parameter-free activation does not add learned weights to that count.

Related terms

  • Bias
  • Activation function
  • Multilayer perceptron
  • Dense layer
  • weight matrix
  • linear projection
  • parameter count

Learn next

Learn next about matrix multiplication and activation functions. Calculate a tiny layer by hand, then compare a single affine transformation with two layers separated by a nonlinearity.

  • Affine transformation

More in Natural language and speech

  • Forward-looking centers - Forward-looking centers are the discourse entities associated with an utterance that centering theory treats as candidates for continued attention in the...
  • Frame elements - Frame elements are the defined semantic roles associated with a particular semantic frame.
  • Free word order - Free word order describes substantial flexibility in the ordering of sentence constituents, such as subjects, objects, and verbs.
  • Function word - A function word primarily expresses a grammatical relationship or structural meaning rather than naming a person, object, action, or descriptive property.
  • Fundamental frequency - Fundamental frequency, usually written F0, is the repetition rate of a periodic signal, measured in hertz, or cycles per second.
  • Gale - Church alignment algorithm - The Gale - Church alignment algorithm identifies corresponding sentences or small sentence groups in two versions of a text, typically written in different...

Sources

Jurafsky and Martin's neural-network chapter was read for fully-connected layers, matrix form, and activations: https://web.stanford.edu/~jurafsky/slp3/6.pdf . PyTorch's official Linear documentation was consulted for the affine-layer implementation distinction: https://docs.pytorch.org/docs/2.14/generated/torch.nn.Linear.html . The calculations and help-desk case are original illustrations, not benchmark or deployment results.

Previous: Full-reference metric Next: Fully connected layer

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer