lm_polygraph.stat_calculators.attention_eliciting_prompt module

class lm_polygraph.stat_calculators.attention_eliciting_prompt.AttentionElicitingPromptCalculator[source]

Bases: BaseAttentionPromptCalculator

static meta_info() Tuple[List[str], List[str]][source]

Returns the statistics and dependencies for the PromptCalculator.

class lm_polygraph.stat_calculators.attention_eliciting_prompt.BaseAttentionPromptCalculator(prompt: str, suffix_prompt: str, method: str, input_text_dependency: str = 'input_texts', generation_text_dependency: str = 'greedy_texts', output_attentions: bool = False)[source]

Bases: StatCalculator

Calculates the attention weights for a specific token to be generated from the specific prompt. Used for CSL method.