Manuscript Offprint
arXiv:2610.32314SKG in Practice: OOD Generalization Cases Across FourDomains
Abstract
This paper presents the engineering implementation methods of the SKG inference framework and provides complete case studies across four domains.
| Case | Domain | Key Results |
|---|---|---|
| 1 | 2D Dissipative Mechanical System | OOD MSE is 1.69–4.12 times lower than the best neural baseline; state-dependent metric yields a -order improvement under controlled conditions |
| 2 | Target Detection Sim-to-Real | Real-machine mAP 0.2564 → 0.4964 (+24.00 points, single-run experiment, 32 images, point estimate), AP75 0.1736 → 0.5765 (+40.29 points), no real-machine retraining required |
| 3 | Sequence Modeling sine→square | OOD MSE 0.0296 vs Transformer 0.0641 (mean of 5 seeds, p=0.024) |
| 4 | Molecular Dynamics MD17 | ID@100 ADE 0.0285 vs ESTAG 0.1467; OOD@100 0.0316 vs 0.1411 (single seed) |
For each case, we present the objective, applied SKG theory, parameter settings, baseline comparison protocol, data results, and sources of advantage. Following the cases, we provide the complete methodology: pre-validation, task invariant construction, three-stage training, residual training, and the four theorems and one proposition supporting these methods. This paper not only demonstrates effective configurations of SKG across four domains but also honestly reports the variance of single-run experiments, limitations of single-seed results, negative updates caused by parameterization mismatch, and practical experience of using engineering thresholds as diagnostic signals rather than hard constraints.
Keywords: SKG; Pre-validation; Task Invariants; Three-Stage Training; Variable Projection; Residual Training; OOD
Contents
1 Introduction 4
1.1 Positioning of This Paper 4
1.2 Relationship with Paper A [1] 4
1.3 Structure of This Paper 4
2 Case 1: 2D Dissipative Mechanical System 4
2.1 Objective 4
2.2 Applied SKG Theory 4
2.3 Parameter Settings 5
2.4 Baseline Comparison Protocol 5
2.5 Results 5
2.6 Controlled Ablation of the Metric Component ..... 7
2.7 Sources of Advantage ..... 8
2.8 Limitations ..... 8
3 Case 2: Target Detection Sim-to-Real Cross-Domain Fallback ..... 8
3.1 Objective ..... 8
3.2 Applied SKG Theory ..... 9
3.3 Parameter Settings ..... 9
3.4 Baseline Comparison Protocol ..... 10
3.5 Results ..... 10
3.6 Mechanism Validation ..... 11
3.7 Sources of Advantage ..... 13
3.8 Limitations ..... 13
4 Case 3: Sequence Modeling sine→square ..... 14
4.1 Objective ..... 14
4.2 Applied SKG Theory ..... 14
4.3 Parameter Settings ..... 15
4.4 Baseline Comparison Protocol ..... 15
4.5 Results and Inference Budget Analysis ..... 15
4.6 Sources of Advantage ..... 17
4.7 Limitations ..... 17
5 Case 4: Molecular Dynamics MD17 ..... 18
5.1 Objective ..... 18
5.2 Applied SKG Theory ..... 18
5.3 Parameter Settings ..... 18
5.4 Baseline Comparison Protocol ..... 19
5.5 Results ..... 19
5.6 Sources of Advantage ..... 22
5.7 Limitations ..... 22
6 Cross-Case Summary ..... 23
7 Methodology: Pre-validation ..... 23
7.1 Why Pre-validation is Needed ..... 23
7.2 Three Criteria for Invariants ..... 24
7.3 Metric Health Criteria ..... 24
7.4 Energy Dual Criteria ..... 24
7.5 Checklist ..... 24
8 Methodology: Task Invariants Construction ..... 25
8.1 Division of Labor Between Two Types of Invariants ..... 25
8.2 Construction Steps ..... 25
8.3 Candidate Constructions ..... 25
8.4 Sources of Advantage and Theoretical Support ..... 25
9 Methodology: Three-Stage Training ..... 26
9.1 Paradigm Selection ..... 26
9.2 Paradigm 1: Stage 0/1/2 ..... 26
9.3 Paradigm 2: Stage A/B/C ..... 26
9.4 Common Core ..... 26
10 Methodology: Residual Training and Supporting Theorems 27
10.1 Three Types of Losses 27
10.2 Theorem 10.1 (Condition Number Dichotomy) 27
10.3 Theorem 10.2 (Constraint Count Dichotomy) 28
10.4 Theorem 10.3 (OOD MSE Dichotomy) 28
10.5 Theorem 10.4 (Numerical Differentiation Error Dichotomy) 29
10.6 Proposition 10.5 (Energy Alignment Premise) 30
10.7 Operational Choice Between Strong and Weak Forms 30
11 Methodology: Variable Projection Interpretation of Three-Stage Training 30
11.1 Positioning 30
11.2 Block Structure of the Joint Objective 30
11.3 Variable Projection 31
11.4 Three Stages are Block Approximations of Variable Projection 31
11.5 Coordinate Conditions for Residual Reducibility 31
11.6 Why Alternating is More Stable Than Joint Optimization 32
11.7 Boundaries 32
12 Conclusion 32
1.1 Positioning of This Paper
This paper is an engineering practice guide for the SKG framework. It targets engineers and researchers who wish to use SKG to solve OOD problems. It answers: what steps to follow to achieve better OOD results than strong existing baselines.
1.2 Relationship with Paper A [1]
This paper (Paper B) is the engineering implementation companion document to Paper A [1]. Paper A establishes the mathematical foundations of SKG (octuple, invariant-induced metric, Fisher objectivity) and rigorous mathematical proofs of the complete learning theory; this paper does not repeat the derivations but focuses on how to transform these theories into operational engineering specifications (Sections 7–11) and verifies their OOD generalization capabilities across four domains (Sections 2–5). Readers seeking theoretical details are referred to Paper A [1]. It should be particularly noted that the four theorems and one proposition in Section 10 are independent theoretical contributions of this paper, not repetitions of Paper A.
1.3 Structure of This Paper
Sections 2–5 present the four cases, each organized as "Objective → Applied SKG Theory → Parameter Settings → Baseline Comparison Protocol → Data Results → Sources of Advantage." Section 6 provides a cross-case summary. Sections 7–11 present the complete methodology and supporting theorems. Section 12 concludes.
2 Case 1: 2D Dissipative Mechanical System
2.1 Objective
To validate the OOD generalization capability of SKG on second-order dissipative systems, compared against neural baselines HNN, NODE, and MLP.
2.2 Applied SKG Theory
• Symplectic structure ( ): Constant matrix .
• Energy decomposition : , dissipation described by S and g, V parameterized by Gaussian kernel Nyström.
• State-dependent dissipation metric (g): parameterized by a full symmetric matrix field, softplus ensures positive definiteness.
• Three-stage training: Trajectory cold start → weak-form residual fine-tuning of metric+energy → trajectory alignment of decoder.
• Weak-form residual training: Simpson local integration, avoiding numerical differentiation errors.
2.3 Parameter Settings
| Component | Configuration |
| Symplectic structure () | Constant matrix |
| Mass () | Unknown constant positive diagonal, calibrated from training data |
| Potential energy () | Gaussian kernel Nyström, 96 centers |
| Dissipation () | Full symmetric matrix field, Gaussian kernel Nyström, softplus |
| Training | Weak-form residual, LBFGS, 500 iterations |
| Regularization | Ridge + Nyström spectral truncation |
| Integration | Strang splitting |
System:
damping is diagonal in the radial/tangential basis, with both linear and nonlinear function families.
Data: RK4 numerical integration, 20 training trajectories, 12 ID, 12 OOD (initial position and momentum amplitude ). Time domain 200 steps, .
2.4 Baseline Comparison Protocol
- Same training data, same test set, same evaluation metric (200-step MSE).
• Baselines: HNN, NODE, MLP, each trained under its own paradigm.
• Ground truth is used only for data generation and evaluation, not as learning input.
2.5 Results
Extrapolation error trend: Figure 1 shows the trajectory MSE of various methods as the initial position radius increases (extrapolating from the training boundary 1.5 to 3.0). Neural network baselines (MLP, NODE, HNN) exhibit exponentially increasing errors with extrapolation distance, while the SKG (General Kernel) error curve grows extremely gently. At the maximum extrapolation radius, SKG's error is 1.69–4.12 times lower than the best baseline.
Error increases with extrapolation radius

