HyperPhaser
A HyperPhaser bundles a stream of observations, much like a Learner does — but it reads each offset as a phase rather than as a label, and that one change of interpretation changes its character throughout.
Recall from Hypervectors that a sparse-segmented vector is already a list of phasors: the offset of the ON bit within its segment is a discretized phase around the unit circle. A Learner treats that offset as an opaque identity and only ever asks whether two of them match. A HyperPhaser takes the phasor reading literally — it superposes unit phasors and keeps the resulting angle.
For segment of a vector with segment size , an observation contributing offset with weight enters as a unit phasor at angle , and the accumulator holds the complex sum:
This is FHRR — Plate’s complex-valued VSA — expressed in the offset representation kongming already uses. The stored offset for segment is simply quantized back onto the ring, so the result is an ordinary sparse-segmented vector that composes under bind like any other.
What it estimates
Comparing two phasor bundles estimates the cosine between the weight vectors underneath them:
The reason is that independent phases cancel on average: the cross terms between unrelated observations vanish, leaving only the mass the two bundles genuinely share. Each segment is one noisy estimate of that quantity, and averaging over of them tightens the estimate with standard error .
That single fact sets the expectations. The readout is scale-free — re-presenting the same data changes the magnitudes but not the angles, so it does not drift. It is flat in the number of distinct observations, because a cosine cares about alignment rather than how many things contributed. And it sharpens with larger , where the extra segments buy ranking resolution rather than fidelity: a pairwise comparison is already unbiased at small , but telling the best match from the tenth-best among many thousands of candidates needs the tighter error.
Accumulating versus sampling
The contrast with a Learner is the useful way to hold this. A Learner is a sample: each write draws on randomness to claim a share of a fixed budget of segments. A HyperPhaser is an accumulator: every write adds deterministically into every segment.
| Learner 💫 | HyperPhaser 🧭 | |
|---|---|---|
| write | reservoir sampling, draws randomness | deterministic and linear |
| repeated observation | a fresh draw | identical to one write at double weight |
| a member owning less than | invisible, it won no segments | still moves every segment |
| compared by | Hamming distance | Lee distance, or alignment |
Determinism and linearity are what make the small shares survive. Because a Learner is a sample, a member too faint to win a single segment is simply absent from it; because a phasor accumulates, even a tiny weight nudges every angle a little, and the bundle as a whole still carries it.
Which distance to ask for
Treating offsets as phases changes which distance measure is meaningful, and this is the sharpest practical consequence of the whole idea.
Two phasors one ring step apart are maximally similar, yet they share no exact offset. Overlap and Hamming distance are blind to that: they are binary per segment, so they read those two phasors as no more related than a pair on opposite sides of the circle. Lee distance reads the circular gap instead, and on unit phasors it induces the same ranking as the complex cosine, being monotone in the phase gap over the half-period. Alignment reads the cosine directly.
Every hypervector answers all of them, so the choice is yours to make and yours to get wrong. A bundle you intend to read as phases must not be fed to the overlap-keyed near-neighbor search — the index would answer at chance. The bytes of a quantized phasor vector are indistinguishable from any other sparse-segmented vector’s, so nothing can carry that warning for you at the call site.
Two forms, one direction
The accumulator and the thing you store are deliberately separate — and only the accumulator is a distinct type, because every hypervector is already a vector of phasors.
A HyperPhaser is the trainable form: a dense complex accumulator holding components, each with an angle and a magnitude. It is not itself a hypervector and has no wire format. The magnitude matters while training — it is a per-segment confidence, recording how much the contributing phases reinforced or cancelled there, and a segment whose phases nearly cancelled holds an angle decided by rounding residuals rather than by evidence. It also behaves as per-segment plasticity.
quantize() crosses to the published form: one angle per segment, an ordinary sparse-segmented vector. It goes one way and keeps angles only — so the per-segment confidences live on the accumulator, and a caller who wants them keeps them alongside deliberately.
Jump to the API reference for HyperPhaser.