Computer generated optical volume elements have been investigated for information storage, spectral filtering, and imaging applications. Advancements in additive manufacturing (3D printing) allow the fabrication of multilayered diffractive volume elements in the micro- scale. For a micro-scale multilayer design, an optimization scheme is needed to calculate the layers. The conventional way is to optimize a stack of 2D phase distributions and implement them by translating the phase into thickness variation. Optimizing directly in 3D can improve field reconstruction accuracy. Here we propose an optimization method by inverting the intended use of Learning Tomography, which is a method to reconstruct 3D phase objects from experimental recordings of 2D projections of the 3D object. The forward model in the optimization is the beam propagation method (BPM). The iterative error reduction scheme and the multilayer structure of the BPM are similar to neural networks. Therefore, this method is referred to as Learning Tomography. Here, instead of imaging an object, we reconstruct the 3D structure that performs the desired task as defined by its input-output functionality. We present the optimization methodology, the comparison by simulation work and the experimental verification of the approach. We demonstrate an optical volume element that performs angular multiplexing of two plane waves to yield two linearly polarized fiber modes in a total volume of 128 mu m by 128 mu m by 170 mu m.