Manuscript Offprint
arXiv:2610.06250Generative World Models Enable Predictive Control of Laser Melt Pool Dynamics
Abstract
World models, which learn how environments respond to actions, are emerging as a powerful paradigm for planning through imagined futures, transforming decision-making across games, robotics and autonomous driving. Bringing this capability to manufacturing could enable process decisions on timescales inaccessible to high-fidelity simulation. Here we introduce a generative world model for localized highly dynamic laser melt pool that predicts evolution from histories of temperature and phase morphology under candidate actions. Its generative latent dynamics capture the effects of unresolved melt flow, enabling more accurate recursive rollouts than deterministic regressors under transient laser inputs. Because the learned dynamics are differentiable, the model can serve directly as a predictive control plant. Gradients through imagined futures optimize laser schedules that regulate melt-pool depth over previously unseen geometry, path, initialization. We further distil this optimization into an amortized policy that produces control actions in a single forward pass, providing a proof of concept for real deployment on machines.
Keywords: World model, Generative model, Laser powder bed fusion, Melt-pool control, Scientific machine learning
Introduction
Localized melt pools are the active transformation zones of fusion-based manufacturing, including welding, directed energy deposition, and laser powder bed fusion (LPBF) [1, 2]. In each process, concentrated energy input, fluid flow, phase change, and solidification interact within a transient region whose geometry and temperature directly influence thermal history, consolidation, and defect formation. LPBF is a particularly stringent case: micrometer-scale melt-pool dynamics evolving over microseconds interact with scan paths and parts spanning much larger spatial and temporal scales [3, 4], while small deviations can produce lack of fusion, keyhole porosity, or spatter [5, 6]. High-fidelity thermal-fluid simulations resolve these mechanisms [7, 8], but even GPU-accelerated solvers need minutes to hours per simulation [9, 10], far beyond the timescale of control decisions.
Controlling the three-dimensional melt-pool geometry, rather than surface signals, would directly target lack of fusion and overmelting, but is currently infeasible from both measurement and simulation. In-process sensors capture only surface signals, and operando X-ray imaging, although able to reconstruct four-dimensional melt pools at 25 kHz, requires a synchrotron beamline and offline reconstruction [11]. In simulation, a linear surrogate identified from smoothed particle hydrodynamics enabled depth control in two dimensions, but its extension to three dimensions was computationally prohibitive [12]. Controllers therefore act at the layer [13] or vector [14] level or on conduction models [15, 16], and neural surrogates predict steady-state [17] or top-view [18] morphology, or three-dimensional dynamics without actions [19]. None combines recursive 3D rollout, time-varying actions, partial observations and usable action gradients.
World Models (WM) enable this combination. They learn a compact state and an action-conditioned transition, so that behaviour can be optimized in imagined trajectories [20], by online planning [21] or by gradients through the learned dynamics [22]. Under partial observation, reliable planning required both a deterministic memory of past observations and a stochastic transition [23], and diffusion transitions now preserve details important for control [24] and simulate games in real time [25]. The melt pool fits this setting: our model resolves temperature and phase morphology but not the velocity and pressure fields driving convective and Marangoni transport, so identical observed states can evolve differently. Eliminating such hidden variables yields reduced dynamics with memory and fluctuating terms [26, 27]. A latent history can capture the memory, and a generative transition the range of futures consistent with it.
When a data-driven model is used in place of the plant for control, it can fail in two ways. Deterministic surrogates trained with mean-squared error average over hidden futures, regressing toward the mean flow in turbulence [28] and losing fine-scale content needed for accurate long rollouts [29]. Generative models avoid this averaging but can instead produce plausible states that violate the underlying physics [30]. Control amplifies both errors because an optimizer seeks actions that perform well under the learned model regardless of whether its predictions are correct, while policies trained in learned dynamics can exploit poorly represented regions [31]. Whether an action-conditioned generative transition provides gradients reliable enough for control, and whether the resulting actions remain effective when re-evaluated by the physics solver, remains largely unexamined.
Here we introduce a WM with generative latent dynamics for transient 3D melt-pool prediction and control. It encodes temperature and phase-indicator fields into a compact finite-scalar-quantized (FSQ) latent state [32, 33], which is advanced by a history-conditioned flow-matching transition differentiable with respect to the laser actions. We validate that the differentiable latent dynamics remain accurate over control-relevant rollouts and provide useful gradients for model predictive control, and further show that an RL policy can reach the same objective in a single forward pass to realize faster planning. The control target is melt-pool depth over variable substrate geometries, scanning path and residual heat, where insufficient or excessive depth causes severe defects (e.g. lack of fusion, overmelting). The selected schedules are re-evaluated in high-fidelity CFD to test whether control performance persists outside the learned model.
The melt-pool WM presents a technical proof-of-concept that localized, highly dynamic and partially observed melt pools can be learned well enough to support gradient-based control, as verified in high-fidelity simulation. We also discuss potential use-cases, including within-track inline control on LPBF machines and other fusion-based processes such as welding and directed energy deposition. However, operationalizing the WM for these applications will require further innovation, notably a measurement-conditioned encoder that maps in-process sensor signals to the latent state and inference fast enough for the melt-pool timescale, in addition to open machine platforms with synchronized sensing and laser actuation.
Generative latent world model for partial thermal-fluid states
The WM evolves the transient three-dimensional melt pool in a learned latent space (Fig. 1). An encoder maps the temperature and phase-indicator fields (T, ) to a FSQ latent grid, in which each channel is rounded to a finite set of levels, so that one compact code accommodates both the sharp phase interfaces and the smoother temperature field. A history-conditioned flow-matching transition, a generative model that learns to transform Gaussian noise into samples of the next latent state, advances this code under the laser actions and accounts for the influence of the unobserved velocity and pressure fields. The decoder reconstructs physical fields only when quantities such as temperature, phase morphology, or melt-pool depth are evaluated (Methods).

Fig. 1: Melt-pool WM with generative latent dynamics. Top: the autoencoder compresses the partially observed state , without the full CFD thermal-fluid state, into a discrete code . Two decoder branches reconstruct the smooth and the sharp from the shared latent code, and the liquid fraction is computed from the reconstructed fields. Bottom: the transition : diffusion-transformer (DiT) blocks, conditioned on the control parameters and scalar flow-matching time through adaptive layer normalization (adaLN), regress the flow-matching velocity , which an Euler sampler integrates into a latent residual that is added to and re-quantized.
Rollout fidelity and generalization across different regimes
We first test whether the latent dynamics remain accurate under recursive prediction, where errors can accumulate over many steps (Fig. 2). In a representative held-out trajectory, the WM follows the moving thermal field and reproduces the location and extent of the high-temperature region from step 20 to step 80 without visible drift (Fig. 2a).
The model generalizes to unseen substrate geometries, scan paths, and initial temperature fields (Fig. A.1). Across high, intermediate, and low final penetration, it recovers the extended melt region penetrating the substrate, the smaller localized melt pool, and the shallow melt pool without spurious depth, in the three-dimensional rendering as well as in the top views and cross-sections (Fig. 2b).
Aggregate metrics confirm this stability (Fig. 2c). Temperature error remains bounded over the horizon, whereas the phase-indicator error roughly doubles over 4 ms as small interface discrepancies accumulate. Melt-pool intersection over union (IoU) stays between about 0.7 and 0.8, and its larger inter-case spread reflects the sensitivity of the phase boundary to small local errors near the solid–liquid interface. Under transient inputs, errors grow steadily over the horizon for all models (Fig. 3c-e,h-j).
For control, the decisive quantity is whether the model predicts penetration accurately enough to distinguish under- from over-penetration. Pooling per-step predictions from 25 held-out rollouts of 80 steps (n = 2000), with depth taken as the median over an eight-member ensemble, more than 80% of predicted depths lie within one voxel (10 m) of CFD, 95% within two voxels, and 98% within three (Fig. 2d). Because the decoded liquid fraction changes sharply across the melt-pool boundary, depth errors cluster near multiples of the vertical grid spacing, so the effective depth resolution is about one grid cell, a fifth of the 50 m control target. The learned dynamics therefore remain stable under recursion, generalize across penetration regimes, and preserve melt-pool geometry at an accuracy suitable for depth control.
Discrete tokenization, generative latent dynamics and adaptation to transient melt pool
Discretizing the latent space typically costs reconstruction fidelity [34, 35], but discrete latents have benefited learned WMs in downstream task performance [36] and in multi-step prediction when model capacity is limited [37]. Against a continuous bottleneck of identical architecture trained on the same constant-schedule frames, the pretrained FSQ autoencoder raises the median reconstruction error on unseen cases by 0.4, 0.6-0.7 and 1.6-1.8 percentage points for temperature, phase indicator and melt-pool field (Supplementary Table S8). In a representative frame, both autoencoders recover the melt pool with an IoU of 0.99 and differ mainly in small temperature errors around it, with medians of 5 and 4 K in the metal (Fig. 3a). This cost is small relative to the dynamics. Encoding and decoding the CFD fields with the fine-tuned world-model autoencoder gives a depth error of 0.17-0.18 m and a temperature relative error of 1.7%, about 30 and 5 times below the rollout's depth continuous ranked probability score (CRPS, 4.5-5.8 m) and temperature error (7.5-9.0%). The CRPS measures how far a predicted distribution lies from the CFD value and reduces to the mean absolute error for a deterministic prediction. With a phase-indicator error about one third of the rollout's, the representation is not the accuracy bottleneck of the WM (Fig. 3b).
The transition comparison tests how the models handle the hidden flow. The deterministic ViT [38] and Transolver [39] regressors reach lower one-step validation errors than the flow-matching model (Supplementary Fig. S4a), as expected for predictors of the conditional mean, yet over recursive rollouts on the transient test cases the flow-matching model is more accurate in temperature and melt-pool field, and the gap grows with the horizon (Fig. 3c,e). This is consistent
1.0 ms (step 20)
2.0 ms (step 40)
3.0 ms (step 60)
4.0 ms (step 80)
WM
CFD

b
3D melt pool
WM
CFD
Top view (x-y)
WM
CFD
Cross-section (y-z, x-z)
WM
CFD
Temperature (K)
Penetration
Intermediate
Low
Temperature rel. L2
Melt-pool IoU
Alpha rel. L2
c
d
Time (ms)
Depth error ( m)
Fig. 2: World-model fidelity, stability and generalization. All panels show the base WM, pretrained on constant schedules, on the constant-parameter test cases. (a) Recursive rollout on a representative scan: WM versus CFD temperature, rendered on the phase indicator (material versus air), at four rollout steps. (b) Final-frame WM versus CFD for three cases selected to span high, intermediate and low final penetration, shown as the three-dimensional melt pool, top view (x-y) and depth cross-sections (y-z and x-z). The computational domain spans . (c) Temperature and phase-indicator relative error and melt-pool intersection over union versus rollout time, aggregated across cases. Lines show the mean across cases and bands show the interquartile range across cases. (d) Cumulative distribution of melt-pool depth error over all cases, with dotted lines marking one, two and three voxels ( ).
with conditional-mean predictions leaving the manifold of realizable states and compounding under recursion, whereas the generative transition samples a realizable state at each step. The slowly evolving phase indicator, largely determined by the observed history, is predicted similarly by all models (Fig. 3d). The advantage carries over to both control quantities: the normalized CRPS of the flow-matching model is 26-28% lower for melt-pool depth and approximately 33% lower for melt-pool volume than that of the two deterministic baselines (Fig. 3f). Paired over the 88 transient cases, the depth CRPS is 2.2 and 2.0 m lower than that of the ViT and the Transolver (both ), and the volume CRPS is and mm lower ( and ). On the fast random walk (Fig. 3h-k), the depth gap widens to 3.4 m ( ) and 5.0 m ( ).
Pretrained on constant schedules, the WM already generalizes to step and ramp inputs, between which the melt pool relaxes toward a quasi-steady state (Fig. 3c-f). A controller that updates power and speed at every interval, however, induces inputs and states closer to the fast random walk, where the melt pool rarely reaches a steady state and every model shows its largest and fastest-growing errors (Fig. 3h-l). Fine-tuning on time-varying schedules targets this regime but requires sufficient data: n = 10 cases roughly double the depth error, and only with n = 100 cases is the fine-tuned model more accurate than the base model (Fig. 3g,l). The gain concentrates where control needs it. On the fast random walk, the depth CRPS falls from 8.4 to 6.5 m, the largest change among the four regimes, although not significant with 19 cases (P = 0.29), and the temperature and melt-pool-field errors separate from those of the base model after approximately 2 ms. Step and ramp inputs do not benefit (Supplementary Fig. S5). Qualitative fast-random-walk rollouts, including a case where fine-tuning worsens depth accuracy, are shown in Supplementary Figs. S7–S10. The adaptation costs little on constant-parameter inputs: the fraction of depth predictions within one voxel of CFD decreases from 81% to 74%, and within 30 m from 98% to 96% (Supplementary Fig. S6).
Exposure to time-varying inputs alone does not ensure this accuracy. Trained from scratch on all 800 time-varying cases of the pool from which the fine-tuning cases are drawn, including the fine-tuning and validation cases, the Pure Transient model has the highest melt-pool volume CRPS on the fast random walk ( mm , compared with for the base and mm for the fine-tuned model), a higher depth CRPS (12.4 versus 8.4 and 6.5 m), and larger melt-pool-field errors than either pretrained model (Fig. 3j-l). One possible explanation is that constant-schedule pretraining first establishes melt-pool formation and relaxation toward quasi-steady states, on which the perturbations caused by changing inputs are easier to learn under partial observation than when rapid forcing and unobserved thermal-fluid relaxation must be learned together. Because a controller issues time-varying inputs, we use the fine-tuned model for both controllers.
Control optimization and CFD re-validation
We next test whether the differentiable WM can select laser power and scan speed that remain effective when transferred back to CFD. Both controllers use the same frozen WM, the fine-tuned transition with n = 100 cases of Fig. 3, but in different ways (Fig. 4). The receding-horizon controller (MPC) rolls the latent dynamics forward under a candidate control sequence and back-propagates the depth-tracking objective through the rollout. The amortized policy (RL) is trained with short-horizon actor-critic (SHAC) [40], which backpropagates through short imagined rollouts, and maps the current latent state directly to a control command. MPC thus solves the control

