check_currentmetric() inverts accuracy/f1: exact-match generations score 0.0, all-wrong/empty generations score 1.0
Đá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
- 82/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ệ
- python
- Lĩnh vực
- testing-qa
Hướng nghiên cứu
Bắt đầu với check_currentmetric() tại codefuseEval/execution.py:680-683 và so sánh logic giống hệt ở cấp byte trong codefuseEval_202503/execution.py:681-684. Xem xét metrics/accuracy/accuracy.py, metrics/f1/f1.py và metrics/accuracy/README.md, sau đó xác minh rằng các kết quả khớp chính xác được chấm điểm đúng cho cả hai metric công khai và bổ sung độ bao phủ hồi quy cho tính phân cực.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
codefuseEval/execution.py:680-683 (byte-identical duplicate at codefuseEval_202503/execution.py:681-684):
if metric == "accuracy" or metric == "f1":
predictions = [0 if prediction == reference else 1 for prediction, reference in
zip(predictions, references)]
references = [1] * len(references)
...
result = metric_module.compute(predictions=predictions, references=references, **kwargs)
When prediction == reference (the generation is correct), this assigns 0; when they differ, it assigns 1. references is then set to all-1s, and the arrays are handed to metrics/accuracy/accuracy.py's Accuracy._compute:
def _compute(self, predictions, references, normalize=True, sample_weight=None):
return {"accuracy": float(accuracy_score(references, predictions, normalize=normalize, sample_weight=sample_weight))}
sklearn.accuracy_score counts the fraction where predictions[i] == references[i] == 1, i.e. the fraction of mismatches. This is the exact inverse of the contract documented in metrics/accuracy/README.md ("Accuracy is the proportion of correct predictions among the total number of cases processed"). f1 shares the identical transform and inverts the same way.
What happens (reproduced on the real module)
check_currentmetric() in codefuseEval/execution.py:680-683 (byte-identical at codefuseEval_202503/execution.py:681-684, both confirmed against the repo's current HEAD 09a4f2af) inverts the accuracy/f1 polarity: on a match it assigns predictions=0 and sets all references=1, then hands these to the vendored HuggingFace evaluate Accuracy/F1 classes (metrics/accuracy/accuracy.py, metrics/f1/f1.py, unmodified), whose sklearn.accuracy_score/f1_score then measure the mismatch rate rather than the match rate — independently reproduced against real sklearn: a 10/10-correct model scores accuracy=0.0/f1=0.0, a 0/10 or all-empty-output model scores accuracy=1.0, exactly contradicting metrics/accuracy/README.md's documented contract. Both accuracy and f1 are public, unguarded CLI-selectable metrics (METRIC_SUPPORT in evaluation.py) with no caller-side correction, no pinning test, and no existing issue/PR — any invocation with --metric accuracy or --metric f1 (e.g. against the registered spider_test/text2sql dataset, whose post-processor only extracts SQL text and performs no scoring of its own) hits this. The one-line polarity flip suggested in the report (swap which branch maps to 0 vs 1) is the correct fix, matching the already-correct polarity convention used a few lines away in the pass@k path (evaluation.py:477-479).
Happy to open the PR.
- Ngôn ngữ chính
- Python
- Star
- 111
- Fork
- 19
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của codefuse-ai/codefuse-evaluation
-
Any related paper?Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 15/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
-
是不是可以增加基于api的测试Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
codefuse-ai/codefuse-evaluation#8 · 1 bình luận ·
Tất cả issue của codefuse-ai/codefuse-evaluation
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
sylvainmetayer/homelab#851 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Add `ty-pre-commit` hookĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
kubeflow/docs-agent#279 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Qiskit/qiskit-ibm-runtime#3523 ·
Maintainer thường phản hồi trong vòng 1 ngày