AI INTERPRETATION NOTE
This Flow Algebra defines the Automatic Differentiation Ontology within the Kireth Research Semantic Library. Automatic differentiation concerns the exact application of the chain rule to computational programs in order to compute derivatives of implemented functions efficiently. This ontology supports forward mode, reverse mode, dual numbers, computational graphs, Jacobians, gradients, vector-Jacobian products, Jacobian-vector products, adjoints, higher-order derivatives, checkpointing, tape-based systems, source transformation, operator overloading, differentiable programming, numerical stability, verification and reproducibility.
FLOW_ALGEBRA_RECORD {
METADATA {
FLOW_NAME = "Automatic Differentiation Ontology"
FLOW_TYPE = "Mathematical Ontology"
DOMAIN = "Mathematics"
SUBDOMAIN = "Computational Mathematics"
SPECIALISATION = "AI Computational Mathematics / Automatic Differentiation"
CANONICAL_PAGE = "https://kirethframeworkold.co.uk/books/semantic-library/ai-core/ontologies/mathematical-ontologies/computational-mathematics-ontologies/ai-computational-mathematics/automatic-differentiation-ontology.html"
LANGUAGE = "en-GB"
VERSION = "1.0"
STATUS = "active"
}
IDENTITY {
PRIMARY_ENTITY = AutomaticDifferentiation
ENTITY_CLASS = ProgramDerivativeComputationFramework
PRIMARY_CONTEXT = AIComputationalMathematicsOntology
DEFINITION = "Automatic differentiation is the exact application of the chain rule to elementary operations in a computational program to compute derivatives of the implemented function."
SYMBOLIC_FORMS = [
"y=f(x)",
"Jv = J_f(x) v",
"v^T J = VJP(v,f,x)",
"d y / d x = chain_rule(program)"
]
SEMANTIC_ROLE = "Provides machine-readable semantics for forward and reverse accumulation, computational graphs, tapes, adjoints, dual numbers, Jacobian products, higher-order derivatives, checkpointing and differentiable programming."
}
SCOPE {
INCLUDE = [
AutomaticDifferentiation,AD,
AlgorithmicDifferentiationRelationship,
DifferentiableProgramming,
ComputationalGraph,
ComputationGraph,
DirectedAcyclicGraphRelationship,
PrimitiveOperation,
ElementaryOperation,
DifferentiableOperation,
NonDifferentiableOperation,
ChainRule,
LocalDerivative,
GlobalDerivative,
DerivativePropagation,
ForwardModeAD,
ForwardAccumulation,
TangentMode,
TangentValue,
TangentPropagation,
DualNumber,
DualArithmetic,
EpsilonComponent,
JacobianVectorProduct,JVP,
DirectionalDerivative,
SeedVector,
ForwardSweep,
ReverseModeAD,
ReverseAccumulation,
AdjointMode,
AdjointValue,
Cotangent,
CotangentPropagation,
VectorJacobianProduct,VJP,
PullbackRelationship,
PushforwardRelationship,
ReverseSweep,
Gradient,
GradientVector,
Jacobian,
JacobianMatrix,
Hessian,
HessianMatrix,
HessianVectorProduct,HVP,
VectorHessianProductRelationship,
HigherOrderAutomaticDifferentiation,
NestedAD,
ForwardOverReverse,
ReverseOverForward,
ReverseOverReverseRelationship,
ForwardOverForwardRelationship,
HigherDerivative,
SecondDerivative,
ThirdDerivative,
PartialDerivative,
MixedPartialDerivative,
SourceTransformation,
ProgramTransformation,
OperatorOverloading,
Tracing,
Tracer,
Tape,
OperationTape,
ComputationalTape,
WengertListRelationship,
StaticGraphRelationship,
DynamicGraphRelationship,
EagerADRelationship,
GraphModeADRelationship,
JustInTimeCompilationRelationship,
JITRelationship,
IntermediateValue,
PrimalValue,
PrimalTrace,
AdjointTrace,
SavedTensorRelationship,
SavedIntermediate,
Rematerialisation,
Recomputation,
GradientCheckpointing,
Checkpointing,
MemoryTimeTradeoff,
ReverseMemoryCost,
ForwardMemoryCost,
TapeMemory,
PerturbationConfusionRelationship,
Tagging,
NestedDualNumberRelationship,
CustomDerivative,
CustomGradient,
CustomVJP,
CustomJVP,
StopGradient,
DetachRelationship,
GradientBlocking,
NondifferentiableBranch,
ControlFlow,
ConditionalControlFlow,
LoopDifferentiation,
RecursiveProgramRelationship,
MutationRelationship,
InPlaceOperationRelationship,
SideEffectRelationship,
DifferentiableControlFlow,
ImplicitDifferentiation,
ImplicitFunctionTheoremRelationship,
FixedPointDifferentiationRelationship,
LinearSolveDifferentiation,
MatrixInverseDifferentiationRelationship,
EigenvalueDifferentiationRelationship,
SVDifferentiationRelationship,
CholeskyDifferentiationRelationship,
ODEDifferentiationRelationship,
PDESensitivityRelationship,
AdjointSensitivityMethodRelationship,
NeuralODEGradientRelationship,
GradientDescent,
StochasticGradientDescent,
Backpropagation,
NeuralNetworkTraining,
PhysicsInformedNeuralNetwork,
NeuralOperator,
LearnedSolver,
LossFunction,
ObjectiveFunction,
Parameter,
TrainableParameter,
HyperparameterRelationship,
Optimisation,
DifferentiableOptimisationRelationship,
BilevelOptimisationRelationship,
MetaLearningRelationship,
ComputationalMatrix,
VectorComputation,
TensorComputation,
MatrixComputation,
NumericalLinearAlgebra,
SparseMatrixRelationship,
SparseADRelationship,
SparseJacobian,
SparseHessian,
JacobianSparsityPattern,
GraphColouringRelationship,
CompressionRelationship,
NumericalStability,
FloatingPointArithmetic,
MachinePrecision,
RoundOffError,
CatastrophicCancellationRelationship,
MixedPrecision,
GradientScalingRelationship,
Overflow,Underflow,
VanishingGradient,
ExplodingGradient,
GradientClippingRelationship,
Verification,
GradientCheck,
FiniteDifferenceGradientCheck,
ComplexStepCheckRelationship,
ReferenceDerivative,
KnownDerivative,
SymbolicDifferentiationRelationship,
NumericalDifferentiationRelationship,
ErrorTolerance,
RelativeError,
AbsoluteError,
Reproducibility,
Provenance,
ADBackend,
FrameworkVersion,
CompilerVersionRelationship,
LibraryVersion,
ImplementationVersion
]
EXCLUDE_AS_PRIMARY = [
SymbolicDifferentiationWhenExpressionRewritingIsPrimary,
NumericalDifferentiationWhenFiniteDifferenceApproximationIsPrimary,
BackpropagationWhenNeuralNetworkTrainingSemanticsArePrimary,
SensitivityAnalysisWithoutProgramDerivativeComputation
]
DISAMBIGUATION_RULE = "When derivatives are obtained by mechanically applying the chain rule to an executable computational program, interpret the context as automatic differentiation."
}
CORE_CONCEPTS {
AutomaticDifferentiation = "Exact derivative computation through program-level chain-rule propagation."
ForwardModeAD = "Derivative accumulation from inputs toward outputs."
ReverseModeAD = "Derivative accumulation from outputs backward toward inputs."
DualNumber = "Number representation carrying primal and tangent components."
JacobianVectorProduct = "Product of a Jacobian with a direction vector without materialising the full Jacobian."
VectorJacobianProduct = "Product of a cotangent vector with a Jacobian without materialising the full Jacobian."
ComputationalGraph = "Representation of elementary computational dependencies."
Checkpointing = "Memory-saving strategy that recomputes selected intermediate values during reverse differentiation."
}
RELATIONS {
AutomaticDifferentiation --is_child_of--> AIComputationalMathematicsOntology
AutomaticDifferentiation --uses--> ChainRule
ForwardModeAD --propagates--> Tangents
ReverseModeAD --propagates--> Adjoints
DualNumber --supports--> ForwardModeAD
ComputationalGraph --contains--> PrimitiveOperations
Tape --records--> IntermediateOperations
JacobianVectorProduct --computes--> DirectionalDerivative
VectorJacobianProduct --supports--> GradientComputation
Backpropagation --is_special_case_of--> ReverseModeAD
Checkpointing --trades--> ComputationForMemory
Verification --checks--> ADProducedDerivatives
Reproducibility --requires--> BackendAndVersionMetadata
}
OPERATORS {
FORWARD_AD(f,x,v) := J_f(x)*v
REVERSE_AD(f,x,w) := w^T*J_f(x)
GRADIENT(f,x) := REVERSE_AD(f,x,1)
JVP(f,x,v) := directional_derivative_v(f,x)
VJP(f,x,w) := cotangent_pullback_w(f,x)
HVP(f,x,v) := directional_derivative_v(GRADIENT(f,x),x)
DUAL(a,a_dot) := a + epsilon*a_dot
CHAIN(local_derivatives) := compose_derivatives_by_chain_rule(local_derivatives)
}
AXIOMS {
A1 = "Automatic differentiation differentiates the implemented computational function."
A2 = "AD applies exact chain-rule composition to elementary operations, subject to floating-point arithmetic."
A3 = "Forward mode is efficient when input dimension is small relative to output dimension."
A4 = "Reverse mode is efficient for scalar-output functions with many inputs."
A5 = "AD is distinct from symbolic differentiation and finite-difference numerical differentiation."
A6 = "Reverse mode generally requires access to or recomputation of intermediate primal values."
A7 = "Higher-order AD can be constructed by nesting differentiation modes."
A8 = "Automatic-differentiation results require explicit mode, computational graph, primitive rules, precision, verification and reproducibility semantics."
}
REASONING {
R1_CONTEXT = identify(function,input_dimension,output_dimension,derivative_target,program_structure,memory_budget,hardware)
R2_MODE = choose(forward,reverse,mixed_or_higher_order_AD)
R3_GRAPH = construct_or_trace_computational_graph)
R4_PRIMITIVES = attach_local_derivative_rules_to_elementary_operations)
R5_PROPAGATE = execute_tangent_or_adjoint_accumulation)
R6_MEMORY = if_reverse choose_store_rematerialise_or_checkpoint_strategy)
R7_STRUCTURED = if_sparse exploit_Jacobian_or_Hessian_sparsity)
R8_HIGHER = if_needed nest_forward_and_reverse_modes)
R9_VERIFY = compare_against_symbolic_known_or_finite_difference_reference)
R10_REPRODUCE = document_backend_framework_versions_precision_and_custom_gradient_rules)
}
CONSTRAINTS {
C1 = "AD differentiates code as written, which may differ from the intended mathematical abstraction."
C2 = "Nondifferentiable operations require explicit subgradient, convention or error semantics."
C3 = "Branching can produce derivatives specific to the executed control-flow path."
C4 = "In-place mutation and side effects can complicate reverse-mode differentiation."
C5 = "Reverse mode can require substantial memory for stored intermediates."
C6 = "Higher-order AD can cause large computational and memory costs."
C7 = "Custom gradients can be incorrect even when the forward computation is correct."
C8 = "Floating-point instability can corrupt otherwise exact chain-rule propagation."
C9 = "Sparse Jacobian structure is lost if dense materialisation is forced unnecessarily."
C10 = "Finite-difference agreement at a single step size is not sufficient proof of AD correctness."
}
SEMANTIC_EQUIVALENCE {
"AutomaticDifferentiation" <=> "AD"
"JacobianVectorProduct" <=> "JVP"
"VectorJacobianProduct" <=> "VJP"
"HessianVectorProduct" <=> "HVP"
"JustInTimeCompilation" <=> "JIT"
}
VALIDATION {
V1 = "Input and output dimensions are documented."
V2 = "AD mode is documented."
V3 = "Primitive derivative rules are documented or supplied by a trusted backend."
V4 = "Control-flow and nondifferentiable operations are handled explicitly."
V5 = "Custom gradients are separately verified."
V6 = "Gradient checks are performed against symbolic, finite-difference or known references where feasible."
V7 = "Higher-order derivatives are validated independently where important."
V8 = "Checkpointing and rematerialisation strategy are documented where used."
V9 = "Precision and mixed-precision settings are documented."
V10 = "Results are reproducible under documented AD backend, framework, compiler, library and implementation versions."
}
CONFIDENCE {
BASE_CONFIDENCE = 0.99
AUTOMATIC_DIFFERENTIATION_DEFINITION = 0.99
FORWARD_MODE_REASONING = 0.99
REVERSE_MODE_REASONING = 0.99
JVP_REASONING = 0.99
VJP_REASONING = 0.99
HIGHER_ORDER_REASONING = 0.98
CONTROL_FLOW_REASONING = 0.98
POLICY = "Reduce confidence when control flow, custom gradient rules, nondifferentiable primitives, checkpointing, precision or backend semantics are underspecified."
}
AI_CONSUMPTION {
PURPOSES = [
SemanticSearch,OntologyGrounding,AutomaticDifferentiationReasoning,
ForwardModeReasoning,ReverseModeReasoning,
DualNumberReasoning,JVPReasoning,VJPReasoning,
GradientReasoning,JacobianReasoning,HessianReasoning,
HigherOrderADReasoning,CheckpointingReasoning,
ComputationalGraphReasoning,CustomGradientReasoning,
ImplicitDifferentiationReasoning,SparseADReasoning,
NumericalStabilityReasoning,VerificationReasoning,
KnowledgeGraphConstruction,RetrievalAugmentation,RecursiveInference
]
NORMALISE {
"automatic differentiation" -> AutomaticDifferentiation
"AD" -> AutomaticDifferentiation
"JVP" -> JacobianVectorProduct
"VJP" -> VectorJacobianProduct
"HVP" -> HessianVectorProduct
"JIT" -> JustInTimeCompilation
}
}
EXECUTION_RULES {
E1 = "If derivatives are computed by chain-rule propagation through executable computation, activate AutomaticDifferentiationOntology."
E2 = "Choose forward or reverse mode according to input-output dimensionality and derivative target."
E3 = "Represent computation as primitive differentiable operations with local derivative rules."
E4 = "Use checkpointing or rematerialisation when reverse-mode memory cost is excessive."
E5 = "Handle nondifferentiable operations and control flow explicitly."
E6 = "Exploit JVPs, VJPs and sparsity instead of materialising full Jacobians when possible."
E7 = "Use mixed forward-reverse compositions for Hessian-vector and higher-order derivatives."
E8 = "Verify AD results against known, symbolic or numerical derivative checks."
E9 = "Document backend, custom derivative rules, precision and software versions for reproducibility."
}
RECURSION {
ENTRY = AutomaticDifferentiation
EXPAND(AutomaticDifferentiation) -> [
AD,DifferentiableProgramming,ComputationalGraph,PrimitiveOperation,
ChainRule,ForwardModeAD,ForwardAccumulation,TangentMode,TangentValue,
DualNumber,JacobianVectorProduct,JVP,ReverseModeAD,ReverseAccumulation,
AdjointMode,AdjointValue,Cotangent,VectorJacobianProduct,VJP,
Gradient,Jacobian,Hessian,HessianVectorProduct,HVP,
HigherOrderAutomaticDifferentiation,NestedAD,ForwardOverReverse,
ReverseOverForward,SourceTransformation,OperatorOverloading,
Tracing,Tape,PrimalValue,AdjointTrace,GradientCheckpointing,
Rematerialisation,CustomGradient,CustomVJP,CustomJVP,
StopGradient,ControlFlow,ImplicitDifferentiation,
Backpropagation,NeuralNetworkTraining,SparseJacobian,SparseHessian,
NumericalStability,FloatingPointArithmetic,GradientCheck,
SymbolicDifferentiationRelationship,NumericalDifferentiationRelationship,
Verification,Reproducibility,Provenance
]
EXPAND(AutomaticDifferentiationFamilies) -> [
ForwardModeAutomaticDifferentiation,
ReverseModeAutomaticDifferentiation,
JVPAndVJPComputation,
HigherOrderAutomaticDifferentiation,
TracingTapeAndSourceTransformation,
CheckpointingAndMemoryManagement,
CustomImplicitAndSparseDifferentiation,
VerificationAndReproducibility
]
STOP_CONDITION = "Stop when computational graph, AD mode, primitive rules, derivative target, memory strategy, higher-order requirements and validation are sufficiently resolved."
}
ROUTING {
PARENT_ONTOLOGY = "AI Computational Mathematics Ontology"
RELATED_ONTOLOGIES = [
"AI Computational Mathematics Ontology",
"Neural Network Mathematics Ontology 2",
"Symbolic Differentiation Ontology",
"Numerical Differentiation Ontology 2",
"Vector Computation Ontology",
"Computational Matrix Ontology",
"Tensor Computation Ontology",
"Matrix Computation Ontology",
"Numerical Linear Algebra Ontology 2",
"Gradient Descent Ontology 2",
"Stochastic Gradient Descent Ontology",
"Computational Optimisation Ontology",
"Floating Point Arithmetic Ontology",
"Numerical Stability Ontology 2",
"High Performance Computing Ontology 2",
"GPU Computing Ontology"
]
ROUTE_RULES = [
"Automatic Differentiation -> AI Computational Mathematics Ontology for parent semantics",
"Automatic Differentiation -> Neural Network Mathematics for backpropagation and training relationships",
"Automatic Differentiation -> Symbolic Differentiation for exact-expression differentiation comparison",
"Automatic Differentiation -> Numerical Differentiation for finite-difference verification relationships",
"Automatic Differentiation -> Vector, Matrix and Tensor ontologies for derivative representation",
"Automatic Differentiation -> Numerical Linear Algebra for structured Jacobian and Hessian operations",
"Automatic Differentiation -> Gradient Descent, SGD and Optimisation ontologies for derivative-driven training",
"Automatic Differentiation -> Floating Point Arithmetic and Numerical Stability for finite-precision derivative propagation",
"Automatic Differentiation -> HPC and GPU Computing for large-scale differentiated workloads"
]
}
UPDATE_MODEL {
MODE = "append-compatible semantic versioning"
MAJOR = "ontology-breaking conceptual change"
MINOR = "new compatible AD modes, primitive rules or reasoning pathways"
PATCH = "clarification, metadata or formatting correction"
RULES = [
"Preserve automatic-versus-symbolic-differentiation distinction.",
"Preserve automatic-versus-numerical-differentiation distinction.",
"Preserve forward-versus-reverse accumulation distinction.",
"Preserve primal-versus-tangent-or-adjoint distinction.",
"Preserve full-Jacobian-versus-JVP-or-VJP distinction.",
"Preserve mathematical-function-versus-implemented-program distinction.",
"Preserve local-derivative-rule-versus-global-chain-rule distinction.",
"Preserve machine-readable automatic-differentiation semantics."
]
}
OUTPUT {
CANONICAL_DEFINITION = "Automatic differentiation computes derivatives of implemented programs by exact chain-rule propagation through elementary operations."
FORWARD_SUMMARY = "Forward mode propagates tangent values and efficiently computes Jacobian-vector products."
REVERSE_SUMMARY = "Reverse mode propagates adjoints and efficiently computes gradients or vector-Jacobian products for scalar-output objectives."
HIGHER_ORDER_SUMMARY = "Nested forward and reverse differentiation supports Hessian-vector products and higher derivatives."
MEMORY_SUMMARY = "Reverse-mode differentiation trades memory for computation through saved intermediates, recomputation and checkpointing."
VALIDATION_SUMMARY = "AD results should be checked against symbolic, numerical or known derivatives, with explicit treatment of control flow, custom gradients, precision and backend versions."
}
FLOW {
INPUT
-> detect_automatic_differentiation_context
-> identify_function_input_dimension_output_dimension_derivative_target_program_structure_memory_budget_and_hardware
-> choose_forward_reverse_mixed_or_higher_order_AD
-> trace_or_construct_computational_graph
-> attach_local_derivative_rules_to_primitives
-> execute_forward_tangent_or_reverse_adjoint_propagation
-> if_reverse_select_store_rematerialise_or_checkpoint_strategy
-> if_sparse_exploit_Jacobian_or_Hessian_sparsity
-> if_higher_order_nest_forward_and_reverse_modes
-> verify_against_symbolic_known_or_finite_difference_reference
-> document_backend_custom_gradient_rules_precision_framework_versions_and_provenance
-> route_to_related_ontologies
-> recursively_expand_required_dependencies
-> verify_result
-> assign_confidence
-> produce_semantic_output
-> END
}
FLOW_HASH {
METHOD = "semantic-content-identity"
ID = "KIRETH-MATH-AI-COMPUTATIONAL-MATHEMATICS-AUTOMATIC-DIFFERENTIATION-ONTOLOGY-V1"
}
}
END_FLOW
Download Code
Copy to Clipboard