An LLM generates text one token at a time. These tokens can represent a single character, word or part of…