FSQ
Continuous
IoU 0.986
IoU 0.990
0
50
(K)
b
Compression vs. rollout error

Base DiT
Fine Tuned
ViT
Transolver
Pure Transient
c
d
e
f
g

h
i
j
k
Fig. 3: A compact discrete representation at small reconstruction cost, and generative dynamics that support prediction under transient laser inputs. (a) Reconstruction of a held-out constant-parameter frame (t = 1.7 ms), chosen at the median melt-pool-field error of the FSQ autoencoder: CFD temperature with the melt-pool boundary ( ) outlined, and absolute temperature error of the FSQ autoencoder and of a continuous bottleneck of identical architecture. IoU, melt-pool intersection over union with CFD. (b) Reconstruction error of the continuous autoencoder, the FSQ autoencoder for ablation and the FSQ autoencoder of the WM (WM), relative to the rollout error of the base WM (100%), on the 88 transient test cases: median relative error of temperature and phase indicator, and melt-pool depth error (depth CRPS for the rollout). FSQ denotes the pretrained autoencoder and FSQ (WM) the same autoencoder fine-tuned on time-varying frames and used by all transition models (Supplementary Tables S5 and S8). (c-g) Transition-model evaluation on all 88 transient test cases. (h-l) As c-g, on the 19 fast random-walk cases. (c,h) Temperature, (d,i) phase-indicator and (e,j) melt-pool-field continuous ranked probability score (CRPS) over the 4 ms autoregressive rollout. (f,k) Melt-pool depth and volume CRPS pooled over all laser-on steps, normalized in both rows by the mean CFD value over the laser-on steps of all 88 transient cases. (g,l) Laser-on depth CRPS, pooled as in f,k, after fine-tuning on n = 10, 20, 50, 75 or 100 time-varying cases. Horizontal lines show the reference models. Base DiT is the flow-matching transition pretrained on constant schedules (360 training and 40 validation cases), and Fine Tuned is its early-stopped adaptation to 100 time-varying cases, used by both controllers. ViT [38] and Transolver [39] are deterministic baselines trained on the same constant-schedule data. Pure Transient is the flow-matching transition trained from scratch on all 800 time-varying cases, including the fine-tuning and validation cases. Generative models use eight rollout samples per case, whereas for deterministic models CRPS reduces to the mean absolute error. Curves in c-e and h-j show case means, and bands and error bars in c-l indicate 95% bootstrap confidence intervals over cases.

b

Fig. 4: Two controllers operating on the same latent WM. (a) At each control step, the gradient-based receding-horizon controller encodes the current observation into the latent state and rolls the frozen WM forward under a candidate control sequence . The predicted latent state is decoded to evaluate the melt-pool depth tracking objective against the target , and gradients are propagated through the rollout to update the control sequence. (b) The latent policy is trained within the same frozen WM using SHAC. The actor generates power and speed commands from the latent state, while imagined rollouts provide the objective and reward used to update the actor and critic . After training, only the actor is required for deployment, mapping the current latent state directly to the control command in a single forward pass.
problem repeatedly during deployment, whereas the policy learns it in advance and executes it in a single forward pass.
The stringent test is whether decisions optimized through the learned dynamics retain their effect in CFD (Fig. 5). In a representative ten-track overhang case, the unoptimized scan, which holds the nominal and that also initialize both controllers, reaches full penetration after the first few tracks and remains there for much of the scan. It serves as a reference for the thermal disturbance accumulating along the overhang rather than as a baseline for the learned dynamics. Both MPC and RL instead regulate the depth around the target despite changes in local support thickness between tracks, and the world-model rollouts follow the CFD re-simulations with local deviations. Because these trajectories are generated by actions that


Fig. 5: World-model control and CFD re-validation in a representative overhang case. (a) Melt-pool depth along the normalized scan path for the unoptimized scan, gradient receding-horizon controller (MPC), and amortized latent policy (RL), together with the local support thickness and target depth . Solid curves show CFD re-simulations and dashed curves the corresponding world-model rollouts. The unoptimized scan progresses toward full penetration, whereas both controllers maintain the melt-pool depth near the target across the ten tracks. (b) Laser-power and scan-speed schedules selected by MPC and RL, with the unoptimized settings shown for reference. (c) Three-dimensional temperature fields for the common initial state and the final CFD states obtained with MPC, RL, and the unoptimized scan. Both controlled cases suppress the large high-temperature region observed without control.
the model itself selected, the comparison directly tests the learned dynamics under control-induced state and action distributions.
The controllers reach this regulation through different schedules (Fig. 5b): MPC makes abrupt corrections to both inputs as the local thermal condition changes, whereas the policy modulates them smoothly across each track. In the final CFD temperature fields, the unoptimized scan develops a large high-temperature region associated with excessive penetration and accumulated heat, whereas both controlled cases retain a localized melt region (Fig. 5c).
Generalization and computational efficiency
Across 30 overhang cases with initial conditions drawn from the constant-parameter and transient test sets (Methods), the WM reproduces the shift of mean and peak depth from the unoptimized scans toward the target, but with a controller-dependent bias: it under-predicts the depths reached under MPC and over-predicts those reached under RL (Fig. 6a,b). MPC often moves power and speed between their bounds within a single control interval, exceeding the per-step variations seen during fine-tuning (60 W and 0.4 m s ) and entering the rapidly varying regime where transition errors are largest (Fig. 3h-l). Because MPC optimizes directly through the model, it can also favour actions for which the model under-predicts depth, a form of model exploitation that biases its predictions downward. In CFD, both controllers nonetheless bring the mean depth close to the 50 m target and substantially reduce the full-penetration peaks of the unoptimized scans. Five further cases, drawn at random from the 30, are detailed in Figs. A.2-A.6.
The two approaches differ substantially in cost (Fig. 6c). The policy requires 692 s for inference and 11.47 ms for the surrogate rollout, or 12.16 ms per 50 s control interval, whereas MPC with requires 3.37 s per replanning cycle of intervals, or about 1.69 s per interval. Amortization therefore makes each control decision approximately 140 times faster.

