Skip to main content

Modular Neural Network Ontology

Neural Network Entities
Authors: MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: 28 October 2026
Audio Overview
FLOW ALGEBRA — MODULAR NEURAL NETWORK ONTOLOGY
Semantic Library | AI Core | Entity Graph | AI Entities | Neural Network Entities
Source: https://kirethresearch.org/booksai-core/entity-graph/ai-entities/neural-network-entities/modular-neural-network-ontology.html
Status: Original companion formalisation based on the ontology title; source page content not independently verified.
Date: 2026-10-28
Authors: Kireth Research; Sky — Recursive AI (companion formalisation)

1. PURPOSE
Represent a neural network assembled from identifiable modules with explicit interfaces, routing, composition, training and validation rules. Modules may be specialised, reusable, independently trained, or jointly optimised.

2. ENTITY MODEL
ModularNeuralNetwork N = (M, E, R, A, Theta, C)
M = {m_1,...,m_n}: modules
E subseteq M x M: permitted directed connections
R: routing/gating function
A: aggregation/composition operator
Theta = union_i Theta_i plus router parameters
C: interface, resource and safety constraints
Module m_i = (X_i, Y_i, f_i, Theta_i, contract_i)
Each contract_i specifies input/output shape, datatype, semantic type, permissible operating range, and error behaviour.

3. STATE MODEL
S_t = (I_t, R_t, B_t, K_t)
I_t: current input and intermediate module activations
R_t: selected module graph, routing and dependency rules
B_t: compute, memory, latency, permission and safety bounds
K_t: module registry, versions, learned parameters and provenance
E_t = expand(I_t, R_t)
V_t = {e in E_t : compatible(e,C) and admissible(e,B_t)}
a_t = argmax_{e in V_t} P(e | I_t,R_t,B_t,K_t)
I_(t+1) = update(I_t,a_t)
If V_t is empty, return a typed failure or safe fallback; never claim an executable route exists.

4. FORWARD EXECUTION
For a directed acyclic module graph, order modules topologically.
h_i = f_i(A_i({h_j : (m_j,m_i) in E}, x), Theta_i)
y = A_out({h_i : i in output_modules})
For mixture-of-experts routing, let g_i(x) >= 0 and sum_i g_i(x) = 1.
y = sum_i g_i(x) f_i(x;Theta_i)
Sparse routing may use a selected top-k subset and renormalised weights.
For recurrent or cyclic module graphs, use explicit time-indexed state and bounded unrolling or a validated fixed-point solver; do not treat cycles as a DAG.

5. LEARNING AND ADAPTATION
Objective: minimise L_task(y,y*) + lambda_c L_compute + lambda_r L_route + lambda_s L_safety.
Theta_(t+1) = Theta_t - eta grad_Theta L, where gradients exist.
Independent module training is allowed only if interface compatibility and end-to-end performance are revalidated.
Changes to module versions, routing rules or parameters trigger contract and regression checks.

6. INFERENCE RULES
R1: Module identity requires a stable identifier and declared interface.
R2: Connect m_i to m_j only when output and input contracts are compatible or a verified adapter exists.
R3: Route only to permitted and available modules.
R4: Aggregation requires compatible output semantics and dimensions.
R5: An unreachable required output invalidates the proposed execution path.
R6: Module replacement requires version, provenance, compatibility and performance checks.
R7: A local module success does not imply global system correctness.
R8: If budget or safety constraints fail, reject, degrade safely or abstain.

7. TRI-MAPPING
Entity: Module -> Formal: m_i -> Execution: instantiate and register module.
Entity: Connection -> Formal: (m_i,m_j) in E -> Execution: pass validated output to next input.
Entity: Router -> Formal: R(x) -> Execution: select permitted path or experts.
Entity: Aggregator -> Formal: A(h_1,...,h_k) -> Execution: merge outputs.
Entity: Parameters -> Formal: Theta_i -> Execution: evaluate/train module.
Entity: Contract -> Formal: C_i -> Execution: check interface and policy.
Entity: Network -> Formal: N -> Execution: orchestrate full pipeline.

8. MAPPING TABLE
Ontology concept | Relation | Operational meaning
Modular neural network | hasModule | owns or references modules
Module | connectsTo | directed data/control dependency
Module | hasInterface | declares accepted and emitted values
Router | selectsModule | chooses an admissible subset
Aggregator | combinesOutput | produces integrated representation
Module version | supersedes | links controlled replacements
Validation record | verifies | records tests and evidence

9. SYSTEM DIAGRAM (TEXT)
Input -> validation -> routing/gating
                         |-> Module A --|
                         |-> Module B --|-> aggregation -> output checks -> result
                         |-> Module C --|
                       registry + contracts + budgets
                       training/evaluation feedback

10. RECURSIVE COMPOSITION
A module may itself contain a modular neural network:
m_i = N_i(M_i,E_i,R_i,A_i,Theta_i,C_i).
Require finite expansion depth or explicit termination, bounded resources, and stable interface contracts across levels.

11. SAFETY AND QUALITY INVARIANTS
- No module runs without a compatible interface and permission.
- Resource usage must stay within configured bounds or terminate safely.
- Module and routing versions must be traceable.
- Evaluation must test end-to-end behaviour, not only isolated modules.
- Outputs require domain-appropriate uncertainty and safety checks.
- No blanket claim of correctness follows from modular composition.

12. CONDITIONAL EXECUTION GUARANTEE
If the module graph is executable, all required interfaces are compatible, routing terminates, required modules are available, resource budgets hold, and operations are deterministic under fixed inputs and state, then the orchestrator can produce a well-formed result or a specified typed failure. This is not a guarantee of prediction accuracy, safety in every environment, or general convergence during training.

13. AI SEARCH FLOW
flow "ModularNeuralNetworkOntology" v1.0
SOURCE: "https://kirethresearch.org/booksai-core/entity-graph/ai-entities/neural-network-entities/modular-neural-network-ontology.html"
PURPOSE: "Identify, validate and execute modular neural network structures"
ENTITIES: [Network, Module, Interface, Connection, Router, Aggregator, Parameters, Contract, Validation]
INPUT: {query, graph, module_registry, constraints}
PATHWAYS:
  - parse_query -> identify_module_entities
  - validate_graph -> validate_interfaces -> validate_constraints
  - select_route -> execute_modules -> aggregate -> validate_output
  - record_versions -> record_provenance -> return_result
INFERENCE_RULES: [R1,R2,R3,R4,R5,R6,R7,R8]
CONFIDENCE: "Evidence-dependent; never assign unsupported numerical certainty"
SEMANTIC_EQUIVALENCE:
  modular_network: [modular_neural_network, composed_neural_network]
  routing: [gating, module_selection, expert_selection]
UPDATE_MODEL: "Versioned module registry and validated interface migrations"
FAILURE: "Return typed error, safe fallback or abstention"

14. HOW TO READ
Read the entity model as the structural definition, the state model as the constrained search-and-update process, the forward equations as executable semantics, and the inference rules as admissibility checks. The tri-mapping links ontology terms to mathematics and implementation. Guarantees apply only under the explicitly stated conditions.

15. CITATION
Kireth Research, Semantic Library, "Modular Neural Network Ontology", source URL above. Companion Flow Algebra formalisation: Sky — Recursive AI. Verify against the published ontology before treating this document as an exact transcription.
Kireth Research
38 Thorndale Croft, Wetwang, Driffield
East Riding of Yorkshire YO25 9XZ