fix(interpretability): allow inf-masking SHAP on the remote backends - #391
Merged
Conversation
## Changes - **The guard refused every remote backend.** `_model_has_inf_passthrough` read only `get_inference_config()`, which no client estimator has, so `get_tabpfn_inf_explainer` rejected configurations that work. The premise that `PASSTHROUGH_INF` is local-only is wrong: `inference_config` is a field both the managed API and a self-hosted container accept, and each forwards it to the TabPFN it runs. - **It now reads either place the flag can live** — a local model's resolved config as before, or the raw `inference_config` argument otherwise. A local model's resolved config still wins, which a test pins. - **Both backends were tested, not assumed.** `+inf` without the flag is rejected either way (container 500, API `422 Input X contains infinity`); with it both predict normally, and the API's output moves away from the finite baseline, so the masking reaches the model. - **Docs and tests corrected** — the path was documented as local-only. - Self-hosted JSON payloads additionally need the hosted estimator's non-finite serialization fix, without which `+inf` never leaves the client. The managed backend uploads Parquet and is unaffected. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AsHuhQhqWz3EkVVtPbdBBa
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AsHuhQhqWz3EkVVtPbdBBa
ggprior
approved these changes
Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
_model_has_inf_passthroughread onlyget_inference_config(), which no client estimator has, soget_tabpfn_inf_explainerrejected configurations that work. The premise thatPASSTHROUGH_INFis local-only is wrong:inference_configis a field both the managed API and a self-hosted container accept, and each forwards it to the TabPFN it runs.inference_configargument otherwise. A local model's resolved config still wins, which a test pins.+infwithout the flag is rejected either way (container 500, API422 Input X contains infinity); with it both predict normally, and the API's output moves away from the finite baseline, so the masking reaches the model.+infnever leaves the client. The managed backend uploads Parquet and is unaffected.Reviewer notes
tabpfn-clientis not a test dependency here. They are currently the only tests in this file that run without local model weights.main, with the same 51 pre-existing failures (TabPFNLicenseError— no local weights in this environment).🤖 Generated with Claude Code
https://claude.ai/code/session_01AsHuhQhqWz3EkVVtPbdBBa