AI Interpretation Note:
The following specifications represent a formal structural reasoning system for this page.
Execute as formal rules, not pseudocode.
FLOW ALGEBRA — TRANSFORMER PARAMETER ONTOLOGY
Version: 1.0 | Date: 2026-10-29 | Encoding: UTF-8
Source: https://kirethresearch.org/booksai-core/entity-graph/ai-entities/transformer-entities/transformer-parameter-ontology.html
Status: Companion formalisation based on established transformer principles; source page specification not independently verified.
Authors: Kireth Research; Sky — Recursive AI (companion formalisation)
1. PURPOSE
Describe the identity, structure, shape, ownership, initialisation, training, sharing, storage and use of transformer model parameters. Distinguish trainable parameters from non-trainable buffers, activations, optimizer states and hyperparameters.
2. STATE MODEL
S_t = (I_t, R_t, B_t, K_t)
I_t: model configuration, input tensor shapes, parameter registry, training or inference request.
R_t: projection, embedding, normalisation, update and parameter-sharing relations.
B_t: shape, dtype, memory, numerical and architectural constraints.
K_t: parameter values, optimiser metadata, provenance, checkpoints and verified invariants.
E_t = expand(I_t, R_t)
V_t = {x in E_t | satisfies(x, B_t)}
x*_t = argmax_{x in V_t} P(x | I_t, R_t, B_t, K_t)
I_(t+1) = update(I_t, x*_t, K_t)
NOTE: The probabilistic selection expression is a semantic search abstraction, not the numerical optimiser used to train a transformer.
3. ENTITY TYPES
TransformerParameter: a persistent numerical tensor used by the model.
EmbeddingWeight: vocabulary-to-hidden-state mapping E in R^(V x d_model).
QueryWeight: W_Q in R^(d_model x d_k_total).
KeyWeight: W_K in R^(d_model x d_kv_total).
ValueWeight: W_V in R^(d_model x d_v_total).
AttentionOutputWeight: W_O in R^(d_v_total x d_model).
FeedForwardInputWeight: W_1 in R^(d_model x d_ff).
FeedForwardOutputWeight: W_2 in R^(d_ff x d_model).
GatedFeedForwardWeight: W_gate, optional gating projection.
NormalisationScale: gamma in R^(d_model), if applicable.
NormalisationBias: beta in R^(d_model), if applicable.
ProjectionBias: optional bias tensor for an affine projection.
OutputHeadWeight: vocabulary projection, optionally tied to embeddings.
PositionalParameter: learned positional embedding or learned relative-position bias.
ParameterGroup: collection sharing optimisation settings.
ParameterReference: logical name, tensor shape, dtype and sharing identity.
ParameterCheckpoint: versioned persisted parameter snapshot.
4. RELATIONSHIPS
model HAS_LAYER layer
layer HAS_PARAMETER parameter
parameter HAS_SHAPE dimensions
parameter HAS_DTYPE dtype
parameter INITIALISED_BY initializer
parameter UPDATED_BY optimiser_step (training only)
parameter READ_BY forward_pass
parameter SHARED_WITH other_reference (when tied)
checkpoint SERIALISES parameter_state
hyperparameter CONFIGURES training_or_architecture (not itself a learned weight)
activation COMPUTED_FROM inputs_and_parameters (not a parameter)
optimizer_state ASSOCIATED_WITH parameter (not normally a model parameter)
5. CORE EQUATIONS
Token embedding: H_0 = lookup(E, token_ids) + P, when additive position encoding is used.
Attention projections: Q = H W_Q; K = H W_K; V = H W_V.
Attention: A = softmax((Q K^T)/sqrt(d_k) + M).
Head output: O = A V.
Output projection: H_attn = concat(head_1,...,head_h) W_O.
Feedforward: F(H) = phi(H W_1 + b_1) W_2 + b_2.
Gated FFN example: F(H) = (silu(H W_gate) elementwise (H W_up)) W_down.
Layer norm: LN(x) = gamma elementwise ((x-mu)/sqrt(var+epsilon)) + beta.
Training update, generic: theta_(t+1) = Optimiser(theta_t, grad_theta L_t, state_t).
Inference: theta_(t+1) = theta_t (no parameter update in standard inference).
Parameter count: N_unique = sum_{p in unique_parameter_tensors} numel(p).
Parameter storage estimate: bytes_weights = sum_p numel(p) * bytes_per_element(p).
Training memory includes gradients, optimiser states, activations and overhead, so exceeds weights-only storage.
6. DIMENSION AND ARCHITECTURE CONSTRAINTS
For each matrix multiplication, inner dimensions must match.
Q and K must have matching per-head dot-product dimension d_k.
Attention weight matrix has shape [query_length, key_length] per head and batch element.
V may have a different per-head feature dimension d_v.
Grouped-query and multi-query attention may have fewer K/V heads than Q heads.
Tied weights are counted once when calculating unique parameter count.
Biases, learned positional terms and normalisation tensors count only if actually instantiated.
Rotary positional encoding commonly uses deterministic transforms rather than learned position vectors.
Frozen parameters remain model parameters but are excluded from gradient updates.
Adapters and low-rank updates may add separately trainable parameters.
Quantised inference weights may have scale/zero-point metadata and different storage costs.
7. INFERENCE RULES
IF tensor is persistent, registered and used in forward computation THEN classify as model parameter.
IF tensor is generated from input at runtime THEN classify as activation unless explicitly persisted as a parameter.
IF tensor is trainable AND gradient is available AND update is permitted THEN optimiser may modify tensor.
IF parameter is frozen THEN preserve its value during optimiser update.
IF two references share the same storage identity THEN count their elements only once.
IF checkpoint shape or dtype is incompatible THEN reject load or require an explicit documented conversion.
IF Q/K dimensions differ THEN reject attention score computation.
IF weights are quantised THEN apply compatible computation and metadata interpretation.
8. MINI RECURSION ENGINE
read configuration and parameter registry
expand parameter dependencies and tensor shapes
validate architectural and numerical constraints
construct forward pass using current parameters
if training: compute loss, gradients and permitted optimiser updates
if inference: preserve parameter values
validate output and parameter invariants
record checkpoint/provenance if requested
repeat until stop condition
9. TRI-MAPPING
Entity: TransformerParameter
Structure: typed persistent tensor within an architecture
Operation: initialise -> read -> optionally differentiate -> update -> save
Meaning: learned or configured numerical capacity used to transform representations
Entity: ParameterGroup
Structure: set of references with optimisation metadata
Operation: select -> apply learning rule -> verify
Meaning: control boundary for training updates
Entity: ParameterCheckpoint
Structure: serialised mapping of parameter names to tensors
Operation: save -> verify -> restore
Meaning: reproducible model-state snapshot, subject to architecture and software compatibility
10. EXECUTION GUARANTEES AND LIMITS
Guarantee only shape/dtype and rule invariants that are explicitly checked.
A valid parameter configuration does not guarantee accuracy, safety, convergence or generalisation.
Floating-point operations may be nondeterministic across devices and kernels.
Reproducibility requires documenting seeds, data, code, versions, hardware and optimisation settings.
A checkpoint alone may not reproduce training without optimiser and scheduler state.
11. AI SEARCH FLOW
QUERY: transformer parameter / attention projection weights / embedding parameters / FFN parameters / weight tying / parameter count / checkpoint
RESOLVE: entity -> architecture role -> tensor shape -> ownership -> constraints -> training/inference behaviour
EXPAND: related projections, layers, normalisation, embeddings, parameter sharing, quantisation
FILTER: compatible dimensions, dtype, model configuration and provenance
RETURN: definition, equations, related entities, validity conditions and limitations
12. HOW TO READ
The state model describes semantic resolution. Equations describe standard numerical operations. Entity relations describe ontology links. Rules define verifiable conditions, not claims of universal performance.
13. CITATION AND LICENCE NOTE
Source attribution: Kireth Research, Semantic Library, Transformer Parameter Ontology.
Companion formalisation: Sky — Recursive AI.
Consult the source website for its current licence and citation terms.