Reject fabricated MoE weights in SVDInterpreter - #1780
Open
emerardd wants to merge 2 commits into
Open
Conversation
koriyoshi2041
approved these changes
Sep 13, 2026
koriyoshi2041
left a comment
Contributor
There was a problem hiding this comment.
Reviewed at 1efd56e0. Omitting structurally unavailable sparse-MoE weights closes the dangerous path where a fabricated zero matrix can produce plausible non-zero singular directions, while the dense/absent-MLP cases remain explicit. I also checked the partial-weight path: an available W_in is preserved while an unavailable W_out is omitted, so the interpreter fails at the requested boundary rather than erasing usable data. The focused parameter, Mixtral, and dense-dispatch tests pass locally (20 passed). The full hosted compatibility/quality matrix is green.
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.
Description
Sparse-MoE layers do not have a single dense
W_inorW_out, butget_bridge_params()previously represented these structurally unavailable weights with zero tensors.SVDInterpreterthen decomposed those zero matrices and projected an arbitrary singular basis through the unembedding, returning plausible non-zero directions that were independent of the real expert weights.This PR:
SVDInterpreterraise a layer-specificNotImplementedErrorbefore SVD for unavailablew_inorw_out;torch.linalg.svdis not reached.The change deliberately does not select, average, or router-weight experts. Those behaviors need a separately defined expert-aware interpretation contract.
Closes #1779
Type of change
Validation
103 passed, 3 skippedw_inandw_outstill return non-zero SVD resultsuv run --no-cache --no-sync mypy .: no issues in 398 source filesgit diff --check: passedThe complete test suite was not run locally.
Checklist: