## 3 Our Proposal
Without considering communication latency, a delay in control could cause an AV to receive a command later than desired, leading to undesirable situations, including collisions. Once the above modifications have been included, a representation of the AIM5 LA architecture can be seen in Figure 2. This figure shows the observation space of AIM5 LA. The latency predictor module is composed of a Transformer-based network [27] that predicts the latency that the _ego_-vehicle will experience in the next time interval based on the history (\(h\) in Figure 2) of latencies experienced by that vehicle and the number of AVs in the intersection (as later discussed, the number of AVs with a 5G communication module affects latency). We believe that the enormous advances provided by Transformers-based networks in countless areas may outperform alternative neural network forecasting networks such as LSTM or GRU [28; 29; 30]. To use AIM5 LA, we propose a protocol message exchange for communication between the AIM module and the AVs, as well as to calculate the latency in the communication channel. This protocol includes the following messages:  
_-Probe_: The _probe_ message is sent by the IM of each intersection and contains IM-specific information (communication characteristics, geographical position, etc. ), as well as a timestamp used to estimate the latency in the communication channel. This timestamp is the internal time of the IM just before sending the message. This message is sent periodically with a sending period such as to allow safe control of the AVs, but without saturating the communication channel. A suitable period is 250 ms, based on the control intervals of other works [20; 31] and our experience with _adv._RAIM [4] development. This means that every 250 ms (four times per second), vehicles update the action to be performed (speed, acceleration, route, etc.). As we have seen in previous work, a shorter update period (e.g., 100 ms) increased the processing load, limiting the real-time processing of the system. On the other hand, a longer update period (e.g., 500 ms) made the system less safe, as too much time elapsed between two updates, leading to control crashes. The other message timing is adjusted to meet with the 250 ms update period. Each vehicle, after receiving the _probe_ message from the IMs, checks whether its geographical position and route match with the IM that should control it, responding to this message with a control _request_ message. This periodicity enables sequential and temporally separated control of all AVs without saturating the processing or communication channel, as well as safe and fast control with sufficient anticipation. _-Request_: These messages are sent by AVs to the IM to indicate that they want to be controlled during the next control interval (250 ms). To avoid channel saturation and delays  
Figure 2: AIM5 LA architecture with latency forecaster module based on Deep Transformer model and Latency encoder based on Stacked LSTM network. due to overlapping with other AVs that want to send the control _request_ message, AVs wait a random time \(t\) to send the control _request_ message. The random time \(t\) is used to reduce the probability of overlap of sending messages when multiple AVs attempt to access the 5G URLLC channel resources and thus remove this overlap from the latency calculation. After performing a preliminary set of experiments in the Simu5G simulator [32], it has been found that the optimal values of the waiting time \(t\) follow a continuous uniform distribution with a minimum value of 0 ms and a maximum value of 50 ms. This interval minimizes the probability of overlap with other AVs, considering the use case of an intersection; furthermore, it allows a compromise so that all control _requests_ can be processed in real-time. The control _request_ message includes a vehicle identifier and the timestamp resulting from adding the random time \(t\) for sending the control _request_ message to the timestamp captured from the IM _probe_ message.