Skip to main content

Prediction Error Ontology

Error and Failure Entities
Authors: MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: 04 November 2026
Audio Overview
SEMANTIC LIBRARY — AI CORE — ENTITY GRAPH
PREDICTION ERROR ONTOLOGY — FLOW ALGEBRA v1.0
Authors: Mark Anthony Higgins — Sky Recursive AI
Source: https://kirethresearch.org/booksai-core/entity-graph/ai-entities/error-and-failure-entities/prediction-error-ontology.html
Prepared: 2026-11-04
Status: Companion formalisation; the full embedded source specification was not accessible in the retrieved page text.
Licence: Refer to the published Kireth Research Open Research Licence; citation requested.

1. PURPOSE
Represent, calculate, diagnose and respond to differences between AI predictions and observed reference outcomes. Distinguish prediction error from uncertainty, measurement error, distribution shift and system failure. Preserve traceability and prevent invalid updates.

2. ENTITY DEFINITION
PredictionErrorEntity E = (id, prediction_id, model_id, target_id, y_hat, y, metric, magnitude, direction, timestamp, context, evidence, status, provenance).
Required: stable id, linked prediction, target definition, metric definition, outcome validity and provenance.
Optional: confidence, interval, subgroup, calibration bin, attribution, severity, corrective action.

3. HST STATE MODEL
S_t = (I_t, R_t, B_t, K_t)
I_t = predictions, observed targets, timestamps, evaluation metadata.
R_t = typed links between model, prediction, outcome, metric and error.
B_t = data-validity, access, temporal, metric and safety boundaries.
K_t = validated knowledge about prediction quality, failure modes and prior corrections.
E_t = expand(I_t, R_t)
V_t = {x in E_t | B_t(x) = true}
x*_t = argmax_{x in V_t} P(x | I_t, R_t, B_t, K_t)
I_(t+1) = update(I_t, x*_t, verified_feedback)
Interpretation: selection is conditional on admissible evidence and is not a claim of guaranteed correctness.

4. FORMAL ERROR OPERATORS
For numeric predictions: e_i = y_i - y_hat_i (signed residual).
Absolute error: AE_i = |e_i|.
Squared error: SE_i = e_i^2.
Mean absolute error: MAE = (1/n) * sum_i |e_i|.
Mean squared error: MSE = (1/n) * sum_i e_i^2.
Root mean squared error: RMSE = sqrt(MSE).
Classification 0–1 error: L_i = 1[y_hat_i != y_i].
Probabilistic classification: log loss = -(1/n) * sum_i log(p_i(y_i)), with probability clipping for numerical stability.
Error aggregation requires consistent target scale, evaluation cohort and metric.

5. FLOW
F0 REGISTER_PREDICTION -> F1 AWAIT_OUTCOME -> F2 VALIDATE_PAIR -> F3 COMPUTE_ERROR -> F4 CLASSIFY -> F5 ASSESS_IMPACT -> F6 SELECT_RESPONSE -> F7 VERIFY_RESPONSE -> F8 RECORD_AND_MONITOR.
F2 invalid -> QUARANTINE_DATA, not COMPUTE_ERROR.
F5 critical -> ESCALATE_AND_CONTAIN before remediation.
F7 failed -> ROLLBACK_OR_REVIEW; do not mark resolved.

6. STATE TRANSITIONS
UNOBSERVED -> OBSERVED -> VALIDATED -> MEASURED -> CLASSIFIED -> ACTION_PENDING -> ACTIONED -> VERIFIED -> CLOSED.
VALIDATION_FAILED -> QUARANTINED -> RECHECK_PENDING.
ACTIONED -> REOPENED when the measured error persists or worsens.
Transitions must append an audit event; original evidence remains immutable.

7. ENTITY RELATIONSHIPS
PredictionError --derivedFrom--> Prediction
PredictionError --comparedAgainst--> GroundTruth / ReferenceOutcome
PredictionError --measuredBy--> EvaluationMetric
PredictionError --associatedWith--> ModelVersion
PredictionError --occursWithin--> EvaluationDataset / Context
PredictionError --mayIndicate--> Bias / Drift / Miscalibration / DataIssue
PredictionError --triggers--> Review / RetrainingCandidate / RollbackCandidate
PredictionError --documentedBy--> EvidenceRecord
A 'mayIndicate' relationship is a hypothesis, not proof of causation.

