acceptodds
Under review as a conference paper at ICLR 2027

HamiFormer: Dual-Expert Diffusion Fields With Affine Symplectic Maps

Abstract

Predicting smooth dynamics and collisions requires modeling continuous evolution and abrupt state changes. We introduce HamiFormer, a dual-expert diffusion field combining whole-window denoising with residual-corrected Hamiltonian propagation. Their mixed-state feedback attenuates the direct contribution of inherited autoregressive error: each mixed state guides subsequent propagation within the jointly refined window. Parallel Local Affine Scan (PLAS) amortizes iterative refinement across rectified-flow steps and evaluates derivatives in parallel across physical time. PLAS's affine symplectic maps achieve lower solver error and runtime than sequential explicit Euler in our evaluation. A Regime Model Tree specializes residuals and routing to balance typical-state accuracy against large tail errors. Our analysis gives conditions for physically consistent refinement and warm-start tracking, and finite-window error bounds under diffusion feedback. In 192-step evaluations, HamiFormer reduces normalized phase-space MSE by 26.3% against PhysiFormer on HamiBalls-1 and 21.4% against DiT on HamiBalls-2, with comparable model capacities. Disjoint-interval comparisons show the lowest late-horizon position and momentum errors among baselines on both datasets. Project page: https://hamiformer.github.io/.

Primary area:
neurosymbolic & hybrid AI systems (physics-informed, logic & formal reasoning, etc.)
Keywords:
Trajectory Generation, Rectified Flow, Hamiltonian Neural Networks, Physics-Informed Machine Learning, Mixture of Experts, Symplectic Integration

Reviews

Among:
Shape:
1234this paper, Top 4%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 3.25 over 4 reviews, above 96% of the others.
Reviewer_RYAfOpenReview ↗
Rating
4
Confidence
2
Informativeness
3
Presentation
3
Soundness
3
Read review
Paper summary

This paper presents HamiFormer, a dual-expert framework that combines whole-window diffusion prediction with residual-corrected Hamiltonian propagation. It introduces PLAS for efficient affine symplectic propagation and a Regime Model Tree for handling different dynamical regimes. On HamiBalls-1 and HamiBalls-2, the method achieves strong improvements in long-horizon prediction.

Critical strengths

The combination of global diffusion refinement and structured local propagation is well motivated.

PLAS is supported by both theoretical analysis and detailed accuracy-runtime evaluations.

The experiments are comprehensive, with long-horizon comparisons and useful component ablations.

Critical weaknesses

The evaluation is limited to two closely related simulated physical systems.

The overall framework contains many components and requires a relatively complex training procedure.

Some theoretical guarantees are local or conditional and do not directly apply to the complete mixed dynamics.

Questions for authors

No, I think this is a good work and deserves acceptance.

Reviewer_zgxhOpenReview ↗
Rating
3
Confidence
2
Informativeness
2
Presentation
2
Soundness
3
Read review
Paper summary

This paper studies long-horizon prediction of mechanical trajectories involving smooth motion and collisions. It extends a PhysiFormer-style whole-window trajectory diffusion framework with a Hamiltonian-based local dynamics branch. The central design mixes residual-corrected local predictions with whole-window diffusion predictions at each denoising evaluation and feeds the mixed states into subsequent physical propagation, rather than combining the two predictions only at the output. The method also introduces PLAS for structured local propagation and a Regime Model Tree for residual correction and routing. Experiments on two synthetic mechanical systems show lower aggregate and late-horizon prediction errors over 192-step rollouts than the evaluated baselines. Component ablations examine the effects of feedback, numerical solvers, regional specialization, and training objectives.

Critical strengths
  1. The paper provides useful ablation studies for its main components, including mixed-state feedback (Table 4), PLAS (Tables 3 and 19), and regional specialization (Table 5). These experiments help demonstrate the effectiveness of the proposed design.

  2. The paper evaluates 192-step predictions and shows improved accuracy on both datasets. The additional comparisons with D-only and PhysiFormer under similar inference costs on HamiBalls-1 further support the effectiveness of the proposed method.