64 shared directions / momentum samples per radius | T = 0.2 | shaded: trajectory bootstrap 95% interval r = 1.5 is the training-initialization boundary; momentum scale is fixed at 1.
Figure 1. Extrapolation error curve with respect to the initial position radius. The left panel is linear damping, and the right panel is nonlinear damping. The vertical axis is on a logarithmic scale. The shaded region is the 95% trajectory bootstrap confidence interval for 64 shared direction/momentum samples.
2D phase trajectory comparison: Figure 2 shows the position trajectory evolution over 200 steps for a predetermined OOD initial state (r = 2.5, outside the training distribution). Lacking physical law constraints, the MLP trajectory (red line) oscillates violently in phase space and completely diverges; while SKG (green line) tightly follows the true trajectory (black dashed line), demonstrating extremely strong dynamical stability.
One predetermined out-of-distribution initial state
--- GT — MLP — SKG ★ Shared input initial state □ MLP initial output
(a) Linear damping law: position trajectory

(b) Nonlinear damping law: position trajectory
(c) Error along the same trajectory
(d) Error along the same trajectory

; first fixed momentum sample. Shared input, frozen weights, unchanged 200-step horizon.
Figure 2. 2D position trajectory and error accumulation under a predetermined OOD initial state. Subplots (c) and (d) show the accumulated state RMS error over time.
Component ablation (Shapley decomposition): To quantify the contribution of each module within SKG, we performed an exact Shapley decomposition over the mass, potential energy, and dissipation components (Figure 3). The results show that the new potential energy is the absolute source of positive gain (linear +0.801, nonlinear +0.693); the dissipation module instead introduces negative cancellation (linear -0.100, nonlinear -0.309); the contribution of the mass correction is close to zero.
Potential energy dominates the frozen-model improvement

Exact 3-component Shapley allocation over all 6 replacement orders.
12 archived OOD trajectories per system; paired bootstrap 95% intervals. Old model minus new model.
Figure 3. Shapley value decomposition of SKG components. Positive values indicate OOD MSE improvement, and negative values indicate performance degradation.
2.6 Controlled Ablation of the Metric Component
To isolate the independent contribution of the "state-dependent metric (dissipation tensor)" itself, under the condition that the energy structure is completely correct (K and use true values), we varied only the representation of the dissipation tensor and conducted four controlled comparisons (Figure 4).
Dissipation-tensor ablation with the true Hamiltonian fixed

A is the numerical-integration floor, not a learned model. B/C also differ in learning and anisotropy. D has unobserved boundary coefficients and constant extrapolation; it is worse than C. Archived v6.23: one fixed seed set, 12 OOD trajectories, T = 0.2; no seed confidence interval.
Figure 4. Dissipation tensor ablation experiment with the true Hamiltonian fixed (logarithmic vertical axis). A is the true tensor (numerical integration lower bound); B is the matched linear affine basis; C is the fixed identity matrix; D is the hat-basis interpolation.
Key findings:
-
The independent contribution of the state-dependent metric is enormous: The OOD MSE of B (state-dependent) is , a -fold improvement over C (constant baseline, ).
-
Parameterization mismatch destroys all gains: The error of D (hat-basis interpolation, ) is 2.56 times worse than the constant baseline C. Because the training data does not cover the terminal nodes of the hat basis, extrapolation leads to catastrophic collapse.
-
Perfect metric is limited by numerical precision: The error of A is already below double-precision floating-point noise.
Engineering guidance: State-dependent dissipation is not an automatic gain. It must be paired with identifiable parameterization (e.g., linear basis, full-rank fitting) and sufficient training coverage. If using local interpolation bases, ensure the nodes cover the OOD radius.
2.7 Sources of Advantage
-
Energy decomposition: Potential energy is the primary source of gain (Shapley +0.80/+0.69); kernel-parameterized potential energy substantially improves over the old potential energy.
-
Residual training: Weak-form residuals avoid Lyapunov amplification; fine-tuning metric+energy is not interfered with by trajectory gradients.
-
Three-stage: Cold start allows the latent space to acquire dynamical structure; the velocity field is calibrated in this coordinate system, and finally the decoder is aligned.
-
Metric contribution: The state-dependent dissipation metric has a -order joint contribution under controlled conditions; this difference simultaneously contains state dependence, anisotropy, and parameter learning, and cannot be attributed solely to "pure state dependence." The premise is that the parameterization is identifiable and training coverage is sufficient.
2.8 Limitations
• Single system, single time domain, OOD partially overlapping.
• The parent model condition number is approximately , exceeding the recommended threshold of 1000, yet still achieving good OOD results.
• The historical reference target has been seen, which is exploratory interpretation.
• Component ablation explains the difference between two frozen models and does not prove any universal causal advantage of "kernel/pullback/Fisher."
• Limitations of metric ablation: The difference between B and C simultaneously contains three variables—state dependence, anisotropy, and parameter learning—and cannot independently quantify the contribution of "pure state dependence"; Group C uses a fixed I rather than the optimal constant tensor, so the B/C gap is an upper bound; the failure attribution of Group D is not fully isolated.
3 Case 2: Target Detection Sim-to-Real Cross-Domain Fallback
3.1 Objective
In industrial vision, detectors trained in simulation domains and deployed to real machines often suffer feature mismatch and localization collapse due to domain shifts in illumination, material, and background. This case validates the fallback capability of SKG in the cross-domain scenario of simulation training and real-machine testing: no fine-tuning or domain adaptation is performed in the real-machine domain; localization performance is rescued purely by the geometric energy flow during inference. This case is an industrial tilted wooden block Sim-to-Real cross-domain fallback (Co-DETR, simulation training, real-machine testing, unit metric + hierarchical physical contour energy).
3.2 Applied SKG Theory
-
Task invariants (): The boundary energy is entirely driven by the image's physical contour and does not depend on network features. This is the fundamental reason the energy flow still works in cross-domain scenarios: network features fail in the real-machine domain, but the image's physical contour does not fail.
-
Hierarchical physical contour observation (robust extraction): To overcome the failure of fixed color thresholds in complex backgrounds, a three-level extraction mechanism is introduced. First, a local normalized coordinate system is established based on the candidate box (core region , peripheral region ). Initial contour validation is performed; if it fails, local Otsu is computed on multi-channel (grayscale/saturation/value) histograms using only the core region; if it still fails, GMM is fitted in RGB space using the core region as foreground seed and the peripheral region as background seed, and GrabCut is executed; if all stages fail, an abstention state is output and the original box is retained.
-
Conditional target energy :
where is the physical contour observation target state, is the initial detection box normalized state, and is the regularization weight.
-
Angular continuity handling: The angle of a rotated rectangle is periodic ( and are equivalent). Direct computation causes jumps (e.g., and directly subtracted yields an error of ). A wrapped difference mechanism is introduced to automatically correct the error to the equivalent , ensuring smooth gradient descent.
-
First-order dissipative flow (g): Fixed unit metric , , executed for 8 steps.
-
Rotated IoU gating (II): Before evolution, the rotated IoU between the initial prediction box and the observation box is computed. If strictly greater than 0.9, the update is frozen and the original detection box is retained. This ensures that prediction boxes already highly aligned with the physical contour are not corrupted by contour noise.
3.3 Parameter Settings
| Component | Configuration |
|---|---|
| Detector | Co-DETR (ResNet-50), with supervised angle branch and rotated width/height branch |
| Detector training | Fine-tuned only on the simulation training set (50-epoch budget, taking epoch 48), frozen and dir |
| Local coordinates | u, v normalized by detector angle rotation; core region , peripheral region |
| Contour extraction | Multi-channel local Otsu (grayscale/saturation/value) + RGB GMM-GrabCut fallback |
| State | |
| Energy (H, S) | Conditional target energy, angular wrapped difference |
| Flow (g) | 8-step first-order dissipation, fixed metric |
| Gating (Π) | Pre-evolution judgment, rotated IoU > 0.9 frozen |
| Observation failure | Retain original box when all hierarchical extractions fail validation |
Data: Industrial tilted wooden block dataset. Simulation domain: 282 training images + 50 dev; real-machine domain: 32 test images. Image resolution , annotation format is rotated bounding box (OBB).
3.4 Baseline Comparison Protocol
-
The detector is fine-tuned only on the simulation training set; the best checkpoint is selected on dev, and the weights are frozen and directly used for real-machine test.
-
No fine-tuning or domain adaptation is performed on the real-machine test.
• Metrics: Official rotated box COCO mAP@[0.50:0.95], AP50, AP75.
- Comparison: Same detector baseline vs. same detector + SKG energy flow, with identical candidates, classes, scores, and NMS rules.
3.5 Results
| Data Domain | Method | OBB mAP | AP50 | AP75 |
|---|---|---|---|---|
| Simulation Dev | Co-DETR Baseline+ SKG 5D Flow | 0.64690.7687 (+12.18) | 0.89140.9600 | 0.71950.8410 (+12.15) |
| Real-Machine Test | Co-DETR Baseline+ SKG 5D Flow | 0.25640.4964 (+24.00) | 0.67300.8432 | 0.17360.5765 (+40.29) |
Within the simulation domain: Baseline 0.6469. Under IoU gating protection, the SKG energy flow pulls the prediction boxes tightly to the physical contour, increasing AP75 from 0.7195 to 0.8410 (+12.15 points) and overall mAP by 12.18 points.
Real-machine domain cross-domain collapse: Domain shift causes catastrophic detector degradation, with mAP plummeting to 0.2564 and AP75 at only 0.1736. A large number of network prediction boxes undergo severe deformation and drift in the real-machine environment.
Real-machine domain SKG physical fallback: SKG energy is entirely driven by the physical contour of the real-machine image itself and does not depend on the failed network features. mAP jumps from 0.2564 to 0.4964 (+24.00 points, nearly doubling relatively), AP50 increases to 0.8432 (+17.02 points), and AP75 jumps from 0.1736 to 0.5765 (+40.29 points).
Qualitative visualization analysis: Figure 5 shows the correction effects for 6 typical candidates (black box is GT, red box is baseline prediction, green dashed line is corrected result):
-
(a) Center + size adjustment (IoU , +0.242): The red box center is deviated and the scale mismatched; the energy flow pulls it back through the , and , dimensions.
-
(b) Size mismatch (IoU , +0.253): The red box is severely enlarged; the , dimensions play a dominant role, shrinking it to the physical edge.
-
(c) Angle mismatch (IoU , +0.195): The red box is diagonally misaligned; the 5D flow combined with wrapped difference rapidly corrects the pose.
-
(d) Touching blocks: Partial repair (IoU , +0.065): Contour extraction is disturbed by adjacent objects; SKG performs a certain degree of geometric correction.
-
(e) Observation abstention (IoU , +0.000): Due to connected components touching the boundary or graph cut failure, the system triggers abstention and retains the original box.
-
(f) Negative update (IoU , -0.409): In extreme cases, if the background chromaticity is extremely similar to the foreground causing incorrect contour extraction, the energy flow will pull the originally correct box off.
Same-block examples: four improvements, abstention and regression
(a) Center + size adjustment IoU 0.202 -> 0.444 (+0.242)

