CALCULATE · INSPECT · COMPARE

Low-rank adapters: compute the base and the update

Inspect XW and (alpha/r)(XA)B separately, then add their actual outputs.

60-second worked calculation · exact small arrays

Your experiment

Set alpha to zero: Y must equal the frozen base. Increase rank without changing X or W and compare the new update and adapter parameter count. At these small dimensions, an adapter can have as many or more parameters than the base.

Play inspects the entire calculated trace over 60 seconds at 1×. Use 0.5× for two minutes, pause, or step through individual operations. Restart preserves your inputs. Changing a model input rebuilds the calculation without autoplay.

What the calculation means

With row-vector inputs, A has shape d × r and B has shape r × m. The adapter has r(d+m) parameters versus dm in W. These nonzero seeded factors illustrate a forward pass, not the usual zero-update initialization or training. Changing rank regenerates factors; it is not a quality comparison.

Matrix values at this step

Canvas and tables round labels for readability. The inspector preserves full JavaScript number values.

Full-precision operation inspector

A bounded mathematical teaching model. Playback measures inspection time, not computation or training latency. No model weights are downloaded; no external inference, storage or training is performed. Read the official AICassindra articles.

Separate the base branch from the adapter

This row-vector experiment computes Y = XW + (alpha/r)(XA)B. Input rows selects token count, Input width selects the input feature dimension d, and Output width selects m. The fixed base W has d times m parameters. Adapter rank r gives factor shapes d by r and r by m, with r times (d + m) factor parameters. The canvas walks through Base, the intermediate H = XA, Delta = HB and the final scaled addition. These illustrative factors are generated nonzero so you can see their contribution; this is not a prescription for initialization or a training simulation.

Generated matrices and explicit input

Input rows sets the number of independent token rows. Input width sets the features in each row. Matrix fixture seed deterministically regenerates small signed integers, so record it with every comparison. Generated input scale multiplies the generated input values, including negative or zero scaling. Open Edit the input matrix to enter a rectangular JSON array matching the selected row and feature counts. An explicit matrix overrides generated input values and input scaling, but the seed still determines any generated weight matrices. Clear the editor to restore the generated fixture. Malformed JSON, a mismatched shape or any component outside minus one hundred through one hundred disables calculation and clears stale results.

Disable the update without removing the factors

Keep the default two rows, input width three, output width two, rank two and seed seven. Set Adapter alpha to zero and inspect the final arrays: Y must equal Base exactly even though Delta may be nonzero. With the same configuration, compare alpha two and alpha four. Because rank remains two, the adapter contribution Y minus Base doubles. Setting Generated input scale to zero with an empty editor makes Base, Delta and Y all zero. An explicit input matrix overrides that scale, so clear it before trying this boundary.

Rank and parameter counts are different claims

At width three by two and rank two, the base has six parameters and the adapter has ten; this tiny example does not save parameters. Increase input width to six and output width to four, then select rank one: the base has twenty-four parameters and the factors have ten. Larger rank changes both the generated factors and the alpha divided by rank multiplier. It therefore cannot be interpreted as changing only an update magnitude or as a guaranteed quality improvement. The parameter count describes stored scalar weights and excludes optimizer state, activations, gradients, quantization and device allocation.

Failure boundaries and limits

Rank must not exceed either input or output width. Selecting rank four with output width two explicitly disables the calculation until the dimensions or rank are corrected. This bound keeps the example within its stated low-rank teaching scope. The matrix fixture seed changes W, A and B together, so preserve it when comparing alpha. No training data, optimizer steps, convergence or inference timing is modeled. The final inspector makes both branches visible for numerical checking; canvas values alone are rounded for readability.

Inspect computation at your own pace

Play spreads the finite operation trace over sixty seconds at normal speed. Pause freezes the arrays and accumulator so you can compare a highlighted input with its contribution. Next operation advances one recorded calculation and pauses. Restart returns to the first frame while preserving the current experiment inputs; it is not a factory reset. Speed selects a quarter, half, normal or double inspection rate. The Inspection slider directly selects a point in that minute and pauses playback. Editing any model parameter rebuilds the trace at its beginning without autoplay. These are viewing times, not CPU performance measurements.

Views are my own and do not represent any employer, past or present.

Search