b
c
Fig. 6: Generalization and computational benchmark across unseen overhang cases. (a,b) Distributions of mean and peak melt-pool depth for the unoptimized scan, MPC and RL across the 30 cases. World-model predictions (open) are compared with CFD re-simulations (filled) to assess generalization under control-induced trajectories. Dashed lines indicate the 50 m target depth in (a) and the full-penetration threshold in (b). Both controllers bring the mean depth toward the target and suppress the large peak depths observed in the unoptimized scans. The WM under-predicts the depths under MPC and over-predicts those under RL. (c) Computational cost per decision for RL (one control interval) and MPC (one replanning cycle, covering two control intervals), separated into controller and surrogate-rollout time. RL requires 692 s for policy inference and 11.47 ms for the surrogate rollout (12.16 ms total), whereas MPC with H = 10 requires 35.36 ms for optimization and 3.34 s for repeated surrogate rollouts (3.37 s total). All latency measurements were obtained on a single NVIDIA GeForce RTX 5090 GPU.
Discussion
This study shows that a WM with generative latent dynamics can connect high-fidelity thermal-fluid simulation to control of transient three-dimensional melt pools. The latent plant remains stable under recursive action-conditioned rollouts, supports both gradient-based receding-horizon optimization and policy learning in imagination, and yields schedules that retain their effect when replayed in CFD across unseen overhang geometries.
The ablations separate the roles of representation and transition. Finite scalar quantization provides a compact, bounded code at a reconstruction cost several-fold to an order of magnitude below the rollout error, so the accuracy of the WM is governed by its dynamics rather than by its representation. The deterministic regressors reach lower one-step error but degrade under recursion, whereas the generative transition trades a small one-step error for rollouts that remain accurate over the horizon, most clearly under rapidly varying inputs. We attribute this to conditional-mean predictions leaving the manifold of realizable states, as expected when temperature and phase morphology do not determine the hidden flow, although the present experiments do not isolate this mechanism. Because the noise seed is fixed so that each planning rollout is a single differentiable sample, the generative transition currently benefits control through more accurate rollouts rather than through its predicted spread. Risk-aware objectives averaging over several samples could exploit this spread, which may become important when control objectives extend beyond penetration depth to shape-, defect-, or uncertainty-sensitive criteria.
CFD re-simulation provides the strongest evidence that the WM is suitable for control, because an optimizer can exploit surrogate errors and produce schedules that work only within the learned dynamics. The WM continues to capture the CFD response after control shifts the state and action distributions, although with controller-dependent errors consistent with partial exploitation of model error by MPC. Both controllers nonetheless suppress full penetration in CFD while regulating mean depth near the target. This does not establish transfer to an experimental plant, but it shows that CFD can serve both as the source of training data and as a high-fidelity filter for control schedules before physical deployment.
The control resolution also differs from the layer-level [12, 13] and vector-level [14] approaches used to make LPBF control tractable. Both controllers update laser power and scan speed as the heat source advances along an active scan vector, enabling in-line control within an individual track in silico. This resolution matters for overhangs, where support conditions and accumulated heat vary over distances shorter than a scan track [41, 42], and regulating depth between a minimum bonding depth and the available support thickness targets both lack of fusion and burn-through.
The framework fits the existing control hierarchy of an LPBF machine, in which a scan controller executes time-ordered position, laser-power, and trigger commands through synchronized galvanometer and laser interfaces, and in-line monitoring adds a measurement path from a coaxial camera or photodetector [43, 44, 45]. A measurement-conditioned encoder would estimate the latent state, and the policy would return power and speed set-points through the existing command interface, leaving motion, synchronization, and safety to the native controllers. Laser power offers the most direct route, whereas within-track speed modulation must also respect galvanometer acceleration and laser-position synchronization limits. Because each transition advances the process by , the policy is about 240 times, and MPC about times, slower than real time on a single RTX 5090 GPU, so the results demonstrate millisecond-scale predictive control rather than a real-time feedback loop at the melt-pool timescale. The model timestep need not match the machine control interval, however: action chunking [46], and real-time chunking demonstrated for flow-based policies [47], would let the controller run less often while the hardware executes blocks of high-rate commands. Because the transition, rather than action generation, dominates the latency, one-step distillation of the flow-matching transition and compiler-level optimization would reduce the decision time itself.
The demonstration remains entirely in silico. The test cases probe new conditions only within the simulated space and do not establish transfer across materials, machines, or discrepancies between CFD and experiment. The transition is conditioned on absolute heat-source coordinates within the domain, so part-scale scan paths would require a moving window attached to the heat source. The controller also assumes a latent state derived from three-dimensional temperature and phase fields, whereas a machine provides indirect and often surface-weighted measurements. For this reason, the unoptimized scan serves as the reference here, and a benchmark against reactive feedback laws acting on measurable surface signals is deferred until a sensing pathway links such measurements to the latent state. Joint embeddings of top-view thermal-camera observations with high-fidelity three-dimensional melt-pool simulation offer a concrete route to this encoder [19], which, together with calibration against the physical process, safeguards outside the training distribution, and testing on an open LPBF platform, is the key remaining step towards machine-integrated in-line control.
Three elements of the approach are not specific to LPBF: pretraining on quasi-steady forcing before adapting to transient forcing, a generative transition over a partially observed state, and re-simulation of every optimized schedule in the solver that generated the training data as a check against exploitation of surrogate errors. They apply to other expensive multiphysics processes controlled through a few actuators, such as welding and directed energy deposition, although each requires process-specific data and validation.
Methods
Branched FSQ autoencoder
The autoencoder (Fig. 1, top) converts the partially observed melt-pool state into a compact discrete latent representation. Because similar spatial patterns can occur at different physical magnitudes, we factorize the encoder output into a morphology component shared by both fields and two field-specific amplitude components. Following the structure-amplitude principle introduced for physical-field tokenization [33], the continuous latent representation is written as
where represents spatial patterns shared by the temperature and phase-indicator fields, whereas and represent their respective amplitudes.
Finite scalar quantization (FSQ) [32] is applied component-wise using quantization resolutions appropriate to the different latent components,
Restricting the morphology component to a finite set of scalar combinations creates an implicit vocabulary of reusable spatial patterns without a learned codebook. The amplitude components are quantized more finely to retain field-specific magnitude information. This factorization biases related melt-pool states toward sharing discrete morphology patterns while allowing their temperature and phase amplitudes to vary independently. It therefore provides the transition model with a structured and regularized state space. Its reconstruction cost relative to a continuous bottleneck is quantified in Fig. 3a,b.
The decoder branches reconstruct the physical fields from the relevant components of the same aggregate state ,
Both branches use the same representation of the coupled spatial structure but retain separate amplitude information and field-specific reconstruction mappings. The melt-pool field , the liquid-metal fraction, is computed from the reconstructed temperature and phase-indicator fields rather than learned as an independent output. The map M multiplies the phase indicator by a smooth tanh step of temperature across the melting interval, mirroring the melt-fraction definition of the CFD solver (Supplementary Information, Eq. S5). The encoder receives neither the laser controls nor the unobserved CFD variables. The controls enter through the latent transition model.
Latent flow-matching dynamics
Given a past window , the transition is conditioned on the heat-source position at the start of the interval and the laser power applied during it, . It represents the next state through
The transition advances the latent state over a fixed interval and does not receive scan velocity as a separate scalar input. Instead, the heat-source coordinates satisfy , where is the tangent to the prescribed scan path. The coordinate sequence therefore encodes the heat-source displacement, and hence the scan speed and direction, with a delay of one interval: the speed applied during interval determines and first enters the model through the condition of the next transition.
The temperature and phase-indicator fields provide only a partial observation of the thermal-fluid system because the underlying velocity and pressure fields are not included. Multiple future states may therefore be compatible with the same observed history and action. A deterministic model trained with a pointwise loss approximates their conditional mean, whereas the generative transition represents the conditional distribution.
The transition is parameterized by a diffusion transformer (DiT) [48] trained with flow matching [49] on the latent residual . Flow matching is adopted because its linear probability path supports deterministic few-step sampling with a simple Euler integrator, which keeps each transition inexpensive and differentiable inside the recursive rollouts required for gradient-based control and policy training. Given Gaussian noise and flow-matching time , the linear probability path and target velocity are
The noisy residual is concatenated with the past latent window and passed to the DiT, while and condition its adaptive layer-normalization blocks. The network minimizes
The concatenated latent input is divided into anisotropic three-dimensional patches before self-attention. The in-plane directions are pooled into attention tokens, whereas the depth direction retains its full latent resolution because melt-pool penetration depth is the principal controlled quantity. The control condition and flow-matching time modulate the attention and multilayer-perceptron blocks through conditional normalization. At rollout time, a four-step Euler sampler integrates the predicted velocity into the latent residual, so that each transition requires only four network evaluations. The residual is added to to yield , which can optionally be re-quantized by FSQ (Fig. 1, bottom). With re-quantization, gradients pass through the rounding during gradient-based control and policy training with the straight-through estimator used to train FSQ [32]. To reduce optimization cost, the MPC planning rollouts instead use two Euler steps per transition (Supplementary Information, Section S7).
Training strategy and generalization protocol for world model
The autoencoder and transition model are trained sequentially, and the autoencoder is trained on individual high-fidelity LPBF frames only, never on transitions. It is first pretrained on frames of the constant-schedule cases. This pretrained autoencoder is the FSQ arm of the representation ablation, compared against a continuous bottleneck trained on the same frames (Fig. 3a,b). It is then fine-tuned on frames of time-varying random-walk cases, so that the representation also covers melt-pool states induced by changing inputs. This fine-tuned autoencoder is frozen and used by the WM: it encodes the simulated trajectories into the fixed latent representation on which every transition model, including the deterministic baselines, is trained. The action-conditioned transition model is trained on these latent sequences together with their heat-source controls. Each simulated case is generated with a randomly initialized substrate overhang geometry, residual-temperature field and scan path, so that cases differ in local support thickness, thermal history and trajectory. The detailed information can be found in Supplementary Information, Section S2. Generalization is evaluated on complete simulation trajectories excluded from training in their entirety, with held-out cases containing previously unseen combinations of residual-temperature fields, hatching paths, substrate overhang geometries and laser-control histories. The rollout-fidelity evaluation uses 25 such cases with constant parameters (Fig. 2), the representation comparison uses these and the transient cases below (Fig. 3a,b), whereas the transition ablation uses 88 test cases with time-varying controls in four regimes, namely 30 step, 20 ramp, 19 modulated and 19 fast random-walk schedules (Fig. 3c-l). To adapt the dynamics to time-varying inputs, the transition model pretrained on constant schedules is fine-tuned on n = 10-100 time-varying cases, drawn in equal parts from a pool of 400 random-walk and 400 banded-schedule cases, with early stopping on a shared 40-case validation set from the same pool. The model fine-tuned on n = 100 cases is used by both controllers. A Pure Transient reference with the same architecture and training recipe as the base model is trained from scratch on all 800 cases of this pool, including the fine-tuning and validation cases, with a random 90/10 split of its latent windows for early stopping. Complete architecture specifications, dataset compositions and training hyperparameters are provided in the Supplementary Information (Sections S2-S6).
Control formulation and controller implementation
The learned WM turns melt-pool control into finite-horizon planning over a differentiable latent plant (Fig. 4). The hatching path is fixed in advance, and the controller determines the laser power and travel speed along that path. At control step , it selects the bounded action , with and . The current path coordinate determines the heat-source position and hence the transition condition . The frozen WM then advances the latent state according to , while the speed component advances the path coordinate as . Here, denotes the prescribed spatial scan path. Consistent with the displacement encoding above, scan velocity is not an additional component of . Instead, it determines the heat-source displacement between successive position conditions over the fixed interval . The decoder is queried when a physical output such as melt-pool depth is needed. Melt-pool depth is measured from the initial substrate top surface to the deepest point at which the decoded liquid fraction reaches 0.5. For evaluation, this point is located with sub-voxel interpolation, whereas the control objectives use a smooth relaxation of the threshold depth that is differentiable with respect to the decoded fields.
Both controllers compare the decoded melt-pool depth with a target that is capped by the local support thickness below the laser. With a nominal fusion depth , a minimum bonding depth and a relative-depth limit , the target at step is
(7) where is the support thickness a short distance ahead of the laser along the path. Away from the overhang, the target rests at . Over thin support, it is capped so that the melt pool penetrates at most a fraction of the available thickness, and the lookahead lowers it, down to , before the laser reaches thinner support. Model-predictive control (MPC) minimizes the finite-horizon objective
where the sum runs over the laser-on steps of the window. The first term penalizes departures from the thickness-capped target, and therefore both insufficient fusion and excessive penetration relative to the support. The second regularizes step-to-step changes in depth. The target is built from thickness lookups that are held constant during differentiation, so that the optimizer cannot lower it by changing the speed. Parameter values are listed in the Supplementary Information (Section S7). At each replanning step, the gradient-based controller optimizes the candidate control sequence directly through the frozen surrogate (Fig. 4a), applies the first actions of the optimized sequence , and then resolves the length-H problem from the updated latent state.
The amortized SHAC controller uses the same physical objective as MPC, defining the reward as the negative stage cost of Eq. (8) at step of imagined trajectory b. It learns an actor and value critic from trajectories generated by the same frozen WM. The observation contains the quantized latent history together with the laser position and path direction, previous action, scan progress and local-support context. For each of B sampled initial observations, the actor maps to a bounded action , and the WM advances the resulting trajectory for L steps. The bootstrapped return and actor loss are
where is the discount factor. During the actor update, is held fixed, while gradients from both the stage rewards and terminal value are propagated through the actor and the complete differentiable rollout.
The critic targets are generated backwards along each imagined trajectory,
and the critic is fitted by
where sg denotes stop-gradient. The observations and return targets used for this critic fit are detached from the world-model computation graph.
This implementation retains the defining SHAC principle of combining truncated differentiable rollouts with a terminal critic [40], but differs from the original formulation in three respects: the actor is deterministic and bounded, the critic uses the full truncated return rather than a TD- mixture of multiple k-step returns, and terminal bootstrapping uses the current critic rather than a slowly updated target critic. These simplifications suit the present low-dimensional action space, in which the two bounded controls are scan speed and laser power, while sampled latent initial states and seeded transition samples provide trajectory diversity. The short differentiable world-model rollout permits direct pathwise actor gradients. Using the full return with alternating actor and critic updates avoids additional TD- and target-network machinery while preserving an estimate of performance beyond the truncation point.
After training, only the actor is retained from the actor-critic pair. At deployment, is evaluated once per control step, the frozen WM advances the latent state, and neither the critic nor a backward optimization pass is required.
Training and testing protocol for the control cases
The actor and critic are trained entirely within the frozen WM. Each training episode is initialized by sampling a random case and a random time window from the constant-schedule training trajectories of the WM, so the substrate overhang geometry, temperature initialization and scan path of every episode are drawn at random from its training data. The imagined rollout then evolves from this sampled latent state under the actions of the current actor.
The control benchmark comprises 30 cases whose initial conditions are drawn at random from the union of the 25-case constant-parameter test set and the 88-case transient test set, neither of which is used for training (Fig. 6). Each case is executed with the unoptimized schedule, MPC and the amortized policy, and every controlled trajectory is re-simulated in CFD. The controller hyperparameters and the re-validation protocol are provided in the Supplementary Information (Section S7).
CFD simulation
All training and evaluation data are generated with a high-fidelity thermal-fluid model of LPBF, implemented as a customized two-phase solver in OpenFOAM v5 [50] that extends the volume-of-fluid (VOF) solver interFoam [51]. The same process model was employed in the previous work [7], where its predictions were validated against operando synchrotron tomographic microscopy. Here, the solver is parameterized for Ti-6Al-4V. The metal and the surrounding argon atmosphere are treated as incompressible Newtonian phases, with the gas-metal interface advected by the geometric isoAdvector scheme [52]. The metal volume fraction of this formulation is the phase-indicator field observed by the WM. The solver resolves the dominant melt-pool physics, including Marangoni shear, evaporation-induced recoil pressure, buoyancy, mushy-zone damping and interfacial heat losses, under a moving Gaussian laser source with absorptivity and beam radius . The source terms, the Ti-6Al-4V thermophysical properties and the remaining model constants are given in the Supplementary Information (Section S1 and Supplementary Tables S1 and S2).
The computational domain of is discretized by a uniform Cartesian grid of cells, giving the cell size at which the WM observes the fields. The substrate occupies the lowest and argon fills the region above. All domain boundaries are stationary no-slip, adiabatic walls, so that heat leaves the metal only through the interfacial convective, radiative and evaporative sinks. Pressure-velocity coupling uses the PIMPLE algorithm, and the time step (initially ) adapts to keep the Courant number below and the interface Courant number below .
Each case is initialized with a randomized substrate overhang geometry, surface morphology and residual-heat field, and is scanned along a hatching path of random orientation with track spacings of 50-200 m, with the laser switched off for 0.25 ms while repositioning between tracks.
The full randomization protocol is given in the Supplementary Information (Section S2). Training cases apply either constant parameters drawn from a grid spanning scan speeds of 0.5-2.4 m s and laser powers of 40-325 W, or time-varying schedules in which both parameters follow a bounded random walk over the same ranges, resampled every 50 s with per-step changes limited to 60 W and 0.4 m s , either across the full ranges or confined to a band of W and m s around the nominal values. The test cases use parameter combinations off the training grid and previously unseen control histories, and a separate transient test set applies step, ramp, modulated and fast random-walk schedules, the last being the random walk above with doubled per-step limits (Supplementary Information, Section S2). The controlled trajectories are re-simulated by imposing the selected power and speed schedules as piecewise-constant inputs over successive 50 s intervals. Each training and test case is simulated for 4 ms of process time, whereas each control case runs until its predefined scan path has been traversed under the applied schedule, so that its duration depends on the case and the controller. In all cases, cell-centered temperature, velocity, phase-indicator and melt-fraction fields are recorded every 50 s, which defines the transition interval of the WM. Only the temperature and phase-indicator fields are exposed to the autoencoder. All CFD simulations are performed on the Euler cluster of ETH Zurich, with each case decomposed over 64 MPI processes on a single AMD EPYC 7763 node. Re-simulating one controlled case required a median wall-clock time of approximately 17 minutes (interquartile range 13 to 19 minutes) on this node, or roughly 10 s of computation per 50 s control interval, compared with 11.47 ms per interval for the world-model rollout on a single GPU (Fig. 6c). Repeated evaluation of candidate action sequences against the CFD model is therefore infeasible within a control loop, and the WM supplies the fast plant required by both controllers.
Statistics
Generative models are evaluated with eight rollout samples per case and deterministic models with one, for which the CRPS reduces to the mean absolute error. Melt-pool depth and volume are scored only on laser-on steps. Reported CRPS levels pool all laser-on steps of a case set, so that each step carries equal weight, and their 95% confidence intervals come from a bootstrap that resamples whole cases (20,000 resamples). Differences between models are computed per case, from each case's mean over its laser-on steps, and averaged over cases, with two-sided P values from a paired bootstrap over the identical case set. Pooled levels and case-averaged differences can therefore differ slightly (Supplementary Information, Section S6.2).
Declaration of Competing Interest
The authors confirm that there are no existing financial conflicts or personal associations that might be perceived as influencing the findings presented in this paper.
Declaration of Generative AI and AI-assisted technologies in the writing process
During the preparation of this work, the authors used Claude to improve the readability and language of this article. After using this tool, the authors reviewed and edited the content as needed and take full responsibility for the content of the publication.
Data Availability
The data supporting the findings of this study have been deposited in the ETH Zurich Research Collection. During peer review, the dataset is available to editors and reviewers through a password-protected repository link https://libdrive.ethz.ch/index.php/s/WibqAP2gBTfDdW3. The data will be made publicly available through the ETH Zurich Research Collection upon publication.
Code Availability
The data and code for the project could be found at https://github.com/yyyyorky/meltpool_world_model.
Extended Data

