Language models like ChatGPT or Bard are trained on what basically amounts to "fill in the blank" tasks. They have a representation of statistical patterns in language, but that is the extent of their understanding. They are very sophisticated