Foundations of Large Language Models