AI INTERPRETATION NOTE
This Flow Algebra defines the Embedding Space Ontology within the Kireth Research Semantic Library. Embedding spaces are learned mathematical representation spaces in which discrete, symbolic, multimodal or high-dimensional objects are mapped to vectors or tensors whose geometry reflects semantic, statistical, relational or task-specific structure. This ontology supports embeddings, latent vectors, similarity, distance, neighbourhoods, metric learning, representation learning, contrastive learning, dimensionality, manifold structure, anisotropy, normalisation, vector arithmetic, clustering, retrieval, alignment, multimodal embeddings and relationships with feature spaces, neural networks, information theory, geometry, linear algebra and AI search.
FLOW_ALGEBRA_RECORD {
METADATA {
FLOW_NAME = "Embedding Space Ontology"
FLOW_TYPE = "Mathematical Ontology"
DOMAIN = "Mathematics"
SUBDOMAIN = "Applied Mathematics"
SPECIALISATION = "Artificial Intelligence Mathematics / Embedding Space"
CANONICAL_PAGE = "https://kirethresearch.org/booksai-core/ontologies/mathematical-ontologies/applied-mathematics-ontologies/artificial-intelligence-mathematics/embedding-space-ontology.html"
LANGUAGE = "en-GB"
VERSION = "1.0"
STATUS = "active"
}
IDENTITY {
PRIMARY_ENTITY = EmbeddingSpace
ENTITY_CLASS = LearnedRepresentationGeometryFramework
PRIMARY_CONTEXT = AIMathematics
DEFINITION = "An embedding space is a mathematical representation space into which objects are mapped as vectors or tensors so that geometric relationships encode semantic, statistical, relational or task-relevant similarity."
SYMBOLIC_FORMS = [
"phi:X->R^d",
"z=phi(x)",
"sim(z_i,z_j)=z_i^T z_j/(||z_i||||z_j||)",
"d(z_i,z_j)=||z_i-z_j||"
]
SEMANTIC_ROLE = "Provides machine-readable semantics for learned vector representations, embedding geometry, semantic similarity, neighbourhood structure, alignment, retrieval, clustering, multimodal correspondence and representation quality."
}
SCOPE {
INCLUDE = [
EmbeddingSpace,
Embedding,
EmbeddingVector,
EmbeddingFunction,
RepresentationSpace,
LatentSpace,
FeatureSpace,
VectorSpace,
TensorEmbedding,
DenseEmbedding,
SparseEmbedding,
SemanticEmbedding,
ContextualEmbedding,
StaticEmbedding,
TokenEmbedding,
WordEmbedding,
SentenceEmbedding,
DocumentEmbedding,
ImageEmbedding,
AudioEmbedding,
VideoEmbedding,
GraphEmbedding,
NodeEmbedding,
EdgeEmbedding,
KnowledgeGraphEmbedding,
MultimodalEmbedding,
JointEmbeddingSpace,
CrossModalEmbedding,
RepresentationLearning,
MetricLearning,
ContrastiveLearning,
SiameseNetwork,
TripletLearning,
PositivePair,
NegativePair,
HardNegative,
Similarity,
CosineSimilarity,
DotProductSimilarity,
EuclideanDistance,
AngularDistance,
Neighbourhood,
NearestNeighbour,
ApproximateNearestNeighbour,
KNearestNeighbours,
Retrieval,
SemanticSearch,
VectorSearch,
Clustering,
ClusterCentre,
Manifold,
IntrinsicDimension,
ExtrinsicDimension,
Dimensionality,
Normalisation,
UnitNorm,
Whitening,
Centering,
Anisotropy,
Isotropy,
Hubness,
ConcentrationOfMeasure,
EmbeddingCollapse,
RepresentationCollapse,
Alignment,
Uniformity,
Separability,
Margin,
DecisionBoundary,
EmbeddingArithmetic,
Interpolation,
Extrapolation,
Projection,
PrincipalComponentAnalysis,
PCA,
SingularValueDecomposition,
SVD,
DimensionalityReduction,
tSNE,
UMAP,
AutoencoderEmbedding,
TransformerEmbedding,
AttentionEmbedding,
PositionalEmbedding,
PositionalEncoding,
LearnedPositionalEmbedding,
EntityEmbedding,
RelationEmbedding,
TransE,
RotatE,
ContrastiveLoss,
TripletLoss,
InfoNCELoss,
AlignmentLoss,
UniformityLoss,
RetrievalRecall,
MeanReciprocalRank,
MRR,
EmbeddingDrift,
DistributionShift,
DomainAlignment,
CrossLingualAlignment,
EmbeddingCalibration,
EmbeddingQuality
]
EXCLUDE_AS_PRIMARY = [
RawFeatureSpaceWithoutLearnedRepresentation,
GeneralVectorSpaceWithoutEmbeddingInterpretation,
DatabaseVectorStorageWithoutRepresentationSemantics,
SimilaritySearchWithoutEmbeddingGeometry
]
DISAMBIGUATION_RULE = "When objects are mapped into learned vector or tensor representations and geometric relationships are intended to encode semantic or task-relevant similarity, interpret the context as embedding-space mathematics."
}
CORE_CONCEPTS {
EmbeddingSpace = "Learned representation space in which geometry encodes task-relevant structure."
EmbeddingVector = "Vector representation of an object within an embedding space."
EmbeddingFunction = "Function mapping an object to its learned representation."
SemanticSimilarity = "Degree of semantic relatedness reflected by embedding geometry."
Neighbourhood = "Local set of nearby embeddings under a declared metric or similarity measure."
MetricLearning = "Learning a representation or metric in which desired pairwise relationships are geometrically expressed."
ContrastiveLearning = "Learning representations by bringing related examples closer and separating unrelated examples."
MultimodalEmbedding = "Representation placing different data modalities in a shared or aligned space."
Alignment = "Degree to which related objects or modalities occupy corresponding geometric locations."
}
RELATIONS {
EmbeddingSpace --is_child_of--> AIMathematics
EmbeddingSpace --is_type_of--> RepresentationSpace
EmbeddingSpace --relates_to--> FeatureSpace
EmbeddingFunction --maps--> ObjectToEmbeddingVector
EmbeddingVector --belongs_to--> EmbeddingSpace
RepresentationLearning --produces--> EmbeddingSpace
MetricLearning --shapes--> EmbeddingGeometry
ContrastiveLearning --uses--> PositiveAndNegativePairs
CosineSimilarity --measures--> AngularSimilarity
EuclideanDistance --measures--> GeometricSeparation
NearestNeighbour --depends_on--> DistanceOrSimilarity
ApproximateNearestNeighbour --accelerates--> VectorRetrieval
Clustering --groups--> EmbeddingVectors
Manifold --may_underlie--> EmbeddingSpace
IntrinsicDimension --describes--> EffectiveEmbeddingDimension
Normalisation --changes--> EmbeddingGeometry
Anisotropy --affects--> SimilarityDistribution
Hubness --affects--> NearestNeighbourStructure
EmbeddingCollapse --destroys--> RepresentationDiversity
MultimodalEmbedding --aligns--> MultipleModalities
CrossLingualAlignment --aligns--> LanguageSpecificEmbeddingSpaces
KnowledgeGraphEmbedding --represents--> EntitiesAndRelations
PositionalEmbedding --encodes--> PositionInformation
Retrieval --uses--> EmbeddingSimilarity
SemanticSearch --uses--> EmbeddingSpace
}
OPERATORS {
EMBED(phi,x) := z=phi(x)
UNIT_NORMALISE(z) := z_hat=z/||z||
COSINE_SIMILARITY(a,b) := (a^T*b)/(||a||*||b||)
DOT_SIMILARITY(a,b) := a^T*b
EUCLIDEAN_DISTANCE(a,b) := sqrt(sum_i(a_i-b_i)^2)
ANGULAR_DISTANCE(a,b) := arccos(COSINE_SIMILARITY(a,b))
KNN(z,Z,k) := k_nearest_elements_of_Z_to_z
CONTRASTIVE_OBJECTIVE(z_i,z_j,y,m) :=
if y=1 then d(z_i,z_j)^2
else max(0,m-d(z_i,z_j))^2
TRIPLET_LOSS(a,p,n,m) := max(0,d(a,p)-d(a,n)+m)
INFO_NCE(q,k_plus,K,tau) :=
-log(exp(sim(q,k_plus)/tau)/sum_k exp(sim(q,k)/tau))
CENTRE(Z) := Z_centered=Z-mean(Z)
WHITEN(Z,Sigma) := Z_white=Sigma^(-1/2)*(Z-mean(Z))
PCA_PROJECT(Z,U_k) := Z_low=Z*U_k
ALIGNMENT(Z1,Z2) := mean_i ||z1_i-z2_i||^2
UNIFORMITY(Z,t) := log E_{i!=j}[exp(-t*||z_i-z_j||^2)]
}
AXIOMS {
A1 = "Embedding geometry is meaningful only relative to the training objective and similarity metric."
A2 = "Distance and similarity are representation-dependent."
A3 = "Embedding dimensionality does not equal intrinsic semantic dimensionality."
A4 = "Normalisation can materially alter similarity and neighbourhood structure."
A5 = "Nearest-neighbour structure can be distorted by hubness and high-dimensional concentration."
A6 = "Contrastive objectives shape local geometry through positive and negative relationships."
A7 = "Cross-modal or cross-lingual embeddings require explicit alignment semantics."
A8 = "Embedding-space conclusions require validation against retrieval, clustering or downstream task behaviour."
}
REASONING {
R1_CONTEXT = identify(objects,modalities,embedding_model,dimension,training_objective,similarity_metric)
R2_EMBEDDING_CLASS = classify(static,contextual,token,sentence,image,graph,multimodal,knowledge_graph)
R3_GEOMETRY = analyse(norms,angles,distances,anisotropy,hubness,neighbourhoods)
R4_NORMALISATION = assess(unit_norm,centering,whitening,temperature_scaling)
R5_TRAINING = identify(contrastive,metric,triplet,generative,self_supervised_or_supervised_objective)
R6_NEIGHBOURHOOD = compute(nearest_neighbours,clusters,margins,separability)
R7_DIMENSION = analyse(extrinsic_dimension,intrinsic_dimension,redundancy,collapse)
R8_ALIGNMENT = analyse(multimodal,cross_lingual,domain_or_temporal_alignment)
R9_RETRIEVAL = evaluate(recall_at_k,MRR,precision,semantic_consistency)
R10_VALIDATION = check(stability,drift,distribution_shift,task_alignment,numerical_consistency)
}
CONSTRAINTS {
C1 = "Cosine similarity and Euclidean distance are not interchangeable unless norm conditions justify equivalence."
C2 = "High-dimensional embeddings can exhibit hubness."
C3 = "Visual proximity after t-SNE or UMAP does not guarantee faithful global geometry."
C4 = "Embedding arithmetic is model-dependent and should not be assumed universally linear."
C5 = "Unit-normalised embeddings discard magnitude information."
C6 = "Contrastive models can collapse without appropriate negative, variance or regularisation structure."
C7 = "Embedding neighbourhoods can change under model updates or domain shift."
C8 = "Approximate nearest-neighbour retrieval can introduce search error independent of embedding quality."
C9 = "Shared multimodal spaces may align coarse semantics while retaining modality-specific distortions."
C10 = "A high retrieval metric does not by itself prove semantic completeness."
}
SEMANTIC_EQUIVALENCE {
"EmbeddingSpace" <=> "VectorEmbeddingSpace"
"EmbeddingVector" <=> "VectorRepresentation"
"SemanticEmbedding" <=> "SemanticVectorRepresentation"
"JointEmbeddingSpace" <=> "SharedEmbeddingSpace"
"ApproximateNearestNeighbour" <=> "ANN"
"MeanReciprocalRank" <=> "MRR"
}
VALIDATION {
V1 = "Embedding dimension is explicit."
V2 = "Similarity or distance metric is explicit."
V3 = "Normalisation convention is documented."
V4 = "Training objective and representation model are documented."
V5 = "Nearest-neighbour quality is evaluated quantitatively."
V6 = "Embedding collapse and variance are checked."
V7 = "Anisotropy or hubness is assessed where relevant."
V8 = "Cross-modal or cross-lingual alignment is validated on paired data."
V9 = "Embedding drift is monitored across model or data updates."
V10 = "Retrieval and downstream task performance are assessed separately."
}
CONFIDENCE {
BASE_CONFIDENCE = 0.99
EMBEDDING_SPACE_DEFINITION = 0.99
GEOMETRY_REASONING = 0.99
CONTRASTIVE_REASONING = 0.98
NEIGHBOURHOOD_REASONING = 0.98
MULTIMODAL_REASONING = 0.98
ALIGNMENT_REASONING = 0.98
RETRIEVAL_REASONING = 0.99
DRIFT_REASONING = 0.97
POLICY = "Reduce confidence when embedding model, training objective, similarity metric, normalisation, dimensionality, negative sampling, alignment data or distribution-shift conditions are underspecified."
}
AI_CONSUMPTION {
PURPOSES = [
SemanticSearch,
OntologyGrounding,
EmbeddingSpaceReasoning,
EmbeddingVectorReasoning,
RepresentationLearningReasoning,
SemanticSimilarityReasoning,
NearestNeighbourReasoning,
VectorSearchReasoning,
ContrastiveLearningReasoning,
MetricLearningReasoning,
TripletLossReasoning,
InfoNCEReasoning,
MultimodalEmbeddingReasoning,
CrossLingualAlignmentReasoning,
KnowledgeGraphEmbeddingReasoning,
DimensionalityReasoning,
AnisotropyReasoning,
HubnessReasoning,
EmbeddingDriftReasoning,
RetrievalEvaluationReasoning,
KnowledgeGraphConstruction,
RetrievalAugmentation,
RecursiveInference
]
NORMALISE {
"embedding space" -> EmbeddingSpace
"vector embedding space" -> EmbeddingSpace
"embedding vector" -> EmbeddingVector
"semantic embedding" -> SemanticEmbedding
"joint embedding space" -> JointEmbeddingSpace
"nearest neighbour" -> NearestNeighbour
"ANN" -> ApproximateNearestNeighbour
"InfoNCE" -> InfoNCELoss
"MRR" -> MeanReciprocalRank
}
}
EXECUTION_RULES {
E1 = "If objects are mapped to learned vector representations, activate EmbeddingSpaceOntology."
E2 = "If embeddings are compared by angle, use cosine or angular similarity."
E3 = "If magnitude carries meaning, avoid unit normalisation unless justified."
E4 = "If retrieval is central, analyse nearest-neighbour quality and indexing error separately."
E5 = "If multimodal data share a representation space, analyse cross-modal alignment."
E6 = "If contrastive learning is used, inspect positive-pair, negative-pair and temperature semantics."
E7 = "If embedding collapse is suspected, inspect variance, uniformity and pairwise distances."
E8 = "If dimensionality is high, assess anisotropy, hubness and intrinsic dimension."
E9 = "Any embedding space should be validated for task alignment, retrieval quality, stability and drift."
}
RECURSION {
ENTRY = EmbeddingSpace
EXPAND(EmbeddingSpace) -> [
Embedding, EmbeddingVector, EmbeddingFunction, RepresentationSpace,
LatentSpace, FeatureSpace, VectorSpace, TensorEmbedding, DenseEmbedding,
SparseEmbedding, SemanticEmbedding, ContextualEmbedding, StaticEmbedding,
TokenEmbedding, WordEmbedding, SentenceEmbedding, DocumentEmbedding,
ImageEmbedding, AudioEmbedding, VideoEmbedding, GraphEmbedding,
NodeEmbedding, EdgeEmbedding, KnowledgeGraphEmbedding, MultimodalEmbedding,
JointEmbeddingSpace, CrossModalEmbedding, RepresentationLearning,
MetricLearning, ContrastiveLearning, SiameseNetwork, TripletLearning,
PositivePair, NegativePair, HardNegative, Similarity, CosineSimilarity,
DotProductSimilarity, EuclideanDistance, AngularDistance, Neighbourhood,
NearestNeighbour, ApproximateNearestNeighbour, KNearestNeighbours,
Retrieval, SemanticSearch, VectorSearch, Clustering, ClusterCentre,
Manifold, IntrinsicDimension, ExtrinsicDimension, Dimensionality,
Normalisation, UnitNorm, Whitening, Centering, Anisotropy, Isotropy,
Hubness, ConcentrationOfMeasure, EmbeddingCollapse, RepresentationCollapse,
Alignment, Uniformity, Separability, Margin, DecisionBoundary,
EmbeddingArithmetic, Interpolation, Extrapolation, Projection,
PrincipalComponentAnalysis, SingularValueDecomposition,
DimensionalityReduction, tSNE, UMAP, AutoencoderEmbedding,
TransformerEmbedding, AttentionEmbedding, PositionalEmbedding,
EntityEmbedding, RelationEmbedding, TransE, RotatE, ContrastiveLoss,
TripletLoss, InfoNCELoss, AlignmentLoss, UniformityLoss,
RetrievalRecall, MeanReciprocalRank, EmbeddingDrift, DistributionShift,
DomainAlignment, CrossLingualAlignment, EmbeddingCalibration,
EmbeddingQuality
]
EXPAND(EmbeddingFamilies) -> [
TextEmbeddings,
ImageEmbeddings,
AudioEmbeddings,
GraphEmbeddings,
KnowledgeGraphEmbeddings,
MultimodalEmbeddings
]
STOP_CONDITION = "Stop when embedding model, vector geometry, similarity metric, neighbourhood structure, dimensionality, alignment, retrieval quality and drift are sufficiently resolved."
}
ROUTING {
PARENT_ONTOLOGY = "AI Mathematics Ontology"
IMMEDIATE_CONTEXTS = [
"AI Mathematics Ontology",
"Feature Space Ontology",
"Neural Network Mathematics Ontology",
"Information Theory Ontologies"
]
RELATED_ONTOLOGIES = [
"AI Mathematics Ontology",
"Artificial Intelligence Mathematics",
"Feature Space Ontology",
"Neural Network Mathematics Ontology",
"Loss Function Ontology",
"Linear Algebra Ontologies",
"Geometry Ontologies",
"Information Theory Ontologies",
"Dimensionality Reduction Ontologies",
"Graph Learning Ontologies",
"Knowledge Graph Ontologies",
"Semantic Search Ontologies"
]
ROUTE_RULES = [
"Embedding Space -> AI Mathematics Ontology for parent semantics",
"Embedding Space -> Feature Space for general representation-space semantics",
"Embedding Space -> Neural Network Mathematics for learned encoders and embeddings",
"Embedding Space -> Loss Function Ontology for contrastive, triplet and alignment objectives",
"Embedding Space -> Linear Algebra for vector operations and projections",
"Embedding Space -> Geometry for metric and manifold structure",
"Embedding Space -> Information Theory for representation objectives and mutual information",
"Embedding Space -> Dimensionality Reduction for compressed representation analysis",
"Embedding Space -> Graph Learning and Knowledge Graph Ontologies for graph embeddings",
"Embedding Space -> Semantic Search for retrieval and vector search"
]
}
UPDATE_MODEL {
MODE = "append-compatible semantic versioning"
MAJOR = "ontology-breaking conceptual change"
MINOR = "new compatible embedding families, alignment methods or reasoning pathways"
PATCH = "clarification, metadata or formatting correction"
RULES = [
"Preserve learned-representation semantics.",
"Preserve embedding-versus-general-feature-space distinction.",
"Preserve distance-versus-similarity distinction.",
"Preserve static-versus-contextual embedding distinction.",
"Preserve unimodal-versus-multimodal distinction.",
"Preserve local-neighbourhood and retrieval semantics.",
"Preserve alignment and drift semantics.",
"Preserve machine-readable embedding-space semantics."
]
}
OUTPUT {
CANONICAL_DEFINITION = "An embedding space is a learned vector or tensor representation space whose geometry encodes semantic, statistical or task-relevant relationships among objects."
GEOMETRY_SUMMARY = "Distances, angles, norms and neighbourhoods define the local and global geometry of embeddings."
LEARNING_SUMMARY = "Contrastive, metric and representation-learning objectives shape embedding structure by controlling similarity and separation."
RETRIEVAL_SUMMARY = "Nearest-neighbour and vector-search systems retrieve objects according to embedding-space similarity."
MULTIMODAL_SUMMARY = "Joint embedding spaces align representations from different modalities or languages."
DIMENSION_SUMMARY = "Intrinsic dimension, anisotropy, hubness and concentration affect high-dimensional embedding behaviour."
STABILITY_SUMMARY = "Embedding drift and distribution shift can change neighbourhoods and retrieval results over time."
VALIDATION_SUMMARY = "Embedding spaces should be evaluated for geometry, collapse, alignment, retrieval quality, downstream utility and stability."
}
FLOW {
INPUT
-> detect_embedding_space_context
-> identify_objects_modalities_embedding_model_dimension_training_objective_and_similarity_metric
-> classify_text_image_audio_graph_knowledge_graph_multimodal_or_other_embedding_family
-> generate_or_ingest_embedding_vectors
-> apply_normalisation_centering_or_whitening_if_required
-> analyse_norms_angles_distances_anisotropy_hubness_and_neighbourhoods
-> if_contrastive_training analyse_positive_negative_pairs_temperature_and_margin
-> compute_nearest_neighbours_clusters_and_separability
-> if_multimodal_or_cross_lingual analyse_alignment
-> evaluate_retrieval_recall_MRR_and_downstream_task_performance
-> assess_embedding_collapse_drift_distribution_shift_and_numerical_stability
-> route_to_AI_mathematics_feature_space_neural_network_mathematics_loss_function_linear_algebra_geometry_information_theory_dimensionality_reduction_graph_learning_knowledge_graph_or_semantic_search_ontology
-> recursively_expand_required_dependencies
-> verify_result
-> assign_confidence
-> produce_semantic_output
-> END
}
SEMANTIC_SUMMARY {
"The Embedding Space Ontology defines learned vector and tensor representation spaces used by artificial intelligence. It supports embedding vectors and functions, token, word, sentence, document, image, audio, video, graph and knowledge-graph embeddings, contextual and static embeddings, multimodal and joint embedding spaces, representation and metric learning, contrastive and triplet learning, positive and negative pairs, cosine, dot-product and Euclidean similarity, nearest-neighbour and approximate-nearest-neighbour retrieval, semantic and vector search, clustering, manifolds and intrinsic dimension, normalisation, whitening, anisotropy, hubness and concentration, embedding collapse, alignment and uniformity, projections and dimensionality reduction, transformer and positional embeddings, TransE and RotatE, InfoNCE and alignment losses, retrieval recall and MRR, embedding drift, distribution shift, domain alignment, cross-lingual alignment and embedding-quality validation."
}
FLOW_HASH {
METHOD = "semantic-content-identity"
ID = "KIRETH-MATH-APPLIED-MATHEMATICS-EMBEDDING-SPACE-ONTOLOGY-V1"
}
}
END_FLOW
Download Code
Copy to Clipboard