lm_polygraph.estimators.eigenscore module

class lm_polygraph.estimators.eigenscore.EigenScore(alpha: float = 0.001)[source]

Bases: Estimator

Estimates the sequence-level uncertainty of a language model following the method of “EigenScore” as provided in the paper https://openreview.net/forum?id=Zj12nzlQbz. Works only with whitebox models (initialized using lm_polygraph.utils.model.WhiteboxModel). Uses embeddings for the last generated token from the middle layer of the model.