Given the accumulated loss over the entire dataset, denoted as \(L\), and the total number of tokens, represented by \(T\), the macro token-level perplexity, denoted as \(\mathcal{P}\), is calculated as: