Logo Llm Align

Llm Align

Tổ chức
Calibre-Labs
llm-align

Analyze alignment between LLM judge scores and human labels in an eval dataset. Use this skill whenever someone wants to evaluate how well an LLM judge agrees with human reviewers, calculate TPR/TNR, investigate disagreements, or improve a scorer prompt. Trigger on phrases like: "calculate TPR/TNR", "judge alignment", "where does the LLM disagree with humans", "improve my scorer", "why is the LLM getting these wrong", "compare human labels to LLM scores", "evaluate my eval", or any time someone shares eval results and asks about score quality or judge calibration.

Add to TypingMind

Tổng quan

Nhà phát hànhCalibre-Labs
Kho mãreforge-ai-evals
Tên kỹ năngllm-align
Sao
94
Bản fork
9
Tệp đi kèm
1
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 1 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được Calibre-Labs công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Llm Align trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/Calibre-Labs/reforge-ai-evals/tree/main/skills/llm-align
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Calibre-Labs/reforge-ai-evals.git /tmp/reforge-ai-evals
mkdir -p .claude/skills
cp -r /tmp/reforge-ai-evals/skills/llm-align .claude/skills/llm-align
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Llm Align trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Llm Align ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Llm Align với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

LLM Judge Alignment Analysis

You are helping analyze how well an LLM-based judge aligns with human labels in an eval dataset. Work through the five phases below in order, confirming with the user at each ambiguous step before proceeding.

The methodology works regardless of eval platform (Braintrust, LangSmith, custom CSV/JSONL, or any other format). Phase 1 covers how to get the data you need from different sources.


Phase 1: Discovery

Goal: Figure out what score fields exist and which are human labels vs. LLM judge scores.

Step 1 — Get the eval results

Ask the user how their eval results are stored:

Option A — Local file (CSV or JSONL) Read the file directly. Look for columns or fields that contain numeric or categorical scores. Common patterns: human_score, llm_score, <judge_name>_score, label, rating.

Option B — Eval platform (Braintrust, LangSmith, etc.) Ask for the experiment/run ID or URL. Use the platform's API or MCP tools to fetch rows. You want: each row's input, the human label field, and the LLM judge score field.

Typical Braintrust query (adapt syntax to other platforms):

select: id, span_id, scores
object_type: experiment
object_ids: ["<experiment-id>"]
where: is_root = true
limit: 500

Option C — The user pastes results directly Accept a JSON array, CSV snippet, or any structured format. Parse it in-context.

Step 2 — Identify human vs. LLM score fields

From the data, extract all score fields. For each:

  • What are the distinct values? (binary 0/1, categorical PASS/FAIL, continuous 0–1)
  • How many rows have this field populated?
  • Does the name suggest human or LLM origin? (e.g., human_*, ground_truth, label are likely human; criterion-named fields are likely LLM)

Present your findings and ask the user to confirm: "Which field is the human label and which is the LLM judge score? I'll skip rows where either is missing — is that OK?"

Technical notes (platform-specific)

  • Braintrust: hyphenated field names need bracket notation: scores["metric-scope"] not scores.metric-scope. Root spans are where scores aggregate — filter is_root = true. The id field ≠ span_id; select both for later trace lookups.
  • CSV/JSONL: parse scores as floats; watch for string "PASS"/"FAIL" that need mapping to 1.0/0.0.

Phase 2: Confusion Matrix + TPR/TNR

Goal: Compute the full confusion matrix and key classification metrics.

Setup

  • Positive (1) = the human label value the user defines as "pass" (default: 1 or "PASS")
  • Negative (0) = the other value (default: 0 or "FAIL")
  • Threshold: for continuous LLM scores (0.0–1.0), default to ≥ 0.5 = predicted positive. Ask if the score looks continuous.

Compute the confusion matrix

Group rows into four cells:

  • TP: human = positive, LLM = positive
  • FN: human = positive, LLM = negative (judge misses a real pass)
  • FP: human = negative, LLM = positive (judge passes something that should fail)
  • TN: human = negative, LLM = negative

Report

LLM: PositiveLLM: Negative
Human: PositiveTP = NFN = N
Human: NegativeFP = NTN = N

Then:

  • TPR (sensitivity/recall) = TP / (TP + FN) — how well the LLM catches true positives
  • TNR (specificity) = TN / (TN + FP) — how well the LLM rejects true negatives
  • Total rows used, rows skipped (missing scores)

Interpret the numbers — don't just show the math. E.g.: "TPR of 85% means the judge misses 15% of cases your human reviewers would pass."


