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: object

One model’s linear-Gaussian claim about the shared latent, tagged with identity + trust.

evidence is the model’s raw (H, y, R) observation of the latent (its name is ignored – fuse_models() stamps f"{model_id}@{version}" on it so attribution and disagreement reporting are keyed by model identity rather than whatever the caller set). reliability in (0, 1] is how much the claim’s stated noise should be trusted: 1.0 takes R at face value; smaller values inflate R (divide by reliability), so a known-flaky model’s claim is assimilated as effectively noisier and contributes less information to the fused belief.

Parameters:
  • evidence (LinearGaussianEvidence)

  • model_id (str)

  • version (str)

  • reliability (float)

property name: str

The stable model_id@version identity used as this claim’s evidence/attribution key.

class ModelFusionResult(answer, weights, disagreement, abstain)[source]

Bases: object

The outcome of fusing several models’ claims about one latent.

answer is the fused ReasonedAnswer (posterior belief + UQ). weights is each model’s attribution – nats of uncertainty it removed (ReasonedAnswer.attribution()), keyed by model_id@version. disagreement reports covariance-aware pairwise tests of the raw claims in measurement space. abstain is True when any pair disagrees by more than disagree_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.

Parameters:
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 / reliability and named model_id@version (DR-ALG L5/M2 precision weighting), then all claims are folded into prior in one pass via mixle.reason.core.reason() – the existing multi-source assimilation path, with one evidence per model rather than per modality. Per-model attribution comes straight from ReasonedAnswer.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 to disagree_sigma. An incomparable pair also causes abstention rather than silently passing.

Parameters:
  • prior (GaussianBelief) – the latent’s prior belief.

  • claims (list[ModelClaim]) – one ModelClaim per model (must have distinct model_id@version identity).

  • 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 ModelFusionResult with the fused answer, per-model weights, the disagreement report, and the abstain flag.

Return type:

ModelFusionResult