Manuscript Offprint
arXiv:2610.05297Do Neural Networks Learn Structure-Preserving Maps? A Case Study in Latent-to-Hilbert Embeddings
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
We ask whether a neural network can learn a structure-preserving map from a compressed latent space to a Hilbert-space representation. Using an 8-dimensional autoencoder bottleneck on MNIST and n-qubit product-state targets from PCA-based angle encoding, we report four findings. Although the target angles are generated by a nonlinear sigmoid transformation of the latent projections, the resulting mapping is well approximated by a linear function over the observed latent distribution: linear regression from z to the true target angles achieves , while regression to the MLP's recovered angles achieves . The learned map's primary direction is strongly aligned with the target-induced direction, with cosine similarity 0.989, while remaining nearly orthogonal to the input's principal direction, with cosine similarity 0.002. The map is genuinely rank-4: removing any singular direction degrades inner-product preservation by despite a singular-value spectrum with two dominant and two small values. The learned subspace does not coincide with the PCA basis used to construct the target, and different random seeds recover the same primary direction but diverge in higher ranks. Finally, kernel ridge regression with an RBF kernel outperforms a tuned MLP (IP error 0.0144 vs. 0.0197), suggesting that for approximately linear structure-preserving mappings, classical kernel methods may be a simpler and more effective alternative.
1 Introduction
Machine learning has increasingly focused on learning representations rather than direct input-output mappings. A recurring problem in this context is measuring whether two learned representations preserve the same underlying structure. Canonical correlation analysis [5], centered kernel alignment [4], and Procrustes-based alignment [1] are widely used to compare representations, but they typically assume a fixed target and ask whether a learned representation is close to it. In this paper, we ask a related but distinct question: given a latent vector z and a target Hilbert-space representation , can a neural network learn a mapping that preserves inner products between points?
This question has practical relevance in settings where geometric structure matters—representation alignment, structure-preserving embeddings, and classical-to-quantum mappings—and is theoretically motivated by the desire to understand when a neural network can recover geometric content rather than merely fit observations.
The problem sits at the intersection of three threads of prior work. The first is representation similarity analysis, which includes canonical correlation analysis and its deep variants , centered kernel alignment [4], and Procrustes-based alignment [1]. These methods assume a fixed target representation and ask whether a learned representation is close to it. Our setup is different: we do not assume that a target exists, but rather ask whether a network can learn a mapping into a specified target space while preserving geometric structure. The second thread is kernel methods, in particular kernel ridge regression [6], which combines a linear model in a high-dimensional feature space with regularization. With an RBF kernel, KRR can approximate a wide class of smooth functions and typically serves as a strong baseline for low-dimensional regression tasks. The relationship between kernel methods and infinitely wide neural networks has been studied through the neural tangent kernel [3]; for finite-width networks and small datasets, kernel methods frequently perform competitively or better, and our experiments add a specific instance of this phenomenon. The third thread is quantum machine learning, where quantum feature spaces have been proposed as a route to enhanced expressivity [2, 7]. A common construction maps classical data to quantum states via angle encoding; our target representation follows this approach, using product-state amplitudes as the target for a classical mapping.
We investigate the question in a controlled setting. We use an 8-dimensional autoencoder bottleneck trained on MNIST, and construct a target Hilbert-space representation via PCA-based angle encoding of the latent vectors. We train several models—linear regression, an MLP trained on MSE only, an MLP trained on MSE plus an inner-product loss, and kernel ridge regression—to map z to . We evaluate them on inner-product preservation error (IP_err), reconstruction error (MSE), and pairwise distance preservation error (dist_err).
Our findings are as follows. First, the learned mapping is approximately linear, with a linear regression from z to the recovered angle space achieving , and its primary direction is target-driven rather than input-driven. Second, the learned map requires all singular directions: rank reduction degrades IP_err by a factor of 2.5 to 5.9. Third, the learned subspace does not equal the PCA basis, and seed-to-seed variation appears in the higher-rank structure while the primary direction remains stable. Fourth, in this controlled setting, kernel ridge regression with an RBF kernel outperforms the tuned MLP, suggesting that classical kernel methods may be preferable when the underlying mapping is approximately linear.
The latent space is defined by a small autoencoder we train on 5,000 MNIST images. The encoder maps a flattened image to a latent vector , and the decoder reconstructs the image from . The autoencoder has approximately 105,944 parameters and is trained with mean-squared error for 5 epochs. We then extract latent vectors for all 5,000 training and 1,000 test images and use them as inputs throughout the paper. The encoder is not fine-tuned during any of the mapping experiments.
The target Hilbert space is that of an -qubit system, which has dimension . We represent a state by its real amplitudes and use a product-state construction
where each is a single-qubit rotation about the -axis and is a vector of angles. Under this encoding, the amplitude of basis state is the product over of if and if .
The angles are defined as a function of the latent vector by taking the top- principal components of the training latents, , projecting each latent onto them, applying a sigmoid to bound the result, and rescaling to the interval :
where is the standard deviation of the projection along across the training set and denotes the sigmoid function. This yields a deterministic target for every latent vector. We use in different experiments, and for the main analysis we focus on , which corresponds to 16 amplitudes.
We train four models to map to . Each model produces an -dimensional vector of angles, from which the amplitude vector is reconstructed via the product-state formula above. A normalization step enforces for every model. The first model is a simple linear map with . The second is a two-layer MLP with ReLU activations, mapping to through a hidden layer of size , which we vary across . The third is an MLP of the same architecture, but trained on a combined loss that includes an inner-product preservation term alongside the MSE. The fourth is a kernel ridge regression model with an RBF kernel, which directly regresses the true target angles .
We evaluate models on three metrics. The inner-product preservation error is the mean absolute difference between pairwise inner products in the predicted and target :
The reconstruction error is the standard MSE, , and the distance preservation error is the mean absolute difference between pairwise Euclidean distances in the two spaces.
Training details vary across experiments. The MLP is trained for 200 to 2000 epochs with Adam at learning rates of or . The loss weight for the inner-product term, denoted , takes values in . The network is evaluated on a held-out test set of 1,000 MNIST images that was never seen during training of either the autoencoder or the MLP. All results are reported across three random seeds (42, 123, 7) where relevant.
3 Experiments
We organize our experiments around four questions: whether the learned mapping is approximately linear, how reconstruction and inner-product preservation trade off against each other, which singular directions of the learned map matter, and how the learned subspace compares across seeds and against the PCA basis. We then compare the MLP against a kernel baseline and evaluate the stability of our findings across random seeds.
We first ask whether the learned mapping is approximately linear. We take the trained MLP with inner-product loss at n = 4 and extract the effective linear map from z to by fitting a linear regression to the network's outputs. The resulting regression achieves on the test set. For comparison, a linear regression from z to the true target angles achieves . The small gap between 0.91 and 0.98 indicates that the MLP is effectively learning a linear map, and the residual nonlinearity is consistent with the sigmoid in the target encoding, which is approximately linear over most of its range. This observation implies that the problem is well posed for linear
Pareto frontier: MSE vs IP preservation

