Supervised Metric Regularization Through Alternating Optimization for Multi-Regime Physics-Informed Neural Networks Enzo Nicolás Spotorno, Josafat Leal Filho, & Antônio Augusto Fröhlich Abstract Standard Physics-Informed Neural Networks (PINNs) often face challenges when modeling parameterized dynamical systems with sharp regime transitions, such as bifurcations. In these scenarios, the continuous mapping from parameters to solutions can result in spectral bias or ”mode collapse”, where the network averages distinct physical behaviors. We propose a Topology-Aware PINN (TAPINN) that aims to mitigate this challenge by structuring the latent space via Supervised Metric Regularization . Unlike standard parametric PINNs that map physical parameters directly to solutions, our method conditions the solver on a latent state optimized to reflect the metric-based separation between regimes, showing ≈ 49 % \approx 49\% lower physics residual (0.082 vs. 0.160). We train this architecture using a phase-based Alternating Optimization (AO) schedule to manage gradient conflicts between the metric and physics objectives. Preliminary experiments on the Duffing Oscillator demonstrate that while standard baselines suffer from spectral bias and high-capacity Hypernetworks overfit (memorizing data while violating physics), our approach achieves stable convergence with 2.18 × \mathbf{2.18\times} lower gradient variance than a multi-output Sobolev Error baseline, and 𝟓 × \mathbf{5\times} fewer parameters than a hypernetwork-based alternative. 1 Introduction Physics-Informed Neural Networks (PINNs) have demonstrated significant potential for solving parameterized Partial Differential Equations (PDEs). However, modeling systems that exhibit qualitative behavioral changes, such as bifurcations from stability to chaos, remains a challenge. The literature suggests that standard Multi-Layer Perceptrons (MLPs) struggle to approximate the discontinuous or non-smooth dependence of the solution on the system parameters due to spectral bias 9 and the singularity of the Jacobian at bifurcation points 6 . While spectral bias reflects a representational limitation 9 , ill-conditioned Jacobians near bifurcations primarily induce optimization pathologies 6 . Nevertheless, existing solutions typically involve specialized architectures. HyperPINNs 1 generate network weights conditioned on parameters to handle these transitions, while aiming to maintain parameter efficiency compared to training separate networks for each parameter 1 . Other approaches, such as Mixture-of-Experts (MoE) 3 , explicitly route inputs to different sub-networks. These methods, however, introduce challenges such as routing instability (MoE) or indirect weight generation overhead (HyperPINNs). In this work, we investigate a single-network architecture that incorporates Supervised Metric Learning (Triplet Loss) to regularize the latent space, and we name it Topology-Aware PINN (TAPINN) . We hypothesize that by explicitly enforcing a geometric structure in the latent space that mirrors the physical regimes, we can improve the trainability of the solver without the computational overhead of hypernetworks. To stabilize the training of these competing objectives (topology vs. physics), we employ an Alternating Optimization schedule. We choose an LSTM-based encoder to capture temporal dependencies in short observation windows, which is crucial for distinguishing periodic from chaotic trajectories. Triplet loss is employed to cluster embeddings from trajectories in similar dynamical regimes while separating dissimilar ones, drawing from representation learning principles 2 and manifold assumptions in high-dimensional data 10 . Triplets are formed in-batch using known forcing amplitudes F_{0} as proxies for regime similarity (anchors/positives share the same F_{0} , negatives differ; no hard/semi-hard mining); we use Euclidean distance and margin m=0.2 . This provides supervision without discrete regime labels. The alternating optimization schedule follows successful block-coordinate strategies in multi-objective PINNs 11 , ensuring the latent manifold is stabilized before heavy physics enforcement and avoiding severe gradient conflicts. This phased approach is inspired by strategies for mitigating gradient pathologies in multi-objective PINNs 11 . 2 Methodology Below, we formalize the problem setting, describe the proposed encoder-generator architecture, and detail the loss functions and phased training procedure. We focus on a parameterized dynamical system governed by the residual \mathcal{N}[\mathbf{x}(t);\lambda]=0 . The objective is to reconstruct the full solution trajectory \hat{\mathbf{x}}(t) given a short observation window \mathbf{x}_{obs} associated with a parameter \lambda . We specifically address the regime where \nabla_{\lambda}\mathbf{x} may be ill-conditioned (e.g., near a bifurcation), making direct regression from \lambda difficult for standard optimizers. Here, \lambda is scalar (forcing amplitude F_{0} ). We assume piecewise smoothness away from bifurcations. Unlike parametric baselines, \lambda is used only indirectly via observed trajectories \mathbf{x}_{obs} . TAPINN consists of an LSTM-based Encoder ( E ) and a PINN Generator ( G ). The Encoder: z=E(\mathbf{x}_{obs}) . Maps the input window to a latent vector z . The Generator: \hat{\mathbf{x}}(t)=G(t,z) . Predicts the solution conditioned on z . LSTM is selected for its effectiveness in capturing long-term dependencies in dynamical trajectories; simpler alternatives (e.g., 1D CNNs) were explored but showed inferior regime discrimination in preliminary tests, therefore we left deeper experimentation for future work. We define a composite loss function \mathcal{L}_{total}=\mathcal{L}_{data}+\alpha\mathcal{L}_{physics}+\beta\mathcal{L}_{metric} . \alpha and \beta are tuned via grid search ( \alpha =1.0, \beta =0.1 in our experiments); adaptive strategies remain future work 11 . To mitigate gradient conflicts observed when optimizing these terms simultaneously 11 , we utilize a block-coordinate descent strategy. Phase I (Metric Alignment) optimizes the Encoder using a Triplet Loss \mathcal{L}_{metric}=\max(0,d(z_{a},z_{p})-d(z_{a},z_{n})+m) . This step organizes the latent space such that inputs from the same physical regime are clustered together, aiming to create a more linearly separable representation of the parameter manifold for the generator, supporting manifold learning techniques like t-SNE for visualization 8 . Phase II (Physics Reconstruction) optimizes the Generator on \mathcal{L}_{physics} while freezing the Encoder. This provides the solver with a stable conditioning variable z . Interleaved Joint Tuning: We train over 30 epochs as follows: Phase I (5 epochs, encoder-only on \mathcal{L}_{metric} ), Phase II (20 epochs, generator-only on \mathcal{L}_{physics}+\mathcal{L}_{data} with encoder frozen), then interleaved joint updates on \mathcal{L}_{total} every k=5 batches ( \approx 20\% of steps). This stabilizes the latent manifold early while keeping the encoder adaptable, preventing generator overfitting to a stale representation. By encouraging a latent space that linearizes the parameter-to-solution manifold, the approach may implicitly reduce the effective condition number of the Jacobian seen by the generator, potentially alleviating optimization difficulties near bifurcations identified in prior work 6 . 3 Experiments and Results We evaluate the method on the Duffing Oscillator , a canonical system exhibiting chaos. Such multi-scale dynamical systems are known to induce severe optimization pathologies in PINNs, as characterized by 6 . While the Duffing system exhibits clear and relatively sharp regime transitions, subtler or higher-codimension bifurcations in systems such as the Lorenz attractor or reaction-diffusion equations (e.g., Allen-Cahn), broader validation is left for future work. Simulating regimes from Period-1 to Chaos by varying the forcing amplitude F_{0}\in[0.3,0.8] , we generated a dataset of 500 trajectories for each regime ( F_{0}\in\{0.3,0.5,0.8\} ) using a 4th-order Runge-Kutta solver with dt=0.01 . The observation window consists of the first 100 timesteps ( 10\% of the trajectory). Models were trained for 30 epochs using the Adam optimizer with a learning rate of 10^{-3} . We compare our approach against three baselines. (I) Parametric Baseline: A standard PINN that receives the explicit parameter \lambda as input ( Input:t,\lambda ). Unlike this and the HyperPINN baseline (both conditioned on known \lambda ), TAPINN infers regime from partial observations \mathbf{x}_{obs} , targeting data-assimilation settings where \lambda is unknown. (II) HyperPINN Baseline: A hypernetwork architecture where weights are predicted as functions of \lambda 1 . This represents a high-capacity alternative for multi-regime modeling, designed for parameter efficiency 1 . (III) Multi-Output Baseline: Identical to our architecture (LSTM Encoder + Generator) but trained via standard joint optimization with a Sobolev ( H^{1} ) loss that enforces constraints on both \mathbf{x} and \dot{\mathbf{x}} 4 . This isolates the combined effect of our Metric Regularization and Alternating Optimization against standard derivative-constrained training. Table 1: Performance Comparison. We report Physics Residual (mean squared ODE residual \mathcal{L}_{physics}=\frac{1}{N_{c}}\sum\|\mathcal{N}[\hat{\mathbf{x}}(t_{i});\lambda]\|^{2}_{2} over N_{c}=10^{4} uniformly sampled collocation points t_{i}\in[0,T] ; no additional weighting), Model Complexity (Exact Parameters), and Test MSE. Note that while HyperPINN achieves low Data MSE, its high Physics Residual indicates overfitting. Our method achieves the best physics compliance with 5\times fewer parameters than HyperPINN. All other models have a similar parameter count for fairness. Since the Parametric baseline doesn’t use the encoder we matched its parameter count by increasing the MLP capacity. Method Physics Res. ( \downarrow ) Params Data MSE ( \downarrow ) Parametric Baseline 0.160 8,577 0.392 Multi-Output 0.192 8,069 0.426 HyperPINN 0.158 39,169 0.281 Ours (AO) 0.082 8,003 0.425 Figure 1: Qualitative analysis of the Topology-Aware training process: (a) Gradient norms during training. The Multi-Output baseline (orange) shows significant spikes near regime transitions compared to ours (blue). (b) t-SNE visualization of the learned embeddings z , colored by regime ( F_{0} ). Distinct clusters emerge without discrete supervision. In our experiments, the Multi-Output baseline exhibited severe numerical instability. While Sobolev training is effective for smooth functions, the inclusion of gradient constraints near the bifurcation point resulted in gradient norms \mathbf{2.14\times} higher on average compared to our method, with a variance \mathbf{2.18\times} larger (see Figure 1 a). This suggests that enforcing high-order constraints on the encoder without explicit metric regularization leads to an unstructured latent space, exacerbating optimization pathologies near bifurcations. Moreover, we include HyperPINNs as a high-capacity benchmark. As shown in Table 1 , HyperPINN suffers from a ”memorization” pathology: it achieves the lowest Data MSE ( 0.281 ) but a high Physics Residual ( 0.158 ), indicating it overfits trajectory points without satisfying the governing ODE. In contrast, our Topology-Aware approach achieves the lowest physics error ( 0.082 ) while using \mathbf{5\times} fewer parameters ( 8,003 vs 39,169 ), demonstrating that structuring the latent space is more efficient than brute-force weight generation. Beyond visual clustering, we quantify the structure of the learned latent space z by training a linear probe to regress the physical parameter F_{0} from z . Our method achieves a Prognostics MSE of 3.5\times 10^{-4} , confirming that the encoder learns a highly structured, linearizable representation of the chaotic regimes (see Figure 1 b), which is not explicitly enforced by the physics loss alone. Finally, to isolate the contribution of our phased training strategy versus the metric loss itself, we compare our approach against a version trained with standard joint optimization (summing Metric, Physics, and Data losses). This ”Joint Training” configuration yielded a significantly higher physics residual ( \approx 0.158 ), performing nearly identically to the standard baseline ( 0.160 ). This failure confirms that metric regularization alone is insufficient; the Alternating Optimization schedule is critical to resolve gradient conflicts, allowing the latent topology to stabilize before being subjected to the competing gradients of the physics constraints. 4 Conclusion We presented an exploratory proof-of-concept Topology-Aware PINN framework that leverages Supervised Metric Regularization and Alternating Optimization to address gradient conflicts and regime transitions. Preliminary results provide initial evidence that structuring the latent space can improve physics residuals and regime separation compared to standard baselines, though extensive validation across diverse systems remains essential. This lightweight approach may serve as a middle ground before resorting to heavier methods like HyperPINNs. Future work will focus on extensive benchmarking of TAPINN against domain decomposition methods 5 and operator learning frameworks 7 , besides ablations on the architecture, statistical analysis across random seeds, and sensitivity to noise.