Back to the curriculum

L2-M03 · Level 2 · ~13 h

Quality Metrics and Rubrics

What you build: Metric definitions and scoring rubric

lessons
5
lesson hours (estimate)
≈ 8.5 h
0/5 lessons marked done · Progress is saved in this browser only. No account, nothing is sent to a server.
In review. The curriculum, module overviews and Levels 1–3 lessons are drafts written with AI assistance and reviewed by AI. Human review is still pending. English translation: AI-assisted, not human-reviewed.

Levels 1–3 lessons, exercises and quizzes are published as drafts, in Vietnamese with an AI-assisted English translation. They may change after human review.

Module path

  1. Lesson 1 · L2-M03-L01≈ 1.5 h

    Deterministic metrics: exact match, regex, schema, numeric tolerance

    What you build: Metric functions with tests

    Needs: L2-M02-L05

    Key terms (10)
    • Deterministic metricHàm metric tất định (grader bằng code; cùng đầu vào, cùng kết quả)
    • Exact matchSo khớp chính xác
    • Normalisation (NFC)Chuẩn hóa (NFC của Unicode)
    • RegexRegex (biểu thức chính quy)
    • ToleranceDung sai (tuyệt đối, tương đối)
    • Schema checkKiểm schema (khuôn cấu trúc JSON)
    • PrecisionPrecision: tỷ lệ đúng trong số câu metric chấp nhận
    • RecallRecall: tỷ lệ metric chấp nhận trong số câu thật sự đúng
    • False accept / false rejectLọt (chấp nhận câu sai) / oan (từ chối câu đúng)
    • Fail closedTừ chối khi đầu vào hỏng
  2. Lesson 2 · L2-M03-L02≈ 1.5 h

    Text-similarity metrics and their limits

    What you build: Shows cases where similarity disagrees with correctness

    Needs: L2-M03-L01

    Key terms (8)
    • Similarity metricMetric tương đồng
    • Token F1F1 theo từ (trung bình điều hòa của precision và recall của từ)
    • ROUGE-LROUGE-L (chuỗi con chung dài nhất của các từ)
    • Threshold sweepQuét ngưỡng
    • GuardChốt kiểm (kiểm tất định đặt cạnh điểm tương đồng)
    • ParaphraseDiễn đạt lại
    • Trivial baselineBaseline tầm thường (quy tắc không làm gì, như chấp nhận tất cả)
    • EmbeddingEmbedding: vector biểu diễn nghĩa
  3. Lesson 3 · L2-M03-L03≈ 1.5 h

    Rubric design: analytic vs holistic, scales, anchors

    What you build: Anchored rubric

    Needs: L2-M03-L02

    Key terms (9)
    • RubricRubric (bảng tiêu chí và mô tả mức điểm)
    • Analytic / holistic rubricRubric phân tích / tổng thể
    • ScaleThang điểm
    • AnchorMốc mô tả (điều quan sát được ở một mức)
    • Anchor exampleVí dụ neo
    • Critical criterionTiêu chí then chốt (loại câu trả lời bất kể điểm khác)
    • Normalised scoreĐiểm chuẩn hóa (về khoảng 0-1)
    • Leniency gapKhoảng cách khoan dung (hiệu điểm trung bình của hai người chấm)
    • Ordinal scaleThang thứ tự
  4. Lesson 4 · L2-M03-L04≈ 2 h

    Correctness, relevance, completeness, consistency, faithfulness, groundedness

    What you build: Operational definitions with examples

    Needs: L2-M03-L03

    Key terms (9)
    • CorrectnessĐộ đúng
    • RelevanceĐộ liên quan
    • CompletenessĐộ đầy đủ
    • ConsistencyĐộ nhất quán
    • FaithfulnessĐộ trung thành với nguồn
    • GroundednessĐộ có căn cứ (mỗi mệnh đề trích dẫn đúng nguồn; nghĩa theo lab)
    • ClaimMệnh đề (một khẳng định kiểm được)
    • Operational definitionĐịnh nghĩa vận hành
    • Topic termThuật ngữ chủ đề
  5. Lesson 5 · L2-M03-L05≈ 2 h

    Aggregation and interpreting metrics

    What you build: Per-slice report rather than one average

    Needs: L2-M03-L04

    Key terms (11)
    • SliceLát cắt (nhóm case chung một thuộc tính)
    • Pooled (micro) averageTrung bình gộp
    • Macro averageTrung bình theo lát
    • Weighted averageTrung bình có trọng số (theo tỷ lệ thật)
    • Simpson's paradoxNghịch lý Simpson
    • Regression (between versions)Hồi quy: lát xấu đi giữa hai phiên bản
    • VerdictQuyết định tổng (SHIP, BLOCK, INCONCLUSIVE)
    • Too few (TOO_FEW)Quá ít case để quyết định
    • Trivial baselineBaseline tầm thường
    • Goodhart's lawĐịnh luật Goodhart (tối ưu hóa quá mức một số đo thì nó thôi giúp ích)
    • Panel (of metrics)Bảng metric

A. Module overview