(d) Touching blocks: partial repair IoU 0.271 -> 0.336 (+0.065)
— GT — Co-DETR — SKG
(b) Size mismatch IoU 0.170 -> 0.423 (+0.253)

(c) Angle mismatch IoU 0.399 -> 0.594 (+0.195)

(e) Observation abstention IoU 0.133 -> 0.133 (+0.000)

(f) Negative update IoU 0.803 -> 0.394 (-0.409)


TEST; five examples have score >= 0.5; the abstention is a low-score candidate. Predictions were frozen before diagnosis. SKG is dashed green so unchanged source/SKG boxes remain visible. Individual pages include full images and crops.
Figure 5. Six typical correction cases on the real-machine test set.
Statistical note: This case is a single-run experiment with a small real-machine test sample size (32 images); no statistical significance test is performed; the mAP improvement is a point estimate.
3.6 Mechanism Validation
Candidate destination and gating statistics: The total number of real-machine test candidates is 3,200 (including all classes/all scores). The destinations of these 3,200 real-machine candidates are: 2,332 (72.9%) successfully evolved and corrected, 862 (26.9%) retained original boxes due to observation failure, and 6 frozen by gating (IoU>0.9). The main reasons for observation failure are connected components touching the search ROI boundary (791) or area too small (71) (Figure 6).
Gating, abstention and updates | corrected 50-epoch experiment
(a) Exact candidate accounting

(b) TEST observation failures (n=862)
TEST: 2,332 updated + 862 unavailable kept + 6 gate kept = 3,200. Gate compares source to image observation, not GT. Keeping a candidate protects its original geometry; it does not certify that the candidate is correct.
Figure 6. Candidate box destination statistics (left) and observation failure reason analysis (right).
Hierarchical physical contour extraction and angular wrapping: Figure 7 shows the local coordinate establishment and hierarchical contour extraction process. When multi-channel Otsu fails, GMM-GrabCut using the core region as foreground seed and the peripheral region as background seed can effectively salvage extraction. Figure 8 shows the necessity of angular wrapping: if directly subtracted (left figure), the angle jumps from +89° to -91° (difference of -178°); using wrapped difference (right figure), the angle difference remains at +2°, avoiding gradient explosion and reverse rotation.
Image observation: Lab-b segmentation and minimum-area OBB
(a) RGB search ROI

(b) Lab b (display: 102-140)

(c) Positive Otsu: b > 119

(d) Selected contour + fitted OBB

Real TEST image 29, candidate 2802. Raw mask shows all thresholded components; cyan is the selected boundary, gold its OBB. Task-dependent color assumption: higher b is foreground. This is an empirical observation, not a physical invariant.
Figure 7. Local normalized coordinates and hierarchical contour extraction process.
Analytic illustration: rectangle angles have period pi
(a) Raw angular difference: -178 deg

(b) Wrapped difference: +2 deg

SYNTHETIC example, same quadratic trust weight=1. Source +89 deg; equivalent target charts -89 deg and +91 deg. Raw subtraction takes the long path. A 180-deg shift alone does not change an undirected rectangle; this is not measured AP.
Figure 8. Periodic handling of rotated rectangle angles. Direct subtraction leads to jumps (left), while wrapped difference maintains continuity (right).
IoU improvement distribution: Figure 9 shows the histogram and box plot of candidate box IoU improvement ( IoU). Among all 3,200 real-machine candidates, 1,467 improved, 75 worsened, and 1,658 remained unchanged (mostly abstention boxes from observation failure), with an average improvement of +0.081. Among the 2,332 successfully updated candidates, the average improvement is +0.111, and the median improvement is +0.121. For the 126 high-confidence candidates with original confidence 0.5, the average improvement is +0.121, and the worsening ratio is extremely low (only 10).
Candidate localization: complete distributions, including failures
(a) All TEST candidates (n=3200)

(b) Updated candidates (n=2332)

(c) Updated, original score 0.5 (n=126)
(d) Baseline and SKG IoU


