In this context, terahertz holograms enabled by single-layer diffractive optical elements have been widely explored. [11,18,19,26] However, the reconfigurability of single-layer passive diffractive optical elements is very limited. Cascaded DOE structures have the advantage of enabling more functionality and information capacity compared to single-layer DOEs, as discussed in ref. [27]. Liao et al. [28] studied terahertz reconfigurable holographic imaging by mechanical translation of an absorber relative to two fixed discrete dielectric DOEs. Cascaded computer-generated phase-only diffractive optical elements for multiplane image formation were simulated by Alkan et al. [29] A lens was utilized in such a cascaded configuration for Fourier transform to project patterns on two imaging planes. In the visible range, Wang et al. [30] demonstrated azimuthal multiplexing with a stratified DOE layout optimized by iterative optimization algorithms. The optical information was encoded azimuthally in the DOEs and retrieved by rotating the DOEs relative to each other. It is to highlight that reconfigurable materials such as phase change materials, semiconductor layers, and MEMS structures integrated with metasurface structures [31][32][33][34][35][36] are also good candidates to realize reconfigurable terahertz devices and holograms.Diffractive optical neural networks (DONN) [12] have been successfully applied for the classification of handwritten digit images, [12,37] the design of spatially controlled wavelength demultiplexing systems, [38] and terahertz pulse shaping. [39] Such a machine learning method is an efficient and powerful tool for designing diffractive optics inverse problems in cascaded configurations. The pixel phase (height distributions) in the diffractive layers can be trained by stochastic gradient descent and error-backpropagation to achieve the desired diffraction pattern as the incident beam passes through the diffractive layers.The purpose of this work is to show that through such a DONN machine learning method, it is possible to realize holograms with a tailored reconfigurable operation when altering multiple degrees of freedom, i.e., either the number, spacing, rotational alignment, and/or order of the cascaded diffractive layers. The height distributions of the diffractive layers are trained by the network on the basis of an initial incident terahertz field distribution and predefined (target) diffraction patterns.For our proof-of-concept demonstration, five scenarios are demonstrated, each corresponding to the variation of an individual degree of freedom in the cascaded configuration. A Machine learning can empower the design of cascaded diffractive optical elements (DOEs) at terahertz frequencies enabling the realization of holograms with a tailored multi-degree-of-freedom reconfigurable operation when altering either the number, spacing, rotational alignment, and/or order of the elements. This unprecedented control over the spatial terahertz light distribution can profoundly impact multiple terahe...