In practical implementation of quantum key distributions (QKD), it requires efficient, realtime feedback control to maintain system stability when facing disturbance from either external environment or imperfect internal components. Usually, a "scanning-and-transmitting" program is adopted to compensate physical parameter variations of devices, which can provide accurate compensation but may cost plenty of time in stopping and calibrating processes, resulting in reduced efficiency in key transmission. Here we for the first propose to employ a well known machine learning model, i.e., the Long Short-Term Memory Network (LSTM), to predict those physical parameter variations in advance and actively perform real-time control on corresponding QKD devices. Experimentally, we take the phase-coding scheme as an example and run the LSTM model based QKD system for more than 10 days. Experimental results show that we can keep the same level of quantum-bit error rate as the traditional "scanning-and-transmitting" program by employing our new machine learning method, but dramatically reducing the scanning time and resulting in significantly enhanced key transmission efficiency. Furthermore, our present machine learning model should also be applicable to any other QKD systems using any coding scheme or QKD protocols, and thus seems a very promising candidate in large-scale application of quantum communication network in the near future. * Quantum key distributions (QKD) [1][2][3][4] can provide information-theoretic secure keys between two communicated parties, usually called Alice and Bob, and has attracted extensive attention from the scientific world since the first BB84 protocol was proposed [2].To date, significant progresses have been achieved in this field both theoretically and experimentally, making it moving from laboratory research to practical implementation and from point-topoint communication to multiuser complex networks [5,6].In practical implementation of QKD, in order to maintain the stability and reliability of the system, especially for fast-speed QKD networks, real-time control are highly demanded due to very complex realistic environment and imperfect internal devices. In the history, the Faraday-Michelson Interferometer (FMI) was designed for phase encoding QKD systems to solve the problem of interference instability existing in Mach-Zehnder Interferometers (MZI) [7] caused by polarization changes in transmission fibers. Both theory and experiment have proven the polarization stability of FMI based QKD systems [8]. Nevertheless, neither MZI nor FMI can maintain phase stability for a long time due to ineluctable internal phase shift. Therefore, it is quite common to use a "scanning-and-transmitting" program to calibrate those physical parameters in present QKD systems [9][10][11][12]. Although present calibration programs can keep the stability of QKD systems, it is at the cost of transmission efficiency, since it takes time to run the calibration program and no signal data can be transmitted during the ca...