Fig. A.1: Initial conditions and prescribed laser scan paths. Representative initial temperature fields span distinct residual-heat distributions and substrate geometries. Green dashed arrows indicate the prescribed laser scan paths used to evaluate the world model across these conditions.

Fig. A.2: Additional world-model control example 1. (a) Melt-pool depth for the unoptimized scan, MPC and RL, comparing the world-model rollout (dashed) with the corresponding CFD re-simulation (solid). The horizontal dashed line marks the target depth. (b) Laser-power and scan-speed schedules for the three control strategies. (c) Initial temperature field and final CFD temperature fields obtained with MPC, RL and the unoptimized scan.

Fig. A.3: Additional world-model control example 2. (a) Melt-pool depth for the unoptimized scan, MPC and RL, comparing the world-model rollout (dashed) with the corresponding CFD re-simulation (solid). The horizontal dashed line marks the target depth. (b) Laser-power and scan-speed schedules for the three control strategies. (c) Initial temperature field and final CFD temperature fields obtained with MPC, RL and the unoptimized scan.

Fig. A.4: Additional world-model control example 3. (a) Melt-pool depth for the unoptimized scan, MPC and RL, comparing the world-model rollout (dashed) with the corresponding CFD re-simulation (solid). The horizontal dashed line marks the target depth. (b) Laser-power and scan-speed schedules for the three control strategies. (c) Initial temperature field and final CFD temperature fields obtained with MPC, RL and the unoptimized scan.

Fig. A.5: Additional world-model control example 4. (a) Melt-pool depth for the unoptimized scan, MPC and RL, comparing the world-model rollout (dashed) with the corresponding CFD re-simulation (solid). The horizontal dashed line marks the target depth. (b) Laser-power and scan-speed schedules for the three control strategies. (c) Initial temperature field and final CFD temperature fields obtained with MPC, RL and the unoptimized scan.