Phase 3: Disagreement Investigation

Goal: Understand why the LLM got each disagreement wrong by reading the scorer's reasoning.

Step 1 — Pull disagreement rows

Filter to rows where human label ≠ LLM score (accounting for threshold if continuous). Show up to 20 disagreements — enough to find patterns without overwhelming.

For each row, gather:

  • The input
  • The AI output (if available)
  • Human verdict vs. LLM verdict
  • The LLM's reasoning (from the scorer's trace/metadata if available)

Step 2 — Retrieve scorer reasoning

If your eval platform stores scorer reasoning (a critique or rationale alongside the score):

  • Braintrust: fetch the scorer span using root_span_id = '<span_id>' and look for output.metadata.rationale or similar
  • LangSmith: check the run's feedback or evaluator output fields
  • Custom: look for a critique, rationale, or reason field in the eval output

If no reasoning is stored, re-run the judge on the disagreement rows locally and capture the reasoning output.

Step 3 — Summarize patterns

Group errors into patterns — don't list them one by one. Common patterns:

  • Too strict FNs: LLM fails responses for a pedantic reason humans overlook
  • Too lenient FPs: LLM passes responses that violate the spirit of the criterion
  • Ambiguous criteria: the rubric has a gap the LLM fills differently than humans would

Phase 4: Prompt Fix Suggestions

Goal: Suggest targeted, surgical edits to the scorer prompt — not a full rewrite.

Based on the disagreement patterns from Phase 3:

  1. Quote the specific part of the existing scorer prompt that's causing the issue
  2. Propose the minimal change — a single sentence addition, a clarification to an example, a new edge case in the rubric
  3. Explain how the change addresses the observed failure mode without overcorrecting

Format for each suggestion:

Issue: [what's going wrong and in which cases]

Current prompt text: "[relevant excerpt]"

Suggested change: "[replacement or addition]"

Why this helps: [which disagreements it would fix, and why it won't break the passing cases]

Aim for 2–4 suggestions. Don't suggest rewriting the whole prompt.


Phase 5: Few-Shot Example Suggestions

Goal: Identify the best 2–3 disagreement rows to add as labeled examples to the scorer prompt.

Good few-shot examples have these properties:

  • The case is genuinely ambiguous (not obviously right or wrong)
  • The human verdict is clearly defensible and can be explained in 1–2 sentences
  • The LLM's mistake was predictable (reveals a systematic blind spot, not a one-off error)
  • Adding it would generalize to similar future inputs

Selection criteria

  • One "too strict" FN: A case the LLM failed that the human passed — include human reasoning as the correct label
  • One "too lenient" FP: A case the LLM passed that the human failed
  • A second FAIL case covering a different failure mode than the first — shows the nuance you want

Output format

For each suggested example, draft the text to add to the scorer prompt:

### Example N — [PASS/FAIL]
Input: "[input]"
Output excerpt: "[relevant part of the AI output]"
{"critique": "[why this is PASS/FAIL — in the voice of the scorer]", "score": "[PASS/FAIL]"}

Explain why you chose each example and what failure mode it targets.


Reminders & Gotchas

  • Threshold matters: A continuous score of 0.49 vs 0.51 may swing a cell. Always clarify the threshold before computing the matrix, and report it alongside the results.
  • Null scores: Always filter out rows where either score is missing before computing metrics. Report how many rows were skipped.
  • Human review timing: In some platforms, human labels may be updated after the experiment runs. If a row appears in disagreement queries but shows agreement when fetched individually, note this — the label was likely updated.
  • Braintrust field names with hyphens: Use scores["field-name"], never scores.field-name.
  • Small samples: With fewer than 30 human-labeled rows, TPR and TNR estimates are noisy. Report this caveat explicitly.

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Llm Align làm được gì?

Analyze alignment between LLM judge scores and human labels in an eval dataset. Use this skill whenever someone wants to evaluate how well an LLM judge agrees with human reviewers, calculate TPR/TNR, investigate disagreements, or improve a scorer prompt. Trigger on phrases like: "calculate TPR/TNR", "judge alignment", "where does the LLM disagree with humans", "improve my scorer", "why is the LLM getting these wrong", "compare human labels to LLM scores", "evaluate my eval", or any time someone shares eval results and asks about score quality or judge calibration.

Vì sao nên dùng Llm Align trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Llm Align là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Llm Align trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/Calibre-Labs/reforge-ai-evals/tree/main/skills/llm-align. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Llm Align?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Llm Align với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Llm Align với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Llm Align có miễn phí không?

Có. Kỹ năng này được Calibre-Labs phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