incerto.llm.ContrastiveDecoding#
- class incerto.llm.ContrastiveDecoding[source]#
Bases:
objectUncertainty from contrastive decoding (comparing expert vs amateur models).
Uses the difference in predictions between a strong and weak model to identify regions of high uncertainty.
- __init__()#
Methods
__init__()compute_contrastive_score(expert_logits, ...)Compute contrastive decoding score.
disagreement_score(expert_logits, amateur_logits)Measure disagreement between expert and amateur.