Skip to content

Predictive Codec

Encode/decode transmission tool — instantiates Predictive Residual Processing

Runs matched predictors at both ends of a channel and sends only quantized residuals plus sync metadata, so the decoder rebuilds the full signal as prediction-plus-correction.

A Predictive Codec puts the same forward predictor at both ends of a channel. The encoder predicts the next sample, subtracts its prediction from the actual value, and transmits only the quantized residual; the decoder runs the identical predictor and adds the residual back to reconstruct the full signal. Its defining trait — the reason it compresses at all — is that symmetry: because both sides already generate the predictable part, neither ever pays to send it, and only the correction crosses the wire, wrapped in enough sync metadata to keep the two predictors aligned. This is the machinery of DPCM and linear predictive coding, where a signal is reconstructed as "what we both expected, plus the small amount we got wrong."[1]

Example

A deep-space probe has a downlink budget measured in a trickle of bits per second, yet must return continuous telemetry: temperatures, voltages, attitude. These channels evolve smoothly and predictably, so both the probe and ground control run the same predictor of each one. Each cycle the probe predicts the next reading, forms the residual against the true sensor value, quantizes it, and sends only that plus a light sync tag (predictor id, sample index). Ground runs the identical predictor and adds the residual back, recovering the full telemetry. A quiet, steady channel costs almost nothing to transmit. When a thruster fires and a temperature jumps off its predicted track, that cycle's residual is large and costs more to send — but it does get through, at the exact moment it carries information. The matched predictors are the whole trick: the expected signal is free because both ends already know it.

How it works

  • Matched predictors, kept identical. The same model runs on encoder and decoder; the design's correctness depends on the two never diverging.
  • Encode by subtraction. Predict the next sample, send the (quantized) difference from the actual — the residual is the payload, the prediction is implicit.
  • Decode by addition. The receiver predicts the same value and adds the received residual, reconstructing the sample as prediction-plus-correction.
  • Quantize to fit the channel. Residuals are quantized (and often entropy-coded) to trade reconstruction fidelity for bandwidth, with sync metadata cueing when to re-anchor.

Tuning parameters

  • Predictor order / model — a richer predictor shrinks residuals and so shrinks payload, but is heavier to run and more fragile if the two ends fall out of step.
  • Quantization step — coarser quantization sends fewer bits but injects more reconstruction error; the lossy-versus-lossless dial, and the one most likely to discard rare detail.
  • Adaptivity — a fixed predictor is simple and predictable; an adaptive one tracks a changing signal and keeps residuals small, at the cost of extra state that must stay synchronised.
  • Sync-metadata cadence — how often the codec re-anchors the predictors. Sparse metadata saves bandwidth but lengthens how far a desync or error can propagate before it's corrected.

When it helps, and when it misleads

Its strength is dramatic compression of smooth, high-volume, predictable signals over a scarce channel, with graceful cost scaling: routine stretches are nearly free, and genuine events pay only for their surprise. Wherever bandwidth is the binding constraint and the signal is largely forecastable, this is the core tool.

It misleads on signals its predictor models badly. Bursty or discontinuous data produces large residuals cycle after cycle, and the codec can end up costing more than sending raw while adding complexity; quantization error can also accumulate through the prediction loop, and — most dangerously — an aggressive quantizer tuned on benign data will smooth away exactly the rare transient the link exists to capture. The classic misuse is cranking quantization to hit a bandwidth target and silently losing the events that mattered. The discipline is to match the predictor to the real signal, keep the two predictors provably identical (that is what the Model-Version Checksum Handshake enforces), monitor reconstruction error, and keep a periodic full-state anchor plus an audit path so the codec can't quietly delete surprise.

How it implements the components

This tool owns the archetype's encode-and-transmit slice:

  • prediction_target_definition — the codec fixes precisely what each predictor forecasts: which channels, at what sampling, in what representation.
  • predictive_feedforward_model — the matched encoder/decoder predictors are the feedforward models that generate the expected signal at both ends.
  • residual_propagation_channel — it is the mechanism that places quantized residuals plus sync metadata onto the transmission channel and reconstructs from them.

It does not send the periodic complete snapshots that bound decoder drift — those keyframes are Periodic Full-State Resynchronization — it does not verify the two predictors are the same version (Model-Version Checksum Handshake), and it does not fall back to raw when the model fails (Raw-Signal Fallback Switch).

Notes

The Predictive Codec is the model-rich end of a spectrum whose simple end is Delta or Differential Encoding. Differential encoding just sends the change from the last value — a trivial "predict = previous sample." The codec generalises that to an arbitrary learned predictor plus explicit quantization and synchronisation, which is why it compresses far harder but also why it needs the version handshake and keyframes that plain delta encoding can do without.

References

[1] Differential pulse-code modulation (DPCM) and linear predictive coding (LPC) transmit the quantized residual between a predicted and actual sample rather than the sample itself, reconstructing the signal at the decoder from an identical predictor. Both are foundational, correctly-named signal-processing techniques; the reconstruction-error and quantization caveats above are their standard, documented trade-offs.