kuq-uncertainty-eval
Knowledge of Knowledge: Exploring Known-Unknowns Uncertainty with Large Language Models — Amayuelas et al. (2023) (arXiv:2305.13712, 2023)
What this evaluates
Evaluates a model's ability to distinguish between questions it can answer confidently (known) and those it cannot (unknown). It probes the model's metacognitive uncertainty articulation and calibration under varying prompt conditions.
Datasets
- KUQ — total ?; splits: test (-1)
Metrics
F1-score(primary) — range: [0, 1]- Harmonic mean of precision and recall for the binary classification of known vs. unknown questions. Computed at the classification threshold that minimizes the Equal Error Rate (EER).
Equal Error Rate (EER)— range: [0, 1]- The operating point on the ROC curve where the false positive rate equals the false negative rate. Lower values indicate better uncertainty calibration.
Input / output format
Input: A natural language question presented to the LLM.
Output: The model's generated response, which is subsequently classified as 'Known' or 'Unknown' based on a threshold applied to its uncertainty score or classification output.
Scoring recipe
def compute_metrics(predictions, gold_labels):
# predictions: continuous uncertainty scores or logits
# gold_labels: binary (1=Known, 0=Unknown)
fpr, tpr, thresholds = roc_curve(gold_labels, predictions)
eer_idx = np.nanargmin(np.abs((1 - tpr) - fpr))
eer = fpr[eer_idx]
threshold = thresholds[eer_idx]
binary_preds = [1 if p >= threshold else 0 for p in predictions]
tp = sum(1 for p, g in zip(binary_preds, gold_labels) if p == 1 and g == 1)
fp = sum(1 for p, g in zip(binary_preds, gold_labels) if p == 1 and g == 0)
fn = sum(1 for p, g in zip(binary_preds, gold_labels) if p == 0 and g == 1)
precision = tp / (tp + fp) if (tp + fp) > 0 else 0
recall = tp / (tp + fn) if (tp + fn) > 0 else 0
f1 = 2 * precision * recall / (precision + recall) if (precision + recall) > 0 else 0
return {'EER': eer, 'F1-score': f1}
Common pitfalls
- The paper evaluates uncertainty classification via ROC/EER but does not specify the exact prompt format or whether the model outputs a probability or a direct label.
- Fine-tuning on KUQ improves uncertainty detection but trades off with accuracy on known questions, which is often overlooked when reporting only F1/EER.
Evidence (verbatim from paper)
We present the results on the KUQ evaluation set before fine-tuning for GPT-3.5, GPT-4, and the Llama Models. We also present the results after fine-tuning for Llama-7B, Llama-13B, and its derived chat versions. Figure 3 presents the ROC curve (receiver operating characteristic curve), showing the performance of the classification at different classification thresholds. From the plot, we extract the EER and the corresponding F1-score. These results are presented in Table 4.
Citation
@misc{amayuelas2023kuq,
title={Knowledge of Knowledge: Exploring Known-Unknowns Uncertainty with Large Language Models},
author={Amayuelas et al. (2023)},
year={2023},
note={arXiv:2305.13712}
}
- arXiv: 2305.13712