Learn Relifold
← Relifold documentation

Relifold 102: Researching better gates

Compare lossy blockers, external block maps, set compositions, and registered parameters in the Workbench.

A pair gate can be far more expressive than one inline threshold. Your code may precompute an embedding index, token buckets, an agglomerative clustering, or another deterministic block map, then let the ordinary *_only_if predicate read that result. Relifold does not execute or endorse that external algorithm; it enforces the predicate result as the task's hard pair boundary.

Reason in admitted sets

Let E0 be the relationships the current gate admits to semantic judgment and E1 a proposed rule's admitted set. Inspect both marginals:

expansion = E1 - E0   # newly delegated to the model
shrink    = E0 - E1   # newly excluded by the gate

On reviewed cards, expansion SAME yield asks whether the added semantic work recovers real relationships. Shrink SAME loss asks whether a cheaper rule throws away true relationships. These are routing metrics, not final cluster quality; a paid or exact downstream replay is still needed when closure, repair, or scheduling changes.

Union, intersection, and direction

Relifold composes admitted sets. E_tokens union E_blocks is a relaxation: either rule may nominate a pair, so more work reaches the judge. Their intersection is stricter and cheaper. An ordered difference isolates one rule's marginal contribution. If you instead reason in blocked sets, De Morgan's laws reverse this intuition; label the set being composed explicitly.

An external average-linkage block map can be converted into admitted pairs without physically partitioning the semantic task. A useful research candidate is often the union of those within-block pairs and a direct similarity rule: the block map recovers contextual neighborhoods while the direct rule preserves high-similarity pairs split by greedy clustering. This is an approximation, not a universal recipe, and must be revalidated per task.

Register variables, not constants

If a threshold, tolerance, time window, or other variable should appear in plots, parameter advice, or optimization, declare it in the predicate's registered parameter schema and read its bound value. similarity >= 0.2 contains a constant; similarity >= threshold.value contains an optimizable registered variable. The shape of the rule stays fixed while Relifold replays candidate values on the saved review sample.

Workbench recipe

  1. Create a random review sample for estimation.
  2. Curate it manually or activate the existing Reviewer on that review sample.
  3. Implement one candidate as the task's Python gate, registering every variable you want to compare.
  4. Use the parameter controls to compare values on the same labelled sample. To compare a union or intersection, express that composition in the Python gate and save it as a new draft revision.
  5. Inspect gate recall, candidate precision, admitted-set size, expansion yield, shrink loss, and parameter-registration warnings.
  6. Run a bounded end-to-end A/B only when the marginal evidence justifies it.

The Workbench never runs an arbitrary uploaded program or silently adopts a winner. It validates and versions the configured gate through the ordinary task editor. A future research assistant may propose experiments, but no assistant has implicit mutation authority.

Next: open the Task Workbench, or review confidence and visible evidence.