mixle.substrate.accum module¶
Measure whether accumulated calibrated knowledge improves held-out answers.
The knowledge-accumulation flywheel measures whether adding calibrated
knowledge to the belief store (mixle.substrate.belief) improves answers
on a held-out question set, with no model retraining. Distillation improves the
student model; accumulation improves what the student or teacher can retrieve.
Two guards keep the measurement grounded:
attribution – the improvement must disappear when the newly-assimilated items are withheld from retrieval, proving the gain came from the store growing rather than anything else (timing, caching, a lucky
answer_fn).credence weighting – retrieval goes through
mixle.substrate.belief.retrieve_beliefs(), which ranks byrelevance * credenceand can be hard-thresholded withmin_credence; a batch of low-credence (e.g. pureMODEL_ASSERTION) knowledge must not inflate the measured improvement – it is down-weighted, never treated as ground truth.
- class QAItem(question, answer)[source]
Bases:
objectOne held-out question:
answer_fnis judged correct on it if it producesanswerfrom the retrieved context alone.
- class FlywheelMeasurement(solve_rate, grounded_fraction)[source]
Bases:
objectHeld-out answer quality and grounding rate for one flywheel measurement.
- class FlywheelReport(before, after, withheld, attribution_confirmed)[source]
Bases:
objectBefore/after/withheld flywheel measurements with an attribution check.
- Parameters:
before (FlywheelMeasurement)
after (FlywheelMeasurement)
withheld (FlywheelMeasurement)
attribution_confirmed (bool)
- measure_flywheel(sub, questions, answer_fn, assimilate_batch, *, k=5, min_credence=None)[source]
Measure
answer_fnagainstquestionsbefore and afterassimilate_batch(sub)adds a batch of calibrated beliefs (returning the ids it touched), with a THIRD measurement that excludes exactly those ids from retrieval – the attribution control.answer_fnand every other piece of the system stay fixed throughout: only the store’s content (and what it makes retrievable) changes.