---
library: "bootstrap"
slug: "SurprisalUpdate"
name: "SurprisalUpdate"
ref: "SurprisalUpdate#5e09"
hash: "sema:SurprisalUpdate#mh:SHA-256:5e092ac54c497452f0bc1ab93fafa89f7cb3de946a724c4f78479ab2225546b2"
type: "Inference"
layer: "Mind"
version: "0.11.0"
root: "a6a3d1ff0f982ee30430c5b42f3784c8ec901fd68482cfc1bc30899c1e5e48c5"
license: null
url: "https://semahash.org/vocabularies/bootstrap/patterns/SurprisalUpdate"
---

# SurprisalUpdate

Learning weighted by prediction failure magnitude

Mind · Inference

## 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](https://semahash.org/vocabularies/bootstrap/patterns/RegimeSense.md), [EpistemicROI](https://semahash.org/vocabularies/bootstrap/patterns/EpistemicROI.md).

## 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

- learning_rate: type=Float, range=[0.0, 1.0], description=How much to update the model based on surprisal
- max_update_rate: type=Float, range=[0.0, 1.0], description=Maximum allowed model shift per single update

## 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](https://semahash.org/vocabularies/bootstrap/patterns/Gradient.md) updates.

## Where this came from

—

## Builds on

- [Gradient](https://semahash.org/vocabularies/bootstrap/patterns/Gradient.md) (references)
- [EpistemicROI](https://semahash.org/vocabularies/bootstrap/patterns/EpistemicROI.md) (references)
- [RegimeSense](https://semahash.org/vocabularies/bootstrap/patterns/RegimeSense.md) (references)

## Used by

- [BeliefTracking](https://semahash.org/vocabularies/bootstrap/patterns/BeliefTracking.md) (references)
- [CounterfactualAnchor](https://semahash.org/vocabularies/bootstrap/patterns/CounterfactualAnchor.md) (references)
- [TraceBelief](https://semahash.org/vocabularies/bootstrap/patterns/TraceBelief.md) (references)

## Related

- [BayesUpdate](https://semahash.org/vocabularies/bootstrap/patterns/BayesUpdate.md)

## Identity

- Library: bootstrap 0.11.0 (root a6a3d1ff0f98)
- Ref: SurprisalUpdate#5e09
- Hash: sema:SurprisalUpdate#mh:SHA-256:5e092ac54c497452f0bc1ab93fafa89f7cb3de946a724c4f78479ab2225546b2

## Links

- Page: https://semahash.org/vocabularies/bootstrap/patterns/SurprisalUpdate
- JSON: https://semahash.org/vocabularies/bootstrap/patterns/SurprisalUpdate.json
- Library: https://semahash.org/vocabularies/bootstrap
- Library index: https://semahash.org/vocabularies/bootstrap/index.json
