Skip to content

Neural Network Parameter Counts

Count a dense layer, grouped Conv2D layer or explicitly specified conventional decoder with bias, grouping and weight-sharing choices.

Use this result well

Inputs that matter
Input features, Output features, Bias parameters, Input channels, and 10 more
Output to expect
Dense layer parameters, Conv2D layer parameters, Parameters in the stated architecture
  • Check the units and required inputs before comparing results.
  • Keep the assumptions with a copied result so you can reproduce the calculation later.
Was this tool helpful?

Reference & details

How it works

One dense layer parameter count

Parameters = input features × output features + optional output-feature biases One affine layer. Batch size and sequence length do not change its parameter count. Shared tensors must not be counted more than once. This is a parameter count, not total training memory.

One grouped Conv2D layer parameter count

Parameters = output channels × (input channels/groups × kernel height × kernel width + optional bias) One grouped Conv2D layer. Stride, dilation and image size affect output/activation shape, not this kernel count. Depthwise convolution uses groups equal to input channels with compatible output channels. Other layers and activation memory are excluded.

Specified conventional decoder parameter count

Per block = 4d² + 2df + (5d + f) linear biases + 4d LayerNorm; total = L×block + Vd token embedding + Pd learned positions + 2d final LayerNorm + optional Vd untied head Exact algebra for the stated conventional architecture. Includes all four attention linear projections and their biases, both MLP matrices and biases, two affine LayerNorms per block and a final affine LayerNorm. The output head has no bias. Weight tying removes its separate V×d matrix. Gated MLPs, RMSNorm, missing biases, grouped-query attention, mixtures of experts, adapters and other sharing need a different count.

Updated: September 2026

Example Scenarios

Count weights and optional biases for one fully connected layer.

Count a grouped 2D convolution’s kernel weights and optional per-output-channel bias.

Count a conventional decoder with full multi-head Q/K/V attention, a two-matrix MLP, affine LayerNorm, optional learned positions and a tied or untied output head.

Common Mistakes to Avoid

Applying one dense layer parameter count outside its stated assumptions

Batch size and sequence length do not change its parameter count. Shared tensors must not be counted more than once. This is a parameter count, not total training memory.

Applying one grouped conv2d layer parameter count outside its stated assumptions

Stride, dilation and image size affect output/activation shape, not this kernel count. Depthwise convolution uses groups equal to input channels with compatible output channels. Other layers and activation memory are excluded.

Applying specified conventional decoder parameter count outside its stated assumptions

Includes all four attention linear projections and their biases, both MLP matrices and biases, two affine LayerNorms per block and a final affine LayerNorm. The output head has no bias. Weight tying removes its separate V×d matrix. Gated MLPs, RMSNorm, missing biases, grouped-query attention, mixtures of experts, adapters and other sharing need a different count.

FAQ

Only if it consists of the one entered layer. Use an actual framework parameter inventory for a full model.

The layer has the same stored parameters; trainability is a separate property.

Groups must divide both input and output channels.

No. It counts this layer’s scalar parameters only.

No. Use it only when the architecture matches the stated components.

Only an entered learned position table does so here. Runtime sequence length affects activations separately.

About Neural Network Parameter Counts

Count a dense layer, grouped Conv2D layer or explicitly specified conventional decoder with bias, grouping and weight-sharing choices. Choose the mode that matches your measurements or study design, enter the stated units and keep the method and limits with the result.