Logo Uncertainty Quantification

Uncertainty Quantification

Tổ chức
AI-ModCon
uncertainty-quantification

Deep uncertainty analysis for ML, AI, and agentic systems. Use when confidence quality is critical to deployment safety, when calibration affects operational decisions (abstention, escalation, routing), when distinguishing aleatoric vs epistemic uncertainty, or when assessing out-of-distribution handling. Provides comprehensive analysis beyond basic calibration checks.

Tổng quan

Nhà phát hànhAI-ModCon
Kho mãgenesis-skills
Tên kỹ nănguncertainty-quantification
Sao
37
Bản fork
16
Tệp đi kèm
8
Giấy phépBSD-2-Clause
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 là Markdown thuần túy, không phải 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ộ.

  • 8 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 AI-ModCon công bố trên GitHub. Hãy đọc nội dung nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Uncertainty Quantification 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 thư mục kỹ năng bên dưới và xác nhận.
    https://github.com/AI-ModCon/genesis-skills/tree/main/skills/basesafe-skills/uncertainty-quantification
  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/AI-ModCon/genesis-skills.git /tmp/genesis-skills
mkdir -p .claude/skills
cp -r /tmp/genesis-skills/skills/basesafe-skills/uncertainty-quantification .claude/skills/uncertainty-quantification
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 Uncertainty Quantification 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ự tải Uncertainty Quantification 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 Uncertainty Quantification không bị giới hạn ở mô hình mà kỹ năng này được viết cho. 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 kỹ năng chưa dùng không tốn chi phí.

  • Đổ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.

Uncertainty Quantification Analysis

Overview

This skill helps assess whether a model or pipeline knows when it does not know. Use it to analyze how uncertainty is represented, measured, calibrated, surfaced, and acted on across training, evaluation, and deployment.

Treat uncertainty quantification as an engineering problem, not just a modeling technique. The goal is to connect uncertainty signals to operational decisions such as abstention, escalation, fallback behavior, human review, or deployment gating.

Analysis Depth

This skill supports both lightweight audits and comprehensive deep-dives. Calibrate your depth to the task.

Go deep when:

  • Model confidence affects safety-critical decisions (medical, autonomous systems, security)
  • Confidence scores gate human review, escalation, or automated actions
  • You need to separate aleatoric from epistemic uncertainty, handle distribution shift, or produce prediction intervals
  • The system requires uncertainty-aware policies (abstention, fallback, safe defaults, deployment gating)
  • Adversarial or OOD robustness of confidence signals is in scope

Stay lightweight when:

  • The ask is a quick audit or gap inventory rather than a full deployment review
  • Only basic calibration metrics (ECE/MCE on clean IID data) are needed
  • Model outputs are informational and no operational decisions are gated on confidence

Quick Reference

ActionApproach
Scan for UQ evidenceManual code review + pattern search
Pattern search: calibrationrg "(calibration|temperature.*scal|platt|isotonic)" --type py -A 5
Pattern search: uncertaintyrg "(uncertainty|confidence|ensemble|dropout)" --type py -A 5
Pattern search: abstentionrg "(abstain|reject|threshold|escalat)" --type py -A 5
Find config filesrg "threshold|confidence" --glob "*.yaml" --glob "*.json"
Review method guidancereferences/methodology.md
Review agent UQ frameworkreferences/agent-uq-framework.md
Review metrics mappingreferences/tooling-matrix.md
Start analysis reportassets/analysis_report_template.md

Core Workflow

Two-step execution (analysis then formatting)

When possible, separate work into two distinct phases:

Phase A: Analysis (can delegate to a subagent)

  • Goal: collect evidence and produce structured findings and recommendations.
  • Output: a compact, structure-first artifact (not a polished report).
  • Optional: bootstrap evidence with scripts/uq_analysis.py <repo-root> --format json.
  • Include: system context (task type, inputs/outputs, decision consequence)
  • Include: evidence index (file paths and short notes; include config/threshold locations)
  • Include: findings list (implemented/partial/missing/unknown) with why it matters and file/path evidence
  • Include: recommended approaches (1-3) and metrics to track
  • Include: operational guidance (routing/abstain/escalate/fail-closed)
  • Include: unknowns and assumptions