Figure 1: Pareto frontier of the MLP with inner-product loss, varying the loss weight from 0 to 100. Each point is the mean across three random seeds. The red dashed line indicates the best KRR result (IP_err = 0.0144), which lies strictly below the MLP curve.
methods, and predicts that a classical kernel method with a flexible kernel will be competitive with the MLP.
We next characterize the trade-off between reconstruction accuracy and inner-product preservation. We vary and train 21 models (seven weights across three seeds), plotting the resulting (MSE, IP_err) pairs in Figure 1. As increases, MSE increases monotonically from 0.005 to 0.037, while IP_err decreases monotonically from 0.070 to 0.029. The relationship is smooth and monotonic, with no phase transitions or anomalies. The best trade-off occurs near , where IP_err has nearly reached its minimum and MSE is still close to its lowest value. We include the best KRR result as a horizontal line at IP_err = 0.0144; this point lies strictly below the MLP Pareto curve, indicating that KRR achieves both lower IP_err and lower MSE than any MLP configuration we tried.
We next examine which singular directions of the learned map carry its behavior. We extract the learned linear map from the MLP's outputs and compute its singular value decomposition. For , the singular values are approximately for one seed and similar for the others: two are large and two are small. For each rank , we truncate to its top- singular directions and re-evaluate IP_err, with results shown in Figure 2. Truncation to rank 3 degrades IP_err from 0.044 to 0.111, a factor of 2.5; rank 2 to 0.187, a factor of 4.2; and rank 1 to 0.262, a factor of 5.9. The degradation is monotonic and shows no plateau, so every direction contributes to the map's behavior. This result is counterintuitive given the singular value spectrum, since one might expect the small singular directions to be negligible. They are not: they carry essential geometric information, and any direction removed causes a substantial drop in inner-product preservation.
We then investigate the geometry of the learned map in more detail. Let denote the first right singular vector of A, that is, its primary direction in latent space. We compare this
Rank ablation: every direction matters

