UniFlow: Unified Multi-Scale Flow Matching for Time Series Generation
Organizations: College of Computing and Data Science, Nanyang Technological University, Singapore. · Shanghai Jiao Tong University and Beijing Zhongguancun Academy, Shanghai, China. · Institute for Infocomm Research and AIMfg, A* STAR, Singapore 138634. · School of Artificial Intelligence, Shanghai Jiao Tong University, Shanghai, China.
Abstract
Real-world time series exhibit complex dynamics across multiple temporal resolutions, yet effectively incorporating multi-scale information into generative modeling remains challenging without increasing generative complexity. We propose UniFlow, a unified framework that integrates multi-scale representation learning with efficient non-autoregressive generation through a shared-semantic discrete interface. Specifically, a multi-scale tokenizer employs shared-index voting to consolidate complementary temporal information into a single public-ID sequence, while scale-specific codebooks preserve the information required for reconstruction. Building on this unified representation, we develop geometry-aware categorical flow matching, which initializes transport from learned low-rank anchors and generates public identities non-autoregressively. This design captures multi-scale temporal structure without requiring multiple generative token streams or sequential token decoding. Experiments across four benchmarks and both short- and long-term settings demonstrate improved generative fidelity, strong cross-scale consistency, and substantial inference speedups over representative autoregressive and diffusion-based baselines. Code is available at https://github.com/William-Liwei/uniflow
Figures & tables
| Dataset | Shared Ref. Token | Shared Ref. Seq | Scale-1 Token | Scale-1 Seq | Scale-2 Token | Scale-2 Seq |
|---|---|---|---|---|---|---|
| Sine | 1.0000 | 1.0000 | 0.7873 | 0.2396 | 0.8540 | 0.3906 |
| Stock | 1.0000 | 1.0000 | 0.8053 | 0.3372 | 0.9053 | 0.5789 |
| ETTh | 1.0000 | 1.0000 | 0.8305 | 0.3389 | 0.8676 | 0.4281 |
| Energy | 1.0000 | 1.0000 | 0.8847 | 0.4974 | 0.8823 | 0.4868 |
| Category | Method | Sine | Stock | ETTh | Energy | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| DS | PS | C-FID | DS | PS | C-FID | DS | PS | C-FID | DS | PS | C-FID | ||
| GAN-based | TimeGAN | .011 .008 | .093 .019 | .101 .014 | .102 .021 | .038 .001 | .103 .013 | .114 .055 | .124 .001 | .300 .013 | .236 .012 | .273 .004 | .767 .103 |
| COT-GAN | .254 .137 | .100 .000 | 1.337 .068 | .230 .016 | .047 .001 | .408 .086 | .325 .099 | .129 .000 | .980 .071 | .498 .002 | .259 .000 | 1.039 .028 | |
| VAE-based | TimeVAE | .041 .044 | .093 .000 | .307 .060 | .145 .120 | .039 .000 | .215 .035 | .209 .058 | .126 .004 | .805 .186 | .499 .000 | .292 .000 | 1.631 .142 |
| Diffusion-based | DiffWave | .017 .008 | .093 .000 | .014 .002 | .232 .061 | .047 .000 | .232 .032 | .190 .008 | .130 .001 | .873 .061 | .493 .004 | .251 .000 | 1.031 .131 |
| DiffTime | .013 .006 | .093 .000 | .006 .001 | .097 .016 | .038 .001 | .236 .074 | .100 .007 | .121 .004 | .299 .044 | .445 .004 | .252 .000 | .279 .045 | |
| Branch Dims | Branch Depths | Patch Sizes | Shared Weights | ||||
|---|---|---|---|---|---|---|---|
| 24 | 512 | 512 | 4 | ||||
| 64 | 512 | 512 | 4 | ||||
| 128 | 512 | 512 | 4 | ||||
| 256 | 512 | 512 | 4 |
| Rank | DiT Layers | Heads | ODE Steps | Bandwidth Factor | ||
|---|---|---|---|---|---|---|
| 24 | 256 | 1 | 512 | 16 | 20 | 0.005 |
| 64 | 256–512 | 3 | 1024 | 16 | 20 | 0.005 |
| 128 | 512 | 3 | 1024 | 16 | 20 | 0.005 |
| 256 | 1024 | 3 | 1024 | 16 | 20 | 0.005 |
| DS | PS | C-FID | |||||||
|---|---|---|---|---|---|---|---|---|---|
| Method | |||||||||
| ETTh Dataset | |||||||||
| TimeGAN | .227 .078 | .188 .074 | .442 .056 | .132 .008 | .153 .014 | .220 .008 | 1.130 .102 | 1.553 .169 | 5.872 .208 |
| COT-GAN | .296 .348 | .451 .080 | .461 .010 | .135 .003 | .126 .001 | .129 .000 | 3.008 .277 | 2.639 .427 | 4.075 .894 |
| TimeVAE | .171 .142 | .154 .087 | .178 .076 | .118 .004 | .113 .005 | .110 .027 | .827 .146 | 1.062 .134 | .826 .093 |
| DiffWave | .254 .074 | .274 .047 | .304 .068 | .133 .008 | .129 .003 | .132 .001 | 1.543 .153 | 2.354 .170 | 2.899 .289 |
| Method | Sine | Stock | ETTh | Energy |
|---|---|---|---|---|
| Diffusion-TS | 9.57 | 10.12 | 11.85 | 34.92 |
| SDformer-ar | 0.15 | 0.18 | 0.40 | 0.15 |
| MSDformer | 0.95 | 0.96 | 0.30 | 0.96 |
| UniFlow (Ours) | 0.05 | 0.04 | 0.04 | 0.04 |
| Speedup vs AR | 3.0 | 4.5 | 7.5 | 3.8 |
| Dataset | Variant | DS / C-FID | MAE / MSE | Cycle Agree. |
|---|---|---|---|---|
| Sine | Real (ref.) | – | – | 0.665 |
| Shared gen. | 0.003 / 0.0004 | 0.1201 / 0.0268 | 0.766 | |
| Scale-1 gen. | 0.008 / 0.009 | 0.1062 / 0.0208 | 0.499 | |
| Scale-2 gen. | 0.011 / 0.007 | 0.1110 / 0.0227 | 0.540 | |
| ETTh | Real (ref.) | – | – | 0.711 |
| Shared gen. | 0.003 / 0.001 | 0.1543 / 0.0428 | 0.768 |
| Dataset | Shared Dist. | S1 Dist. | S2 Dist. | S1/Shared | S2/Shared |
|---|---|---|---|---|---|
| Sine | 0.455 | 15.185 | 13.908 | 33.3 | 30.5 |
| ETTh | 3.746 | 14.949 | 14.848 | 4.0 | 4.0 |
| Energy | 62.493 | 369.868 | 241.368 | 5.9 | 3.9 |
| Condition | Initial Acc. | Refined Acc. | Correction | DS / C-FID |
|---|---|---|---|---|
| Scale-1 IDs | 0.7873 | 0.9999 | 0.9996 | 0.0116 / 0.00024 |
| Scale-2 IDs | 0.8540 | 0.9999 | 0.9997 | 0.0109 / 0.00026 |
| Dataset | MSE | MAE | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Shared | Scale-1 | Scale-2 | S1 | S2 | Shared | Scale-1 | Scale-2 | S1 | S2 | |
| Sine | 0.00004929 | 0.00005341 | 0.00006096 | 0.00000412 | 0.00001166 | 0.005348 | 0.005533 | 0.005819 | 0.000185 | 0.000471 |
| Stock | 0.00018091 | 0.00018585 | 0.00018173 | 0.00000495 | 0.00000082 | 0.008570 | 0.008625 | 0.008587 | 0.000055 | 0.000017 |
| ETTh | 0.00010566 | 0.00011746 | 0.00013094 | 0.00001180 | 0.00002528 | 0.007804 | 0.008116 | 0.008494 | 0.000312 | 0.000690 |
| Energy | 0.00005832 | 0.00008911 | 0.00016054 | 0.00003078 | 0.00010222 | 0.005546 | 0.005986 | 0.006699 | 0.000440 | 0.001153 |
| Avg. | – | – | – | 0.00001291 | 0.00003500 | – | – | – | 0.000248 | 0.000583 |
| Component | Variant | DS | C-FID |
|---|---|---|---|
| Tokenizer | Single-scale token flow | 0.006 | 0.003 |
| Multi-scale, dilation-only | 0.027 | 0.018 | |
| Multi-scale, patch-based | 0.003 | 0.001 | |
| Interface | Shared public IDs | 0.003 | 0.001 |
| Scale-1 IDs only | 0.345 | 0.363 | |
| Scale-2 IDs only | 0.316 | 0.326 |
| Layer | Function | Description | Input Shape | Output Shape |
|---|---|---|---|---|
| 1 | Input permutation | Channel-first representation | ||
| 2 | Patch Conv1D | , kernel/stride | ||
| 3 | ReLU | Activation | ||
| 4 | ResNet | Depth , dilation growth | ||
| 5 | Downsampling + ResNet | Stride-2 Conv1D + ResNet, repeated times | ||
| 6 | Output Conv1D | , kernel |
| Layer | Function | Description | Input Shape | Output Shape |
|---|---|---|---|---|
| 1 | ReLU | Activation | ||
| 2 | Dilated Conv1D | , kernel , dilation , padding | ||
| 3 | ReLU | Activation | ||
| 4 | Pointwise Conv1D | , kernel | ||
| 5 | Residual connection | Output = Input + Conv output |
| Layer | Function | Description | Input Shape | Output Shape |
|---|---|---|---|---|
| 1 | Shared-index voting | Weighted cosine similarity, vocabulary size | ||
| 2 | Codebook retrieval | Shared-ID lookup in scale-specific codebooks | ||
| 3 | Feature fusion | Concatenate private embeddings, | ||
| 4 | Input Conv1D | , kernel | ||
| 5 | ReLU | Activation | ||
| 6 | ResNet | Depth , reverse dilation |
| Layer | Function | Description | Input Shape | Output Shape |
|---|---|---|---|---|
| 1 | Low-rank anchor | Projection through | ||
| 2 | Flow interpolation | |||
| 3 | Global token | Prepend one learned token | ||
| 4 | Input projection | Linear + positional encoding | ||
| 5 | Time embedding | Linear + SiLU + Linear | ||
| 6 | DiT blocks | AdaLN + MHSA ( heads) + FFN ( ), repeated times |
Time Series Generation
Time series generation creates synthetic sequential data that preserve temporal patterns, cross-variable structure, and controllable conditions.
See all 97 papers