optimize for perplexity