{
 "library": "bootstrap",
 "version": "0.11.0",
 "root": "a6a3d1ff0f982ee30430c5b42f3784c8ec901fd68482cfc1bc30899c1e5e48c5",
 "license": null,
 "slug": "SurprisalUpdate",
 "ref": "SurprisalUpdate#5e09",
 "hash": "sema:SurprisalUpdate#mh:SHA-256:5e092ac54c497452f0bc1ab93fafa89f7cb3de946a724c4f78479ab2225546b2",
 "stub": "5e09",
 "layer": "Mind",
 "type": "Inference",
 "summary": "Learning weighted by prediction failure magnitude",
 "mechanism": "A learning protocol where the agent updates its internal model (weights, embeddings, or context) based on failed predictions, weighted by the magnitude of surprise. Higher surprisal = larger update. 'Learn most from what confused you most.' This implements Surprisal-Weighted Fine-Tuning (SWFT): loss contribution is proportional to -log(P(observed|predicted)). Utilizes RegimeSense#8bba, EpistemicROI#b0d8.",
 "invariants": [
  "Loss contribution is proportional to surprisal, -log P(observed|predicted).",
  "Stability Guard: no single update shifts the model more than `max_update_rate`, whatever the loss.",
  "Update magnitude follows from the loss through `learning_rate` and the optimiser, not from surprisal directly."
 ],
 "parameters": [
  {
   "name": "learning_rate",
   "type": "Float",
   "range": "[0.0, 1.0]",
   "description": "How much to update the model based on surprisal"
  },
  {
   "name": "max_update_rate",
   "type": "Float",
   "range": "[0.0, 1.0]",
   "description": "Maximum allowed model shift per single update"
  }
 ],
 "signature": [],
 "preconditions": [
  "Actual outcome observed and diverged from prediction",
  "Prediction was made with computable probability"
 ],
 "postconditions": [
  "Loss weighted by surprisal; model shift bounded by `max_update_rate`",
  "Update logged for audit trail"
 ],
 "failure_modes": [
  "Outlier Overfitting: Rare high-surprisal events dominating learning.",
  "Catastrophic Forgetting: Aggressive updates erasing previously stable knowledge.",
  "Compute Cost: High-surprisal events require expensive Gradient#ecfc updates."
 ],
 "domain": "",
 "caution": "",
 "sources": [],
 "name": "SurprisalUpdate",
 "builds_on": [
  {
   "alias": "gradient",
   "relation": "references",
   "library": "bootstrap",
   "slug": "Gradient",
   "ref": "Gradient#ecfc",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/Gradient"
  },
  {
   "alias": "epistemic_roi",
   "relation": "references",
   "library": "bootstrap",
   "slug": "EpistemicROI",
   "ref": "EpistemicROI#b0d8",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/EpistemicROI"
  },
  {
   "alias": "regime_sense",
   "relation": "references",
   "library": "bootstrap",
   "slug": "RegimeSense",
   "ref": "RegimeSense#8bba",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/RegimeSense"
  }
 ],
 "related": [
  {
   "alias": null,
   "relation": "related",
   "library": "bootstrap",
   "slug": "BayesUpdate",
   "ref": "BayesUpdate#a762",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/BayesUpdate"
  }
 ],
 "used_by": [
  {
   "slug": "BeliefTracking",
   "relation": "references",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/BeliefTracking"
  },
  {
   "slug": "CounterfactualAnchor",
   "relation": "references",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/CounterfactualAnchor"
  },
  {
   "slug": "TraceBelief",
   "relation": "references",
   "url": "https://semahash.org/vocabularies/bootstrap/patterns/TraceBelief"
  }
 ],
 "url": "https://semahash.org/vocabularies/bootstrap/patterns/SurprisalUpdate",
 "md_url": "https://semahash.org/vocabularies/bootstrap/patterns/SurprisalUpdate.md",
 "library_url": "https://semahash.org/vocabularies/bootstrap"
}
