With this current limitation in obtaining the exact polaritonic gradient (see Sec. 4.3), we turn toward the use of machine learning, which will allow one to train the molecular dipole as a function of the nuclear coordinates. Then the nuclear gradient can be obtained analytically from the gradient of the trained dipole function. One of the many possible techniques is the kernel ridge regression (KRR) scheme, which relies on supervised learning of the molecular dipole matrix and has been used in several recent works. In this approach, the molecular property, µ