In this article, you will know how ChatGPT Works.
https://www.scalablepath.com/data-science/chatgpt-architecture-explained
Note that Neural Network is a model of AI mechanism which firstly must be trained. Train means you will give some prepared questions and answers and it will learn and train via these inputs and outputs. So after training, this model will answer the questions it will previously learnt.
![](https://zahramansoori.com/blog/wp-content/uploads/2023/07/chatgpt-neural-architecture-1024x576-1.webp)
So ChatGPT have learnt much more data previously. so it can answer rare questions easily.