Each candidate keeps its baseline maximum-IoU same-image/class GT. All low-score duplicates are retained. Green: improved; gray: tied within 1e-6; red: worsened. Full [-1,1] range; 1.5 IQR whiskers. Candidates are not unique objects or AP.
Figure 9. IoU distribution of real-machine candidate boxes and IoU box plot of baseline/SKG.
3.7 Sources of Advantage
-
Physical geometric prior does not depend on network features: SKG energy is entirely driven by hierarchical physical contours. When the detector collapses in the real-machine domain due to feature mismatch, the energy flow can still work. This is the fundamental reason for cross-domain fallback.
-
Robustness of hierarchical extraction: Through the four-level mechanism of "local validation → multi-channel Otsu → GMM-GrabCut graph cut → abstention," the success rate of contour extraction under complex backgrounds, weak contrast, and uneven illumination is greatly improved.
-
Angular continuity wrapped difference: Completely solves the jump problem of the energy flow in angle dimension computation, preventing the correction process from becoming "reverse optimization."
-
Huge gains in high-precision intervals: The real-machine AP75 improvement of 40.29 points shows that the physical fallback has the most significant rescue effect on strict localization (high IoU).
3.8 Limitations
• Real-machine test has only 32 images, limited sample size.
• The degree of domain shift between simulation dev and real-machine test is not quantified.
• Although hierarchical contour extraction is powerful, it still relies on a certain degree of foreground/background separability. In extreme cases such as complete color similarity between target and background, or severe occlusion, incorrect contours may be extracted, leading to very few negative updates (as shown in Figure 5(f), where IoU 0.803 degrades to 0.394).
• This case uses the unit metric . The value of the pulled-back metric can only potentially emerge under the Fisher objective metric; this case does not implement Fisher.
4 Case 3: Sequence Modeling sine→square
4.1 Objective
To validate the OOD generalization of SKG under distribution shift. Train on sine, test on square; both share frequency and amplitude ranges but have different waveform structures.
4.2 Applied SKG Theory
• Energy decomposition (H, S): The energy is a sum of four terms, each contributing a different geometric shape in the 16-dimensional latent space. Their superposition forms the complete "energy landscape":
-
quad : A parabolic bowl centered at the origin. It serves as the global bowl bottom, ensuring z is bounded and energy monotonically increases far away.
-
bound : A quartic wall outside radius . It provides a hard boundary, where energy steeply increases outside the sphere, confining the evolution within the ball.
– mlp MLP(|z|): Even-symmetric arbitrary undulations. It creates local minima, saddle points, and ridges—the main "terrain details".
– spec w SpecMLP(|rfft(Wz)|): Undulations along the spectral direction. It makes the landscape sensitive to the spectral structure of the signal and is the only term that can possibly "recognize the square wave" during OOD.
• Overall landscape shape: Three layers can be seen: the outer layer (quad + bound) forms a finite-depth bowl (conservative, isotropic); the middle layer (mlp) carves multiple local minima at the bottom (task-relevant, shaped by trajectory training); the inner layer (spec) adds undulations along the spectral direction (anisotropic, sensitive to specific directions).
• Evolution in the landscape: Inference is a 10-step gradient descent . The starting point falls inside the bowl, and each step moves along , with the metric converting gradients into velocity. Backtracking search ensures energy does not increase at each step. After 10 steps, it stops near a local minimum, where the decoder reads .
• Three-stage training: Trajectory cold start → weak-form residual fine-tuning of metric+energy → trajectory alignment of decoder.
• Weak-form residual training: Simpson local integration.
4.3 Parameter Settings
| Component | Form | Parameter Count |
| State | Encoder MLP(24→64→16) | ~1.7K |
| Metric (g) | , rank 4 | ~1.8K |
| Energy () | quad + bound + mlp + spec | ~5.5K |
| Step size | ~500 | |
| Evolution | 10-step explicit evolution + 3 backtracking | — |
| Decoder | Linear layer | 17 |
| Total | 9,489 |
Three stages:
| Stage | Training Object | Loss | Epoch |
|---|---|---|---|
| A | encoder + metric + energy + decoder + | Trajectory loss | 100 |
| B | metric + energy + | Weak-form residual (Simpson) | 100 |
| C | decoder | Trajectory loss | 50 |
Data: Window 24, frequency 0.1, noise 0.05. Train 3000 single windows + 1000 trajectories, validation 500, ID test 500, OOD test 500.
4.4 Baseline Comparison Protocol
-
Same data split (3000 single windows training, 500 validation, 500 ID test, 500 OOD test).
-
Comparison: 1-layer Transformer, d_model 32, 11,617 parameters.
-
Metrics: ID MSE, OOD MSE, OOD/ID.
-
Paired t-test, 5 seeds.
4.5 Results and Inference Budget Analysis
Quantitative comparison (mean of 5 seeds):
| Metric | SKG | Transformer |
|---|---|---|
| ID MSE | ||
| OOD MSE | ||
| OOD/ID |
Inference budget diagnostic (internal evolution steps with frozen weights): Under the premise of freezing network weights, we varied the number of internal evolution steps during SKG inference (1 to 10) and observed its impact on OOD MSE (Figure 10). With only 1-step inference, OOD MSE is 0.031776; with the preset 10-step inference, OOD MSE decreases to 0.029577. This indicates that the geometric evolution mechanism during inference itself brings additional generalization gain, and this gain smoothly accumulates with increasing evolution steps.
Sine → square: inference-budget diagnostic

Five seeds (42–46), 500 OOD windows each. Shading: population SD across seeds. SKG checkpoints trained with 10 updates. Transformer evaluated once; horizontal line is a reference.
Figure 10. Effect of the number of internal evolution steps in SKG on OOD MSE (frozen weights). The one-pass reference line of Transformer serves as a horizontal baseline. Shading is the standard deviation across 5 seeds.
Multi-seed paired distribution: Figure 11 shows the OOD MSE distribution and box plot of 5 paired seeds (42–46). SKG-CM (green box) outperforms Transformer (orange box) on all 5 seeds, and the paired lines (gray lines) consistently slope upward to the right, indicating that Transformer’s error is significantly higher on every seed.
Sine → square: all five paired runs

Boxes: median and IQR; whiskers: IQR. Every seed is shown, including outliers. Same supervised windows; SKG additionally uses 1,000 training trajectories. No seed selection.
Figure 11. OOD MSE distribution of five paired seeds. The box represents the IQR, and the whiskers are IQR, showing all seed data (including outliers).
Parameter efficiency comparison: Figure 12 shows the relationship between model parameter count and OOD MSE. SKG-CM achieves an average OOD MSE of 0.0296 with 9,489 parameters, while Transformer uses 11,617 parameters with an average OOD MSE of 0.0641. SKG reduces OOD error by 54% while using 18.3% fewer parameters.
Sine → square: parameter count and OOD error

