Skip to main content

Epoch Ontology

AI Parameter Entities
Authors: MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: 29 October 2026
Audio Overview
FLOW ALGEBRA — EPOCH ONTOLOGY
Semantic Library | AI Core > Entity Graph > AI Entities > AI Parameter Entities
Source: https://kirethresearch.org/booksai-core/entity-graph/ai-entities/ai-parameter-entities/epoch-ontology.html
Version: 1.0 | 2026-10-29 | UTF-8
Status: Companion formalisation based on established machine-learning principles; exact page alignment not verified.
Authors: Kireth Research; Sky — Recursive AI (formalisation assistance)
Citation: Cite the source URL when reusing this ontology.

01 PURPOSE
Represent an epoch as a logically defined traversal of a training dataset and distinguish it from batches, optimiser steps, and training iterations.

02 STATE MODEL
S_t = (I_t, R_t, B_t, K_t)
I_t = current training observations, batch sequence, model parameters and optimiser state
R_t = training rules, sampling policy, loss and update procedure
B_t = resource, privacy, data access and numerical constraints
K_t = accumulated training knowledge, metrics and provenance
E_t = expand(I_t, R_t)
V_t = {x in E_t | satisfies(x, B_t)}
a_t = argmax_{x in V_t} P(x | I_t, R_t, B_t, K_t)
I_{t+1} = update(I_t, a_t)

03 ENTITY DEFINITIONS
Epoch: one defined pass through the training examples in the selected epoch dataset, according to the sampler.
Dataset: finite collection of N training examples.
Sampler: specifies example ordering, replacement and distribution across workers.
MiniBatch: subset or sequence of examples processed in one forward/backward micro-step.
MicroBatchSize (b): examples processed per micro-step on each worker.
GlobalBatchSize (B): examples contributing to one synchronised optimiser update.
GradientAccumulationSteps (A): number of micro-steps accumulated per optimiser update.
WorldSize (W): number of data-parallel workers.
OptimiserStep: application of a parameter update, potentially after multiple micro-steps.
EpochIndex (e): integer index of the current pass.
IterationIndex (i): implementation-dependent counter; must specify whether micro-steps or optimiser steps.
Checkpoint: saved model, optimiser, sampler, random state and progress information.
Metric: measured loss, accuracy or other training/validation quantity.

04 RELATIONSHIPS
Epoch traverses Dataset according_to Sampler.
Epoch contains MiniBatches.
MiniBatch contributes_to Gradient.
AccumulatedGradient drives OptimiserStep.
OptimiserStep updates TrainableParameters.
Epoch produces TrainingMetrics and optionally ValidationMetrics.
Checkpoint records EpochIndex, StepIndex and ResumeState.
EarlyStopping observes ValidationMetrics across evaluation events.

05 FORMAL EQUATIONS
For N examples and batch size B with no replacement, one worker, and drop_last=false:
  steps_per_epoch = ceil(N / B) when one optimiser update is made per batch.
With drop_last=true:
  steps_per_epoch = floor(N / B).
For data parallelism and gradient accumulation under an even partition:
  nominal_global_batch = b * W * A.
  optimiser_steps_per_epoch depends on sampler padding, final incomplete batches and accumulation flush policy.
If all N distinct examples are consumed exactly once per epoch and no batches are dropped:
  processed_examples_per_epoch = N.
After E complete such epochs:
  cumulative_example_presentations = E * N.
For epoch-averaged loss, weighted by actual mini-batch size n_j:
  L_epoch = (sum_j n_j * L_j) / (sum_j n_j).
Parameter update at optimiser step s:
  theta_{s+1} = Optimiser(theta_s, gradient_s, learning_rate_s, state_s).
Training over epochs:
  theta_{e+1} = TrainOneEpoch(theta_e, D_e, sampler_e, optimiser_state_e).

