Preserving Local Weights in Locally Linear Embedding
This article explores how Locally Linear Embedding (LLE) projects high-dimensional artificial intelligence features into lower dimensions by preserving local neighborhood reconstruction weights. We will break down the three primary steps of the LLE algorithm: identifying nearest neighbors, computing the linear reconstruction weights in the high-dimensional space, and mapping the data to a low-dimensional embedding using these exact fixed weights. By the end of this overview, you will clearly understand the mathematical intuition and geometric mechanics that allow LLE to unfold complex manifolds while strictly maintaining local structural relationships.
Locally Linear Embedding relies on a simple geometric intuition: even if a high-dimensional dataset lies on a complex, curved manifold, a small enough local patch of that surface behaves as if it is flat. LLE leverages this by treating each data point and its immediate neighbors as a locally linear patch. The core goal of the algorithm is to calculate the geometric relationships within these small patches in the high-dimensional space and force the low-dimensional projection to adhere to those exact same local relationships.
The first step in preserving these weights is defining the local neighborhoods. For every high-dimensional feature vector, the algorithm identifies a specific number of nearest neighbors, typically using Euclidean distance. This step isolates the local patches. By restricting calculations strictly to these nearest neighbors, LLE ensures that global curvatures do not distort the local geometric properties of the data.
The second step is computing the reconstruction weights. In the high-dimensional space, LLE attempts to reconstruct each data point exclusively as a weighted linear combination of its nearest neighbors. To find the optimal weights, the algorithm minimizes the reconstruction error, which is the squared distance between the original data point and its reconstructed approximation. Two strict mathematical constraints are applied during this optimization: first, the reconstruction weight between any two points that are not neighbors is forced to be zero; second, the weights for any single point's neighbors must sum to one. Making the weights sum to one is critical because it makes the reconstruction invariant to rotations, rescalings, and translations. These weights now permanently encode the intrinsic local geometry of the high-dimensional features.
The final step is projecting the features into the low-dimensional space using the fixed weights. Here, the high-dimensional feature coordinates are completely discarded, and only the calculated reconstruction weights are retained. The algorithm now searches for a new set of low-dimensional coordinates for each data point. It does this by minimizing a new embedding cost function. This cost function measures the error of reconstructing a low-dimensional point using its low-dimensional neighbors, multiplied by the exact same weights calculated in the high-dimensional space.
Because the weights are held constant during this final phase, the optimization problem reduces to finding the new coordinates that best satisfy the pre-existing weight constraints. Mathematically, this is solved as an eigenvalue problem, which yields a single global minimum and avoids the trap of local minima. By decoupling the weight calculation from the coordinate projection, Locally Linear Embedding successfully forces the low-dimensional representation to adopt the exact local structural geometry of the original high-dimensional artificial intelligence features.