Phase B: Report synthesis and formatting (main agent)

  • Goal: translate Phase A into the assets/analysis_report_template.md format.
  • Requirements: preserve evidence fidelity (paths), keep recommendations prioritized, and keep scope aligned to Analysis Depth.

If you delegate Phase A, instruct the subagent to avoid report prose and return only the structured artifact above.

1. Establish the uncertainty surface

Determine:

  • Prediction type: classification, regression, ranking, generation, detection, segmentation, retrieval, agent decision
  • Decision consequence: low-stakes logging, user-facing recommendation, automated actuation, safety gate
  • Existing uncertainty outputs: softmax scores, intervals, variances, ensemble disagreement, heuristics, refusal logic
  • Failure modes: class confusion, hallucination, OOD drift, corrupted inputs, retrieval misses, prompt sensitivity

2. Gather repository evidence

Look for concrete evidence in code, configs, and documentation:

Search patterns:

bash
# Find calibration implementations
rg "temperature.*scaling|platt.*scaling|isotonic" --type py -A 5

# Locate uncertainty estimation methods
rg "ensemble|dropout.*inference|bayesian|uncertainty" --type py -A 10

# Identify abstention/rejection logic
rg "abstain|reject|confidence.*threshold|escalate" --type py -A 5

# Find OOD detection
rg "out.*of.*distribution|ood|novelty.*detect|drift.*detect" --type py -A 5

# Check evaluation scripts for UQ metrics
rg "calibration|uncertainty|ECE|Brier" --glob "**/eval/*.py" -A 5
rg "calibration|uncertainty" --glob "**/test/*.py" -A 5

# Review configs for thresholds and policies
rg "threshold|confidence|uncertainty|abstain" --glob "*.yaml" --glob "*.json"

# Find conformal prediction
rg "conformal|coverage|prediction.*interval" --type py -A 5

# Locate model cards or documentation
rg -i "uncertainty|calibration|confidence" --glob "*model*card*" --glob "*README*"

Prioritize evidence for:

  • Methods: ensembles, MC dropout, Bayesian approximations, Gaussian processes, conformal prediction
  • Calibration: temperature scaling, Platt scaling, isotonic regression, reliability diagrams, ECE/Brier/NLL
  • Selective prediction: abstain/reject options, confidence thresholds, human review triggers
  • OOD handling: drift detection, novelty detection, corrupted-data tests, retrieval confidence
  • Operational use: fallback logic, alerts, safe defaults, deployment gates

3. Classify what is present and what is missing

For each claim, separate:

  • Implemented: visible in code, configs, metrics, or docs
  • Partially implemented: signal exists but is not validated or operationalized
  • Missing: method or control should exist but no evidence was found
  • Unknown: could exist outside the repo

4. Recommend methods that fit the task

Match method sophistication to task requirements and current capabilities. Prefer simple, validated baselines over complex probabilistic frameworks unless complexity is justified.

Method Selection by Task:

Task TypeLightweight BaselineWhen to UpgradeAdvanced Methods
ClassificationTemperature scalingMulti-class imbalance, security-criticalConformal prediction sets, ensemble disagreement
RegressionQuantile regressionSafety-critical boundsConformal regression, Gaussian processes
Detection/SegmentationPer-box confidence calibrationPixel-level uncertainty neededEpistemic maps via dropout, corruption robustness
Generation/LLMSelf-consistency varianceFactual grounding requiredVerifier disagreement, citation-based confidence
Agent pipelinesTool selection confidenceMulti-step uncertainty propagationBranching probability, retrieval sufficiency scores

Avoid recommending:

  • Full Bayesian neural networks for simple classification (start with temperature scaling)
  • Gaussian processes for high-dimensional problems (poor scaling)
  • Ensemble methods without testing single-model calibration first
  • Complex methods when simple ones haven't been tried

Do recommend:

  • Conformal prediction (distribution-free, finite-sample guarantees)
  • Temperature/Platt scaling (simple, effective for calibration)
  • Ensemble disagreement (when multiple models already exist)
  • MC dropout (when uncertainty needed without retraining)
  • Prediction intervals for regression (quantile regression or conformal)
  • Abstention policies with risk-coverage curves

Specific Guidance by Task:

