Skip to main content

token_entropy

Function token_entropy 

Source
pub fn token_entropy(text: &str) -> f64
Expand description

Shannon entropy over BPE token IDs (o200k_base). More LLM-relevant than character entropy since LLMs process BPE tokens.