This document presents a study on using artificial intelligence to optimize resource allocation in 5G and beyond 5G cellular networks. It discusses the increasing demand for network resources due to more connected devices and applications. A dynamic nested neural network model is developed that can adjust its structure online to meet the changing resource allocation needs. An AI-driven algorithm called ADRA is used that combines the neural network with a Markov decision process to train a model for dynamic resource allocation in modern cellular networks. The algorithm is found to improve the average resource hit rate and reduce average delay time compared to other methods.