Coming from legacy MLLM-Shap

mllm-shap replaces the legacy MLLM-Shap research code: same algorithms; new configuration, result types and some defaults.

Explainers to estimators

Legacy classes per estimator and variant map to explanation.estimator plus budget keys:

legacy MLLM-Shap class

explanation.estimator

Budget keys

PreciseShapExplainer

exact

budget.fraction: 1.0

StandardMcShapExplainer

mc

fraction: 1.0, include_minimal_masks: false

LimitedMcShapExplainer

mc

fraction < 1.0 and/or include_minimal_masks: true

StandardComplementaryShapExplainer

complementary

fraction: 1.0, include_minimal_masks: false

LimitedComplementaryShapExplainer

complementary

fraction < 1.0 and/or include_minimal_masks: true

StandardComplementaryNeymanShapExplainer

neyman_cc

fraction: 1.0

LimitedComplementaryNeymanShapExplainer

neyman_cc

fraction < 1.0

The estimand is its own key, explanation.estimand (shapley or banzhaf), and every result carries it (Using estimand aggregators).

Utilities to value functions

Legacy experiments named their utilities U1 to U4 (unrelated to the use cases of Using value functions):

Label

legacy MLLM-Shap

mllm-shap

U1

CosineSimilarity on static embeddings

value_fn: embedding_cosine, plugin_options.embedding_cosine.encoder: model_states, embedding_mode: static

U2

CosineSimilarity on contextual embeddings

value_fn: embedding_cosine, plugin_options.embedding_cosine.encoder: model_states, embedding_mode: contextual

U3

TfIdfCosineSimilarity

value_fn: tfidf_cosine

U4

EuclideanSimilarity

None: embedding_euclidean was removed in 0.7 because it depends on vector scale and answer length; use embedding_cosine

Since 0.7 embedding_cosine defaults to a sentence encoder; model_states keeps the legacy pooled states of the explained model.

Behaviour that changed

  • tfidf_cosine fits IDF once on all of a run’s outputs, not per comparison, so scores compare across coalitions.

  • Results report base_value and grand_value; values should sum to their difference. Axiom tests enforce it; runs do not check it. Exact results match PreciseShapExplainer on additive games.

  • Archives keep the base generation and every coalition output; reanalyze() recomputes attributions with another value function or normalizer without model calls.

  • hash_mask() uses BLAKE2b: hashes are process-independent and differ from legacy ones.

  • Model, generation and explanation settings live in one validated ExplainConfig (Configuration), not keyword arguments and model config objects.