Skip to main content

O1Rect

Enum O1Rect 

Source
pub enum O1Rect {
    Aggregate,
    Fm,
}
Expand description

Which rectifier keeps the skeleton’s estimated far mass non-negative.

pinv(exp(Q̃K̃ᵀ/√d)) is violently ill-conditioned, so M is indefinite and the raw skeleton estimates negative weights for a large minority of keys (measured on Qwen3-0.6B: 23.5% of far weights negative, carrying 24.5% of the absolute far mass). Unrectified, the joint denominator goes near-zero/negative and the model collapses (×510).

The matrix probe rectifies every estimated weight — west = ((Fu@Mu)@E).clamp_min(0). A STREAMING kernel cannot do that: the per-(t, j) weights are never materialized, they exist only already contracted against the accumulators. Two streaming-legal stand-ins:

MEASURED (Qwen3-0.6B, all 28 layers, W=128, sink=4, wikitext-2 val, 12×512 windows, landmarks frozen at a 256-token prefill — i.e. the runtime’s real discipline, cortiq ppl --o1):

       m=8              m=16             m=32
agg    28.51 (×1.318)   28.82 (×1.332)   28.04 (×1.296)  ← default
fm     28.97 (×1.340)   29.69 (×1.373)   30.58 (×1.414)

Aggregate wins at every m, so it stays the default. Fm is kept selectable because its per-key guarantee is the intuitively “correct” fix and someone will re-derive it: this table is the evidence that it costs quality HERE, and the reason is that the guarantee is bought by destroying signal — clamping a landmark’s coefficient zeroes its contribution to EVERY far key, including the majority where the weighted sum was already positive and accurate.

Variants§

§

Aggregate

Clamp only the AGGREGATE far denominator: a row whose skeleton denominator comes out negative drops its far field entirely. Coarse — negative per-key mass survives untouched whenever the row sum happens to stay positive — but measured BEST (see above): the surviving negatives are apparently error-cancelling, not error-causing.

§

Fm

Clamp FM = F_u·M_u (an m-vector, per query row) at zero. ŵ(t,j) = Σ_b FM[b]·E[b,j] and E = exp(·) ≥ 0 ELEMENTWISE, so FM ≥ 0 is SUFFICIENT for every far weight to be non-negative — a per-key guarantee bought with O(m) work on a vector the row already materializes, state untouched. It is strictly stronger than the probe’s clamp (a negative landmark is dropped for every key, not only where the sum would go negative), so this is a DIFFERENT operator, not an emulation of the matrix reference — and, measured, a worse one. Opt in with --o1-rect fm.

Trait Implementations§

Source§

impl Clone for O1Rect

Source§

fn clone(&self) -> O1Rect

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for O1Rect

Source§

impl Debug for O1Rect

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for O1Rect

Source§

impl PartialEq for O1Rect

Source§

fn eq(&self, other: &O1Rect) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for O1Rect

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more