Critical weaknesses
  1. Although the authors explain why they use a Hamiltonian expert, the current ablations do not compare it with a standard local dynamics model within the same framework. Such a comparison would help clarify whether the improvement comes from the Hamiltonian design or the overall hybrid architecture.

  2. The feedback ablation (Table 4) and the component ablations (Table 5) only cover the first 48 steps, while the main experiments evaluate 192-step predictions. Extending these ablations to the full horizon and including HamiBalls-2 for the Table 5 experiments would provide stronger evidence for the effectiveness of these components in long-term prediction.

Questions for authors

Have the authors considered adding a physics-consistency loss to PhysiFormer without introducing an additional local dynamics branch? Comparing this alternative with the proposed method would help clarify whether explicit dynamics propagation provides benefits beyond incorporating physical constraints through the loss function. This is different from the loss ablations in Table 5, which retain the hybrid architecture.

One more very minor suggestion: I think Figure 2 could be moved down to just before Section 3 for better layout.

Reviewer_jDbKOpenReview ↗
Rating
2
Confidence
1
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

This paper proposes HamiFormer for predicting smooth dynamics and collisions given an initial state and observable physical attributes. Specifically, HamiFormer combines two experts:

  • Diffusion expert (D): a rectified-flow diffusion model that accounts for more than 98% of the parameters and predicts an entire 48-step window at once.
  • Hamiltonian expert (H + r): a learned scalar Hamiltonian advanced by symplectic Euler, plus a learned residual r; it predicts one step at a time.

At each physical edge (time step), a router mixes the two candidates, and the mixed state becomes the predecessor of the next Hamiltonian step. This mixed-state propagation is repeated at every denoising step. To compute the implicit symplectic-Euler step efficiently, the paper proposes Parallel Local Affine Scan (PLAS), which linearizes the step at cached trajectory anchors that persist across rectified-flow steps. A CART-based Regime Model Tree provides leaf-specific linear residual readouts and affine routing corrections.

All components are trained with state supervision on simulated trajectories. The theory covers the symplecticity and local accuracy of the PLAS maps (Theorem 3.1), self-consistency and quadratic refinement with warm-start tracking (Theorem 3.2), and a finite-window error bound (Proposition 3.3). Experiments use two simulated datasets, HamiBalls-1 and HamiBalls-2 (balls with springs and inelastic collisions; App. G.1). The paper reports 26.3% and 21.4% lower 192-step normalized phase-space MSE than the strongest baselines (PhysiFormer and DiT, respectively).

Critical strengths
  1. Combining whole-window diffusion prediction with structured one-step Hamiltonian propagation through mixed-state feedback is an intuitive approach, and it improves prediction accuracy over the compared baselines on both datasets. This is the main positive factor in my assessment, since the gains hold on both datasets.
  2. PLAS is evaluated on HamiBalls-1 from several angles, including solver error against FP64 Newton references, end-to-end prediction MSE, and sampling time. It reduces sampling time relative to the sequential solvers (Explicit Euler and SymEuler2), with prediction MSE close to SymEuler2 and lower than Explicit Euler. This matters because it makes the repeated Hamiltonian propagation inside the diffusion sampler practical.
Critical weaknesses

W1. The necessity of some key components is not examined separately.

The core idea (mixing whole-window and one-step predictions and feeding the mixed state back) is intuitive, but its implementation involves many components: the diffusion expert, the learned Hamiltonian, the residual, the router, the Regime Model Tree, PLAS, and four 200-update downstream training stages. The following components are not examined separately.

  • Deterministic window predictor: All initial states and physical attributes are observable inputs (Sec. 4.1), and the stored ground-truth trajectories are reproduced bitwise from the original scene seeds (App. G.2), so the target is effectively a deterministic function of the inputs; prediction is evaluated with normalized MSE. It therefore seems possible to combine a deterministic whole-window predictor of the same architecture with the H + r mixing. To show the benefit of using a generative model that requires denoising, a comparison with such a deterministic variant is needed.
  • Residual r: End-to-end results without r (H only) are not reported. App. G.6 reports that the momentum correction reduces direct candidate SSE in the hardest quartile but increases it in the easier quartiles.
  • Router: There is no comparison with a tuned constant router weight g.

These comparisons need to be added. This matters for my assessment because the proposed method is defined by this combination of components.