Classification:

  • Prefer calibration over raw softmax scores
  • Test calibration on IID, OOD, and adversarial data
  • Recommend conformal prediction for set-valued predictions with coverage guarantees
  • Use ensemble disagreement only if ensemble already exists

Regression / Forecasting:

  • Provide prediction intervals, not just point estimates
  • Use conformal regression for distribution-free intervals
  • Report coverage (empirical vs. nominal) and interval width
  • Use CRPS (Continuous Ranked Probability Score) for probabilistic forecasts

Detection / Segmentation:

  • Calibrate per-box or per-pixel confidence
  • Provide epistemic uncertainty maps (e.g., via MC dropout)
  • Test robustness to corruptions (blur, noise, occlusion)
  • Recommend abstention on low-confidence regions

Generative / LLM Systems:

  • Self-consistency: sample multiple outputs, measure variance
  • Verifier disagreement: use separate models to check outputs
  • Citation grounding: confidence based on retrieval quality
  • Abstention policy: refuse when uncertainty exceeds threshold
  • Token-level uncertainty: attention entropy, logit variance

Agent Pipelines:

See references/agent-uq-framework.md for method selection, implementation guidance, and validation for agent and multi-turn pipeline UQ.

5. Test uncertainty under adversarial conditions

Test whether uncertainty signals can detect adversarial manipulation or OOD scenarios. Uncertainty estimates may behave differently when the model is under attack.

Key Tests:

  • Calibration Under Attack: Does confidence remain well-calibrated on adversarial examples?
  • Uncertainty as Attack Detector: Can uncertainty signals detect adversarial inputs?
  • Attack-Specific Patterns: Different attacks produce different uncertainty signatures
  • OOD Detection for Agents: Use uncertainty to detect out-of-distribution scenarios in agentic systems
  • Distribution Shift: Does uncertainty increase appropriately under shift?

Risk Levels:

  • Critical: Model confident on misclassified adversarial examples, no OOD detection
  • High: Poor calibration under attack, uncertainty doesn't increase on adversarial data
  • Medium: Uncertainty increases on adversarial data but not sufficiently for detection
  • Low: Well-calibrated under attack, uncertainty effectively detects adversarial inputs

Detailed methodology: See references/adversarial-uq.md for complete testing protocols, metrics, and integration guidance.

6. Produce an actionable report

Use assets/analysis_report_template.md as your structure. See Required Output Shape below for the sections to include and how to calibrate them to analysis depth.

Required Output Shape

Structure every UQ analysis using assets/analysis_report_template.md. The sections below are always required; tailor depth and detail to the analysis scope.

Executive Summary

  • Overall assessment of current UQ maturity
  • Highest-risk gaps
  • Whether existing confidence signals are decision-usable

Evidence-Based Findings

  • Specific methods or gaps with file/path evidence
  • Classify each item: implemented, partially implemented, missing, or unknown
  • Distinguish uncertainty estimation, calibration, and policy use

Recommended Approaches

  • 1–3 prioritized approaches matched to the model and deployment context
  • Why each approach fits better than alternatives
  • What metrics should improve if implemented correctly

Tooling and Implementation Notes

  • Concrete libraries or patterns to use (see references/tooling-guide.md)
  • Integration points and interpretation notes
  • Justify lightweight baselines vs. more complex approaches

Operational Guidance

  • How to route uncertain outputs
  • Where to abstain, escalate, retry, or fail closed
  • Which metrics should be monitored in production

Unknowns and Assumptions

  • Evidence gaps that limit conclusions
  • Aspects that could not be assessed from the repository alone

For deep analyses, also include:

  • Adversarial uncertainty analysis results (see references/adversarial-uq.md)
  • An implementation roadmap (use assets/roadmap-template.md)

Red Flags

Escalate concern when you find:

  • Confidence scores used as probabilities without calibration evidence
  • Thresholds chosen without risk-coverage or validation analysis
  • Softmax maximum treated as uncertainty with no OOD testing
  • No abstention or escalation path for high-uncertainty cases
  • Retrieval or tool-use pipelines with no measure of evidence sufficiency
  • Calibration only reported on IID validation data despite known domain shift
  • Bayesian or ensemble methods claimed in docs but absent in code
  • Generative systems using style or verbosity as a proxy for certainty
  • Confidence-based access control without adversarial calibration testing
  • Safety-critical decisions gated by uncalibrated confidence