Fig. A.6: Additional world-model control example 5. (a) Melt-pool depth for the unoptimized scan, MPC and RL, comparing the world-model rollout (dashed) with the corresponding CFD re-simulation (solid). The horizontal dashed line marks the target depth. (b) Laser-power and scan-speed schedules for the three control strategies. (c) Initial temperature field and final CFD temperature fields obtained with MPC, RL and the unoptimized scan.
References
[1] DebRoy, T. & David, S. A. Physical processes in fusion welding. Reviews of Modern Physics 67, 85–112 (1995).
[2] DebRoy, T. et al. Additive manufacturing of metallic components – process, structure and properties. Progress in Materials Science 92, 112–224 (2018).
[3] King, W. E. et al. Laser powder bed fusion additive manufacturing of metals; physics, computational, and materials challenges. Applied Physics Reviews 2, 041304 (2015).
[4] Khairallah, S. A., Anderson, A. T., Rubenchik, A. & King, W. E. Laser powder-bed fusion additive manufacturing: Physics of complex melt flow and formation mechanisms of pores, spatter, and denudation zones. Acta Materialia 108, 36–45 (2016).
[5] Huang, Y. et al. Keyhole fluctuation and pore formation mechanisms during laser powder bed fusion additive manufacturing. Nature Communications 13, 1170 (2022).
[6] Khairallah, S. A. et al. Controlling interdependent meso-nanosecond dynamics and defect generation in metal 3d printing. Science 368, 660–665 (2020).
[7] Muther, A. et al. Identifying melt pool behavior in ceramics PBF-LB via operando synchrotron tomographic microscopy and high-fidelity process modeling. Additive Manufacturing 103, 104756 (2025).
[8] Zhang, Z. et al. Mixing-driven defects and composition evolution in multi-material metal additive manufacturing. Advanced Science e75723 (2026).
[9] Lüthi, C., Bambach, M. & Afrasiabi, M. MULTI-3: A GPU-enhanced meshfree simulation framework for multi-track, multi-layer, and multi-material laser powder bed fusion processes. Journal of Manufacturing Processes (2025). Open access.
[10] Leonor, J. P. & Wagner, G. J. GO-MELT: GPU-optimized multilevel execution of LPBF thermal simulations. Computer Methods in Applied Mechanics and Engineering 426, 116977 (2024).
[11] Witte, L. et al. 4D reconstruction of alumina laser melt pools at 25 kHz via operando X-ray multi-projection imaging (2026). URL https://arxiv.org/abs/2603.14391. arXiv:2603.14391.
[12] Liao-McPherson, D. et al. Layer-to-Layer Melt Pool Control in Laser Powder Bed Fusion. IEEE Transactions on Control Systems Technology 33, 207–218 (2025).
[13] Kavas, B. et al. Layer-to-layer closed-loop switched heating and cooling control of the laser powder bed fusion process. Additive Manufacturing 119, 105124 (2026). URL https://www.sciencedirect.com/science/article/pii/S2214860426000503.
[14] Kirschbaum, N., Wood, N., Kim, C.-E., Tumkur, T. U. & Okwudire, C. Vector-level feedforward control of LPBF melt pool area using a physics-based thermal model. Additive Manufacturing 112, 104981 (2025).
[15] Ogoke, F. & Barati Farimani, A. Thermal control of laser powder bed fusion using deep reinforcement learning. Additive Manufacturing 46, 102033 (2021).
[16] Mozaffar, M., Liao, S., Jeong, J., Xue, T. & Cao, J. Differentiable simulation for material thermal response design in additive manufacturing processes. Additive Manufacturing 61, 103337 (2023).
[17] Benoit, A. et al. A Fast and Generalizable Fourier Neural Operator-Based Surrogate for Melt-Pool Prediction in Laser Processing (2026). ArXiv:2602.06241.
[18] Manav, M. et al. MeltpoolINR: predicting temperature field, melt pool geometry and their rate of change in laser powder bed fusion. Journal of Intelligent Manufacturing (2025).
[19] Zhang, Y., Fu, Y. & Cheng, L. A scientific deep learning framework integrating process stochasticity with high-fidelity simulation for millisecond-scale melt pool prediction for L-PBF process. Additive Manufacturing 121, 105138 (2026).
[20] Ha, D. & Schmidhuber, J. Recurrent world models facilitate policy evolution. In Advances in Neural Information Processing Systems, Vol. 31 (2018). ArXiv:1809.01999.
[21] Hansen, N. A., Su, H. & Wang, X. Temporal difference learning for model predictive control. In Proceedings of the 39th International Conference on Machine Learning, Vol. 162, 8387–8406 (PMLR, 2022). URL https://proceedings.mlr.press/v162/hansen22a.html.
[22] Hafner, D., Lillicrap, T., Ba, J. & Norouzi, M. Dream to control: Learning behaviors by latent imagination. In International Conference on Learning Representations (2020). URL https://openreview.net/forum?id=S11OTC4tDS.
[23] Hafner, D. et al. Learning latent dynamics for planning from pixels. In Proceedings of the 36th International Conference on Machine Learning, Vol. 97, 2555–2565 (PMLR, 2019). URL https://proceedings.mlr.press/v97/hafner19a.html.
[24] Alonso, E. et al. Diffusion for world modeling: Visual details matter in Atari. In Advances in Neural Information Processing Systems, Vol. 37 (2024). ArXiv:2405.12399.
[25] Valevski, D., Leviathan, Y., Arar, M. & Fruchter, S. Diffusion models are real-time game engines. In International Conference on Learning Representations (2025). ArXiv:2408.14837.
[26] Mori, H. Transport, collective motion, and Brownian motion. Progress of Theoretical Physics 33, 423–455 (1965).
[27] Zwanzig, R. Nonlinear generalized Langevin equations. Journal of Statistical Physics 9, 215–220 (1973).
[28] Molinaro, R. et al. Generative ai for fast and accurate statistical computation of fluids (2025). URL https://arxiv.org/abs/2409.18359. arXiv:2409.18359.
[29] Lippe, P., Veeling, B. S., Perdikaris, P., Turner, R. E. & Brandstetter, J. PDE-Refiner: Achieving accurate long rollouts with neural PDE solvers. In Advances in Neural Information Processing Systems, Vol. 36 (2023). ArXiv:2308.05732.
[30] Kang, B. et al. How far is video generation from world model: A physical law perspective. In Proceedings of the 42nd International Conference on Machine Learning (2025). ArXiv:2411.02385.
[31] Kurutach, T., Clavera, I., Duan, Y., Tamar, A. & Abbeel, P. Model-ensemble trust-region policy optimization. In International Conference on Learning Representations (2018). ArXiv:1802.10592.
[32] Mentzer, F., Minnen, D., Agustsson, E. & Tschannen, M. Finite Scalar Quantization: VQ-VAE made simple. In International Conference on Learning Representations (ICLR) (2024).
[33] Lingsch, L., Kissas, G., Jakubik, J. & Mishra, S. Phaedra: Learning High-Fidelity Discrete Tokenization for the Physical Science (2026). ArXiv:2602.03915.
[34] Rombach, R., Blattmann, A., Lorenz, D., Esser, P. & Ommer, B. High-resolution image synthesis with latent diffusion models. In 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 10674–10685 (2022).
[35] Li, T., Tian, Y., Li, H., Deng, M. & He, K. Autoregressive image generation without vector quantization. In Advances in Neural Information Processing Systems, Vol. 37, 56424–56445 (2024).
[36] Hafner, D., Lillicrap, T., Norouzi, M. & Ba, J. Mastering atari with discrete world models. In International Conference on Learning Representations (ICLR) (2021). URL https://arxiv.org/abs/2010.02193.
[37] Meyer, E. J., White, A. & Machado, M. C. Harnessing discrete representations for continual reinforcement learning. Reinforcement Learning Journal 2, 606–628 (2024). URL https://rlj.cs.umass.edu/2024/papers/Paper84.html. ArXiv:2312.01203.
[38] Dosovitskiy, A. et al. An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale. In International Conference on Learning Representations (2021). URL https://openreview.net/forum?id=YicbFdNTTy.
[39] Wu, H., Luo, H., Wang, H., Wang, J. & Long, M. Transolver: A Fast Transformer Solver for PDEs on General Geometries. In Proceedings of the 41st International Conference on Machine Learning, Vol. 235 of Proceedings of Machine Learning Research (PMLR, 2024).
[40] Xu, J. et al. Accelerated policy learning with parallel differentiable simulation. In International Conference on Learning Representations (ICLR) (2022).
[41] Molnar, B. A., Heigel, J. C. & Whitenton, E. P. In situ thermography during laser powder bed fusion of a nickel superalloy 625 artifact with various overhangs and supports. Journal of Research of the National Institute of Standards and Technology 126, 126005 (2021).
[42] Ashby, A. et al. Thermal history and high-speed optical imaging of overhang structures during laser powder bed fusion: A computational and experimental analysis. Additive Manufacturing 53, 102669 (2022).
[43] Craeghs, T. et al. Feedback control of layerwise laser melting using optical sensors. Physics Procedia 5, 505–514 (2010).
[44] Wang, R., Standfield, B., Dou, C., Law, A. C. & Kong, Z. J. Real-time process monitoring and closed-loop control on laser power via a customized laser powder bed fusion platform. Additive Manufacturing 66, 103449 (2023).
[45] Yeung, H. Toward real-time feedback control for powder bed fusion additive manufacturing. Additive Manufacturing 114, 105041 (2025).
[46] Zhao, T. Z., Kumar, V., Levine, S. & Finn, C. Learning fine-grained bimanual manipulation with low-cost hardware. In Robotics: Science and Systems XIX (2023). ArXiv:2304.13705.
[47] Black, K., Galliker, M. Y. & Levine, S. Real-time execution of action chunking flow policies (2025). ArXiv:2506.07339.
[48] Peebles, W. & Xie, S. Scalable diffusion models with transformers. In Proceedings of the IEEE/CVF International Conference on Computer Vision, 4195–4205 (2023).
[49] Lipman, Y., Chen, R. T. Q., Ben-Hamu, H., Nickel, M. & Le, M. Flow matching for generative modeling. In The Eleventh International Conference on Learning Representations (2023). URL https://openreview.net/forum?id=PqvMRDCJT9t.
[50] Weller, H. G., Tabor, G., Jasak, H. & Fureby, C. A tensorial approach to computational continuum mechanics using object-oriented techniques. Computers in Physics 12, 620–631 (1998).
[51] Hirt, C. W. & Nichols, B. D. Volume of fluid (VOF) method for the dynamics of free boundaries. Journal of Computational Physics 39, 201–225 (1981).
[52] Roenby, J., Bredmose, H. & Jasak, H. A computational method for sharp interface advection. Royal Society Open Science 3, 160405 (2016).
Supplementary Information for "Generative World Models Enable Predictive Control of Laser Melt Pool Dynamics"
Yiyang Yan , Markus Bambach , Mohamadreza Afrasiabi
Advanced Manufacturing Lab, ETH Zürich, Leonhardstrasse 21, Zürich 8092, Switzerland
- Corresponding author: afrasiabi@ethz.ch (M. Afrasiabi)
This Supplementary Information provides the details required to reproduce the results of the main text: the high-fidelity thermal-fluid model and its numerical solution (Section S1), the randomized case-generation protocol and the composition of all datasets (Section S2), the preparation of the training data (Section S3), the architectures and training protocols of the autoencoder and the transition model (Sections S4 and S5), the baseline models and the evaluation protocol (Section S6), the configuration of the two controllers (Section S7), and the compute environment (Section S8).
S1 High-fidelity thermal-fluid model
S1.1 Governing equations and source terms
All training and evaluation data are generated with a customized two-phase solver implemented in OpenFOAM v5 [1], which extends the volume-of-fluid (VOF) framework [2] with the interfacial physics of laser melting. The same process model was validated against operando synchrotron tomographic microscopy in previous work [3]. Here, it is parameterized for Ti-6Al-4V under an argon atmosphere. Both phases are treated as incompressible Newtonian fluids in the laminar regime, and the metal volume fraction of the VOF formulation is the phase-indicator field observed by the world model. The solver advances the velocity , pressure , temperature and phase indicator according to
where the density , viscosity and thermal conductivity are blended between the metal and gas phases by , and the specific enthalpy includes the latent heats of fusion and evaporation. The momentum sources are surface tension , Marangoni shear , recoil pressure , Boussinesq buoyancy and the mushy-zone Darcy sink . The energy source is the absorbed laser power density, and is the interfacial heat loss. Their closures are summarized below, and the full formulation is given in [3].
The energy equation is solved in enthalpy form with temperature-dependent specific heat and thermal conductivity, blended between solid- and liquid-phase values across the melting interval. The latent heats of fusion and evaporation enter through liquid and vapor fractions that vary smoothly over the solidus-liquidus and boiling ranges, and the local temperature is capped at the boiling temperature. The laser follows the Gaussian irradiance profile with absorptivity and beam radius , and is distributed over the diffuse gas-metal interface in a continuum-surface-force manner [4]. The momentum equation includes surface tension with a linear temperature dependence, the associated Marangoni shear, evaporation-induced recoil pressure [5], Boussinesq buoyancy, and a Kozeny-Carman Darcy sink that suppresses flow in the mushy and solid regions [6]. Heat is extracted from the free surface by convective, radiative and evaporative losses. The thermophysical properties of Ti-6Al-4V are taken from standard references [7, 8] and are listed in Table S1, and the remaining model constants in Table S2.
Table S1: Thermophysical properties of Ti-6Al-4V used in the CFD model [7, 8]. denotes temperature in K.
| Property | Value |
|---|---|
| Solidus temperature | 1877 K |
| Liquidus temperature | 1923 K |
| Boiling temperature | 3315 K |
| Latent heat of fusion | J kg |
| Latent heat of evaporation | J kg |
| Density | 4420 kg m |
| Liquid viscosity | Pas |
| Specific heat, solid | J kg K |
| Specific heat, liquid | 831 J kg K |
| Thermal conductivity, solid | W m K |
| Thermal conductivity, liquid | 33.4 W m K |
| Thermal expansion coefficient | K |
| Surface tension at liquidus | 1.65 N m |
| Surface-tension temperature coefficient | N m K |
S1.2 Numerical solution
The computational domain of is discretized by a uniform Cartesian grid of cells ( cell size). The substrate occupies the lowest and argon fills the region above. All six domain boundaries are stationary no-slip, adiabatic walls, so that heat leaves the metal only through the interfacial convective, radiative and evaporative sinks. Pressure-velocity coupling uses the PIMPLE algorithm with two outer and three pressure-corrector iterations, first-order implicit (Euler) time integration and van Leer-limited divergence schemes for the advected fields. The gas-metal interface is advected with the geometric isoAdvector scheme [9]. The time step starts at and adapts to keep the Courant number below 0.75 and the interface Courant number below 1. Each case is decomposed over 64 MPI processes with a hierarchical in-plane
Table S2: Laser, environment and numerical model constants of the CFD model.
| Parameter | Value |
|---|---|
| Absorptivity (laser distribution factor) | 0.5 |
| Beam radius | 50m |
| Ambient temperature | 300 K |
| Convective heat-transfer coefficient | |
| Surface emissivity | 0.4 |
| Argon density | |
| Argon kinematic viscosity | |
| Darcy (mushy-zone) coefficient | |
| Gravitational acceleration |
decomposition.
S2 Randomized case generation and datasets
S2.1 Randomization protocol
Every simulated case is generated from a per-case random seed that determines the substrate geometry, the surface morphology, the initial temperature field, the scan path and, where applicable, the laser schedule. The individual components are constructed as follows.
Substrate and overhang geometry. The substrate is a 0.2 mm-thick prism whose top outline is cut by a random polyline of one or two segments and whose bottom outline is offset inward, producing an unsupported overhang whose face is inclined to the vertical. For the pretraining and schedule datasets, the inclination is drawn from , and with probability 0.05 each the cut or the overhang is omitted, yielding occasional fully supported substrates. For the banded-schedule dataset, the inclination is drawn from and every case contains an overhang. Spherical powder-like features are scattered across the top face: 800 spheres per case with radii drawn from and uniformly distributed centers.
Initial temperature field. The initial temperature field superposes 30 randomly placed anisotropic Gaussians centered at the substrate surface. Each Gaussian's normalized peak is drawn from , and the summed field is mapped to , giving peak initial temperatures up to approximately 1225 K. Gas cells start at the 300 K ambient temperature.
Scan path. Each case is scanned along a hatching pattern of random orientation drawn from , with track spacing drawn from and an inward margin from the substrate outline drawn from . Tracks shorter than 20% of the substrate diagonal are discarded and additional patterns are appended until the prescribed path length is reached. The laser is switched off for 0.25 ms while repositioning between tracks.
Laser schedules. Three schedule types are used. (i) Constant: laser power and scan speed are held at the case's nominal values, drawn from a grid spanning 0.5-2.4 m s (incre-ments of 0.1 ms ) and 40-325 W (increments of 15 W). (ii) Random walk: both parameters are resampled every 50 s by a clipped random walk started at the case's nominal grid values, with per-step changes drawn uniformly within ms and W and clipped to the global ranges. (iii) Banded random walk: as (ii), but each case's walk is additionally confined to a band of ms and W around its nominal values, so that the nominal grid point controls the case's processing regime.
Transient test schedules. A separate test set probes the response of the world model to time-varying laser inputs that drive the melt pool out of quasi-steady state. Its 90 cases are generated with the substrate, powder, initial-temperature and scan-path protocols above, with nominal power and speed drawn from the training grid and with every power and speed value kept within the global training ranges. The initial set comprises 30 step, 20 ramp, 20 modulated and 20 fast random-walk cases (Fig. S3). (i) Step: a single step change is applied at the first laser-on interval at or after ms, in laser power only (10 cases, W), in scan speed only (10 cases, ms ), or in both (10 cases). In the ten cases with the largest changes, the step coincides with the re-ignition of the laser after a repositioning interval. (ii) Ramp: power, speed or both change linearly from their nominal values, starting at ms and lasting 0.5, 1 or 2 ms, with total changes of 40-200 W and 0.4-1.5 ms (8 power-only, 6 speed-only and 6 combined cases). (iii) Modulated: the power oscillates about its nominal value as a sine or square wave at 0.5, 1, 2 or 5 kHz with an amplitude of 50-100 W, and in 4 of the 20 cases the speed is modulated in phase with an amplitude of 0.3-0.5 ms . At 5 kHz, one period spans four control intervals. (iv) Fast random walk: the clipped random walk of schedule type (ii) with the per-step limits doubled to W and ms . All seeds are disjoint from those of the training datasets. Two cases, one modulated and one fast random walk, were excluded because their CFD simulations diverged, leaving 88 test cases (30 step, 20 ramp, 19 modulated and 19 fast random walk).
S2.2 Dataset composition
Table S3 summarizes all datasets. Each case is simulated for 4 ms of process time, except the control-benchmark cases, which run until their predefined scan path has been traversed under the applied schedule. Cell-centered fields are recorded every 50 s, which defines the transition interval of the world model, so that a 4 ms case contributes 81 frames. The world model is trained in stages. The autoencoder is pretrained on the constant-schedule pretraining dataset, fine-tuned on frames of the random-walk schedule dataset and then frozen. Every transition model is trained on its latents. Representation and dynamics are learned separately: the autoencoder is trained on individual frames and never on transitions, so its fine-tuning exposes only the per-frame representation to time-varying schedules, whereas the base transition model is trained exclusively on constant-schedule trajectories. The comparison between the base and fine-tuned transition models therefore isolates the effect of time-varying data on the learned dynamics. The transition model is first trained on the constant-schedule pretraining dataset, giving the base model of the transition ablation, and is then fine-tuned on 100 time-varying cases. This fine-tuned model is the one used by both controllers. The time-varying cases come from a common pool of 400 random-walk (schedule) and 400 banded-schedule cases, generated with the protocols of Section S2.1. From this pool, 50 cases of each type form the fine-tuning set, with nested subsets of n = 10-75 cases for the data-scaling study, and a further 40 cases form the shared validation set used for early stopping. The Pure Transient reference is trained from scratch on all 800 cases of the pool, including the fine-tuning and validation cases, and is validated on a random 10% of their latent windows. The 25-case rollout test set uses constant parameters off the training grid: five speeds (0.825, 1.125, 1.425, 1.725 and 1.975 m s ), each lying between two training speeds, crossed with five powers (85, 145, 205, 265 and 315 W), and the 30-case control benchmark draws its initial conditions at random from the union of this rollout test set and the 88-case transient test set, so that the controller-selected schedules are re-simulated from overhang geometries and initial temperature fields unseen during training. All held-out cases are excluded from training in their entirety. The parameter-space coverage of the training and test grids, together with example schedule trajectories, is shown in Fig. S1, and example schedules of the three types in Fig. S2. The 88-case transient test set (Section S2.1) is used for the transition ablation of the main text, and representative schedules of its four regimes are shown in Fig. S3.