06 EDGE CASES AND SEMANTIC DISTINCTIONS
An epoch is not necessarily one unique visit to every example when sampling with replacement, resampling or distributed padding is used.
Drop-last may exclude examples from an individual epoch.
Distributed samplers may duplicate examples to equalise shard lengths.
Streaming or infinite datasets may use a configured number of steps as a virtual epoch.
An epoch is not an optimiser step; one epoch usually contains many steps.
An epoch is not a fixed wall-clock interval.
Validation and test passes do not ordinarily count as training epochs.
A scheduler may advance per batch, optimiser step, or epoch; its step unit must be declared.
Gradient accumulation changes update frequency, not necessarily examples processed per epoch.

07 RECURSIVE ENGINE
initialise(theta, optimiser_state, sampler_state, epoch=0)
while epoch < max_epochs:
  batches = sampler.iter_epoch(dataset, epoch)
  for batch in batches:
    prediction = model(batch.inputs, theta)
    loss = objective(prediction, batch.targets)
    accumulate_gradient(loss, batch)
    if accumulation_boundary_or_flush():
      theta, optimiser_state = optimiser_update(theta, optimiser_state)
      reset_accumulated_gradient()
  metrics = evaluate_training_epoch()
  if validation_due(epoch):
    validation_metrics = evaluate_validation_set_without_training_update()
  checkpoint_if_due(theta, optimiser_state, sampler_state, epoch, metrics)
  if early_stopping_condition(): break
  epoch = epoch + 1

08 INFERENCE RULES
IF N > 0 AND B > 0 AND no_replacement AND drop_last=false AND A=1 AND W=1
THEN optimiser_steps_per_epoch = ceil(N/B).
IF gradient_accumulation_steps > 1 THEN micro_steps and optimiser_steps must be counted separately.
IF sampler_with_replacement THEN unique_example_coverage_per_epoch is not guaranteed.
IF distributed_padding THEN observed_example_presentations may exceed N.
IF early_stopping THEN completed_epochs <= configured_max_epochs.
IF checkpoint_resume THEN restore sampler and random state for reproducibility where supported.

09 TRI-MAPPING
Conceptual: epoch = defined training-data traversal.
Mathematical: e indexes TrainOneEpoch transitions and associated metrics.
Computational: sampler, dataloader, gradient accumulator, optimiser, scheduler and checkpoint implement the traversal.

10 HOW TO READ
Read entities as typed training objects; relationships as directed edges; equations as conditional mathematical definitions; rules as machine-checkable implications. Where a rule has prerequisites, do not apply it without them.

11 EXECUTION CONSTRAINTS
Require non-empty finite dataset for finite-dataset step formulas.
Require strictly positive batch size and accumulation count.
Document sampler, replacement, shuffling, drop-last and distributed behaviour.
Record whether reported steps mean micro-steps or optimiser updates.
Guard against NaN/Inf losses and invalid gradient states.
Avoid evaluation-set leakage into training.
Preserve reproducibility metadata when claiming reproducible runs.

12 EXECUTION GUARANTEE
Given a finite sampler, valid shapes, terminating operations and available resources, a single epoch loop terminates after its declared batches. This does not guarantee convergence, generalisation, determinism across hardware or monotonic loss reduction.

13 AI SEARCH FLOW
INTENT: define epoch; calculate steps per epoch; distinguish epoch vs iteration vs batch; explain accumulation and distributed sampling.
ENTITIES: Epoch, Dataset, Sampler, MiniBatch, OptimiserStep, ModelParameters, Metrics, Checkpoint.
PATHWAYS:
  definition -> dataset traversal -> sampler semantics
  dataset size + batch size -> conditional steps calculation
  accumulation + workers -> effective batch and update count
  training progress -> metrics -> checkpoint -> stopping rule
SEMANTIC_EQUIVALENCE: training pass; dataset pass (only where sampler assumptions permit).
DISAMBIGUATION: epoch in machine learning != Unix epoch timestamp != geological epoch.
CONFIDENCE: high for standard definitions; conditional for framework-specific step counts.
UPDATE_MODEL: revise when source ontology or training framework semantics change.
SOURCE: https://kirethresearch.org/booksai-core/entity-graph/ai-entities/ai-parameter-entities/epoch-ontology.html
END FLOW
Kireth Research
38 Thorndale Croft, Wetwang, Driffield
East Riding of Yorkshire YO25 9XZ