Stop NaN/Inf Phoenix heads from poisoning For You rank - #74
Closed
Pitchfork-and-Torch wants to merge 1 commit into
Closed
Stop NaN/Inf Phoenix heads from poisoning For You rank#74Pitchfork-and-Torch wants to merge 1 commit into
Pitchfork-and-Torch wants to merge 1 commit into
Conversation
One non-finite Phoenix head was used as a real feature. Dwell-regret means then went NaN and TopK kept the poisoned scores. Treat non-finite heads as missing, persist only finite ranks, and last-place the rest. Co-authored-by: Jon Bailey <Pitchfork-and-Torch@users.noreply.github.com>
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.
Problem
Phoenix can emit NaN (logged in
model_runner, still returned).RankingScorer::applydidunwrap_or(0.0) * weight, soSome(NaN)/Some(±Inf)entered the sum. Dwell-regret then added that NaN into the slate mean, and every candidate’s score became NaN.TopKScoreSelectorkeptSome(NaN)(partial_cmp→ Equal).DedupConversationFilterusedscore > best, which is false for NaN, so a NaN first-post locked the conversation.This is not xai-org#142 (all heads
Nonestill ranked). This is not xai-org#181 (engagement-count store errors zeroing features). A present non-finite feature fail-opened into rank.Five-line proof
has_nanincrements a metric and stillreply_requests the batch (phoenix/xrex/inference/model_runner.py).RankingScorer::apply/ dwell-regret means usedunwrap_or(0.0)—Some(NaN)stays NaN; one head NaNsmean_favorite.centered_ratiothen NaNs every candidate;offset_scorewritesSome(NaN).TopKScoreSelector/Selector::sorttreat NaN as Equal, so poisoned posts occupy For You slots;+Infwins the slate.None; TopK last-places the rest; conversation collapse ignores NaN.Change
RankingScorer::finite_head/persistable_score— NaN/Inf heads do not enter the weighted sum or dwell-regret means; non-finite finals are unset.PhoenixScoresRankingScorer— same persist rule.TopKScoreSelector— non-finite →NEG_INFINITY.DedupConversationFilter— non-finite → 0 so a finite sibling can win.Tests
nan_favorite_head_does_not_poison_dwell_regret_slateinf_favorite_head_does_not_win_weighted_ranknon_finite_final_score_is_unset_for_topknan_score_does_not_lock_the_conversationnon_finite_scores_sort_lastcargo testcannot run here: the public dump has no home-mixer crate manifest.Survey
xai-org/x-algorithmmain.