Skip to content

Main content

Artificial Intelligence: LoRA Layer Trainable Parameter Count Tool

Count two bias-free low-rank adapter matrices r*in + out*r for one dense layer; excludes base weights, optimizer state and any trained biases.

Loading tool…

Description

Return exact trainable parameter count for two low-rank factors.

A low-rank update represents a weight change as the product of two smaller matrices, with a scaling convention applied to that product. Counting their entries and evaluating one updated weight are distinct operations; neither trains an adapter or checks the quality of an adapted model.

Return exact trainable parameter count for two low-rank factors.

When to use this tool

Use Artificial Intelligence: LoRA Layer Trainable Parameter Count when checking a low-rank update entry or its stated matrix-parameter count.

How to use the tool and how it works

  1. Enter inputDimension, outputDimension, rank. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read result. Expand result to inspect the returned fields.

Return exact trainable parameter count for two low-rank factors. Require input/output dimensions 1..1e9 and whole rank 1..min(dimensions); trainableParameters = rank*(inputDimension+outputDimension), serialized as decimal text.1

LoRA represents a weight update using low-rank factors. These helpers cover one factor-product entry or its parameter count, rather than training an adapter or selecting an effective rank.2

Input fieldMeaning and unitsAccepted input
inputDimensionInput DimensionRequired. Safe integer.
outputDimensionOutput DimensionRequired. Safe integer.
rankRankRequired. Safe integer. Calculation range: 1 through Math.min(inputDimension, outputDimension, inclusive.
Output fieldInterpretationReturned shape
resultObject containing the returned operation-specific members listed below.Required. Object.
result.trainableParametersExact decimal-integer text for rank*(inputDimension+outputDimension), excluding bias and optimizer state.Calculated result member: string.
json
{
  "input": {
    "inputDimension": 8,
    "outputDimension": 12,
    "rank": 2
  },
  "output": {
    "result": {
      "trainableParameters": "40"
    }
  }
}

Limitations and assumptions

  • This excludes biases, base weights and additional adapter parameters; no model allocation or training is executed.
  • Outputs are nested inside result. Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Inspect the full adapter configuration, matrix orientation, rank and scaling convention for implementation-specific training or inference.

References

  1. Calculation and input contract: artificial-intelligence/lora-layer-trainable-parameter-count — tool.io

  2. LoRA: Low-Rank Adaptation of Large Language Models — Edward J. Hu and coauthors

Similar or alternative tools