Tooling Recommendations

Comprehensive tooling guide: See references/tooling-guide.md for detailed information on:

  • Calibration tools (NetCal, scikit-learn, uncertainty-toolbox)
  • Conformal prediction (MAPIE, crepes)
  • Bayesian/ensemble methods (MC Dropout, TensorFlow Probability, Pyro)
  • OOD detection (PyOD, ADBench, torch-uncertainty)
  • Metrics and evaluation tools
  • Agent/LLM-specific methods (self-consistency, logit variance, attention entropy)
  • Adversarial testing (ART, Foolbox, WILDS, ImageNet-C)

Practical Guidance

Evidence Over Aspiration

  • Prefer repository evidence over documentation claims
  • If code doesn't show calibration, it's not calibrated
  • If thresholds are hardcoded without validation, they're arbitrary

Simple Before Complex

  • Temperature scaling before Bayesian neural networks
  • Quantile regression before Gaussian processes
  • Single-model calibration before ensembles
  • Validate baseline before adding complexity

Separation of Concerns

  • Uncertainty estimation (method produces uncertainty signal)
  • Calibration (uncertainty signal is accurate)
  • Policy (how to act on uncertainty signal)
  • Good UQ without a response policy still leaves risk

State Uncertainty Explicitly

  • If evidence is thin, say "insufficient evidence to assess"
  • Distinguish "not implemented" from "implemented but not validated"
  • Note when UQ methods are claimed in docs but absent in code

Connect to Operations

  • Uncertainty must connect to decisions (abstain, escalate, retry, fail closed)
  • Calibration without operational use is a vanity metric
  • Recommend specific policies: "Escalate when confidence < 0.7"

Common Patterns

Pattern 1: Confidence Used, Not Calibrated

Issue: Uncalibrated softmax used for decisions | Risk: HIGH
Recommendation: Add temperature scaling + validation

Pattern 2: Calibration on IID Only

Issue: Calibration may not hold under distribution shift | Risk: MEDIUM-HIGH
Recommendation: Test calibration on shifted/corrupted data

Pattern 3: Ensemble Without Disagreement

Issue: Wasted opportunity for uncertainty quantification | Risk: LOW
Recommendation: Report ensemble disagreement as epistemic uncertainty

Pattern 4: Thresholds Without Validation

Issue: Arbitrary threshold without risk-coverage analysis | Risk: MEDIUM
Recommendation: Plot risk-coverage curve, choose validated threshold

Pattern 5: Generation Without Uncertainty

Issue: No way to detect unreliable outputs | Risk: HIGH for factual domains
Recommendation: Add self-consistency variance + abstention policy

Detailed pattern analysis: See references/methodology.md

Conclusion

Uncertainty quantification is not about choosing the most sophisticated method - it's about connecting uncertainty signals to operational decisions in a reliable, validated way. Start simple, validate thoroughly, and add complexity only when justified by deployment requirements.

Critical Addition: Always test uncertainty under adversarial conditions and distribution shift, not just on IID validation data. Models must know when they don't know, especially when under attack or encountering novel scenarios.

Tệp đi kèm

Mô hình đọc các tệp này khi cần trong lúc kỹ năng được tải. Các tệp được cung cấp ở dạng có thể đọc và không bao giờ được thực thi.

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

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

Deep uncertainty analysis for ML, AI, and agentic systems. Use when confidence quality is critical to deployment safety, when calibration affects operational decisions (abstention, escalation, routing), when distinguishing aleatoric vs epistemic uncertainty, or when assessing out-of-distribution handling. Provides comprehensive analysis beyond basic calibration checks.

Vì sao nên dùng Uncertainty Quantification 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. Uncertainty Quantification 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 Uncertainty Quantification trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/AI-ModCon/genesis-skills/tree/main/skills/basesafe-skills/uncertainty-quantification. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm và cài đặt thành 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 Uncertainty Quantification?

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.

Bạn có thể dùng Uncertainty Quantification 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 Uncertainty Quantification 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 Uncertainty Quantification có miễn phí không?

Có. Kỹ năng này được AI-ModCon phát hành trên GitHub theo giấy phép BSD-2-Clause. 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 cho mô hình các công cụ mới để gọi — mã đượ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à tiêu chí của đầu ra tốt. 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 👇