MarkovTS: Pretrained State-Transition Representations for Zero-Shot Time Series Generation
Organizations: State Key Laboratory of AI Safety, Institute of Computing Technology, Chinese Academy of Sciences, Beijing, China · University of Chinese Academy of Sciences, Beijing, China · Baidu Frontier Research Department, Beijing, China
Abstract
Across heterogeneous real-world domains, time-series generation supports simulation, model development, and data augmentation by generating sequences that preserve target-domain statistics and temporal dependencies when real observations are scarce or costly. However, existing methods predominantly address in-domain generation, limiting their reuse in unseen domains. We study reference-conditioned zero-shot time series generation: target domains are unseen during pretraining, generation uses a single target-domain reference sequence, and no model parameters are updated. MarkovTS characterizes sequence evolution through local morphologies and their ordered transitions at multiple temporal scales. Its pretrained encoder quantizes normalized time-series patches into multiscale morphological states with a state codebook, while a transition codebook encodes contextual transitions between adjacent intervals. These transferable state-transition representations condition a pretrained flow-matching model. At generation, the frozen model combines a reference-derived condition with independent Gaussian noise to produce stochastic samples that retain the reference's temporal organization. Across 12 unseen target datasets, MarkovTS outperforms strong baselines in most distributional comparisons and generates diverse, reference-consistent sequences. As downstream augmentation, its samples yield overall gains across forecasting, classification, and anomaly detection benchmarks and diverse model families. Our code is available at https://github.com/blisky-li/MarkovTS.
Figures & tables
| Metric | Dataset | MarkovTS | Winformer | ImagenFew | TimeDP | Diffusion-TS | TimeGAN | GT-GAN | TimeVAE | TimeVQVAE | TimeVQVAE-C |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Maximum Mean Discrepancy | Electricity | 0.001 0.001 | 0.001 0.002 | 0.002 0.003 | 0.001 0.001 | 0.003 0.002 | 0.367 0.255 | 0.254 0.166 | 0.577 0.006 | 0.152 0.024 | 0.002 0.001 |
| Solar | 0.033 0.003 | 0.035 0.004 | 0.039 0.011 | 0.041 0.011 | 0.050 0.012 | 0.628 0.053 | 0.578 0.039 | 0.353 0.014 | 0.437 0.020 | 0.058 0.005 | |
| Wind | 0.013 0.009 | 0.034 0.014 | 0.071 0.050 | 0.025 0.017 | 0.035 0.006 | 0.213 0.017 | 0.170 0.040 | 0.170 0.004 | 0.131 0.014 | 0.018 0.007 | |
| Traffic | 0.087 0.002 | 0.071 0.005 | 0.080 0.009 | 0.083 0.034 | 0.111 0.031 | 0.567 0.057 | 0.538 0.078 | 0.218 0.007 | 0.213 0.016 | 0.089 0.001 | |
| Taxi | 0.110 0.008 | 0.085 0.010 | 0.108 0.042 | 0.095 0.023 | 0.131 0.014 | 0.275 0.054 | 0.319 0.032 | 0.139 0.007 | 0.128 0.004 | 0.109 0.014 | |
| Pedestrian | 0.032 0.006 | 0.040 0.008 | 0.041 0.012 | 0.044 0.020 | 0.071 0.019 | 0.090 0.030 | 0.112 0.019 | 0.065 0.002 | 0.067 0.007 | 0.058 0.002 |
| Metric | Elec. | Solar | Wind | Traffic | Taxi | Ped. | Air | Temp. | Rain | NN5 | Fred-MD | Exchange | Mean |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Shape | 0.016 | 0.017 | 0.093 | 0.056 | 0.041 | 0.127 | 0.074 | 0.036 | 0.040 | 0.018 | 0.032 | 0.057 | 0.051 |
| ACF | 0.230 | 0.085 | 0.234 | 0.124 | 0.152 | 0.177 | 0.237 | 0.078 | 0.056 | 0.093 | 0.233 | 0.242 | 0.162 |
| PSD | 0.250 | 0.122 | 0.242 | 0.160 | 0.214 | 0.218 | 0.300 | 0.148 | 0.220 | 0.113 | 0.171 | 0.236 | 0.199 |
| Binary retrieval | 95.5 | 95.7 | 93.8 | 98.8 | 99.4 | 92.0 | 95.8 | 92.3 | 96.7 | 75.9 | 92.2 | 96.0 | 93.7 |
| 100-way correct | 58.9 | 51.6 | 71.2 | 84.1 | 89.1 | 45.8 | 86.6 | 45.1 | 78.3 | 26.0 | 46.3 | 77.3 | 63.4 |
| 100-way swapped | 59.2 | 51.9 | 69.9 | 84.2 | 89.4 | 46.7 | 84.0 | 45.0 | 78.0 | 25.6 | 46.5 | 76.6 | 63.1 |
| Variant | Metric | Elec. | Solar | Wind | Traffic | Taxi | Ped. | Air | Temp. | Rain | NN5 | Fred-MD | Exchange |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| MarkovTS | MMD | 0.001 | 0.032 | 0.019 | 0.087 | 0.101 | 0.032 | 0.009 | 0.142 | 0.031 | 0.180 | 0.002 | 0.124 |
| flat-KL | 0.001 | 0.009 | 0.147 | 0.003 | 0.002 | 0.007 | 0.019 | 0.161 | 0.007 | 0.043 | 0.244 | 1.631 | |
| Random states | MMD | 0.002 | 0.236 | 0.023 | 0.168 | 0.118 | 0.049 | 0.016 | 0.134 | 0.046 | 0.205 | 0.003 | 0.148 |
| flat-KL | 0.059 | 0.689 | 0.189 | 0.144 | 0.075 | 0.088 | 0.039 | 0.134 | 0.010 | 0.106 | 0.364 | 5.030 | |
| Random transitions | MMD | 0.002 | 0.190 | 0.023 | 0.130 | 0.119 | 0.054 | 0.017 | 0.152 | 0.053 | 0.231 | 0.002 | 0.147 |
| flat-KL | 0.061 | 0.842 | 0.165 | 0.131 | 0.146 | 0.148 | 0.046 | 0.109 | 0.015 | 0.193 | 0.200 | 3.068 |
| ECL | ETTh1 | ETTh2 | Exchange | Traffic | Weather | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Backbone | MAE | MSE | MAE | MSE | MAE | MSE | MAE | MSE | MAE | MSE | MAE | MSE | Imp. |
| CATS | .258/ .245 | .165/ .161 | .443/ .423 | .448/ .425 | .425/ .384 | .392/ .355 | .420/.421 | .388/ .387 | .284/ .252 | .421/ .402 | .258/ .249 | .221/.225 | 10/12 |
| iTrans. | .259/.261 | .164/.169 | .473/ .433 | .485/ .421 | .439/ .427 | .421/ .409 | .478/ .447 | .464/ .419 | .289/.297 | .412/.429 | .267/ .258 | .233/ .230 | 8/12 |
| SparseTSF | .265/ .261 | .173/ .171 | .429/ .417 | .427/ .412 | .427/ .414 | .399/ .389 | .481/ .425 | .478/ .390 | .295/ .279 | .445/.458 | .283/ .276 | .252/.255 | 10/12 |
| TQNet | .246/.247 | .158/.158 | .425/.428 | .422/.429 | .417/ .416 | .391/.393 | .454/ .427 | .428/ .387 | .265/ .259 | .410/ .398 | .249/.252 | .222/.223 | 5/12 |
| OLinear | .298/ .297 | .188/ .186 | .428/.429 | .414/.415 | .416/ .412 | .389/ .386 | .456/ .439 | .435/ .402 | .328/ .321 | .465/ .453 | .250/.254 | .221/.223 | 8/12 |
| Classifier | Acc. | BAcc. | F1 | AUROC | LL | Sens. | Spec. | Imp. |
|---|---|---|---|---|---|---|---|---|
| ResNet1D | 68.15/ 68.94 | 67.94/ 68.86 | 65.05/ 67.12 | 83.71/ 85.05 | 1.13/ 1.07 | 66.02/ 69.33 | 69.95/69.21 | 6/7 |
| TimesNet | 65.84/ 68.36 | 65.03/ 66.94 | 63.86/ 65.26 | 83.32/ 84.13 | 1.16/ 1.10 | 66.28/ 66.73 | 65.03/ 68.30 | 7/7 |
| ConvTran | 69.31/ 70.23 | 68.01/ 69.16 | 67.93/67.49 | 85.52/ 85.65 | 0.82/ 0.79 | 70.49/69.10 | 67.36/ 70.65 | 5/7 |
| Arsenal | 73.21/73.17 | 71.34/71.32 | 71.16/ 71.31 | 84.39/ 84.85 | 5.56/ 5.12 | 71.19/ 71.53 | 74.17/73.77 | 4/7 |
| Detector | A-P | A-R | R-A-P | R-A-R | V-PR | V-ROC | Imp. |
|---|---|---|---|---|---|---|---|
| DLinear | .233/ .253 | .672/ .679 | .255/ .273 | .713/ .715 | .254/ .271 | .710/ .714 | 6/6 |
| TranAD | .278/.278 | .674/ .676 | .267/.261 | .676/ .677 | .264/.259 | .673/ .675 | 3/6 |
| CATCH | .248/ .254 | .675/ .683 | .278/ .284 | .720/ .726 | .275/ .281 | .717/ .723 | 6/6 |
| ModernTCN | .237/ .241 | .660/ .664 | .259/ .262 | .704/ .708 | .257/ .261 | .702/ .705 | 6/6 |
| TimesNet | .268/.267 | .689/.685 | .286/ .290 | .731/.730 | .285/ .289 | .729/.727 | 2/6 |
Appendix figures & tables28 assets
Supplementary material from the paper’s appendix.
Appendix
| Symbol | Meaning |
|---|---|
| Pretraining corpus and its set of source-domain distributions. | |
| Unseen target distribution, evaluation reference pool, and disjoint target test set. Each generated sample uses one member of . | |
| Inference reference and number of references used in repeated single-reference evaluation. | |
| A length- time series comprising aligned variable sequences, each modeled independently. | |
| Standardized input, canonical patch dimension, and number of padded intervals at scale . | |
| Set, number, and index of temporal scales. |
| Stage | Objective | Weight |
| State | Normalized-shape reconstruction | 1.00 |
| Code commitment | 1.00 | |
| Query isotropy | 0.10 | |
| Perturbation consistency | 0.05 | |
| Delayed negative separation | ||
| Transition | Full-resolution reconstruction | 1.00 |
| Stage | Updates | Learning rate | LR warm-up | Effective batch |
|---|---|---|---|---|
| State warm-up | 20,000 | 200 | 84 ( ) | |
| State–transition | 160,000 | 1,600 | 84 ( ) | |
| Flow, final phase | 2,400 | 100 | 10,240 ( ) |
| Component | Configuration |
|---|---|
| Representation configuration | |
| Base patch / temporal spans | / |
| State codebook | , dimension , EMA |
| Transition codebook | , dimension , EMA |
| Conditional flow: final optimization phase | |
| Flow backbone | width , depth , heads , MLP ratio |
| Length | Batch/GPU | Flow-only | End-to-end |
|---|---|---|---|
| 512 | 128 | 323.02 | 128.89 |
| 1024 | 96 | 221.13 | 74.40 |
| 2048 | 64 | 166.73 | 43.75 |
| Dataset | Application | Frequency | Scale | Content and temporal extent |
|---|---|---|---|---|
| Electricity | Energy | Hourly | 321 clients | Electricity consumption, 2012–2014 |
| Solar | Energy | Hourly | 137 series | Solar power production in Alabama, 2006 |
| Wind | Energy | 4 seconds | 1 long series | AEMO wind production, beginning August 2019 |
| Traffic | Transportation | 10 minutes | 963 sensors | Freeway-lane occupancy in the San Francisco Bay Area over 440 days |
| Taxi | Transportation | 30 minutes | 1,214 locations | New York City taxi rides in January 2015 and January 2016 |
| Pedestrian | Transportation | Hourly | 66 sensors | Pedestrian counts in Melbourne, May 2009–April 2020 |
| Dataset | Application | Frequency | Ch. | Mean length | Training values | Split |
|---|---|---|---|---|---|---|
| ECL | Energy | Hourly | 321 | 18,412 | 5,910,252 | 7:1:2 |
| ETTh1 | Energy | Hourly | 7 | 8,640 | 60,480 | 6:2:2 |
| ETTh2 | Energy | Hourly | 7 | 8,640 | 60,480 | 6:2:2 |
| Exchange | Economy | Daily | 8 | 5,311 | 42,488 | 7:1:2 |
| Traffic | Transportation | Hourly | 862 | 12,280 | 10,585,360 | 7:1:2 |
| Weather | Environment | 10 minutes | 21 | 36,887 | 774,627 | 7:1:2 |
| Dataset | Train | Test | Ch. | Mean length | Training values | Cls. | Type |
|---|---|---|---|---|---|---|---|
| ArticularyWordRecognition | 275 | 300 | 9 | 144 | 356,400 | 25 | Motion |
| AtrialFibrillation | 15 | 15 | 2 | 640 | 19,200 | 3 | Biosignal |
| CharacterTrajectories | 1422 | 1436 | 3 | 119 (60–182) | 507,654 | 20 | Motion |
| Cricket | 108 | 72 | 6 | 1,197 | 775,656 | 12 | Motion |
| DuckDuckGeese | 50 | 50 | 1345 | 270 | 18,157,500 | 5 | Audio |
| ERing | 30 | 270 | 4 | 65 | 7,800 | 6 | Motion |
| Model | Optimizer / learning rate | Batch size | Maximum epochs |
|---|---|---|---|
| ResNet1D | Adam / | 64 | 100 |
| TimesNet | RAdam / | 16 | 30 |
| ConvTran | RAdam / | 16 | 100 |
| Arsenal | 25 members; 2,000 kernels each | — | — |
| Dataset | Series | Mean length | Ch. | Training values |
|---|---|---|---|---|
| ASD | 12 | 8,527.6 | 19 | 1,944,289 |
| CalIt2 | 1 | 2,520.0 | 2 | 5,040 |
| CATSv2 | 4 | 28,471.8 | 17 | 1,936,079 |
| CICIDS | 1 | 85,115.0 | 72 | 6,128,280 |
| Creditcard | 1 | 142,403.0 | 29 | 4,129,687 |
| DAPHNET | 7 | 29,241.0 | 9 | 1,842,183 |
| Model | Window | Optimizer / learning rate | Batch size | Maximum epochs |
|---|---|---|---|---|
| DLinear | 100 | Adam / | 64 | 10 |
| TranAD | 100 | Adam / | 64 | 5 |
| CATCH | 96 | Adam / , | 64 | 3 |
| ModernTCN | 100 | Adam / | 64 | 1 |
| TimesNet | 100 | Adam / | 32 | 10 |
| Dataset | ImagenFew | MarkovTS |
|---|---|---|
| Electricity | 0.5226 | 0.3845 |
| Solar | 0.1857 | 0.4350 |
| Wind | 2.3173 | 0.6314 |
| Traffic | 0.6135 | 0.6471 |
| Taxi | 0.6176 | 0.4889 |
| Pedestrian | 0.4465 | 2.2981 |
| Dataset | Shape-TS2Vec | ACF | PSD | Binary (%) | 100-way correct/swapped (%) |
|---|---|---|---|---|---|
| Electricity | / | ||||
| Solar | / | ||||
| Wind | / | ||||
| Traffic | / | ||||
| Taxi | / | ||||
| Pedestrian | / |
| Dataset | Replication | MarkovTS | |||||
|---|---|---|---|---|---|---|---|
| MMD | |||||||
| Electricity | 0.001 0.001 | 0.001 0.001 | 0.001 0.002 | 0.001 0.001 | 0.001 0.002 | 0.002 0.002 | 0.001 0.001 |
| Solar | 0.035 0.005 | 0.037 0.005 | 0.038 0.006 | 0.040 0.006 | 0.049 0.009 | 0.193 0.011 | 0.033 0.003 |
| Wind | 0.026 0.015 | 0.028 0.020 | 0.024 0.018 | 0.023 0.016 | 0.022 0.007 | 0.021 0.005 | 0.013 0.009 |
| Traffic | 0.070 0.006 | 0.092 0.003 | 0.092 0.003 | 0.092 0.003 | 0.098 0.004 | 0.165 0.009 | 0.087 0.002 |
| Taxi | 0.094 0.011 | 0.099 0.000 | 0.099 0.000 | 0.098 0.000 | 0.093 0.000 | 0.106 0.000 | 0.110 0.008 |
| Random | Stochastic | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Dataset | Metric | MarkovTS | States | Transitions | Both | States | Transitions | Both | Patch- Flow |
| Elec. | MMD | 0.001 0.000 | 0.002 0.002 | 0.002 0.002 | 0.003 0.002 | 0.001 0.001 | 0.002 0.002 | 0.002 0.002 | 0.003 0.002 |
| flat-KL | 0.001 0.000 | 0.059 0.044 | 0.061 0.041 | 0.068 0.039 | 0.005 0.003 | 0.012 0.008 | 0.015 0.013 | 0.054 0.031 | |
| Solar | MMD | 0.032 0.003 | 0.236 0.008 | 0.190 0.011 | 0.516 0.008 | 0.034 0.004 | 0.034 0.003 | 0.034 0.003 | 0.045 0.006 |
| flat-KL | 0.009 0.000 | 0.689 0.036 | 0.842 0.027 | 1.099 0.046 | 0.015 0.008 | 0.014 0.007 | 0.020 0.010 | 0.173 0.018 | |
| Wind | MMD | 0.019 0.001 | 0.023 0.026 | 0.023 0.025 | 0.023 0.026 | 0.023 0.026 | 0.023 0.026 | 0.023 0.026 | 0.033 0.030 |
| Metric | Dataset | 512 | 1024 | 2048 |
|---|---|---|---|---|
| MMD | Electricity | |||
| Solar | ||||
| Wind | ||||
| Traffic | ||||
| Taxi | ||||
| Pedestrian |
| CATS | iTransformer | SparseTSF | TQNet | OLinear | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Dataset | R | R+M | O | R | R+M | O | R | R+M | O | R | R+M | O | R | R+M | O | |
| MAE | ||||||||||||||||
| ECL | 96 | .232 | .217 | .223 | .230 | .233 | .235 | .244 | .237 | .238 | .220 | .218 | .221 | .274 | .273 | .274 |
| 192 | .250 | .233 | .239 | .252 | .248 | .252 | .252 | .248 | .249 | .239 | .237 | .240 | .287 | .288 | .289 | |
| 336 | .260 | .250 | .256 | .264 | .264 | .268 | .266 | .264 | .264 | .248 | .252 | .256 | .301 | .303 | .304 | |
| 720 | .291 | .281 | .290 | .289 | .299 | .302 | .297 | .295 | .296 | .277 | .280 | .287 | .329 | .323 | .338 | |
| Dataset | Acc. | BAcc. | F1 | AUROC | LL | Sens. | Spec. |
|---|---|---|---|---|---|---|---|
| ResNet1D | |||||||
| ArticularyWordRecognition | 95.78/88.78 | 95.78/88.78 | 95.78/87.48 | 99.94/99.71 | 0.16/0.42 | = Acc. | |
| AtrialFibrillation | 11.11/13.33 | 11.11/13.33 | 8.85/10.73 | 37.56/40.22 | 4.18/4.13 | = Acc. | |
| CharacterTrajectories | 98.84/99.28 | 98.75/99.21 | 98.84/99.28 | 99.98/99.99 | 0.05/0.03 | = Acc. | |
| Cricket | 98.15/98.15 | 98.15/98.15 | 98.14/98.14 | 99.97/99.99 | 0.06/0.04 | = Acc. | |
| DuckDuckGeese | 56.67/55.33 | 56.67/55.33 | 55.66/56.01 | 82.37/81.68 | 1.62/2.17 | = Acc. | |
| Dataset | A-P | A-R | R-A-P | R-A-R | V-PR | V-ROC |
|---|---|---|---|---|---|---|
| DLinear | ||||||
| ASD | 0.179/0.172 | 0.762/0.762 | 0.208/0.204 | 0.815/0.814 | 0.205/0.200 | 0.806/0.806 |
| CATSv2 | 0.064/0.063 | 0.567/0.564 | 0.078/0.077 | 0.654/0.650 | 0.079/0.078 | 0.648/0.645 |
| CICIDS | 0.002/0.002 | 0.748/0.749 | 0.002/0.002 | 0.683/0.680 | 0.002/0.002 | 0.699/0.700 |
| CalIt2 | 0.100/0.108 | 0.776/0.800 | 0.101/0.107 | 0.808/0.826 | 0.099/0.105 | 0.799/0.818 |
| Creditcard | 0.070/0.055 | 0.919/0.748 | 0.036/0.006 | 0.847/0.589 | 0.035/0.010 | 0.851/0.622 |
Time Series Generation
Time series generation creates synthetic sequential data that preserve temporal patterns, cross-variable structure, and controllable conditions.
See all 97 papers