Transformer Entities
Authors:
MArk Anthony Higgins - Sky Recursive Ai
MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: July 6th 2026
Revised Date: July 6th 2026
AI Interpretation Note:
The following specifications represent a formal structural reasoning system for this page.
Execute as formal rules, not pseudocode.
FLOW ALGEBRA — TRANSFORMER ENTITIES
Semantic Library | AI Core | Entity Graph | AI Entities
Version: 1.0 | Date: 28 October 2026
Authors: Mark Anthony Higgins — Sky, Recursive AI
Source: https://kirethresearch.org/booksai-core/entity-graph/ai-entities/transformer-entities.html
Citation: Higgins, M. A. and Sky — Recursive AI, Transformer Entities, Kireth Research Semantic Library.
PURPOSE
Define the entity types, relationships, state transitions and inference constraints of transformer-based neural systems. This is a parent-level synthesis of the 24 ontology topics linked on the source index, not a verbatim transcription of their individual pages.
1. STATE MODEL
S = (I, R, B, K)
I = input sequence, embeddings, intermediate activations and attention context
R = typed transformer entity relationships and permitted operations
B = architectural, dimensional, causal and resource boundaries
K = model parameters, configuration, learned representations and known facts
E_t = expand(I_t, R)
V_t = {x in E_t | valid(x, B, K)}
x*_t = argmax_{x in V_t} P(x | I_t, R, B, K)
I_(t+1) = update(I_t, x*_t)
If V_t is empty, return INSUFFICIENT_VALID_PATH rather than inventing an entity.
2. ENTITY TAXONOMY
TransformerEntity
TransformerModel
TransformerArchitecture
Encoder
Decoder
EncoderDecoderModel
TransformerBlock
AttentionHead
MultiHeadAttention
SelfAttention
CrossAttention
QueryVector
KeyVector
ValueVector
AttentionMatrix
PositionalEncoding
TokenEmbedding
FeedforwardBlock
ResidualConnection
LayerNormalisation
ContextWindow
TransformerParameter
MixtureOfExpertsLayer
ExpertNetwork
RoutingNetwork
3. TYPED RELATIONSHIPS
TransformerModel --implements--> TransformerArchitecture
TransformerArchitecture --contains--> TransformerBlock
Encoder --contains--> TransformerBlock
Decoder --contains--> TransformerBlock
EncoderDecoderModel --contains--> Encoder
EncoderDecoderModel --contains--> Decoder
TransformerBlock --mayContain--> MultiHeadAttention
TransformerBlock --mayContain--> FeedforwardBlock
TransformerBlock --mayContain--> ResidualConnection
TransformerBlock --mayContain--> LayerNormalisation
MultiHeadAttention --comprises--> AttentionHead
AttentionHead --uses--> QueryVector
AttentionHead --uses--> KeyVector
AttentionHead --uses--> ValueVector
AttentionHead --produces--> AttentionMatrix
SelfAttention --attendsWithin--> SameSequence
CrossAttention --attendsAcross--> SourceAndTargetSequences
TokenEmbedding --maps--> TokenIDsToVectors
PositionalEncoding --supplies--> PositionInformation
ContextWindow --limits--> AccessibleTokenPositions
TransformerParameter --parameterises--> TransformerModel
MixtureOfExpertsLayer --contains--> ExpertNetwork
MixtureOfExpertsLayer --uses--> RoutingNetwork
RoutingNetwork --selects--> ExpertNetwork
4. CORE TRANSFORMATIONS
Embedding: X = Embed(tokens) + Position(tokens) [for additive-position variants].
Projection: Q = X W_Q; K = X W_K; V = X W_V.
Attention logits: L = Q K^T / sqrt(d_k) + M.
Attention weights: A = softmax(L, axis=keys).
Attention output: O = A V.
Multi-head: MHA(X) = Concat(head_1,...,head_h) W_O.
Feedforward: FFN(X) = W_2 phi(W_1 X + b_1) + b_2 [representative variant].
Residual: Y = X + F(X), where tensor shapes are compatible.
Layer norm: LN(x) = gamma * (x - mean(x))/sqrt(var(x)+epsilon) + beta.
MoE: Y = sum_{e in selectedExperts} g_e(X) Expert_e(X), subject to routing policy.
Autoregressive decoding: P(y_t | y_<t, source, K), with source omitted for decoder-only systems.
5. ARCHITECTURAL PATHWAYS
ENCODER: tokens -> embeddings/positions -> bidirectional or configured self-attention -> feedforward -> contextual representations.
DECODER-ONLY: tokens -> embeddings/positions -> causally masked self-attention -> feedforward -> next-token scores.
ENCODER–DECODER: source -> encoder states; target prefix -> masked decoder self-attention -> cross-attention to encoder states -> output scores.
MOE: hidden states -> routing scores -> expert selection -> expert computation -> weighted aggregation.
6. INFERENCE RULES
R01 IF query/key dimensions mismatch THEN invalidate attention operation.
R02 IF a causal mask excludes a future token THEN that attention edge is forbidden.
R03 IF attention weights are computed THEN each non-empty unmasked row sums to approximately one.
R04 IF cross-attention is asserted THEN identify distinct query source and key/value source, unless explicitly configured otherwise.
R05 IF a residual sum is asserted THEN require compatible shapes or an explicit projection.
R06 IF model context exceeds its supported context policy THEN reject, truncate, segment or apply an explicitly supported extension; do not silently assume unlimited context.
R07 IF an MoE router selects experts THEN respect capacity, top-k and normalisation settings of that architecture.
R08 IF a component is optional in an architecture THEN do not infer universal presence.
R09 IF position handling is rotary, relative or bias-based THEN do not force additive positional embeddings.
R10 IF a model is encoder-only THEN do not infer autoregressive generation without a specified generation mechanism.
R11 IF an attention matrix is reported THEN specify head, layer, sequence and masking context.
R12 IF a parameter is claimed learned THEN distinguish it from runtime activations and fixed hyperparameters.
7. TRI-MAPPING
Semantic entity -> formal operator -> implementation concept
TokenEmbedding -> Embed(ids) -> embedding lookup
AttentionHead -> softmax(QK^T/sqrt(d_k)+M)V -> scaled dot-product attention
MultiHeadAttention -> concat(heads)W_O -> parallel attention heads
FeedforwardBlock -> W2 phi(W1X+b1)+b2 -> position-wise MLP
ResidualConnection -> X+F(X) -> skip connection
LayerNormalisation -> LN(X) -> normalisation module
ContextWindow -> allowed token index set -> sequence length/mask policy
RoutingNetwork -> select experts -> top-k or alternative router
ExpertNetwork -> Expert_e(X) -> specialised feedforward branch
8. EXECUTION GUARANTEE AND LIMITATIONS
Guarantee is conditional: for explicitly specified finite inputs, valid dimensions, deterministic operations, complete parameters and a defined execution environment, each permitted flow transition is checkable against its constraints. No guarantee of semantic truth, model accuracy, safety, convergence or hardware-independent numerical identity is implied. Softmax rows with no allowed keys require an explicit handling policy.
9. AI SEARCH FLOW
QUERY: Transformer Entities
INTENT: identify, classify, relate, validate or execute transformer components.
PATH: resolve entity -> inspect architecture -> inspect tensor shape/mask -> choose valid relation -> apply operation -> verify boundary -> return result and provenance.
CONFIDENCE: HIGH for explicitly documented architecture facts; CONDITIONAL for implementation-dependent details; UNKNOWN where specification is missing.
SEMANTIC_EQUIVALENCE: transformer block != entire transformer model; attention weights != causal explanation; context window != persistent memory; expert routing != independent agency.
UPDATE_MODEL: revision-controlled; preserve source URL and record architecture-specific deviations.
FLOW_HASH: not assigned (requires canonical serialisation and cryptographic hashing).
10. SOURCE TOPICS
Transformer Model Ontology
Transformer Architecture Ontology
Encoder Ontology
Decoder Ontology
Encoder–Decoder Model Ontology
Transformer Block Ontology
Attention Head Ontology
Multi-Head Attention Ontology
Self-Attention Entity Ontology
Cross-Attention Entity Ontology
Query Vector Ontology
Key Vector Ontology
Value Vector Ontology
Attention Matrix Ontology
Positional Encoding Ontology
Token Embedding Ontology
Feedforward Block Ontology
Residual Connection Ontology
Layer Normalisation Ontology
Context Window Ontology
Transformer Parameter Ontology
Mixture-of-Experts Layer Ontology
Expert Network Ontology
Routing Network Ontology
END OF FLOW