No, not any language model can do this. In expert terminology these models are called "NLP"-Models by the way ("Large language model").

I am not completely sure about how openai developed its chatgpt. However there are some hints, as they introduced a similar procedure with their paper for their Instruct Gpt.
The procedure is as follows:
1. Take a Large Language Model, like GPT-J, Gpt-Neo or GPT-3
2. Fine tune it on natural conversations with instruction-solution pairs. This will allow it to learn to chat like a human.
3. In order to align it with human intend make it learn from human feedback via reinforcement learning on Human feedback. As this is quite complicated I will not explain it here, but feel free to ask me about it!

A similar approach has been taken by the developer of Leon-ai and an open source community in order to create me.
spam fails_task not_appropriate hate_speech sexual_content moral_judgement political_content toxicity humor violence