W2. The scope of some ablations is limited.

  • The internal D-only comparison, the integrator ablation (PLAS), and the model-tree and objective ablation are conducted only on HamiBalls-1.
  • The expert feedback ablation (Table 4) uses 64 sources per dataset over the initial 48 edges, and the model-tree and objective ablation (Table 5) is evaluated over the initial 48 edges.
  • Variance across training runs is not reported; the reported confidence intervals are for fixed trained models (App. G.2).

These analyses need to be shown on HamiBalls-2 and over all 192 edges, together with the variance across training runs. This matters because the current evidence for these components comes mainly from one dataset and a shorter horizon than the main evaluation.

Questions for authors
  1. Clarification: H is trained with the Hamiltonian loss LHL_H, whose relation evaluates the gradient at the midpoint of observed adjacent states (Eq. 46, an implicit-midpoint form), but it is advanced with symplectic Euler (Eq. 4) in PLAS. Why are different integration schemes used, and how does this difference affect prediction? Does the residual r partly absorb it?
Reviewer_4bvdOpenReview ↗
Rating
4
Confidence
2
Informativeness
3
Presentation
2
Soundness
3
Read review
Paper summary

This paper studies phase-space trajectory prediction for systems involving both smooth mechanical evolution and inelastic collisions. It develops a method that combines whole-window trajectory refinement with local physical propagation, allowing them to work together effectively in the presence of collisions, dissipation, and prediction errors. The paper proposes a new coupling mechanism: whole-window denoising provides candidate states, a local physics expert provides structure, and the corrected mixed states are fed back into subsequent propagation. Dedicated solver and regime-specific modules support this closed loop. HamiFormer combines a whole-window diffusion expert with a residual-corrected Hamiltonian expert. A router separately mixes the position and momentum candidates and feeds the mixed states into subsequent physical propagation. PLAS evaluates derivatives in parallel at cached anchors, constructs affine symplectic maps, and amortizes refinement by retaining anchors across rectified-flow steps. A Regime Model Tree provides regional residual readouts and routing corrections. The paper also proves the symplecticity of fixed-anchor affine propagation, establishes conditional results on local convergence and warm-start tracking, and derives a finite-window error propagation bound. Numerical experiments examine the practical applicability of these results. Finally, in 192-step predictions without ground-truth resets on the two HamiBalls systems, the proposed method reduces normalized phase-space MSE by approximately 26.3% and 21.4%, respectively, relative to the best evaluated baseline on each system.

Critical strengths
  1. The diffusion expert provides the state at the corresponding time within its whole-window prediction, while the Hamiltonian expert propagates one step from the current state and adds a learned residual correction. PLAS reduces the computational cost of the physics expert. The rationale behind this design is clear, and the experiments demonstrate its practical value.
  2. Fixed-anchor symplecticity (Theorem 3.1) shows that the local approximation preserves the specified geometric structure. The local refinement and tracking analysis (Theorem 3.2) explains the effectiveness of reusing anchors with only a small number of refinement steps. The finite-window error analysis (Proposition 3.3) characterizes how errors propagate through feedback. These results make the method highly interpretable and provide targeted theoretical support.
Critical weaknesses
  1. The model-tree ablation does not fully isolate the effect of regime partitioning itself. The authors compare shared corrections, tree-conditioned corrections, and different training objectives. However, Appendix G.6 explicitly states that each variant uses its own generated training trajectories. In a closed-loop model, changing the routing or correction mechanism also changes subsequent states and therefore the distribution of training samples. Consequently, the comparison changes both how states are partitioned and corrected and which states the model is trained on. The existing comparisons support the effectiveness of the complete tree-conditioned scheme, but do not fully disentangle the contribution of regime partitioning itself from those of the training trajectory distribution and readout structure.
Questions for authors
  1. Regarding Weakness 1: Is there additional evidence from the model-tree experiments that helps distinguish the sources of the gains?
  2. Are there corresponding experimental results validating the three theoretical analyses mentioned in Strength 2?

Comments on the paper

1 comment

I thank the authors for addressing all my questions in detail. However, as my research background is not directly related to this work, I do not have enough confidence to justify raising my score. Therefore, I will keep my original score.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.