Add caching for bigram processing.