In both, there isn't anything resembling "thinking" going on. What these machines are doing is recognizing habits, ways of making situations more definite, embodied in how we use language. You can see this through how BERT learned discrimination, and ChatGPT... Well, you know.