Skip to main content

Module predictive_coding

Module predictive_coding 

Source
Expand description

Predictive Coding for mode outputs — send only prediction errors (deltas).

Scientific basis: Rao & Ballard (1999), “Predictive coding in the visual cortex” — Neural systems only propagate the difference between prediction and observation. Applied here: when a file is re-read in a different mode, we compare the new output against the last delivered output and transmit only structural deltas.

This achieves 40-60% token savings on repeated reads.

Structs§

ModeDelta
Represents a structural delta between two mode outputs.

Functions§

compute_delta
Compute a structural delta between two mode outputs. Uses line-level diff for structural modes (map, signatures).
should_use_delta
Decide whether to send delta or full output based on savings threshold. Returns true if delta is more efficient.