Judge score profiler samples reasoning with squared category weights, crowding out uncommon scores

Đang mở Phù hợp với người mới
#1,202 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
76/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
pandas, python
Lĩnh vực
machine-learning

Hướng nghiên cứu

Đọc sample_scores_and_reasoning trong engine/analysis/utils/judge_score_processing.py và các bài kiểm thử hiện có trong tests/engine/analysis/utils/test_judge_score_processing.py. Kiểm tra cách nhánh tỷ lệ gán trọng số cho các hàng, sau đó thêm một bài kiểm thử hồi quy sử dụng các nhóm điểm mất cân bằng. Xác minh số lượng các nhóm điểm được lấy mẫu khớp với tỷ lệ mong đợi. Hoàn tất khi bài kiểm thử hồi quy chạy thành công và mẫu giữ lại các điểm ít phổ biến như mong đợi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
Python
Star
2.4k
Fork
258
Merge trung bình
4 ngày 20 phút
Pull request đã merge (30 ngày)
32

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NVIDIA-NeMo/DataDesigner

Tất cả issue của NVIDIA-NeMo/DataDesigner

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.