Fig. S1: Process-parameter coverage of the datasets. Gray dots mark the constant-parameter training grid and orange circles the 25 test grid points, whose speeds lie between the training values. The blue trace shows an example random-walk schedule trajectory and the green trace an example banded random-walk trajectory, confined to the shaded band of m s and W around its nominal point. Filled dots mark the nominal starting points. Trajectories are generated with the sampling rules of Section S2.1.
S3 Training data preparation
For each recorded frame, the cell-centered temperature, phase-indicator, velocity, and liquid-metal-fraction fields are stored in single-precision HDF5 archives on the simulation grid, together with the heat-source position and laser power of every interval. Only the temperature and phase-indicator fields are exposed to the world model. Temperature is normalized as and clipped to , corresponding to the physical range between the ambient

Fig. S2: Example laser schedules of the three dataset types. Laser power (blue, left axis) and scan speed (orange, right axis) over one 4 ms case for (a) constant parameters, (b) the clipped random walk, and (c) the banded random walk. Gray bands mark 0.25 ms repositioning intervals between tracks, during which the laser is off. The track boundaries shown are illustrative, as actual track lengths depend on the sampled scan path. Traces are generated with the sampling rules of Section S2.1.
Table S3: Composition of the simulated datasets. Each case uses an independently sampled substrate geometry, surface morphology, initial temperature field and scan path (Section S2.1). The schedule and banded-schedule datasets form one 800-case pool, from which the fine-tuning set (50 + 50 cases) and the shared validation set (40 cases) are drawn. The Pure Transient reference is trained on all 800 cases. The control-benchmark cases take their initial conditions from the rollout and transient test sets.
| Dataset | Cases | Laser schedule | Overhang angle | Role |
|---|---|---|---|---|
| Pretraining | 400 | constant (20 × 20 grid) | AE + transition pretraining | |
| Schedule | 400 | random walk | AE fine-tuning, time-varying pool | |
| Banded schedule | 400 | banded random walk | time-varying pool | |
| Rollout test | 25 | constant (off-grid) | base model evaluation | |
| Transient test | 88 | step, ramp, modulated, fast walk | transition evaluation and ablation | |
| Control benchmark | 30 | controller-defined | control evaluation |

b
c
d
Speed (m s )
Fig. S3: Example laser schedules of the four transient test regimes. Laser power (blue, left axis) and scan speed (orange, right axis) recorded over one 4 ms case for (a) a step change in both power (-70 W) and speed (+1.5 ms ), (b) a 0.5 ms ramp in both power (+90 W) and speed (-0.7 ms ) starting at 0.5 ms, (c) a 0.5 kHz sinusoidal modulation of power (75 W amplitude) and speed (0.5 ms amplitude), and (d) a fast random walk with per-step changes of up to 120 W and 0.8 ms . Gray bands mark the 0.25 ms repositioning intervals during which the laser is off. Each control value is held for one 50 s control interval.
temperature and 4000 K. The phase-indicator and liquid-fraction fields lie in and are used unnormalized.
For transition-model training, all frames of a dataset are encoded once by the frozen autoencoder into latent tensors of shape . Training samples are windows of consecutive latent frames ( ) together with up to five rollout targets. A 4 ms case yields 76 windows. The conditioning vector of each transition is , comprising the in-plane heat-source coordinates at the start of the interval in millimetres and the laser power applied during it in kilowatts. Gaussian noise with standard deviation is added to the past latent window at load time as a stabilizing perturbation. The autoencoder uses a random 90/10 train-validation split over frames, drawn with a fixed seed (42). The transition models use case-level splits, so that no window of a validation case enters training: the base model and the two deterministic baselines are trained on 360 cases of the pretraining dataset and validated on the remaining 40, and each fine-tuned model is trained on its cases and validated on a shared set of 40 cases (20 random-walk and 20 banded) from the 800-case time-varying pool, disjoint from every fine-tuning set. The fine-tuning sets are nested () and balanced between random-walk and banded cases. Only the Pure Transient reference uses a random 90/10 split, over the latent windows of its 800 training cases (seed 42). The case lists are released with the code. Because early frames are underrepresented relative to their importance for rollout initialization, frames at and are oversampled with replacement at and their base probability.
S4 Autoencoder architecture and training
S4.1 Architecture
The branched FSQ autoencoder maps the two observed fields to a 10-channel latent tensor at 4× reduced resolution and reconstructs three fields (Table S4). The encoder is a 3D convolutional network with two downsampling stages, channel widths 64/128/256, two residual blocks per resolution and two mid-level residual blocks, using GroupNorm (32 groups) and SiLU activations. Its 10 output channels are split into 8 morphology channels, quantized by finite scalar quantization [10] with nominal per-channel levels [5, 4, 4, 3, 3, 3, 2, 2], and two amplitude channels, one per field, each quantized uniformly on [-1, 1]. Each channel is quantized as round(tanh(·)(L - 1)/2) without the half-step offset that FSQ applies to an even number of levels L, so a channel with L = 4 takes three values and a channel with L = 2 takes only the value zero. The effective morphology levels are therefore [5, 3, 3, 3, 3, 3, 1, 1]: six active channels with an implicit vocabulary of 1215 spatial patterns per latent site. The amplitude channels take 1023 uniformly spaced levels. Two lightweight decoder branches with mirrored architecture (base width 32, one residual block per resolution) reconstruct temperature and phase indicator from the shared morphology channels and the respective amplitude channel. A Softplus output activation enforces non-negative temperature and a Sigmoid keeps the phase indicator in [0, 1]. The full model has 25.6 M parameters (15.9 M encoder, 4.8 M per decoder branch).
The liquid-metal fraction is not learned as an independent output. It is computed deterministically from the reconstructed fields by the melt-fraction map of the main text, applied voxel-wise to the denormalized temperature,
where and are the midpoint and width of the melting interval. The phase-indicator factor restricts to cells containing material, and the smooth step transitions from 0 to 1 as the temperature crosses the melting interval, mirroring the melt-fraction definition of the CFD solver. The same map produces the decoded liquid fraction used by the auxiliary supervision of the transition model (Section S5.2) and by the depth extraction of the controllers.
S4.2 Training
The autoencoder is trained on individual frames in two stages (Table S5): it is first trained from random initialization on the constant-schedule pretraining dataset (400 cases), and then fine-tuned, starting from these weights, on the random-walk schedule dataset (400 cases) to adapt the representation to time-varying laser schedules. The loss is the sum of (i) equally weighted mean-squared
Table S4: Autoencoder architecture.
| Component | Setting |
|---|---|
| Input | (normalized ) |
| Latent | |
| Latent split | 8 morphology + 1 -amplitude + 1 -amplitude channels |
| FSQ levels (morphology) | nominal [5, 4, 4, 3, 3, 3, 2, 2] |
| Effective levels | [5, 3, 3, 3, 3, 3, 1, 1] (1215 patterns per site) |
| Amplitude quantization | 1023 uniform levels per channel |
| Encoder | base width 64, multipliers (1, 2, 4), 2 residual blocks per level |
| Decoders () | base width 32, multipliers (1, 2, 4), 1 residual block per level |
| Normalization / activation | GroupNorm (32 groups) / SiLU |
| Output activations | Softplus (), Sigmoid () |
| Parameters | 25.6 M |
reconstruction errors of the three output fields, (ii) a phase-mass term (weight 1) penalizing the squared relative error of the reconstructed phase indicator, (iii) a temperature-gradient term (weight 1) matching three-dimensional finite-difference gradients of the reconstructed and target temperature fields, (iv) an initial-condition penalty on frames (value and gradient errors, with weight 1 during the first epoch and thereafter), and (v) the quantizer commitment terms of the FSQ and amplitude tokenizers. Optimization uses AdamW with weight decay excluded for bias parameters, a cosine learning-rate schedule with warmup over the first 10% of steps, and bf16 mixed precision with data parallelism over four GPUs. The checkpoint with the lowest validation relative error is retained, and it reaches a validation relative error of about 1.6%. The two stages serve different purposes. The pretrained checkpoint is the FSQ arm of the representation ablation (Section S6.1 and main-text Fig. 3a,b), compared with a continuous bottleneck trained on the same constant-schedule frames. The fine-tuned checkpoint is the world-model autoencoder: it is frozen and encodes the latents on which every transition model, including the deterministic baselines, is trained.
Table S5: Autoencoder training protocol.
| Pretraining | Fine-tuning | |
|---|---|---|
| Dataset | constant schedules (400 cases) | random walk (400 cases) |
| Initialization | random | pretrained weights |
| Optimizer | AdamW | AdamW |
| Peak learning rate | , then | |
| Weight decay | , then | |
| Schedule | cosine, 10% warmup | cosine, 10% warmup |
| Batch size (global) | 8 | 8 |
| Epochs | 294 (193 + 101) | checkpoint at epoch 78 of 101 |
| Precision | bf16 | bf16 |
| Hardware | 4× RTX 4090 | 4× RTX 4090 |
| Wall-clock time |
S5 Transition model architecture and training
S5.1 Architecture
The transition model is a diffusion transformer [11] operating on the latent grid (Table S6). The noisy residual is concatenated channel-wise with the past window of latent frames (50 channels), giving 60 input channels, and divided into anisotropic patches (after replicate-padding the in-plane extent to ), producing tokens. The depth direction retains its full latent resolution because melt-pool penetration depth is the principal controlled quantity. Tokens are embedded to width 256 with a learned positional embedding and processed by 8 transformer blocks with 8 attention heads and GELU MLPs of expansion 4. The conditioning vector and the flow-matching time are embedded and injected through adaLN-Zero modulation of every attention and MLP block, with the modulation and output projections initialized to zero so that the network starts as an identity map. The model has 10.2 M parameters.
At rollout time, the flow is integrated with four Euler steps from a Gaussian sample, so that each transition costs four network evaluations. The predicted residual is added to , and the result can optionally be re-quantized by the frozen FSQ tokenizer. Fixing the noise seed makes the sampled transition deterministic, and the rollout is differentiable end to end, with gradients passed through the optional FSQ rounding by the straight-through estimator, which is exploited by both controllers.
Table S6: Transition-model (DiT) architecture.
| Component | Setting |
|---|---|
| Input | noisy residual past window: |
| Patch size | (1352 tokens) |
| Width / depth / heads | 256 / 8 / 8 |
| MLP expansion | 4 (GELU) |
| Conditioning | and via adaLN-Zero |
| Euler steps per transition | 4 |
| Parameters | 10.2 M |
S5.2 Training
The flow-matching transition is trained in two stages with the objective of the main text (Table S7): first from random initialization on the latents of the pretraining dataset (the base model, used for the rollout-fidelity evaluation of main-text Fig. 2 and as the base of the transition ablation, trained on an explicit split of 360 training and 40 validation cases), and then initialized from the pretraining-data model and fine-tuned on 100 time-varying cases (50 schedule and 50 banded-schedule cases from the 800-case pool of Section S2.2), with early stopping on a separate 40-case validation set from the same pool (used for the control studies). The same fine-tuning recipe with , 20, 50 and 75 cases, drawn as nested subsets of the same case pool, provides the data-scaling study of main-text Fig. 3g,l (training curves in Fig. S4b,c). The Pure Transient reference of main-text Fig. 3 uses the architecture and training recipe of the base model (Table S7, first column) but is trained from random initialization on all 800 cases of the time-varying pool, including the fine-tuning and validation cases, with a random 90/10 split of their latent windows (seed 42) and early stopping on this validation error. Optimization uses AdamW with a 500-step linear warmup followed by cosine decay, gradient-norm clipping at 1.0, and bf16 mixed precision over four GPUs. The checkpoint with the lowest validation error is retained, where validation draws a full four-step sample of the next latent state and measures its relative error (Fig. S4a,b). Both models are trained in the latent space of the frozen autoencoder.
Three mechanisms stabilize long autoregressive rollouts. First, a push-forward curriculum is applied: after a short teacher-forced warmup (3 epochs for both runs), each batch draws a rollout depth , advances the first steps with the model's own four-step samples without gradient tracking, and applies the flow-matching loss at step . Second, each sample's loss is weighted by , where is the frame index, emphasizing the early transient during which the melt pool forms. Third, for both models, an auxiliary supervision anchors the latent dynamics to the physical melt pool: the one-step estimate is decoded through the frozen decoder and its liquid-metal fraction is penalized with an loss against the CFD reference (weight ).
Table S7: Transition-model training protocol.
| Pretraining-data model | Control model | |
|---|---|---|
| Training latents | pretraining (360 + 40 cases) | schedule + banded (50 + 50 cases) |
| Initialization | random | pretraining-data model |
| Latent windows | 27,360 | 7,600 |
| Optimizer | AdamW | AdamW |
| Peak learning rate | ||
| Weight decay | ||
| Warmup steps | 500 | 200 |
| Gradient clipping | 1.0 | 1.0 |
| Batch size (global) | 32 | 32 |
| Push-forward warmup epochs | 3 | 3 |
| Liquid-fraction supervision | , weight | , weight |
| Stopping | best validation, 400 epochs (342,000 steps) | early stopping (patience 20), steps |
| Precision | bf16 | bf16 |
| Hardware | 4× RTX 4090 | 4× RTX 4090 |
| Wall-clock time |
S6 Baselines and evaluation protocol
S6.1 Baseline models
The transition ablation compares the flow-matching DiT against two deterministic regressors trained on the same frozen latent space, with the same past window, conditioning construction and early-step weighting. The ViT baseline [12] shares the DiT's tokenization and transformer dimensions: identical patch size (), width (256), depth (8) and head count (8), predicting the latent
a

