###### Abstract
We anticipate this decrease in performance by proposing to integrate machine learning techniques to enhance the grouping strategy with energy efficiency and low latency access in mind. In other words, our grouping strategy aims to reduce the collision rate and the devices' energy consumption. This goal is critical in B5G network scenarios with more deployed mMTC devices, diverse applications, and complex and ubiquitous scenarios. It requires a deepersense of efficiency and scalability. Therefore, a multi-aspect efficiency grouping strategy targeting energy consumption, access delay, and the miss rate is worth considering. This work proposes a learning-based energy-efficient device grouping mechanism for massive MTC in a (B5G) network capable of reducing the miss rate, energy consumption, and access delay. The reinforcement learning technique is applied to optimize the grouping decision and the intra-group device access scheduling based on the application's arrival time and time constraints. Powered by reinforcement learning, it offers a trifold approach that simultaneously addresses access delay, energy consumption, and the success rate of mMTC devices within the contention-based RACH framework of B5G networks. To the best of our knowledge, this is the first mMTC grouping strategy considering the scalability factor and device heterogeneity in the context of massive deployment in the B5G network. The main contributions of this paper can be listed as follows:  
* We formulate a group number minimization problem to efficiently coordinate each device's access to the network and propose a machine learning-powered energy-efficient mechanism, prompting devices to join a group to minimize the overall energy within delay constraints. Our model can interact with the dynamic environment without increasing the model's complexity. * We present the implementation of the grouping strategy as a Markov decision process (MDP)-based constrained optimization with a policy gradient. Constraints such as group condition, devices, application arrival, and time constraints are considered the state with the Lagrange relaxation technique. The action to group each device is based on the constraints mentioned above. * We investigate the impact of massive access attempts on energy consumption and access delay in the proposed model. Given the heterogeneity of the applications in the real world, we show that certain delay-tolerant applications can afford the miss rate, so the non-tolerant ones can be completed before the expiration of the time constraint. The simulations conducted in this study compare a neural network to multiple baseline grouping strategies. They were carried out under a realistic scenario where many IoT devices were deployed [12]. The results show that, regardless of the model used, the risk of collision increases as more devices try to access the network. This highlights the criticality of the proposed dynamic algorithm selection method, which has a miss rate of less than 4% in the worst-case scenario. Furthermore, the simulations also indicate that the proposed machine learning-based grouping mechanism outperforms the baseline models considering collision percentage, energy efficiency, and delay. This underscores the effectiveness of the proposed method in improving the performance of IoT networks. The rest of this paper is organized as follows: Section 2 describes the related research works. Section 3 introduces the system model. The signaling overload problem is presented in Section 4. Section 5 presents the proposed solutions. The simulation results for various performance metrics are presented in Section 6. Finally, conclusions are drawn in Section 8.