Skip to main content

Module mece

Module mece 

Source
Expand description

MECE gate — the information-gain test that decides whether a facet earns its place (design.py §“MECE gate: Collectively-Exhaustive (coverage) × Mutually-Exclusive (orthogonality)”).

The reference implementation measures orthogonality as cosine between SPLADE decoder weight vectors. Over a roaring index the same semantics are available directly from the postings — a facet’s incidence vector over situations is its activation — so:

  • coverage (Collectively Exhaustive): |situations where the facet fires| / N
  • maxcos (Mutually Exclusive): the largest cosine between this facet’s incidence vector and any other facet’s, i.e. how redundant it is
  • gain = coverage × (1 − maxcos) — high only when a facet covers a lot and covers something nothing else does. A candidate is kept iff gain ≥ threshold (an MDL-style split criterion).

Computing this on the index rather than on model weights is both cheaper and more honest: it scores the facets as the corpus actually instantiates them, not as the heads were trained.

Structs§

FacetScore
MeceReport

Constants§

MIN_SUPPORT
Redundancy between two facets, measured in term space (as design.py compares decoder weight vectors) rather than over union-incidence: the largest cosine between any token of a and any token of b. Union-incidence degenerates in a relational corpus — every facet fires on every row, so all union vectors are all-ones and cosine saturates to 1 regardless of redundancy. Token-level max cosine instead answers the question that matters: does some token here duplicate a token there? Minimum postings a token needs before it may drive the redundancy estimate. Without a floor, two rare terms that happen to fire on the same single document score cosine 1.0 — noise reading as perfect redundancy, which silently zeroes a candidate facet’s gain.

Functions§

report
Score every facet in the index for MECE fitness. skip names structural facets that shouldn’t be judged (e.g. src, the per-file provenance tag).