- Introduced by
- Sam Roweis & Lawrence Saul
- Year
- 2000
- Type
- Nonlinear manifold dimensionality reduction
What does it do?
Locally linear embedding (LLE), introduced by Sam Roweis and Lawrence Saul in 2000, is a manifold-learning method for nonlinear dimensionality reduction.
It assumes that data may curve through a high-dimensional space while each point and its neighbours lie approximately on a locally linear patch. LLE represents each point as a weighted combination of its neighbours and then seeks low-dimensional coordinates that preserve those same weights, so the global layout is built from local relationships.
The intuition behind the method
Imagine data lying on a crumpled sheet in three dimensions: globally it is curved, but any small patch is nearly flat. LLE exploits this by describing each point purely in terms of how its near neighbours combine to reconstruct it, giving a small set of weights that encode the local geometry. Those weights depend on the patch's relative arrangement rather than on the sheet's orientation in space, so they can be carried into a lower-dimensional layout. LLE then asks which low-dimensional placement of all the points reproduces each point from its neighbours using the same weights. Solving that problem unfolds the sheet while keeping local neighbourhoods intact.
History
Roweis and Saul introduced LLE in a 2000 Science paper as an unsupervised algorithm that computes low-dimensional, neighbourhood-preserving embeddings of high-dimensional inputs. Unlike clustering-based approaches to local dimensionality reduction, LLE maps all inputs into a single global coordinate system. The paper describes its target as nonlinear manifolds such as those generated by face images or text documents.
When to use it
Choose LLE when data are believed to lie on a smooth nonlinear manifold, with a few latent factors generating many observed features, such as images that vary continuously in pose or lighting, or motion-capture trajectories. If the structure is essentially linear, PCA is the simpler choice. Avoid LLE when the neighbourhood graph is unreliable, for example with substantial noise, sparse sampling, or density that varies strongly across the data, because the reconstruction weights and the embedding inherit those errors. LLE does not provide a natural out-of-sample mapping for new points, so it is less suitable when new data must be projected repeatedly. For exploratory visualization of clusters, t-SNE and UMAP are often used instead; LLE is most useful when local linearity is plausible and the goal is to recover the global layout of the manifold.
Limitations and considerations
- Results depend on the neighbourhood size k: too few neighbours fragment the manifold, while too many violate local linearity.
- Noise and uneven sampling corrupt the local reconstruction weights, and the embedding inherits those errors.
- Manifolds that are poorly sampled, have holes, or vary in density are difficult, because local patches may not be reliable.
- There is no straightforward out-of-sample extension for projecting new points.
- For cluster-focused visualization, it is often less effective than t-SNE or UMAP.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Captures nonlinear manifold structure that a single global linear projection such as PCA cannot represent.
- Its optimisation is reported to involve no local minima, and the embedding reduces to a sparse eigenproblem.
- Reconstruction weights sum to one, so they are unchanged by rotation, scaling and translation of a neighbourhood and encode only its local geometry.
- Maps all points into a single global coordinate system, rather than fitting separate local models that must be combined afterwards.
Applications
- Visualising image collections, such as face images, whose variation is driven by a few continuous factors.
- Analysing text or document representations that lie on a nonlinear manifold.
- Reducing the dimensionality of motion-capture and pose data before further analysis.
- Feature extraction ahead of clustering or classification, when local manifold structure is plausible and has been checked.
- Teaching nonlinear manifold learning, where the local-reconstruction idea contrasts clearly with PCA.
How it works
How it works
For each data point x_i, find its k nearest neighbours in the high-dimensional space. This neighbourhood defines the locally linear patch, and k is the method's main tuning parameter.
Formula
\text{find the } k \text{ nearest neighbors of each point } x_iFor each point, find the weights that best reconstruct it as a linear combination of its neighbours, with the weights summing to one. Weights for points that are not neighbours are taken to be zero, so W is sparse. The sum-to-one constraint makes the weights invariant to rotation, scaling and translation of the patch, so they capture only its local geometry. When k exceeds the input dimension D, the local Gram matrix is singular and the weights are no longer unique, so a small regularisation term is added before solving, usually a multiple of the identity scaled by the trace of the Gram matrix. The regularisation used should be reported with the results.
Formula
\min_W \sum_i \Big\| x_i - \sum_{j} W_{ij} x_j \Big\|^2,\ \textstyle\sum_j W_{ij}=1With the weights W held fixed, find low-dimensional coordinates y_i that are each reconstructed from their neighbours' low-dimensional coordinates using the same weights. Without further constraints this objective is minimised trivially by setting all coordinates to zero. The standard formulation therefore imposes two constraints on the coordinates: they are centred, so that they sum to zero, and they have unit covariance, so that (1/N) times the sum of y_i y_i^T equals the identity. The eigensolve step relies on these constraints.
Formula
\min_Y \sum_i \Big\| y_i - \sum_j W_{ij} y_j \Big\|^2The minimising coordinates are given by eigenvectors of the sparse matrix (I − W)ᵀ(I − W). The eigenvector for the zero eigenvalue is discarded, and the next d bottom eigenvectors give the d-dimensional embedding. The objective has no local minima, but in practice the eigenvectors are computed with standard numerical sparse eigensolvers, which are iterative in implementation.
Formula
Y \leftarrow \text{bottom nonzero eigenvectors of } (I-W)^\top(I-W)Common pitfalls
- Choosing k poorly — too small fragments the manifold, too large violates local linearity.
- Applying it to noisy data where local neighbourhoods are unreliable.
- Interpreting absolute distances or densities in the embedding, which LLE does not preserve.
- Expecting to project new points easily, which the basic algorithm does not support.
- Setting k above the input dimension without regularisation, which makes the local reconstruction weights non-unique.
- Using a neighbourhood graph that is disconnected. It produces several zero eigenvalues, so the components are embedded independently with arbitrary relative placement; increase k until the graph is connected, or analyse the components separately.
Frequently asked questions
How is LLE different from PCA?
PCA finds a single global linear subspace, so it cannot unfold curved (nonlinear) structure. LLE assumes the data lie on a nonlinear manifold that is locally flat and preserves each point's local neighbourhood relationships, allowing it to represent curved manifolds that a linear projection would distort.
How does LLE compare to Isomap?
Both are manifold-learning methods. Isomap preserves global geodesic distances along the manifold, computed from shortest paths on a neighbourhood graph, while LLE preserves only local reconstruction weights. When global distances along the manifold matter, Isomap is the more direct choice; LLE is more local in its focus.
Why does the choice of k matter so much?
k sets the size of the neighbourhood assumed to be linear. Too few neighbours fragment the manifold and make the embedding unstable; too many include points where the manifold has curved away, violating local linearity. Results can change noticeably with k, so it should be tuned and the embedding's sensitivity to it assessed.
Related methods
Sources
Roweis, S. T., & Saul, L. K. (2000). Nonlinear dimensionality reduction by locally linear embedding. Science, 290(5500), 2323–2326.
Open DOI reference