How Large Language Models Work: Architecture, Training, and AI Language Understanding