mixle.reason.model_fusion module¶
Numeric cross-model belief fusion – precision-weighted assimilation across MODELS, not modalities.
mixle.reason.core.reason already folds a sequence of per-modality linear-Gaussian evidence
into a shared latent belief (a product of experts). This module reuses exactly that Kalman path to
fuse per-model claims about the same latent: several independently-run models (e.g. two physics
solvers, or a solver and a learned emulator) each hand back a linear-Gaussian view of the same
quantity, tagged with the model’s identity and an operator-supplied reliability. fuse_models
scales each claim’s noise by its reliability (inverse-variance precision weighting), assimilates
all of them in one pass, and reports which model contributed how much (in nats, via
ReasonedAnswer.attribution) plus whether the models disagree badly enough that the fused
answer should not be trusted outright.
Fusion reuses the existing Kalman path, while conflict detection stays in raw measurement space so a shared prior cannot hide contradictory claims. The pairwise test uses the full claim-difference covariance and a rank-aware chi-square bound. Merging non-scalar structured knowledge (graphs/tables/images) across models is a different lifecycle owned by the knowledge-conflict machinery, not this module.
- class ModelClaim(evidence, model_id, version, reliability=1.0)[source]
Bases:
objectOne model’s linear-Gaussian claim about the shared latent, tagged with identity + trust.
evidenceis the model’s raw(H, y, R)observation of the latent (itsnameis ignored –fuse_models()stampsf"{model_id}@{version}"on it so attribution and disagreement reporting are keyed by model identity rather than whatever the caller set).reliabilityin(0, 1]is how much the claim’s stated noise should be trusted:1.0takesRat face value; smaller values inflateR(divide byreliability), so a known-flaky model’s claim is assimilated as effectively noisier and contributes less information to the fused belief.- property name: str
The stable
model_id@versionidentity used as this claim’s evidence/attribution key.
- class ModelFusionResult(answer, weights, disagreement, abstain)[source]
Bases:
objectThe outcome of fusing several models’ claims about one latent.
answeris the fusedReasonedAnswer(posterior belief + UQ).weightsis each model’s attribution – nats of uncertainty it removed (ReasonedAnswer.attribution()), keyed bymodel_id@version.disagreementreports covariance-aware pairwise tests of the raw claims in measurement space.abstainisTruewhen any pair disagrees by more thandisagree_sigma– the fused number should not be trusted at face value; callers are expected to route that case to a verifier (IC-6) / an abstaining natural-language surface rather than presenting the fused mean as settled.
- fuse_models(prior, claims, *, query=None, disagree_sigma=3.0, cross_covariances=None)[source]
Fuse several models’ claims about the same latent into one belief (precision-weighted Kalman).
Each claim’s noise is scaled by
1 / reliabilityand namedmodel_id@version(DR-ALG L5/M2 precision weighting), then all claims are folded intopriorin one pass viamixle.reason.core.reason()– the existing multi-source assimilation path, with one evidence per model rather than per modality. Per-model attribution comes straight fromReasonedAnswer.attribution(). Before returning, each pair of models’ individual (solo) raw measurement claims are compared with a rank-aware Mahalanobis test whose chi-square confidence mass corresponds todisagree_sigma. An incomparable pair also causes abstention rather than silently passing.- Parameters:
prior (GaussianBelief) – the latent’s prior belief.
claims (list[ModelClaim]) – one
ModelClaimper model (must have distinctmodel_id@versionidentity).query (Any) – optional latent coordinate indices to restrict the fused answer (and the disagreement check) to.
disagree_sigma (float) – the standardized-distance threshold above which models are considered to be in conflict.
cross_covariances (Mapping[tuple[str, str], Any] | None) – optional pairwise covariance between model measurement errors, keyed by
(model_name, model_name). Missing pairs are explicitly treated as independent.
- Returns:
A
ModelFusionResultwith the fused answer, per-model weights, the disagreement report, and the abstain flag.- Return type:
ModelFusionResult