Judge score profiler samples reasoning with squared category weights, crowding out uncommon scores
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 76/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
调研方向
阅读 engine/analysis/utils/judge_score_processing.py 中的 sample_scores_and_reasoning,以及 tests/engine/analysis/utils/test_judge_score_processing.py 中现有的测试。检查比例分支如何为各行加权,然后使用分布不均衡的分数类别添加回归测试。验证抽样得到的类别数量是否符合预期比例。回归测试通过且样本按预期保留少见分数后,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Priority Level
Low (Cosmetic / Minor)
Describe the bug
sample_scores_and_reasoning in engine/analysis/utils/judge_score_processing.py picks the judge reasoning examples that JudgeScoreProfiler sends to the summarization model and stores in JudgeScoreSummary.score_samples. The code comment says it samples "proportionally to maintain original category ratios", but each row is weighted by the count of its own score category:
weights = df_samples["score"].map(score_category_counts)
samples = df_samples.sample(n=num_samples, weights=weights, random_state=random_seed)
A category with c rows then gets total weight c * c, so the sampled share of each score is proportional to the square of its frequency. Uncommon scores (usually the low ones, which carry the "areas for improvement" reasoning) are crowded out of the sample, and the summary prompt mostly sees reasoning for the majority score.
Steps/Code to reproduce bug
from collections import Counter
from data_designer.engine.analysis.utils.judge_score_processing import sample_scores_and_reasoning
scores = [5] * 90 + [1] * 10
reasoning = [f"r{i}" for i in range(100)]
total = Counter()
for seed in range(200):
sample = sample_scores_and_reasoning(scores, reasoning, num_samples=20, random_seed=seed)
total.update(s.score for s in sample)
n = sum(total.values())
print({k: round(v / n, 3) for k, v in total.items()})
# main (861a082): {5: 0.988, 1: 0.013}
Score 1 is 10% of the records but only 1.3% of the sampled reasoning; most 20-row samples contain no score-1 reasoning at all.
Expected behavior
The sample keeps the score proportions of the data, as the comment describes: about 18 rows with score 5 and 2 with score 1 in the example above.
Prior Investigation
Read sample_scores_and_reasoning and its tests (tests/engine/analysis/utils/test_judge_score_processing.py); the existing tests only check sample sizes and the one-per-category branch, not the proportional branch. Searched open and closed issues and PRs for sample_scores_and_reasoning, judge_score_processing and judge score sampling; found nothing related.
Proposed fix: replace the per-row weights with a proportional allocation per score category (largest-remainder rounding to hit num_samples exactly), then sample that many rows from each category. Plain unweighted df.sample would also be unbiased; the per-category allocation additionally keeps the counts exact so a 10% score is not dropped by chance. I have the fix and a regression test ready and can open a PR once this is triaged.
Checklist
- I reproduced this issue or provided a minimal example
- I searched the docs/issues myself
- 主要语言
- Python
- 星标
- 2.4k
- 派生
- 258
- 平均合并
- 4 天 20 分钟
- 30 天内合并 PR
- 32
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
NVIDIA-NeMo/DataDesigner 的其他 Issue
-
Local seed path containing a single quote breaks the DuckDB query可能已有人在做 @xubenqiang 于 38 天前认领。 未关闭bug triaged
难度 2/5 1-3 小时 新手友好度 67/100
NVIDIA-NeMo/DataDesigner#1102 · 3 条评论 ·
维护者通常 1 天内回复
-
enforce \from future import annotations` via ruff FA102 rule`可能重新可做 关联的 PR 已关闭且未合并。 未关闭task
难度 2/5 1-3 小时 新手友好度 82/100
NVIDIA-NeMo/DataDesigner#760 ·
维护者通常 1 天内回复
-
NVIDIA-NeMo/DataDesigner#1205 ·
维护者通常 1 天内回复
-
NVIDIA-NeMo/DataDesigner#1204 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 76/100
NVIDIA-NeMo/DataDesigner#1203 ·
维护者通常 1 天内回复
查看 NVIDIA-NeMo/DataDesigner 的全部 Issue
相似的 Issue
-
docs(contributing): the two things that silently block a PR可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭available documentation good first issue
难度 1/5 1-3 小时 新手友好度 95/100
Nixitov/Riptide-Native#944 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 88/100
JTHCode/secretguard#24 ·
维护者通常 1 天内回复
-
area: middleware documentation good first issue
难度 2/5 1-3 小时 新手友好度 88/100
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
good first issue
难度 1/5 1 小时以内 新手友好度 95/100
omarelshamy25x/shamy-hijri#63 ·
维护者通常 1 天内回复