Dots: all five seeds. Diamonds: mean. Error bars: population SD. Counts verified against checkpoints. Two fixed architecture budgets; this comparison does not establish a full Pareto frontier.
Figure 12. Relationship between total parameters (logarithmic horizontal axis) and OOD MSE. Dots are single-seed results, diamonds are means, and error bars are population standard deviations.
Paired t-test: ID ; OOD , mean difference -0.034520.
4.6 Sources of Advantage
-
Evolution structure (multi-step buffering): Under fixed weights, increasing inference evolution steps from 1 to 10 reduces OOD MSE from 0.031776 to 0.029577. Each evolution step is constrained by the metric/energy landscape, and the shift in the latent space during OOD is buffered by the dynamical structure.
-
Energy landscape prior for the square wave: The spectral prior (spec term) is the only explicit component sensitive to the spectrum, detecting the odd harmonics of the square wave through the spectral MLP and altering the local shape of the landscape near the square wave's starting point. This is likely one of the reasons SKG does not degrade on OOD—the landscape itself "knows" the waveform has changed.
-
Alignment loss: Landscape alignment and state direction alignment provide additional gradient signals.
-
Limited marginal contribution of metric: The OOD of the position-dependent metric and the Identity metric are almost identical (0.0244 vs 0.0243). Under the condition that the window covers only 2.4% of the period, the OOD advantage mainly comes from evolution structure + energy landscape prior + alignment loss.
-
High parameter efficiency: With fewer parameters (9.5K vs 11.6K), it achieves lower OOD error and higher stability on all 5 seeds.
4.7 Limitations
• Energy minima do not correspond to the task ground truth: Validation shows that at the true state , the gradient and the Hessian has negative eigenvalues; is not a local minimum. Therefore, the decoder learns to map from the landscape's local minima to y, not from the true value to y. The landscape is self-consistent (evolution reaches a minimum, energy decreases), but the semantic meaning of the minima is learned, not physically given.
• Paired t-test for OOD .
• SKG has fewer parameters than Transformer but 1000 more trajectories in training data.
-
The OOD MSE of seeds 45 and 46 are 0.0337 and 0.0433 respectively, and seed 42 is 0.0207 (see Figure 11).
-
Figure 12 is only a comparison of two fixed architecture budgets and does not represent the Pareto frontier at arbitrary parameter scales.
5 Case 4: Molecular Dynamics MD17
5.1 Objective
To validate the OOD generalization of SKG on second-order Newtonian dynamics and compare two types of parameterization: potential energy residual and trajectory residual. Given two consecutive frames of atomic positions, predict future 10/50/100 step trajectories.
5.2 Applied SKG Theory
-
Energy decomposition : . is the frozen known physics [2], and is the residual potential energy to be learned.
-
Learning decoupling: MACE is frozen (millions of parameters), and the only training object is (approximately 3K parameters).
-
Zero initialization: The last layer weights are zeroed; before training, , strictly degenerating to the MACE-Cart baseline.
-
Strong-form residual training: The training objective is force residual MSE.
5.3 Parameter Settings
Potential energy residual:
| Component | Configuration |
|---|---|
| Baseline | MACE-OFF23 medium (frozen) |
| Residual network | Conservative Residual EGNN |
| Hidden dimension | 64 |
| Layers | 3 |
| RBF count | 32 |
| Cutoff radius | 5.0 Å |
| Trainable parameters | ~3K |
| Zero initialization | Yes |
| Training objective | Force residual MSE |
| Optimizer | AdamW, lr , cosine annealing to |
| Batch size | 8 |
| Epochs | 100 |
Trajectory residual proxies:
| Method | Structure | Parameters | Training Objective |
|---|---|---|---|
| ESTAG-res | Temporal graph network + equivariant message passing | 478,622 | |
| ATOM-res | Global neural operator | ~1M | Same as above |
| GSE-res | Velocity field integration | — | Same as above |
All trajectory residuals share: 500 training frames, 100 epochs, AdamW, , batch=4, identical MACE-Cart frozen baseline.
Data: MD17 Aspirin, NVT 500K, dt=0.5fs. Train 500, validation 100, ID 100, OOD 100.
5.4 Baseline Comparison Protocol
-
All methods use the same split files, the same anchor frames, and the same 50/100 frame generation history.
-
Input: Two frames of historical coordinates + atomic numbers.
-
Output: Future -step trajectory.
-
Metrics: ADE (per-atom average displacement error), FDE (per-atom final displacement error).
-
Checkpoint is selected solely by validation set ADE@10.
External baselines:
| Baseline | Parameters | Source |
|---|---|---|
| ESTAG [3] | 7,799 | NeurIPS 2023 |
| GSE-Flow [4] | 25,208 | ICML 2026 |
| GF-NODE [5] | 531,986 | TMLR 2025 |
| ATOM [6] | 3,557,830 | ICLR 2026 |
| MACE-Cart | 0 (frozen) | Reference baseline |
5.5 Results
External baseline comparison (ID, ADE unit Å):
| Model | Parameters | @10 | @50 | @100 |
|---|---|---|---|---|
| SKG Potential Residual | ~3K | 0.003853 | 0.017989 | 0.028546 |
| ESTAG | 7,799 | 0.006718 | 0.065849 | 0.146704 |
| MACE-Cart | 0 | 0.006710 | — | — |
| GF-NODE | 531,986 | 0.037661 | 0.145711 | 0.219097 |
| GSE-Flow | 25,208 | 0.037954 | 0.223124 | 2.761314 |
| ATOM | 3,557,830 | 0.068298 | 0.718328 | 1.152361 |
External baseline comparison (OOD, ADE unit Å):
| Model | @10 | @50 | @100 |
|---|---|---|---|
| SKG Potential Residual | 0.004144 | 0.018740 | 0.031575 |
| ESTAG | 0.006977 | 0.063881 | 0.141094 |
Improvement relative to the second-best baseline (ESTAG): ID @10 -42.6%, ID @100 -80.5%, OOD @10 -40.6%, OOD @100 -77.6%.
Long-horizon error accumulation trend: To intuitively demonstrate the stability of different methods in long-horizon prediction, we plotted the relationship between prediction steps and cumulative ADE error (Figure 13). Under both ID and OOD splits, the errors of end-to-end methods (GSE-Flow, ATOM) exhibit exponential explosive growth with prediction steps. In contrast, the error curve of the SKG potential residual (SKG V23) maintains an extremely gentle linear growth within 100 steps, and at @100 steps its error is two orders of magnitude lower than GSE-Flow. This indicates that the physical constraint based on local force residuals successfully suppresses error accumulation in autoregressive prediction.
MD17 Aspirin | Forecast error over 100 steps (50 fs)

ADE averages every future step and all 21 atoms. Step 0 has zero error and is omitted on log Y. Adapted baseline protocols; unequal pretraining/budgets. One seed; dependent windows. Finite-horizon evidence only.
Figure 13. Cumulative ADE forecast error curve of MD17 Aspirin within 100 steps (50 fs). The left panel is ID data, and the right panel is OOD data. The vertical axis is on a logarithmic scale. End-to-end baselines (e.g., GSE-Flow) diverge catastrophically in long-horizon forecasting, while the SKG potential residual remains stable.
Potential residual vs. trajectory residual proxies: To isolate the impact of "residual type" on prediction, we constructed trajectory residual proxy networks based on the same frozen MACE-Cart baseline and compared them with the potential residual (Figure 14).
MD17 Aspirin | Potential and coordinate residuals

Common frozen MACE baseline. ESTAG-res / ATOM-res are supplied simplified proxies, not official implementations. Objectives, architectures and rollout policies differ: these bars do not isolate a causal effect of residual type.
Figure 14. Comparison of cumulative ADE between potential residual and trajectory residual proxies at @10, @50, and @100 steps. The potential residual directly constrains local forces and outperforms the trajectory residual proxies that constrain global displacement across all time horizons.
Note: ESTAG-res / ATOM-res in the table are trajectory residual proxies constructed in this paper, not the official implementations of ESTAG / ATOM; the parameter count differences arise from the proxy structures and cannot be directly compared with official baselines.
Potential residual vs. trajectory residual (ID):
| Method | Parameters | @10 | @50 | @100 | Relative to Potential @10 | @100 |
|---|---|---|---|---|---|---|
| Potential Residual | ~3K | 0.003853 | 0.017989 | 0.028546 | — | — |
| ESTAG-res | 478,622 | 0.004567 | 0.024961 | 0.040293 | +18.5% | +41.2% |
| ATOM-res | ~1M | 0.004591 | 0.025167 | 0.040385 | +19.2% | +41.5% |
| MACE-Cart | 0 | 0.006706 | 0.028402 | 0.043124 | +74.0% | +51.0% |
Potential residual vs. trajectory residual (OOD):
| Method | @10 | @50 | @100 |
|---|---|---|---|
| Potential Residual | 0.004144 | 0.018740 | 0.031575 |
| ESTAG-res | 0.005046 | 0.025979 | 0.042990 |
| ATOM-res | 0.005502 | 0.026796 | 0.043456 |
| MACE-Cart | 0.006763 | 0.029043 | 0.045503 |
Advantage expands with rollout length: @10 -15.6%, @50 -27.9%, @100 -29.2% (ID, versus ESTAG-res).
3D trajectory visualization: Figures 15 and 16 show the atomic motion trajectories of a typical anchor (anchor 159799) on the OOD test set over 100 steps.
MD17 Aspirin | 100-step atom paths · 3D
-- Ground truth —— SKG V23 —— GSE-Flow (end-to-end)
(a) Full extent · all three trajectories

(b) Molecule scale · GT + V23 only

OOD anchor 159799 (first listed; fixed before scoring). All 21 atoms, 0–50 fs. Dots mark step 100.
This anchor: ADE@100 V23 = 0.0249 Å; GSE-Flow = 3.4766 Å.
Equal Cartesian units; one fixed initial origin. Panel (a) includes the entire GSE-Flow path; panel (b) omits it for detail.
Schematic initial bonds from the first training frame. Posthoc visualization; no trajectory alignment or coordinate exaggeration.
Figure 15. 3D visualization of 100-step atomic paths (dashed line is ground truth GT, green line is SKG V23, red line is GSE-Flow). Subplot (a) shows the full extent, and subplot (b) focuses on the molecular scale.
MD17 Aspirin | 100-step atom paths · XY projection
-- Ground truth SKG V23 GSE-Flow (end-to-end)
(a) Full extent · all three trajectories

