#785·laya

[feature]: attribute shortlist evaluation errors to retrieval and decision stages

Author: zhangxinping666Created Oct 1, 2026Updated Oct 1, 2026
Labelsenhancement

The problem

The opt-in predict_shortlist helper returns the selected labels, but laya.evals.evaluate currently drops that metadata. On a labelled high-cardinality choice set, an end-to-end accuracy number alone cannot tell whether the gold label was removed by retrieval or the decision head chose the wrong label despite receiving it. Issue #102 reported a one-off BANKING77 recall@20; there is no reusable per-example diagnostic in the eval harness.

Proposed solution

Add an opt-in Python evaluation path that calls the existing predict_shortlist and reuses laya.evals.evaluate. Preserve shortlist metadata on eval cases; classify each choice as correct, retrieval_miss, or decision_miss. Report recall@k, accuracy conditional on recall, and the existing end-to-end choice_accuracy, including slice metrics. Validate the gold label and shortlist metadata so malformed rows cannot inflate the score. Record k, checkpoint and embedder identity in the report. Keep normal prediction and normal eval unchanged; no second decision-model pass or hosted dependency. I plan to implement this in a focused PR and link it here.

Alternatives considered

A standalone benchmark loop would duplicate dataset parsing, timing and report behavior already in laya.evals. Adding gold labels or metrics to predict_shortlist would mix evaluation concerns into inference. A small eval adapter can use the existing outputs without changing the scoring path.

Use case

When testing k=10 versus k=20 on a labelled intent dataset, compare retrieval recall, conditional decision accuracy and end-to-end accuracy, then inspect the individual missed examples. If recall is high but conditional accuracy is low, work on the decision stage; if the gold label is often absent, work on retrieval or k.

Prior art

Related measurement: #102. Existing shortlist implementation: #106. Existing eval harness: #382.

Before submitting

  • I searched the existing issues and this is not a duplicate.