b
c
Fig. S4: Training curves of the transition models. (a) Validation one-step relative error of the transition models trained on the constant-schedule latents with the same 360/40 case split: the base flow-matching model (DiT) and the deterministic ViT and Transolver baselines, plotted against optimizer steps at a matched budget of approximately steps. For the DiT the one-step prediction is one sample of the predicted distribution, whereas the deterministic regressors predict its conditional mean, which minimizes the expected squared error by construction. Their lower one-step error therefore does not carry over to recursive rollouts (main-text Fig. 3c-f). (b) One-step and (c) five-step-rollout validation relative error of the fine-tuning ladder, in which the base model is fine-tuned on n = 10, 20, 50, 75 and 100 time-varying cases and validated on the same 40 time-varying cases. With n = 10 and 20 the validation error does not improve beyond its value after 2,016 steps, and early stopping ends both runs after 22,176 steps. With , both errors decrease throughout, and the lowest validation error falls near the 60,000-step cap. Open circles mark the checkpoints with the lowest validation error, which are the models used in the main text. Curves are parsed from the training logs.
residual deterministically from the 50-channel past window under a mean-squared-error loss (6.8 M parameters, compared with 10.2 M for the DiT). The Transolver baseline [13] uses five physics-attention layers of width 256 with 8 heads and 64 slices, with the conditioning injected through feature-wise modulation. Both baselines are trained with AdamW (learning rate , weight decay , 500 warmup steps, gradient clipping 1.0) with a rollout curriculum of depth . Because their transitions are deterministic, gradients are propagated through the full rollout with activation checkpointing rather than by push-forward. The ViT is trained for 400 epochs at a global batch size of 32 (342,000 optimizer steps), identical to the base flow-matching model, and the Transolver (19.0 M parameters) for 201 epochs at a global batch size of 16 (343,710 steps). All three constant-schedule models are thus trained with the same budget of approximately optimizer steps on the same 360/40 split. The Transolver validation error reaches its minimum after steps and remains flat thereafter (Fig. S4a), so its training is converged within this budget.
The representation comparison contrasts the FSQ autoencoder with a continuous bottleneck of identical architecture, in which only the rounding of the morphology and amplitude channels is removed while their tanh bounding is retained, so both models have the same parameters and latent dimensionality (25.6 M parameters, latent). The FSQ arm is the autoencoder after constant-schedule pretraining (Table S5), before fine-tuning on random-walk frames. The continuous arm is trained from random initialization on the same constant-schedule dataset with the pretraining recipe of Table S5 over a 200-epoch cosine schedule, and its epoch-150 checkpoint is used, so it receives less training than the FSQ arm. Both are evaluated on the 25 constant-parameter and 88 transient test cases by the per-frame relative error of each field, reported as the median over frames (for , over frames containing melt). The error budget encodes and decodes each CFD frame with the world-model autoencoder, without the transition model, and scores the reconstruction with the same melt-pool depth and field metrics as the rollouts (Table S8).
Table S8: Reconstruction errors of the FSQ and continuous autoencoders and error budget of the world model. Field errors are median per-frame relative errors in percent. The depth error is the mean absolute error of the reconstructed melt-pool depth for the autoencoders (all 80 steps for the constant set, laser-on steps for the transient set) and the depth CRPS for the world-model rollout. The world-model autoencoder is the fine-tuned FSQ autoencoder used by all transition models, and the rollout is the base transition model of main-text Figs. 2 and 3.
| Test set | Model | T (%) | (%) | (%) | Depth () |
|---|---|---|---|---|---|
| Constant (25) | FSQ autoencoder | 1.73 | 2.45 | 6.9 | 0.23 |
| Continuous autoencoder | 1.33 | 1.86 | 5.3 | 0.14 | |
| World-model autoencoder | 1.65 | 2.65 | 6.1 | 0.17 | |
| World-model rollout | 7.49 | 7.60 | - | 4.55 | |
| Transient (88) | FSQ autoencoder | 1.80 | 2.44 | 7.4 | 0.22 |
| Continuous autoencoder | 1.37 | 1.79 | 5.6 | 0.15 | |
| World-model autoencoder | 1.69 | 2.66 | 6.4 | 0.18 | |
| World-model rollout | 8.99 | 7.79 | - | 5.77 |
S6.2 Rollout evaluation
Rollout fidelity is evaluated on the 25 rollout-test cases. Each evaluation encodes the CFD state at , tiles it to fill the five-frame history, and rolls the transition model forward for 80 steps (4 ms) under the recorded heat-source controls, with four Euler steps per transition, repeated for 8 noise seeds per case. Fields are decoded at every step. Consistent with the CFD solver's boiling-temperature cap, decoded temperatures are clamped at 3315 K. Reported metrics are the relative errors of the physical temperature and phase-indicator fields, the intersection-over-union of the melt-pool region (), and the melt-pool depth, measured from the initial substrate top surface to the deepest point at which the decoded liquid fraction reaches 0.5 and located with sub-voxel interpolation. The depth-error distribution pools all per-step predictions, with the predicted depth taken as the median over an ensemble of 8 rollouts with distinct noise seeds.
The distributional comparison of the transition ablation uses the continuous ranked probability score. For the flow-matching model, an ensemble of 8 rollouts with distinct noise seeds is generated per trajectory, and the CRPS against the CFD reference is computed with the empirical ensemble estimator
with members . For the temperature, phase-indicator and melt-pool fields it is evaluated per voxel and averaged over all voxels of the grid, gas cells included, whereas for melt-pool depth and volume it is evaluated per step. For the deterministic baselines () the CRPS
Base DiT Fine Tuned ViT Transolver Pure Transient
a
b
c
d
e

f
g
h
k
1
m
n
0
p
q
r
s
t
Fig. S5: Transition ablation resolved by transient schedule regime. Rows correspond to the step (30 cases), ramp (20), modulated (19) and fast random-walk (19) regimes of the transient test set (Fig. S3), and columns follow main-text Fig. 3c-g, with the same models, normalization and axis limits. (a,f,k,p) Temperature, (b,g,l,q) phase-indicator and (c,h,m,r) melt-pool-field CRPS over the 4 ms rollout. Lines are case means and shaded bands their 95% bootstrap confidence intervals. (d,i,n,s) Normalized CRPS of melt-pool depth and volume, with 95% bootstrap confidence intervals. (e,j,o,t) Melt-pool depth CRPS of the fine-tuned model against the number of time-varying fine-tuning cases n, with horizontal lines marking the models without fine-tuning. Paired statistics are given in Section S6.2.

b
c

d

Fig. S6: Base and fine-tuned transition on the constant-parameter test set. Rollouts on its 25 cases of main-text Fig. 2. (a) Temperature and (b) phase-indicator relative error and (c) melt-pool intersection over union over the 4 ms rollout. Lines are case means (each case averaged over 8 noise seeds) and bands their 95% bootstrap confidence intervals. (d) Cumulative distribution of the melt-pool depth error, with the depth taken as the median over 8 noise seeds and all per-step predictions pooled, with dotted lines marking one, two and three voxels. Within one, two and three voxels lie 81%, 95% and 98% of the base-model predictions and 74%, 91% and 96% of the fine-tuned predictions.
reduces to the mean absolute error, allowing a direct comparison. These ensemble evaluations use the 88 transient test trajectories (Section S2.1) of 80 steps each, and results are reported both for all 88 cases and resolved by schedule regime (Fig. S5). Melt-pool depth and volume are scored only on laser-on steps, excluding the 0.25 ms repositioning intervals. Their CRPS is pooled over all laser-on steps of a case set, so that each step carries equal weight (4,616 steps for the 88 transient cases and 972 for the 19 fast random-walk cases). The normalized values of main-text Fig. 3f,k divide these pooled means, in both rows, by the mean CFD value over the laser-on steps of all 88 cases (73.5 m for depth and mm for volume), and the fine-tuning curves of main-text Fig. 3g,l show the same pooled depth CRPS in micrometres. Error bands and error bars are 95% confidence intervals from a bootstrap over cases (20,000 resamples), in which each resample draws whole cases and recomputes the step-pooled mean. Differences between models are instead computed per case: each case's value is its mean over its laser-on steps, the paired differences are averaged over cases with equal weight, and a paired bootstrap over the identical case set (20,000 resamples) gives a two-sided P value. Pooled levels and case-averaged differences can therefore differ slightly. On the fast random walk, for example, the pooled base and fine-tuned depth CRPS are 8.42 and 6.46 m, whereas the mean per-case difference is m ( ).
Resolving the transition ablation by schedule regime (Fig. S5) shows a consistent ordering of difficulty: every model is most accurate on step inputs and least accurate on the fast random walk, with base-model depth CRPS of 4.5, 5.0, 6.0 and 8.4 m for step, ramp, modulated and fast random-walk inputs. The benefit of fine-tuning follows the non-stationarity of the input. On step and ramp inputs, where the melt pool relaxes toward a quasi-steady state between changes, the fine-tuned model is not more accurate than the base model ( m, , and m, , respectively). On modulated inputs it improves the depth CRPS by 0.90 m ( ), and on the fast random walk it lowers it from 8.4 to 6.5 m, the largest change in magnitude but not significant with 19 cases ( ). The degradation from fine-tuning on few cases is significant for on step, ramp and modulated inputs, and persists up to on ramp inputs. The flow-matching base model is more accurate than both deterministic baselines in every regime, significantly so on step and fast random-walk inputs, and the phase indicator is predicted similarly by all models throughout.
S6.3 Qualitative rollouts under fast random-walk inputs
Figures S7-S10 complement the aggregate transient evaluation with three-dimensional temperature and surface-geometry comparisons between the fine-tuned world model and CFD on four of the 19 fast random-walk test cases. The cases were selected by quantiles of per-case laser-on depth-CRPS differences: case p83 is the median of the fine-tuned-minus-base DiT difference, and cases p89, p88 and p84 correspond to the 25th, 50th and 75th percentiles of the ViT-minus-base DiT difference, respectively. Selection therefore uses the quantitative evaluation rather than visual agreement. Fine-tuning lowers the depth CRPS relative to the base model for p83, p89 and p84, but increases it for p88, which illustrates that the average benefit on fast random-walk inputs does not imply an improvement on every trajectory. Each figure shows one autoregressive sample (noise seed 0), whereas its header reports the ensemble-based laser-on depth CRPS used in the quantitative evaluation.
WM depth CRPS: 2.59 m
25th percentile
best
worst