(b) Molecule scale · GT + V23 only
OOD anchor 159799 (first listed; fixed before scoring). All 21 atoms, 0–50 fs. Dots mark step 100.
This anchor: ADE@100 V23 = 0.0249 Å; GSE-Flow = 3.4766 Å.

X (Å)
Equal Cartesian units; one fixed initial origin. Panel (a) includes the entire GSE-Flow path; panel (b) omits it for detail. Schematic initial bonds from the first training frame. Posthoc visualization; no trajectory alignment or coordinate exaggeration.
Figure 16. XY projection visualization of 100-step atomic paths.
It is clearly visible from the visualization results that, due to the lack of physical law constraints, the end-to-end method (GSE-Flow) rapidly collapses in long-horizon autoregressive prediction, with predicted atomic positions completely flying out of the true molecular motion range. In contrast, the SKG potential residual, through the base physical constraints provided by the frozen MACE and paired with small residual corrections, makes the generated trajectory still highly coincident with the true physical trajectory after 100 steps (50 fs).
5.6 Sources of Advantage
-
Energy decomposition: , known physics frozen, only residual learned.
-
Learning decoupling: The only learning object is (approximately 3K parameters), which is 1/160 of the parameter count of the trajectory residual proxies.
-
Zero initialization: Before training, it strictly degenerates to MACE-Cart, and the gain clearly comes from residual correction.
-
Potential residual vs. trajectory residual: The potential residual directly constrains forces (local quantities), while the trajectory residual constrains displacement (propagated quantities). The potential residual outperforms the trajectory residual on all 6 metrics, with the advantage expanding as rollout increases, and the validation→test degradation is small (2.7% vs 22.8%).
-
Long-horizon advantage: The benefits of residual correction accumulate with rollout length. End-to-end methods learn the entire dynamics from scratch, and insufficient training data (500 samples) leads to long-horizon divergence.
5.7 Limitations
• The unified adaptation protocol is not equivalent to the original MD17 protocols of each paper.
• OOD is a time-split label and does not independently prove out-of-domain molecular generalization.
• Single seed (42). Multi-seed paired t-test to be supplemented.
-
The residual potential is implicitly learned by EGNN and is not explicitly parameterized as a function of task invariants.
-
The trajectory residuals are simplified proxy networks and are not equivalent to the official implementations of ESTAG / GSE-Flow / ATOM.
-
GSE-res did not converge (0.006728 ≈ MACE-Cart 0.006706) and is not used as a basis for comparison with GSE-Flow.
-
ID/OOD are given time-split labels; the target window has 11 overlapping frames (13 frames including historical input).
-
Whether MACE pre-training overlaps with MD17 Aspirin configurations is unknown.
6 Cross-Case Summary
| Dimension | Case 1 | Case 2 | Case 3 | Case 4 |
|---|---|---|---|---|
| Domain | Scientific ML | Industrial Vision Sim-to-Real | Sequence Modeling | Molecular Dynamics |
| Dynamics | Second-order dissipative | First-order dissipative | First-order gradient flow | Second-order Newtonian |
| Paradigm | Three-stage A/B/C | Unit metric + energy alignment | Three-stage A/B/C | Known metric (mass matrix) |
| Evidence Strength | Relatively Strong | Moderate | Weak | Moderate |
| Pre-validation | Three criteria passed | Physical contour driven | Passed | Implicit |
| Task Invariant () | Gaussian kernel potential | Boundary energy (hierarchical contour) | Spectral prior | E(3) equivariant |
| Residual Loss | Weak-form + ridge | — | Weak-form (Simpson) | Strong-form force residual |
| Key Gain | OOD reduced 1.69–4.12×; Metric joint contribution | Real mAP +24.00 points (single-run, point estimate), AP75 +40.29 points | OOD 54% lower ( 0.024) | ADE -42.6% (@10), -80.5% (@100) |
Common Operating Chain:
-
Pre-validation: Three criteria for invariants, metric health, energy dual criteria;
-
Task invariant construction: Anchor energy extrema to task ground truth;
-
Three-stage training: Separate metric/energy learning from task alignment;
-
Residual training: Local constraints replace trajectory propagation.
7 Methodology: Pre-validation
7.1 Why Pre-validation is Needed
SKG inference relies on three components: invariants, metric, and energy. If any component fails, the downstream flow heads toward the wrong target. Pre-validation checks the three components before training.
7.2 Three Criteria for Invariants
| Criterion | Test | Passing Score |
|---|---|---|
| Truly invariant | Apply 24 transformations to the OOD transformation group, compute relative change rate | mean < 0 |
| Non-trivial | Variance of each dimension | |
| Non-redundant | Cov condition number, inter-dimensional correlation | Condition |
Testing framework: 24 transformations (translation 5, scaling 4, rotation 4, brightness 4, contrast 4, noise 2, background replacement 1), computing the relative change rate of with respect to the baseline for each transformation.
Design principles:
-
Geometric invariants take priority (Hu moment combinations, det, etc.);
-
Low-order statistics take priority (above third order amplifies boundary changes);
-
Soft masks take priority over hard masks;
-
Separate scale quantities from invariants (scale2, log_ar, log_area grouped separately).
7.3 Metric Health Criteria
| Criterion | Test | Passing Standard |
|---|---|---|
| Condition number | ||
| Directional stability | Direction cosine when metric changes | |
| Full rank |
7.4 Energy Dual Criteria
Criterion 1: Additional information:
\text{orth_ratio}=\frac{\|\nabla S-\operatorname{proj}_{J^{\top}}(\nabla S)\|}{\|\nabla S\|}>0.5. \tag{5}Criterion 2: Extrema aligned with task ground truth:
and the ground truth should be a local optimum of the energy. Diagnostic method: Perform a local grid scan near the ground truth and count the proportion of grids where the ground truth is the energy minimum.
7.5 Checklist
Invariants: Variance of each dimension ; mean , max for 24 transformations; Cov condition number ; J_z rank = D_INV; scale features grouped separately.
Metric: Condition number ; directional cosine ; J_z full rank.
Energy: orth_ratio ; task gradient cosine ; the proportion of ground truth being the energy minimum on the local grid is significantly higher than random; parameter count data volume.
It is recommended to proceed to training only after all three items pass; if not passed, diagnose the cause first. Thresholds are diagnostic signals, not hard constraints. In Case 1, the parent model condition number exceeds the recommended threshold but still achieves good OOD results.
8 Methodology: Task Invariants Construction
8.1 Division of Labor Between Two Types of Invariants
| Invariant Type | Function | Invariant To | Used For |
|---|---|---|---|
| Metric invariant () | Construct metric | Geometric group action | |
| Task invariant () | Construct energy | Task-related nuisance |
The two can be independent and need not be correlated.
8.2 Construction Steps
-
List task-related nuisances: brightness, contrast, color, texture, background;
-
For each nuisance, design features invariant to it;
-
Check whether the task invariant is sensitive to the task signal;
-
Use task invariants or task-related geometric priors to construct energy. The specific form is adjusted according to the task: Case 1 uses kernel potential energy, Case 2 uses image physical contour, Case 3 uses spectral prior, Case 4 uses E(3) equivariant structure (implicit; explicit task invariants to be validated).
8.3 Candidate Constructions
| Nuisance | Task Invariant |
|---|---|
| Brightness | Relative brightness, local contrast normalization |
| Contrast | Normalized gradient, structure tensor |
| Color | Lab chromaticity, chromaticity normalization |
| Texture | Low-frequency structure, multi-scale pyramid |
| Background | Center-surround contrast, saliency |
8.4 Sources of Advantage and Theoretical Support
Task invariants can improve OOD because they anchor the energy extrema to the task ground truth. Proposition (Energy Alignment Premise): Let the minimum of the residual loss correspond to energy . If the minimum of is not at the task ground truth, then regardless of the metric used, the endpoint of finite-step optimization is not guaranteed to improve the task metric. The choice of metric only affects convergence speed and basin of attraction, not the location of the minimum. Task invariants construct the energy as a function invariant to nuisances, so that the energy extrema do not drift under OOD transformations.
9 Methodology: Three-Stage Training
9.1 Paradigm Selection
| Condition | Paradigm | Applicable Scenario |
|---|---|---|
| Metric objectively determinable | Stage 0/1/2 | Mass matrix known, Fisher estimable |
| Metric needs learning | Stage A/B/C | Nyström dissipation, sequence model |
| Metric uses unit/simplified engineering form | Unit metric + energy alignment | Case 2: Sim-to-Real, focus on energy |
9.2 Paradigm 1: Stage 0/1/2
| Stage | What to Do | Training Object | Frozen | Uses flow | Uses energy |
|---|---|---|---|---|---|
| 0 | Train invariant head | Detector/System | No | No | |
| 1 | Statistical estimation | None (statistical) | All | No | No |
| 2 | Train energy + decoder | energy, decoder | frozen | Yes | Yes |
Stage 0: Train only , supervised with transformation pairs, no task labels, no flow.
Stage 1: Sample sufficient , remove dimensions with variance , confirm condition number , save mean and . No training, no flow, no energy.
Stage 2: Load and freeze , train only the decoder for the first 2 epochs with learning rate or lower, EMA smooths OOD gain.
9.3 Paradigm 2: Stage A/B/C
| Stage | Training Object | Loss | Purpose |
|---|---|---|---|
| A | encoder + metric + energy + decoder + | Trajectory loss | Cold start |
| B | metric + energy + | Residual loss | Fine-tune metric and energy |
| C | decoder | Trajectory loss | Align to task metric |
Stage A: Trajectory loss cold start. All components are not yet working; trajectory loss provides global guidance. The number of training epochs should not be too large.
Stage B: Residual loss fine-tunes metric + energy + , with encoder and decoder frozen. The condition number of the residual loss is not amplified by Lyapunov (Theorem 10.1), the number of constraints is sufficient (Theorem 10.2), and OOD has an upper bound (Theorem 10.3). When observation noise is large, use the weak form (Theorem 10.4).
Stage C: Trajectory loss aligns the decoder; other components are frozen.
9.4 Common Core
The training of the metric/energy cannot be mixed with the task alignment of the decoder.
-
Paradigm 1: Metric is frozen by Fisher; Stage 2 trains only energy + decoder; the decoder is trained separately for the first 2 epochs.
-
Paradigm 2: Stage B trains metric + energy (residual loss); Stage C trains decoder (trajectory loss); the two are strictly separated.
10 Methodology: Residual Training and Supporting Theorems
This section establishes the theoretical support behind the engineering operations. It should be noted that the four theorems and one proposition are independent theoretical analyses proposed in this paper regarding "why residual training is superior to trajectory training" and "how to choose between strong and weak forms," providing rigorous mathematical justification for the three-stage training paradigm in Section 9.
10.1 Three Types of Losses
True dynamics . Parameterization . Error field . Training data: trajectories, each with time points, state dimension . This fitting of trajectory data has been deeply studied in system identification [7] and neural differential equations [8], but traditional methods easily face gradient ill-conditioning [9].
Trajectory loss:
Strong-form residual loss:
Weak-form residual loss: Test function , local support length . This form is consistent with the ideas of weak-form variants of PINN [10] and the Deep Ritz method [11]:
Structural distinction:
| Loss | Jacobian | Contains state transition | Amplified by Lyapunov |
|---|---|---|---|
| Trajectory | Yes | Yes | |
| Strong-form residual | No | No | |
| Weak-form residual | No | No |
Lyapunov amplification only occurs in the trajectory loss. The residual loss is local and does not propagate along the trajectory.
10.2 Theorem 10.1 (Condition Number Dichotomy)
Assumptions A1–A4:
-
A1: Maximum Lyapunov exponent on the training trajectory ;
-
A2: ;
-
A3: has nonzero components in both the expanding subspace and the contracting subspace ;
-
A4: , and in some direction .
Theorem 10.1 (Condition Number Dichotomy). Under A1–A4, there exist independent of :
Proof sketch. Step 1 (lower bound): By A3, there exists such that has a nonzero component in , amplified along the flow by . Integration yields . Step 2 (lower bound non-cancellation lemma): By A3, there exists whose component is in , contracted by , so the integral is bounded. The amplified and contracted terms cannot cancel each other. Step 3: Condition number ratio . Step 4: or , condition number bounded by A4.
Boundary: Only holds for ; does not hold for purely contracting systems.
Corollary: Under the same parameterization, the optimization difficulty of trajectory loss is amplified by relative to residual loss. This is the direct reason for using residual loss to fine-tune metric+energy in Stage B.
10.3 Theorem 10.2 (Constraint Count Dichotomy)
Theorem 10.2 (Constraint Count Dichotomy). Let the parameter dimension be P, train M trajectories, each with time points, and state dimension d.
• Trajectory loss provides at most Md independent scalar constraints;
• Strong-form residual loss provides at most ;
• Weak-form residual loss provides at most .
Corollary: If , trajectory loss is underdetermined and residual loss is identifiable; and .
Proof. By the Jacobian rank upper bound , the null space dimension is .
Numerical values for this system: (Nyström), , , . .
Boundary: is an upper bound; time points are strongly correlated, so the actual effective constraints are smaller. But the conclusion that trajectory loss is underdetermined when is unaffected.
10.4 Theorem 10.3 (OOD MSE Dichotomy)
Assumptions C1–C5:
• C1 (Coverage): There exists through which both training and OOD trajectories pass within ;
• C2 (Hyperbolic): The maximum Lyapunov exponent of on is ; is the minimum Lyapunov exponent in the contracting direction (absolute value);
• C3 (Small residual): ;
• C4 (Trajectory fitting): ;
• C5 (Lipschitz): .
Theorem 10.3 (OOD MSE Dichotomy). (i) (Upper bound of residual loss) Under C1–C3:
(ii) (No upper bound for trajectory loss) Under C1–C2, C4–C5, there exists c > 0 independent of :
C4 does not constrain , so this lower bound may be arbitrarily large.
(iii) (Corollary) If , then .
Proof. (i) Variational equation , solution . Taking norms, by C2 and C3, . Squaring and taking expectation yields (i).
(ii) Let . There exist OOD initial conditions such that the trajectory passes through the point where is maximal, and the contribution of that point is amplified by . By C5 and hyperbolicity, there exists such that . C4 only constrains the training endpoint, not the sup norm of , so is unbounded.
Constructive counterexample: , . The training trajectory is small. Minimizing the trajectory loss gives , which is insensitive to the direction . For OOD , . The residual loss constrains itself on , so , and .
Applicable boundaries:
• The "controllable upper bound" condition of (i): The upper bound contains ; "controllable" requires not to be too large; when is large or is large, the upper bound may still be very loose. If C1 does not hold (OOD trajectories do not pass through ), the upper bound does not hold.
• (ii) is a constructive lower bound: It shows that trajectory loss can be arbitrarily large, not that it necessarily is.
• in C2 is a necessary condition for Lyapunov amplification.
• C4 only constraining the endpoint is the root cause of trajectory loss "not constraining g"; if changed to multi-step trajectory MSE, the lower bound weakens.
10.5 Theorem 10.4 (Numerical Differentiation Error Dichotomy)
Assumptions: Observation noise , step size . Strong-form residual requires k-th order difference , weak-form test function is k-times differentiable.
Theorem 10.4 (Numerical Differentiation Error Dichotomy).
As , the strong-form condition number grows as , while the weak form is independent of .
Proof. The strong-form residual contains numerical differentiation , amplifying noise by ; for second-order differences, amplification is . Weak-form integration by parts transfers the derivative to , with noise amplification , independent of .
Per-window boundary: The global condition number of the weak form is determined by the number of windows and inter-window coupling; when is finite and windows do not overlap, the global condition number is approximately the single-window condition number , independent of .
Relationship with existing work: This is a reorganization of standard conclusions from weak-form PINN literature such as VPINN, WAN, and Deep Ritz [10, 11]; the increment of this paper is connecting "avoiding numerical differentiation errors" with SKG residual theory and providing per-window analysis.
10.6 Proposition 10.5 (Energy Alignment Premise)
Let the minimum of the residual loss be , corresponding to energy . If the minimum of is not at the task ground truth, then regardless of the metric used (unit, pullback, Fisher), the endpoint of finite-step optimization is not guaranteed to improve the task metric. The choice of metric only affects convergence speed and basin of attraction, not the location of the minimum.
Proposition 10.5 (Energy Alignment Premise). Proof. The optimization endpoint is determined by . The minimum satisfies , independent of . only changes the path to the minimum. If the minimum itself deviates from the task ground truth, all converge to the same wrong target.
Implication: The metric is an amplifier, but an amplifier needs a correct target. Theorems 10.1–10.4 explain "why use residuals instead of trajectories"; Proposition 10.5 explains "the limitation of metric choice under the same residual." In Case 2, the goal in the real-machine domain is to "use the physical contour to pull the collapsed box back," and this goal itself is correct, so the energy flow can work; the reason Case 2 uses the unit metric rather than the pullback metric in the real-machine domain is that the pullback metric has no stable advantage under the simplified engineering form of this case, while the computational overhead of the unit metric is much smaller.
10.7 Operational Choice Between Strong and Weak Forms
| Condition | Choice | Reason |
|---|---|---|
| Low observation noise | Strong form | Directly constrains residual, simple |
| High observation noise | Weak form | Avoids numerical differentiation error (Theorem 10.4) |
Operational steps for the weak form:
-
Select test function , local support length ;
-
Compute weak-form residual: ;
-
Use Simpson or midpoint numerical integration;
-
Optimize with LBFGS;
-
Add ridge regularization () to ensure numerical stability.
11 Methodology: Variable Projection Interpretation of Three-Stage Training
11.1 Positioning
This is an explanatory framework, not strictly equivalent. Three-stage training can be explained by block variable projection and residual reducibility; this is approximate analysis, not a strict theorem.
11.2 Block Structure of the Joint Objective
Let the encoder parameters be , metric+energy parameters be , and decoder parameters be . Joint objective:
Key block structure:
- appears in both losses;
• is a nonlinear function of ;
• appears only in the residual;
• appears only in the trajectory.
11.3 Variable Projection
Write as implicit functions of :
The outer layer optimizes only over : . Advantage: and are no longer updated simultaneously, avoiding chasing a moving target when changes.
11.4 Three Stages are Block Approximations of Variable Projection
Stage A: Near the initial values of , optimize simultaneously with . Mathematical role: allow to acquire dynamical structure and fall near the function class of .
Stage B: Fix , solve
and are constants, so the residual is a standard regression with respect to .
Stage C: Fix , solve
is fixed, and the subproblem is convex.
The three subproblems are each well-defined, corresponding to Gauss–Seidel block coordinate descent.
11.5 Coordinate Conditions for Residual Reducibility
The minimum of the residual:
where is the orthogonal projection onto the function class of . This lower bound depends on the distance between and , and is determined by .
Mathematical role of Stage A: requires to be predictable, which forces to be consistent with the dynamics of . Formally, if Stage A converges to a local minimum of , then
i.e., the distance between and is . The lower bound of the residual drops from "energy of high-frequency differences" to .
In the observation of Case 3, the residual of Stage B can converge to the order, consistent with the explanation that "the coordinates have made reducible"; this is not a universal guarantee.
11.6 Why Alternating is More Stable Than Joint Optimization
The two losses of the joint objective have different gradient directions with respect to :
• : propagates through , pointing to the "trajectory endpoint pair";
• : directly points to the "velocity field pair."
The two conflict on . Joint optimization is Jacobi iteration, with both gradients updating simultaneously, which may oscillate. Three stages are Gauss–Seidel iteration: after fixing , the gradient of with respect to is no longer interfered with by ; after fixing , the gradient of with respect to is no longer interfered with by the residual.
Convergence condition of block coordinate descent: The Hessian of the subproblems is approximately block diagonal. This is approximately satisfied under weak inter-block coupling; the block structure of the three stages exhibits this characteristic in the cases.
11.7 Boundaries
-
Residual reducibility is approximate: is a first-order approximation and does not hold when is large;
-
Block diagonal Hessian is an assumption: Gauss–Seidel convergence requires the subproblem Hessian to be approximately block diagonal; in practice, there may be inter-block coupling;
-
Variable projection is approximate: Three stages are block approximations, not exact variable projection;
-
The convergence quality of Stage A determines the upper bound of Stage B: If Stage A does not bring near , the residual lower bound of Stage B will be large.
12 Conclusion
This paper presents the engineering implementation methods of the SKG inference framework. Four-step operating chain: Pre-validation → Task invariant construction → Three-stage training → Residual training. Complete configurations, protocols, and results are provided for four domains:
• Case 1: OOD MSE is 1.69–4.12 times lower than the best neural baseline; potential energy is the primary source of gain; controlled metric ablation shows a -order joint contribution of state-dependent dissipation relative to the constant baseline, but parameterization mismatch destroys the gain.
• Case 2: Simulation training, real-machine testing; when the detector collapses, the SKG physical energy flow raises real-machine mAP from 0.2564 to 0.4964 (+24.00 points, single-run experiment, 32 images, point estimate), AP50 to 0.8432 (+17.02 points), and AP75 from 0.1736 to 0.5765 (+40.29 points), without real-machine retraining. The energy flow is entirely driven by the image's physical contour, independent of the failed network features; angular wrapped difference solves the periodicity problem of rotation angles; IoU gating protects reliable in-domain predictions.
• Case 3: OOD MSE 0.0296 vs Transformer 0.0641, with 18.3% fewer parameters.
• Case 4: ID@100 ADE 0.0285 vs ESTAG 0.1467; the potential residual outperforms the trajectory residual proxies on all 6 metrics, with 1/160 of the parameter count, and validation→test degradation of 2.7% vs 22.8%.
The methodology is supported by four theorems: Condition Number Dichotomy (Theorem 10.1) explains why trajectory loss has an exponentially amplified condition number in systems with positive Lyapunov exponents; Constraint Count Dichotomy (Theorem 10.2) explains why trajectory loss is underdetermined while residual loss is identifiable; OOD MSE Dichotomy (Theorem 10.3) explains why residual loss has a controllable upper bound while trajectory loss does not; Numerical Differentiation Error Dichotomy (Theorem 10.4) explains why the weak form bypasses the numerical differentiation error of the strong form. Proposition 10.5 (Energy Alignment Premise) explains why the metric is an amplifier, but an amplifier needs a correct target. The variable projection interpretation of three-stage training (Section 11) explains why alternating is more stable than joint optimization.
References
[1] An, J. (2026). SKG: A Law-Induced Engine from Inference to Induction. arXiv:2610.19505. (companion paper)
[2] MACE-OFF: Short-Range Transferable Machine Learning Force Fields for Organic Molecules. JACS, 2024. DOI: 10.1021/jacs.4c07099.
[3] Wu, L., Hou, Z., Yuan, J., Rong, Y., & Huang, W. (2023). Equivariant Spatio-Temporal Attentive Graph Networks to Simulate Physical Dynamics. NeurIPS 2023.
[4] Wu, J., Liu, Y., Yu, R., & Sun, J. (2026). Flow for Future: Geometric SE(3)-Equivariant Flow Matching for 3D Trajectory Prediction. ICML 2026.
[5] Sun, F., Huang, Z., Wang, H., Tang, H., Luo, X., Wang, W., & Sun, Y. (2025). Graph Fourier Neural ODEs: Modeling Spatial-Temporal Multi-Scales in Molecular Dynamics. Transactions on Machine Learning Research (TMLR). arXiv:2411.01600v3.
[6] Thompson, L., Guan, D., Matthews, S., Shi, D., Gao, J., & Han, A. (2026). ATOM: A Pretrained Neural Operator for Multitask Molecular Dynamics. ICLR 2026.
[7] Ljung, L. (1999). System Identification: Theory for the User. Prentice Hall.
[8] Finlay, C., Jacobsen, J.-H., Nurbekyan, L., Oberman, A. (2020). How to train your neural ODE. ICML.
[9] Wang, S., Teng, Y., Perdikaris, P. (2021). Understanding and mitigating gradient flow pathologies in PINNs. SIAM J. Sci. Comput.
[10] Kharazmi, E., Zhang, Z., Karniadakis, G. E. (2021). hp-VPINNs. CMAME.
[11] E, W., Yu, B. (2018). The deep Ritz method. Commun. Math. Stat.