KPMG interview question

How does llm stop generating tokens, based on what?