Figure 2: Rank ablation of the learned linear map. Truncating the map to its top-r singular directions (for ) monotonically degrades IP_err, indicating that every direction is essential. The best KRR result is shown as a horizontal dashed line for reference.
The learned primary direction is target-driven, not input-driven

Figure 3: The learned primary direction is target-driven, not input-driven. Cosine similarity with the input’s principal direction is 0.002; similarity with the lifted target’s principal direction is 0.989.
direction to two candidate directions: , the principal direction of the input latent space, and , the principal direction of the target angle space lifted back into the input space via . The cosine similarity between and is 0.002, essentially orthogonal. The cosine similarity between and is 0.989. The learned primary direction is therefore determined by the geometry of the target space, not by the input. This is the key structural finding of the paper: the mapping is not a PCA-like projection of the input, but a target-driven transformation in which the network identifies which input directions matter for the geometry of the output.
We also compare the four-dimensional subspace spanned by the rows of A to the four-dimensional PCA subspace used to construct the target. The principal angles between these two subspaces are , with mean cosine 0.31, so the two subspaces overlap only partially. Across the three random seeds, the principal angles are for seed 42 vs. 123, for seed 42 vs. 7, and for seed 123 vs. 7. All three seeds agree on the first singular direction to within , while higher directions diverge substantially.
Subspace comparison: learned vs PCA, and seed-vs-seed

Figure 4: Principal angles between the learned subspace and the PCA subspace (top row) and between different random seeds (rows 2–4). All seeds converge on the primary direction but diverge in higher ranks, and none match the PCA basis used to construct the target.
Figure 4 displays these principal angles as a heatmap and makes two facts immediately clear: the learned subspace is not the PCA subspace, and it is stable across seeds only in its primary direction.
Finally, we compare the MLP to a kernel baseline. We train kernel ridge regression with an RBF kernel on the same 5,000 training pairs, sweeping and . The best configuration is , , achieving IP_err = 0.0144 and MSE = 0.0013. For comparison, we sweep the MLP over 24 configurations varying the hidden layer size, the number of epochs, the learning rate, and the inner-product loss weight. The best configuration is , 2000 epochs, learning rate , , achieving IP_err = 0.0197 and MSE = 0.0015. KRR is better than the best MLP result by a factor of 1.37 in IP_err, and both metrics favor the simpler method. Figure 5 summarizes the comparison across all model classes.
We check the stability of these findings across random seeds. For each qubit count and each of three seeds, we train a fresh MLP with inner-product loss. The mean IP_err across seeds is 0.065 for , 0.025 for , 0.032 for , and 0.047 for . The standard deviation across seeds is largest for (0.034) and smallest for (0.0008), indicating that the four-qubit result is essentially deterministic. The two-qubit case shows high variance, which we attribute to the small dimension of the target space and the resulting flatness of the loss landscape. The three- and four-qubit cases are stable, which supports the robustness of the main findings.
4 Discussion
Our experiments support four findings, each with a corresponding limitation. The mapping is approximately linear in the latent vector. A linear regression from z to the recovered angles achieves , close to the achieved when regressing to the true angles, so the residual nonlinearity is small. This explains why kernel ridge regression with an RBF kernel reaches IP_err = 0.0144, better than any of the 24 MLP configurations we tried (best IP_err = 0.0197). For approximately linear mappings at this scale, kernel methods should be the first candidate. Our experiments use a single autoencoder and fix the latent dimension at 8; varying both would show
Method comparison: inner-product preservation error