Field Value
Module ID L2-M03
Level 2 - AI Quality Engineer (Evaluation)
Description Turn a dataset into a number you can trust: deterministic metrics (exact match, regex, number finding, tolerance, schema); text-similarity metrics and their limits; analytic and holistic rubrics with scales and descriptive anchors; operational definitions for six criteria (correct, relevant, complete, consistent, faithful, grounded); aggregating and interpreting results with a per-slice report. The lab builds a small toolkit for HocVui Tutor, the fictional math-tutoring chatbot of L2-M01 and L2-M02, running offline on seeded data and simulation.
Why this module matters An evaluation number is only as good as the metric that produces it. A hastily written metric lets wrong answers through and wrongly rejects correct ones in predictable ways; a high similarity score does not mean correct; an ambiguous rubric scores inconsistently; one average hides a dangerous group of answers getting worse. This module teaches how to measure the metric itself and to report in a way others can re-check.
Target professional competency Level 2: "Define quality metrics and scoring rubrics that separate good from bad outputs, and report them per slice".
Estimated duration 3 lessons × 90 minutes + 2 lessons × 120 minutes = 8.5 hours + module assignment ~4 hours + quiz 0.5 hours ≈ 13 hours for someone who has completed L2-M02. An estimate, not yet measured with real learners.
Prerequisites L2-M02 (a versioned dataset, labelling guidelines) and L2-M01 (strategy, statistics for eval). High-school math. No API key needed.
Module output Metric definitions and scoring rubrics (tested metric functions, a rubric with descriptive anchors, operational definitions for the criteria, a per-slice report)
Cost 0 VND

What learners build. Step by step, in code-labs/l2-m03: (L01) deterministic metric functions with boundary tests, and a measurement of the metric's own precision and recall against human labels; (L02) similarity metrics, a threshold sweep, and an acceptance rule that pairs similarity with a deterministic check; (L03) a rubric as data with a linter, a scoring function, and a simulation of two graders; (L04) operational definitions and a check suite for six criteria, including faithfulness and groundedness per claim; (L05) a per-slice report with confidence intervals, a decision rule, regression detection, Simpson's paradox and a trivial baseline. The lab is independent of l2-m01 and l2-m02 and needs only pytest.

B. Learning objectives

ID Objective
MO1 Write deterministic metrics (exact match, regex, number finding, tolerance, schema) with boundary tests and measure them with precision and recall against human labels.
MO2 Compute text-similarity metrics, sweep thresholds and point out where similarity disagrees with correctness.
MO3 Design a rubric with a scale, descriptive anchors and examples, score with weights and critical criteria, and compare two graders.
MO4 Write operational definitions for correctness, relevance, completeness, consistency, faithfulness and groundedness, and state the blind spots of each check suite.
MO5 Aggregate results into a per-slice report, detect regressions and gamed metrics, and interpret an average within its limits.

C. Lessons

ID Lesson Duration Prerequisite Concepts Practical output
L2-M03-L01 Deterministic metrics: exact match, regex, schema and numeric tolerance 90' L2-M02-L05 NFC normalisation, whole-number match, exact tolerance, strict schema, the metric's precision and recall Tested metric functions
L2-M03-L02 Text-similarity metrics and their limits 90' L01 token F1, ROUGE-L, threshold sweep, diacritics, deterministic guard A table of cases where similarity and correctness disagree
L2-M03-L03 Rubric design: analytic and holistic, scales, descriptive anchors 90' L02 analytic and holistic rubric, scale, descriptive anchors, critical criterion, inter-grader agreement A rubric with descriptive anchors
L2-M03-L04 Six quality criteria: correct, relevant, complete, consistent, faithful and grounded 120' L03 operational definition, claim, faithfulness and groundedness, no input means no score Operational definitions with examples
L2-M03-L05 Aggregating and interpreting metrics: a per-slice report instead of one average 120' L04 pooled, per-slice and weighted averages, per-slice confidence interval, regression, Simpson, trivial baseline A per-slice report

D. Hands-on assignment (module assignment)

The module assignment (a set of metrics and rubrics for an AI feature, with a per-slice report, a measurement of the metrics against human labels, and a list of what is not checked) is in exercises.md. The five standalone exercises for the individual lessons are in code-labs/l2-m03/exercises/ and in §9 of each lesson.

E. Module assessment

The module quiz quiz.md, the module assignment rubric in exercises.md, and the practice-0N.md practice for each lesson. The solutions and the instructor guide are for instructors only and are not published.

F. References

The shared list references.md; each lesson also has its own references table in §12 with access dates.

Objectives ↔ assessment matrix

Objective Lesson Standalone exercise (§9) Module quiz
MO1 L01 exercises/test_l01_metrics.py (to be added with the quiz)
MO2 L02 exercises/test_l02_guard.py (to be added with the quiz)
MO3 L03 exercises/test_l03_rubric.py + my_rubric.json (to be added with the quiz)
MO4 L04 exercises/test_l04_criteria.py + my_points.json (to be added with the quiz)
MO5 L05 exercises/test_l05_report.py (to be added with the quiz)