Release notes¶
Changes in each published nlp-shap version. Newest first.
Unreleased¶
0.1.16 (2026-07-19)¶
Added¶
Optional sync
CoalitionProgresscallbacks onInferenceSchedulerandExplainRunnerfor per-coalition progress reporting (no-op when omitted).Deterministic hash embeddings on mock
generation_record_from_snapshot()so embedding-based value functions work in CI / mock campaigns.BackendConfig.serialize_generate(defaultTrue) to serialize LM Studiogeneratecalls; required for MLX backends that crash under concurrent predict.LM Studio SDK websocket INFO logs are silenced on backend import.
Changed¶
DeletePolicyrenders the empty coalition as empty message text instead of raising, so exact Shapley can evaluate \(v(\emptyset)\) under deletion absence.NeymanEstimatorinitial sampling no longer waits on empty/grand M-matrix columns (which are never yielded), fixing an infinite loop on small player counts.LM Studio model handles use
ttl=Noneand retry once after unload/crash.
0.1.15 (2026-07-15)¶
Added¶
Runtime micro-benchmarks in
tests/benchmarks/for dedup keys, mask pack/unpack, archive round-trip (10k coalitions), and prefix-cache hits.make benchandmake bench-regressiontargets with recordedbaselines.jsonand an optional >10% regression gate.
0.1.14 (2026-07-15)¶
Added¶
Extending nlp-shap user guide for optional extras and plugin entry points.
[dev]optional extra for contributor tooling.Base-wheel smoke test ensuring
torchis not installed without extras.
Changed¶
Removed the transitional
explain.use_v2YAML flag; the v2 explain pipeline is now the only path.render_attribution()andrender_attribution_html()load lazily soimport nlp_shapworks without[viz].
Documentation¶
README quickstart with
ExplainRunner.Getting-started explain walkthrough and API export table updates.
0.1.13 (2026-07-15)¶
Added¶
nlp_shap.vizwithtoken_textandtoken_barrenderer plugins andrender_attribution()public helper.AttributionRendererprotocol andnlp_shap.renderersentry-point group.Optional
[viz]extra (matplotlib,ipywidgets).Visualization user guide and
attribution_viz/text_explain_e2eexample notebooks.
Fixed¶
Lazy visualization imports so the published wheel passes the base
import nlp_shapsmoke test withoutmatplotlib.
0.1.12 (2026-07-15)¶
Added¶
ApiBackendfor OpenAI-compatible/chat/completionsHTTP APIs viahttpx.In-memory response deduplication for identical request bodies at
temperature: 0.0.Optional
[api]extra,config/dev_api.yaml, and mock-transport contract tests in CI.User guide for generative backends: Generative backends.
0.1.11 (2026-07-15)¶
Added¶
TransformersTextBackendwith chat templates, text-only validation, and contextual embedding hooks.PrefixCacheManagerwith scheduler prefix grouping andkv_cache_hitsmetrics onSchedulerMetrics.Optional
[transformers]extra andconfig/dev_transformers.yaml.@pytest.mark.gpuintegration tests for local Hugging Face runs.
0.1.10 (2026-07-15)¶
Added¶
LmStudioBackendusinglmstudio.AsyncClient.BackendUnavailableErrorwhen the LM Studio API server is down.Optional
[lmstudio]extra,config/dev_lmstudio.yaml, and@pytest.mark.lmstests.
0.1.9 (2026-07-15)¶
Added¶
reanalyze()rescoring on archived coalitions with zero backend executions.Grand-coalition
base_generation.txtpersisted in run archives before the coalition scheduler loop whenprecompute_baseis enabled.nlp_shap.runtime.telemetrywithInMemoryObservabilitySinkstage spans for orchestrator and estimator phases.load()for reopening existing archives.
0.1.8 (2026-07-14)¶
Added¶
ExplainRunnerwithexplainandexplain_syncentry points.ExplainOrchestratorwiring partition, estimation, generation, value functions, and normalizers.MockBackendfor deterministic CI-safe E2E runs.ExplainRunOutputwith scheduler metrics and run manifest metadata.mockbackend entry point andresolve_type().
0.1.7 (2026-07-14)¶
Added¶
TfIdfCosineValuewith frozen-corpus TF-IDF cosine scoring (U3).CosineEmbeddingValueandEuclideanEmbeddingValuefor embedding utilities (U1/U2/U4).LogprobValuewith deterministic stub logprobs.Presentation normalizers in
nlp_shap.estimation.normalizers.GenerationRecordfor token rows, embeddings, and logprobs.tfidf_cosine,embedding_cosine,embedding_euclidean, andlogprobvalue-function entry points;identity,abs_sum,power_shift, andmin_maxnormalizer entry points.
0.1.6 (2026-07-14)¶
Added¶
MonteCarloEstimatorfor budgeted random coalition sampling with estimand-plugin aggregation.ComplementaryEstimatorfor complementary-pair sampling and CC Shapley aggregation.NeymanEstimatorfor two-phase Neyman-CC sampling withNeymanConfigcontrols.Shared sampling helpers in
nlp_shap.estimation._shared.mc,complementary, andneyman_ccestimator entry points.Theory and guide pages for approximate estimation.
estimator_comparison.ipynbcomparing budget, sample count, and accuracy.
Changed¶
ExplanationConfigaddsneymansettings for Neyman-CC runs.Drop unnecessary
from __future__ import annotationsacross the package; document the policy in development rules.Consolidate Examples into a single list-table with hidden toctree.
0.1.5 (2026-07-13)¶
Added¶
ExactEstimatorfor lazy coalition enumeration with estimand-plugin aggregation.iter_mask_ints()anditer_masks()for streaming masks without materializing2^ncoalitions.estimate_attributions()wires coalition payoffs to Shapley or Banzhaf aggregators.Vectorized exact Shapley aggregation for complete characteristic tables.
run_iter()andrun_streamfor bounded pending-task scheduling.exactestimator entry point undernlp_shap.estimators.
Changed¶
build_coalition_keyuses compact binary hashing instead of JSON serialization.Marginal estimand aggregation uses integer bitmask keys and cached factorial weights.
sample_masksyields an iterator instead of a materialized tuple.
Documentation¶
Theory and usage guides for exact estimation and streaming scheduler usage.
API reference for
nlp_shap.estimation.exact.Example notebook
examples/exact_estimation.ipynb.Performance review rules in contributor workflow.
0.1.4 (2026-07-13)¶
Added¶
RunArchivewith SQLite index, blob storage, and lazyhistory_lazy()iteration.CoalitionRecordrows with mask bytes, utility, timing, and cache-hit metadata.CoalitionDedupRegistryandbuild_coalition_key()SHA256 coalition keys.HotResultStoreLRU cache for recent generations.InferenceSchedulerwith boundedmax_inflightconcurrency andSchedulerMetrics.
Documentation¶
Theory and usage guides for the runtime archive, dedup, and scheduler.
API reference page for
nlp_shap.runtime.Example notebook
examples/runtime_core.ipynb.
0.1.3 (2026-07-12)¶
Added¶
Masking codec:
PackedMask,MaskCodecwith legacy-compatible packed hashing.MaskSpacefor projecting feature splits to full masks.View-based
MaskedSnapshotandMaskBuilderwith structural sharing.Absence policies:
DeletePolicy,PadPolicy,NeutralPolicy.TokenPartitionerand built-in plugin registration fortokens,delete,pad, andneutral.numpycore dependency for mask packing.
Documentation¶
Theory and usage guides for coalition masking and absence policies.
API reference page for
nlp_shap.masking.Example notebook
examples/masking_views.ipynb.
0.1.2 (2026-07-12)¶
Added¶
Domain types:
ConversationSnapshot,Turn,Message,PlayerSet,CoalitionMask,CooperativeGame, and conversation enums.Protocols for backends, estimators, value functions, partitions, absence policies, and embedding providers.
PluginRegistrywith packaging entry-point discovery.ExplainConfig(Pydantic v2) with YAML load/save helpers.Configuration guide and expanded API reference pages.
Documentation¶
Sphinx theory pages for cooperative games and estimands (Shapley vs Banzhaf).
Usage guide for estimand aggregators, results, and manifests.
Expanded API reference for public modules.
Example notebook
examples/estimands_toy_game.ipynb.Furo theme, getting-started page, embedded notebook rendering, and API module layout.
Tooling¶
make notebookstarget to execute example notebooks in place before commit.
0.1.1 (2026-07-12)¶
Added¶
ShapleyAggregatorandBanzhafAggregatorfor coalition-weighted attribution from masks and payoffs.Estimandenum and wire types for honest estimand labelling.ExplainResultwith requiredestimandfield.RunManifest,RunManifestPayload, andparse_manifest()for run-archive metadata.EstimandAggregatorprotocol.
0.1.0 (2026-07-12)¶
Added¶
Initial PyPI package layout and
nlp_shapimport surface.Logging bootstrap from
[tool.logging]inpyproject.tomlvialogging518.