Figure 5: Inner-product preservation error across model classes. KRR outperforms all neural configurations, including the tuned MLP.
how broadly the effect holds.
The learned map requires all singular directions despite a highly uneven singular value spectrum. Removing the smallest singular direction alone degrades IP_err from 0.044 to 0.113, a factor of 2.6, and removing more increases the degradation further, reaching 0.262 at rank 1. Since the singular values are approximately (5.5, 5.3, 1.3, 0.8), one might expect the last two directions to be negligible; they are not. Rank truncation based on singular value magnitude is unsafe for this class of problem, and importance should be measured by impact on the target metric instead.
The learned primary direction is target-driven, not input-driven. The first right singular vector of the learned map has cosine similarity 0.002 with the input's principal direction and 0.989 with the target's principal direction lifted back into the input space. The network identifies the input directions that matter for the geometry of the target, a form of task-aware dimensionality reduction. We do not provide a theoretical account of this effect; a gradient-flow analysis of the combined loss would be a natural next step.
A classical kernel method outperforms the tuned neural network in this setting. The best KRR configuration ( , ) achieves IP_err = 0.0144 with MSE = 0.0013, while the best MLP configuration ( , 2000 epochs, learning rate , ) achieves IP_err = 0.0197 with MSE = 0.0015. KRR is better by a factor of 1.37 in IP_err and 1.15 in MSE. This does not mean neural networks are never useful here; when the target is genuinely nonlinear—for example, when qubits are entangled—the MLP may regain an advantage. Our comparison is at fixed hyperparameter budgets, and the observed gap should be read as evidence for the specific setting we studied.
More broadly, our experiments use 5,000 MNIST images, an 8-dimensional latent space, and target Hilbert spaces of up to 5 qubits. Extending to larger benchmarks such as Fashion-MNIST or CIFAR-10, and to entangled target encodings, is the natural next step.
5 Conclusion
We have studied whether a neural network can learn a structure-preserving mapping from a compressed latent space to a Hilbert-space representation. Our experiments show that the mapping is learnable, approximately linear, and target-driven in its primary direction; that the learned map requires all singular directions; and that kernel ridge regression outperforms a tuned MLP in this setting. These results suggest that for approximately-linear structure-preserving mappings, classical kernel methods are a strong baseline and should be considered before more complex neural approaches.
We hope that these findings contribute to a broader discussion of when neural networks are the right tool for representation-learning tasks, and when simpler methods suffice.
References
[1] John C. Gower. Generalized Procrustes analysis. Psychometrika, 40(1):33–51, 1975.
[2] Vojtěch Havlíček, Antonio D. Córcoles, Kristan Temme, Aram W. Harrow, Abhinav Kandala, Jerry M. Chow, and Jay M. Gambetta. Supervised learning with quantum-enhanced feature spaces. Nature, 567:209–212, 2019.
[3] Arthur Jacot, Franck Gabriel, and Clément Hongler. Neural tangent kernel: Convergence and generalization in neural networks. Advances in Neural Information Processing Systems, 31, 2018.
[4] Simon Kornblith, Mohammad Norouzi, Honglak Lee, and Geoffrey Hinton. Similarity of neural network representations revisited. In Proceedings of the 36th International Conference on Machine Learning, pages 3519–3529, 2019.
[5] Maithra Raghu, Justin Gilmer, Jason Yosinski, and Jascha Sohl-Dickstein. SVCCA: Singular vector canonical correlation analysis for deep learning dynamics and interpretability. Advances in Neural Information Processing Systems, 30, 2017.
[6] Craig Saunders, Alexander Gammerman, and Volodya Vovk. Ridge regression learning algorithm in dual variables. Proceedings of the 15th International Conference on Machine Learning, pages 515–521, 1998.
[7] Maria Schuld and Francesco Petruccione. Machine Learning with Quantum Computers. Springer, 2021.
A Reproducibility
All experiments reported in this paper are reproducible from a single public repository. The code is available at
https://github.com/adnanphp/diffusion-hilbert
The repository contains the full experiment notebook, notebooks/02_minimum_experiment.ipynb, with all cells executed and outputs included. The dependencies are PyTorch 2.0 or later, torchvision, NumPy, scikit-learn, and Matplotlib. MNIST is downloaded automatically on first run and cached locally; the split is 5,000 images for training and 1,000 for testing, drawn from the standard MNIST training and test sets. Random seeds are set to 42, 123, and 7 where multiple seeds are reported. The autoencoder is trained once and reused for all mapping experiments, and only the mapping models are retrained per seed. Fashion-MNIST and CIFAR-10 results mentioned in the discussion section are not included in the repository and are listed as future work.