In generative modeling, the "holy grail" is a model that can both sample efficiently and provide exact density evaluation. As Ivan Kobyzev and colleagues explain in Normalizing Flows: Introduction and Ideas, Normalizing Flows achieve this by transforming a simple base distribution through a sequence of invertible, differentiable mappings.
However, this flexibility comes with a steep "computational tax." To compute the probability of a data point, we must use the change-of-variables formula, which requires calculating the determinant of the Jacobian matrix—the matrix of all first-order partial derivatives of the transformation. For a data dimension $D$, a general determinant calculation costs $O(D^3)$, a prohibitive expense for high-dimensional data like images or point clouds.
The central challenge in this field is designing transformations that are expressive enough to model complex data, yet structured enough that their Jacobian determinants can be computed in linear ($O(D)$) or quadratic ($O(D^2)$) time.
The Trace Trick: Matrix Exponentials
One of the most elegant ways to bypass the cubic bottleneck is to define transformations using the matrix exponential. If we represent a linear transformation as $f(x) = \exp(A)x$, we can leverage a fundamental identity from matrix calculus: the log-determinant of a matrix exponential is exactly equal to the trace of the matrix.
$$\log \det(\exp(A)) = \text{Tr}(A)$$
As Changyi Xiao and Ligang Liu demonstrate in Generative Flows with Matrix Exponential, this reduces a $O(D^3)$ operation to a simple $O(D)$ summation of the diagonal elements of $A$. This idea extends to spatial data as well; Emiel Hoogeboom and colleagues showed in The Convolution Exponential and Generalized Sylvester Flows that the log-determinant of a convolutional layer can be reduced to the sum of the center-pixel weights of the kernel.
Beyond efficiency, the matrix exponential provides a structural guarantee: $\exp(A)$ is always invertible, with its inverse being $\exp(-A)$. This property is used by Lucas Laird and Robin Walters in MatrixNet to bake group axioms directly into neural networks, ensuring that learned representations of symmetry groups always possess valid inverses.
Dimensionality Shifting: Sylvester and Woodbury Identities
When we cannot reduce the determinant to a trace, we can often use matrix identities to shift the computation from a high-dimensional space to a lower-dimensional one.
Sylvester’s Determinant Identity allows us to compute the determinant of a high-dimensional matrix $I + AB$ by instead computing the determinant of a smaller matrix $I + BA$. Rianne van den Berg and Max Welling utilized this in Sylvester Normalizing Flows to create "bottleneck" layers. By projecting data into a low-dimensional hidden space, performing a transformation, and projecting back, they achieve high expressivity while keeping the volume-change calculation proportional to the hidden dimension rather than the input dimension.
Similarly, You Lu and Bert Huang introduced Woodbury Transformations, which use low-rank updates to the identity matrix. By applying the Woodbury matrix identity, the cost of both inverting the transformation and calculating its determinant scales with the rank of the update, making it possible to model complex dependencies across channels and space efficiently.
Enforcing Sparsity and Triangular Structures
The most direct way to simplify a determinant is to ensure the Jacobian is triangular. The determinant of a triangular matrix is simply the product of its diagonal entries.
John Mern and Mykel Kochenderfer use this in Recurrent Autoregressive Flows, where the model generates a lower-triangular weight matrix from a latent state. Because the matrix is triangular, the likelihood remains easy to compute even as the model's parameters evolve over time.
However, simple triangular matrices can struggle to capture global correlations. To solve this, Chenlin Meng and Stefano Ermon proposed ButterflyFlow. They use "butterfly matrices"—a structured sparse factorization inspired by the Fast Fourier Transform. These matrices can represent complex permutations and global interactions while maintaining $O(D \log D)$ complexity for both inversion and determinant calculation.
Amortization and Perturbation
Finally, some researchers look for ways to avoid the determinant calculation during the most frequent operations. Andreas Krämer in P4Inv suggests training invertible layers through rank-one perturbations. By updating only a single rank of the weight matrix at a time and using the Sherman-Morrison formula, the model maintains its inverse and determinant with $O(D^2)$ updates, avoiding the full $O(D^3)$ cost of retraining from scratch.
In Self Normalizing Flows, T. Anderson Keller and Priyank Jaini take this a step further by amortizing the cost. If a transformation is data-independent (like a linear layer), the determinant only needs to be calculated once after training, allowing for lightning-fast inference and sampling.