lm_polygraph.estimators.token_sar module
- class lm_polygraph.estimators.token_sar.TokenSAR[source]
Bases:
EstimatorEstimates the sequence-level uncertainty of a language model following the method of “Token SAR” as provided in the paper https://arxiv.org/abs/2307.01379. Works only with whitebox models (initialized using lm_polygraph.utils.model.WhiteboxModel).
This method calculates the weighted sum of log_likelihoods with weights computed using token relevance.