Tracing the thoughts of a large language model