Fig. S7: Qualitative fast random-walk rollout of the fine-tuned world model: case p83. World-model (WM) and CFD temperature fields at eight times from 0.5 to 4.0 ms, arranged in two blocks of four columns. WM denotes the early-stopped DiT fine-tuned on n = 100 time-varying cases. Starting from the encoded CFD state at t = 0, the model advances autoregressively for 80 steps of 50 s under the recorded controls, without subsequent CFD feedback. The displayed sample uses noise seed 0 and four function evaluations per transition. Surfaces delimit the metal region ( ) and are coloured by temperature on the scale of main-text Fig. 2. Below each block, laser power P (navy, left axis) and scan speed v (ochre, right axis) show the inputs. The strip below each column covers the preceding 0.5 ms, and dotted lines mark the frame times. The header reports the ensemble-based laser-on depth CRPS (2.59 m, versus 3.77 m for the base DiT). The navy marker locates the case among the 19 fast random-walk cases from lowest to highest WM depth CRPS: rank 5 of 19, displayed as the 25th percentile after rounding to the nearest five percentage points.
WM depth CRPS: 2.78 m
35th percentile
best
worst

Fig. S8: Qualitative fast random-walk rollout of the fine-tuned world model: case p89. As in Fig. S7, for case p89, selected at the 25th percentile of the ViT-minus-base DiT depth-CRPS difference. WM and CFD temperature fields are shown at 0.5 ms intervals with the corresponding laser-power and scan-speed schedules. The displayed WM trajectory uses noise seed 0, whereas the ensemble-based laser-on depth CRPS is 2.78 m, compared with 4.68 m for the base DiT. This case ranks 7th of 19 fast random-walk cases by increasing fine-tuned depth CRPS, shown as the 35th percentile.
WM depth CRPS: 2.72 m
30th percentile
best
worst

Fig. S9: Qualitative fast random-walk rollout of the fine-tuned world model: case p84. As in Fig. S7, for case p84, selected at the 75th percentile of the ViT-minus-base DiT depth-CRPS difference. WM and CFD temperature fields are shown at 0.5 ms intervals with the corresponding laser-power and scan-speed schedules. The displayed WM trajectory uses noise seed 0, whereas the ensemble-based laser-on depth CRPS is 2.72 m, compared with 3.40 m for the base DiT. This case ranks 6th of 19 fast random-walk cases by increasing fine-tuned depth CRPS, shown as the 30th percentile.
WM depth CRPS: 12.38 m
95th percentile best | worst

Fig. S10: Qualitative fast random-walk rollout with degraded depth accuracy after fine-tuning: case p88. As in Fig. S7, for case p88, selected at the median of the ViT-minus-base DiT depth-CRPS difference. WM and CFD temperature fields are shown at 0.5 ms intervals with the corresponding laser-power and scan-speed schedules. The displayed WM trajectory uses noise seed 0. The ensemble-based laser-on depth CRPS is 12.38 m for the fine-tuned model, compared with 4.91 m for the base DiT. This case ranks 18th of 19 fast random-walk cases by increasing fine-tuned depth CRPS, shown as the 95th percentile. This case illustrates a deterioration in depth accuracy despite the average improvement across the fast random-walk test set.
S7 Controller configuration
S7.1 Shared plant interface
Both controllers act on the frozen control-stage world model with the same bounded action space, m s and W, and the same control interval s. The local support thickness below the laser, , is precomputed for each case from the initial substrate geometry as a map on the simulation grid. Both controllers use the thickness-capped band penalty of Methods, with the effective depth target at step
where is the nominal fusion depth, a minimum bonding depth, the relative-depth threshold, and the support thickness at a single lookahead point ahead of the laser along the path (one control interval at ). The stage cost is
with band width , and . Here is a smooth relaxation of the threshold depth of Section S6.2, differentiable with respect to the decoded liquid fraction. The stage cost is summed over the laser-on steps of each planning window or imagined trajectory. Repositioning steps, during which the laser is off, contribute nothing. The target is computed from thickness lookups that are held constant during differentiation, so that the optimizer cannot lower it by changing the speed.
S7.2 Model-predictive controller
At each replanning step, the receding-horizon controller optimizes a candidate sequence of actions (0.5 ms) by backpropagating the summed stage cost through the latent rollout, and executes the first actions before replanning (Table S9). The actions are parameterized by unconstrained variables and that a sigmoid maps into the bounds, sigmoid( ) and sigmoid( ), so that every candidate schedule respects the action bounds. Each replanning solves 10 Adam iterations on these unconstrained variables at learning rate 0.5 with gradient-norm clipping at 1.0. Because the scan path is fixed, the number of remaining control intervals is recomputed from the optimized speeds at each replanning, so that faster schedules finish the path in fewer intervals. To keep the optimization inexpensive, the planning rollout integrates the flow with two Euler steps per transition (rather than the four used for evaluation rollouts), with gradients propagated through the full planning window using activation checkpointing. The controls are initialized at 1.8 ms and 250 W at the start of each case and warm-started from the previous plan thereafter.
S7.3 Amortized policy
The actor and critic share the same observation encoder (Table S10). The observation combines three inputs. The quantized latent history (50 channels at ) is processed by a three-layer 3D convolutional encoder (widths 64/64/128, GELU) followed by a linear projection to 256 features. Twelve scalars, comprising the laser position (mm), the local path tangent, the previous
Table S9: Model-predictive controller settings.
| Setting | Value |
|---|---|
| Planning horizon | 10 steps (0.5 ms) |
| Executed actions per replan | 2 |
| Action parameterization | sigmoid of unconstrained variables |
| Inner optimizer | Adam, 10 iterations, learning rate 0.5 |
| Gradient clipping | 1.0 |
| Euler steps per transition (planning) | 2 |
| Action bounds | |
| Initialization |
normalized action, the scan progress, and the support thickness at five lookahead points along the path, are processed by a two-layer MLP to 32 features. A local support-thickness patch centered on the laser is processed by a two-layer 2D convolutional encoder to 32 features. Thickness inputs are scaled by . The concatenated 320 features feed separate two-layer heads of width 256: the actor outputs two logits mapped to the bounded actions through sigmoids, and the critic outputs a scalar value.
Training follows the SHAC scheme of Methods. Each update samples initial observations by drawing a random case and a random time window from the constant-schedule training set, excluding windows whose initial melt-pool depth exceeds . The actor is rolled through the frozen world model for steps with seeded transition noise, and the bootstrapped return is backpropagated through the differentiable rollout with activation checkpointing. The critic is fitted to the backward-accumulated return targets. Actor and critic use Adam with learning rates and , gradient-norm clipping at 5.0, and discount , for 700 alternating updates on a single GPU. At deployment only the actor is retained and evaluated once per control step.
Table S10: Amortized-policy (SHAC) settings.
| Setting | Value |
|---|---|
| Rollout length | 16 steps (0.8 ms) |
| Trajectories per update | 6 |
| Updates | 700 |
| Discount | 0.99 |
| Actor / critic optimizer | Adam, |
| Gradient clipping | 5.0 |
| Feature dimensions | latent 256 + scalars 32 + thickness patch 32 |
| Head widths | 256, 256 |
| Action bounds | |
| Actor parameters | 4.8 M |
S7.4 Control benchmark and CFD re-validation
The control benchmark executes each of the 30 benchmark cases, whose initial conditions are drawn at random from the union of the 25-case rollout test set and the 88-case transient test set.
(Section S2.2), with the unoptimized schedule, MPC and the amortized policy. The unoptimized reference holds the nominal parameters and constant along the path. For every controlled trajectory, the selected power and speed schedules are exported together with the case's initial temperature and phase fields, imposed as piecewise-constant inputs over successive intervals, and re-simulated with the identical CFD configuration of Section S1. World-model and CFD depths are then compared on the simulation grid.
S8 Compute environment
All CFD simulations run on the Euler cluster of ETH Zurich, each case decomposed over 64 MPI processes on a single AMD EPYC 7763 node. Re-simulating one control case required a median wall-clock time of approximately 17 minutes (interquartile range 13 to 19 minutes). The solver is containerized (Docker image converted to Apptainer) with OpenFOAM v5, swak4Foam for field initialization and the isoAdvector interface scheme. Network training uses PyTorch (v2.10) with Accelerate (v1.12) for bf16 data-parallel training on nodes with four NVIDIA RTX 4090 GPUs (24 GB), and experiment tracking uses Weights & Biases. Controller training, policy inference and all latency measurements of the main text run on a single NVIDIA RTX 5090 GPU.
References
[1] Weller, H. G., Tabor, G., Jasak, H. & Fureby, C. A tensorial approach to computational continuum mechanics using object-oriented techniques. Computers in Physics 12, 620–631 (1998).
[2] Hirt, C. W. & Nichols, B. D. Volume of fluid (VOF) method for the dynamics of free boundaries. Journal of Computational Physics 39, 201–225 (1981).
[3] Muther, A. et al. Identifying melt pool behavior in ceramics PBF-LB via operando synchrotron tomographic microscopy and high-fidelity process modeling. Additive Manufacturing 103, 104756 (2025).
[4] Brackbill, J. U., Kothe, D. B. & Zemach, C. A continuum method for modeling surface tension. Journal of Computational Physics 100, 335–354 (1992).
[5] Anisimov, S. I. & Khokhlov, V. A. Instabilities in Laser-Matter Interaction (CRC Press, Boca Raton, 1995).
[6] Voller, V. R. & Prakash, C. A fixed grid numerical modelling methodology for convection-diffusion mushy region phase-change problems. International Journal of Heat and Mass Transfer 30, 1709–1719 (1987).
[7] Mills, K. C. Recommended Values of Thermophysical Properties for Selected Commercial Alloys (Woodhead Publishing, Cambridge, 2002).
[8] Boivineau, M. et al. Thermophysical properties of solid and liquid Ti-6Al-4V (TA6V) alloy. International Journal of Thermophysics 27, 507–529 (2006).
[9] Roenby, J., Bredmose, H. & Jasak, H. A computational method for sharp interface advection. Royal Society Open Science 3, 160405 (2016).
[10] Mentzer, F., Minnen, D., Agustsson, E. & Tschannen, M. Finite Scalar Quantization: VQ-VAE made simple. In International Conference on Learning Representations (ICLR) (2024).
[11] Peebles, W. & Xie, S. Scalable diffusion models with transformers. In Proceedings of the IEEE/CVF International Conference on Computer Vision, 4195–4205 (2023).
[12] Dosovitskiy, A. et al. An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale. In International Conference on Learning Representations (2021). URL https://openreview.net/forum?id=YicbFdNTTy.
[13] Wu, H., Luo, H., Wang, H., Wang, J. & Long, M. Transolver: A Fast Transformer Solver for PDEs on General Geometries. In Proceedings of the 41st International Conference on Machine Learning, Vol. 235 of Proceedings of Machine Learning Research (PMLR, 2024).