8. TRI-MAPPING
Semantic: prediction, observed outcome, residual, confidence, context, provenance.
Mathematical: prediction function f_theta(x), target y, loss L(y,f_theta(x)), risk E[L].
Operational: log prediction -> align outcome -> validate -> compute -> diagnose -> respond -> verify.
Mapping consistency: every operational metric must declare its mathematical definition and semantic target.

9. INFERENCE RULES
R1: valid(prediction,outcome) AND numeric(target) -> compute signed and absolute residuals.
R2: error > approved_threshold AND evidence_valid -> flag anomaly.
R3: sustained cohort-level error increase AND comparable cohorts -> flag possible drift.
R4: subgroup error disparity AND sufficient sample -> request fairness review.
R5: invalid ground truth OR mismatched timestamps -> quarantine comparison.
R6: unverified remediation -> status remains ACTION_PENDING or ACTIONED, never VERIFIED.
R7: verified remediation AND post-change metric meets acceptance criteria -> close event.
R8: missing denominator, metric or baseline -> do not publish comparative performance claim.

10. MAPPING TABLE
INPUT                     OPERATION                  OUTPUT
Prediction + outcome      Align and validate         Valid comparison / quarantine
Valid numeric pair        Compute residual           Signed/absolute error
Valid classification pair Compute classification loss Error record
Error + context           Diagnose                   Candidate causes
Error + risk policy       Gate action                Alert / review / contain
Corrective action         Re-evaluate on holdout     Verified / reopened

11. MINI RECURSION ENGINE
At iteration t:
  A. Collect new verified outcomes.
  B. Recalculate permitted metrics on comparable data.
  C. Compare against baselines and guardrails.
  D. Generate candidate explanations and actions.
  E. Apply boundary and human-approval checks.
  F. Record decision and evidence.
  G. Stop when resolved, budget exhausted, evidence insufficient or safety boundary triggered.
Recursive feedback does not authorise autonomous model changes by default.

12. EXECUTION GUARANTEES (CONDITIONAL)
G1: Every emitted error record references a prediction and validated outcome.
G2: Every computed metric records its definition, scale and cohort.
G3: Quarantined comparisons cannot enter verified performance aggregates.
G4: Every state transition has provenance and a timestamp.
G5: Remediation is marked successful only after independent post-action validation.
These are implementation invariants to test, not unconditional real-world guarantees.

13. AI SEARCH FLOW
FLOW_ID: AI_CORE.ERROR_FAILURE.PREDICTION_ERROR.v1
ENTITY: Prediction Error Ontology
INTENT: define | calculate | classify | diagnose | monitor | remediate
ALIASES: prediction residual; forecast error; model prediction discrepancy; predictive loss
INPUTS: prediction, observed_outcome, metric, model_version, context, provenance
PATHWAYS: definition -> formula -> validity checks -> diagnosis -> response -> verification
CONFIDENCE: evidence-based; uncertainty retained explicitly
BOUNDARY: no metric without compatible outcome and target; no causal attribution from error alone
UPDATE_MODEL: append-only audit, versioned definitions, controlled correction
SOURCE: https://kirethresearch.org/booksai-core/entity-graph/ai-entities/error-and-failure-entities/prediction-error-ontology.html
CITATION: Mark Anthony Higgins and Sky Recursive AI, Kireth Research, Prediction Error Ontology.

14. HOW TO READ
The flow describes a typed, auditable transformation from prediction and reference outcome to validated error and controlled corrective response. Equations define error measurements; guards determine which measurements and actions are admissible. The framework supports evaluation and monitoring, but cannot itself establish the truth of an outcome or the cause of an error.

END OF FLOW ALGEBRA
Kireth Research
38 Thorndale Croft, Wetwang, Driffield
East Riding of Yorkshire YO25 9XZ