OrangeTree: A Linear and Tree-based Time Series Forecasting Model Supporting Multiple Input and Output Lengths
Authors: Yiqi Tang, Zhichen Lai, Yuxuan Yang, Dalin Zhang, Jinpeng Chen, Gang Chen, Huan Li
Organizations: State Key Laboratory of Blockchain and Data Security, Zhejiang University · Hangzhou High-Tech Zone (Binjiang) Institute of Blockchain and Data Security · College of Computer and Data Science, Fuzhou University · Space Information Research Institute, Hangzhou Dianzi University · School of Computer Science, Beijing University of Posts and Telecommunications
Time series forecasting (TSF) models suffer from a critical rigidity: the inability to handle Multiple Input and Output Lengths (MIOL) within a single architecture. Current workarounds, such as padding or autoregression, often incur computational redundancy or suffer from error accumulation. We propose OrangeTree, a linear and tree-based architecture that decouples model parameters from sequence lengths. It employs a Segment Tree Encoder and an Inverse Tree Decoder to translate multi-length input history into multi-length output predictions within a unified framework. Crucially, a Range Weighter and a Feature Fuser bridge these components, dynamically selecting and fusing relevant ranges into optimal contexts for forecasting. Experiments on six benchmarks confirm OrangeTree achieves the SOTA performance. In MIOL settings, it matches the accuracy of length-fixed models without substantial accuracy degradation or a substantial increase in inference latency typical of heuristic methods. Code is available at https://github.com/Tang-Yiqi/OrangeTree.
Figures & tables
Figure 1: Paradigm Shift in TSF: (a) The traditional rigid approach requires training distinct models for each input-output configuration. (b) The proposed OrangeTree paradigm enables a single model to natively support MIOL during inference.
Figure 2: OrangeTree architecture with a toy example ( C=3,L=4 for an input): Encoder aggregates time steps into range representations (e.g., 1-2, 2-4, and 1-4) using a linear layer; Range Weighter and Feature Fuser compute importance across ranges and fuse the most informative features; Decoder produces variable-length forecasts by expanding parallel Main and Residual inverse trees.
Figure 3: Mechanics of the Segment Tree Encoder. a & b) The encoder recursively aggregates time steps using a shared linear layer, ensuring length-independent parameters; c) Arbitrary ranges’ representations like [2:4] are efficiently extracted by stitching together the minimal set of pre-computed nodes; d) The tree dynamically expands via binary lifting to fit variable input lengths.
Figure 4: Overview of the Range Weighter.
Figure 5: Architecture of the Feature Fuser, combining the Range Weighter and Encoder to produce a channel - dependent representation.
Figure 6: Structure of the Inverse Tree Decoder. a) Main architecture; b) Representation decomposition method; c) Variable output length.
OrangeTree -IS ( S1 )
OrangeTree -HU ( S2 )
DGraF. (2025)
CASA (2025)
TQNet (2025)
S-Mamba (2025)
SOFTS (2024)
iTrans. (2024)
PatchTST (2023)
TSMixer (2023)
TiDE (2023)
DLinear (2023)
LSTM (1997)
Dataset
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
ETTm1
0.365
0.379
0.366
0.377
0.379
0.394
0.386
0.394
0.377
0.393
0.398
0.405
0.399
0.405
0.401
0.408
0.397
0.406
0.448
0.447
0.409
0.411
0.403
0.407
1.181
0.825
ETTm2
0.272
0.316
0.275
0.319
0.284
0.326
0.276
0.319
0.277
0.323
0.288
0.332
0.287
0.330
0.288
0.332
0.287
0.330
0.289
0.333
0.358
0.404
0.350
0.401
2.562
1.262
ETTh1
0.428
0.425
0.428
0.427
0.442
0.432
0.438
0.433
0.441
0.434
0.455
0.450
0.449
0.443
0.454
0.448
0.453
0.446
0.463
0.452
0.541
0.507
0.456
0.452
1.212
0.843
ETTh2
0.366
0.394
0.372
0.396
0.372
0.398
0.373
0.398
0.378
0.402
0.381
0.405
0.373
0.400
0.383
0.406
0.385
0.410
0.402
0.417
0.611
0.550
0.559
0.515
3.283
1.431
Weather
0.234
0.261
0.239
0.265
0.249
0.271
0.243
0.267
0.242
0.269
0.251
0.276
0.255
0.278
0.258
0.278
0.256
0.279
0.256
0.278
0.270
0.320
0.265
0.317
0.406
0.401
Table 1: Multivariate forecasting performance ( L=96 , averaged over 4 output horizons T∈{96,192,336,720} ). We compare OrangeTree -IS and all baselines (trained specifically for each horizon T , following Setting S1 ) against OrangeTree -HU (a single unified model trained jointly to support all 4 horizons, following Setting S2 ). Bold and underlined values indicate the best and second-best results, respectively. Full results are provided in Appendix G .
OrangeTree -IS ( S1 )
OrangeTree -MIOL ( S3 )
OrangeTree + Trim - Reg
OrangeTree + Trim - Trim
OrangeTree + Pad - Reg
OrangeTree + Pad - Trim
Dataset
MSE
MAE
Time
MEM
MSE
MAE
Time
MEM
MSE
MAE
Time
MEM
MSE
MAE
Time
MEM
MSE
MAE
Time
MEM
MSE
MAE
Time
MEM
ETTh1
0.353
0.374
0.248
9.71
0.356
0.375
0.244
9.71
0.370
0.383
0.210
6.48
0.362
0.383
0.121
12.74
0.370
0.389
0.633
6.69
0.359
0.386
0.465
12.91
ETTh2
0.256
0.314
0.261
9.68
0.258
0.315
0.257
9.66
0.268
0.322
0.214
6.45
0.265
0.316
0.113
12.65
0.263
0.331
0.628
6.90
0.259
0.319
0.414
12.95
ETTm1
0.337
0.354
0.262
9.67
0.343
0.357
0.270
9.67
0.446
0.412
0.231
6.49
0.403
0.389
0.110
12.64
0.407
0.397
0.720
6.72
0.370
0.374
0.403
12.91
ETTm2
0.153
0.237
0.251
9.76
0.155
0.237
0.261
9.72
0.167
0.256
0.221
6.47
0.169
0.256
0.125
12.68
0.169
0.262
0.695
6.77
0.167
0.259
0.389
12.91
Weather
0.145
0.182
0.258
13.95
0.147
0.184
0.252
13.97
0.192
0.229
0.242
9.39
0.168
0.205
0.116
18.48
0.147
0.189
0.672
9.48
0.146
0.184
0.400
18.64
Table 2: Performance trade-offs in the Full MIOL setting (averaged over L∈{48,96} and T∈{48,96} ). We compare the unified OrangeTree -MIOL against the idealized specialist OrangeTree -IS (trained for each (L,T) pair, as the baseline) and four heuristic adapters. Time and MEM denote inference latency (s) and memory usage (GB). Full results and the results across 8 pairs from L={48,96,144} and T={96,192,336,720} are provided in Appendix H.3 .
Figure 7: Ablation results with L=96,T=96 (full results and analysis in Appendix D.3 ).
Figure 8: Parameter counts on ETTm1, Weather, and Solar using official baseline hyperparameters with input length L=96 and output lengths T∈{96,192,336,720} .
Figure 9: Representation reuse for different input lengths L and output lengths T in one OrangeTree model.
Appendix figures & tables16 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 10: Example: Encoder Aggregation Process.
Figure 11: Weight calculation in the Range Weighter (Taking range [1:3] as an example).
Hyperparameter
Meaning
Value
B
Branch Number
Search in {2,3,4,5}
K
Top- K Selection
Search K-Rate in {0.1,0.01,0.001} or K in {4,16,64}
D
Hidden Size
384
D′
Hidden Size for the Range Weighter
32
α
L=α⋅MAE+(1−α)⋅MSE
0.8
Appendix
Table 3: Core hyperparameters of OrangeTree .
Dataset
α=0.0
α=0.2
α=0.4
α=0.6
α=0.8
α=1.0
MSE
MAE
MSE+MAE
MSE
MAE
MSE+MAE
MSE
MAE
MSE+MAE
MSE
MAE
MSE+MAE
MSE
MAE
MSE+MAE
MSE
MAE
MSE+MAE
ETTh1
0.376
0.395
0.771
0.372
0.392
0.764
0.368
0.388
0.756
0.370
0.388
0.758
0.369
0.385
0.754
0.382
0.389
0.771
ETTm1
0.301
0.350
0.651
0.299
0.344
0.643
0.299
0.341
0.640
0.302
0.340
0.642
0.303
0.337
0.640
0.311
0.337
0.648
Weather
0.158
0.219
0.377
0.157
0.205
0.362
0.154
0.202
0.356
0.156
0.198
0.354
0.149
0.187
0.336
0.154
0.196
0.350
Appendix
Table 4: Effect of α on model performance ( L=96,T=96 ).
Figure 12: Ablation study: a) original structure; b) w/o CI-Residual; c) w/o Range-Selection; and d) CI-Only.
Figure 13: Ablation results ( L=96 , T=96 ).
Component
Specification
CPU
Intel(R) Xeon(R) w9-3495X
GPU
NVIDIA RTX 5000 Ada (32GB, Ada Lovelace architecture)
NVIDIA Driver
Version 570.195.03
CUDA
Version 12.8
OS
Ubuntu 24.04.3 LTS
Deep Learning Framework
PyTorch 2.5.1+cu121
Appendix
Table 5: Hardware and software configuration.
Figure 14: A toy example of variable-length training.
Dataset
L-T
IS (S1)
MIOL (S3)
Arbitrary Length
MSE
MAE
MSE
MAE
MSE
MAE
ETTh1
48-48
0.338
0.362
0.339
0.363
0.381
0.408
48-96
0.376
0.389
0.381
0.390
0.431
0.439
96-48
0.328
0.361
0.331
0.361
0.372
0.390
96-96
0.369
0.385
0.371
0.387
0.421
0.418
AVG
0.353
0.374
0.356
0.375
0.401
0.414
Appendix
Table 6: Performance comparison between MIOL and Arbitrary Length. IS ( S1 ) trains one model per length as the baseline. MIOL ( S3 ) is trained only on L,T∈{48,96} . Arbitrary Length trains on continuous lengths L,T∈[48,96] .
OrangeTree -IS STD
OrangeTree -IS AVG
DGraFormer (2025)
CASA (2025)
TQNet (2025)
S-Mamba (2025)
Dataset
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
ETTh1
0.008
0.007
0.432
0.428
0.442
0.432
0.438
0.433
0.441
0.434
0.455
0.450
ETTm1
0.001
0.001
0.366
0.379
0.379
0.394
0.386
0.394
0.377
0.393
0.398
0.405
Weather
0.001
0.001
0.234
0.262
0.249
0.271
0.243
0.267
0.242
0.269
0.251
0.276
Appendix
Table 7: Forecasting performance across five random seeds ( L=96 , averaged over output lengths T∈{96,192,336,720} ). Bold and underlined values indicate the best and second-best results when comparing OrangeTree -IS AVG with the baselines.
OrangeTree -IS ( S1 )
OrangeTree -HU ( S2 )
DGraF. (2025)
CASA (2025)
TQNet (2025)
S-Mamba (2025)
SOFTS (2024)
iTrans. (2024)
PatchTST (2023)
TSMixer (2023)
TiDE (2023)
DLinear (2023)
LSTM (1997)
Dataset
T
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
ETTm1
96
0.303
0.337
0.300
0.336
0.326
0.366
0.313
0.358
0.311
0.353
0.333
0.368
0.325
0.361
0.334
0.368
0.329
0.365
0.323
0.363
0.364
0.387
0.345
0.372
1.010
0.764
192
0.355
0.366
0.350
0.365
0.358
0.376
0.375
0.382
0.356
0.378
0.376
0.390
0.377
0.391
0.380
0.394
0.376
0.392
0.450
0.451
0.374
0.387
0.380
0.389
1.221
0.851
336
0.381
0.388
0.377
0.387
0.387
0.397
0.397
0.398
0.390
0.401
0.408
0.413
0.426
0.420
0.400
0.410
0.407
0.413
0.532
0.515
0.410
0.411
0.413
0.413
1.182
0.849
720
0.422
0.424
0.436
0.421
0.446
0.436
0.459
0.437
0.452
0.440
0.475
0.448
0.466
0.447
0.491
0.459
0.475
0.453
0.485
0.459
0.487
0.461
0.474
0.453
1.312
0.835
Avg
0.365
0.379
0.366
0.377
0.379
0.394
0.386
0.394
0.377
0.393
0.398
0.405
0.399
0.405
0.401
0.408
0.397
0.406
0.448
0.447
0.409
0.411
0.403
0.407
1.181
0.825
Appendix
Table 8: Multivariate forecasting performance ( L=96 , T∈{96,192,336,720} ). We compare OrangeTree -IS and all baselines (trained specifically for each horizon, Setting S1 ) against OrangeTree -HU (a single unified model trained for all horizons, Setting S2 ). Bold and underlined values indicate the best and second-best results, respectively.
Table 9: Theoretical comparison of MIOL adaptation strategies versus Native Support.
OrangeTree -IS ( S1 )
OrangeTree -MIOL ( S3 )
OrangeTree + Trim - Reg
OrangeTree + Trim - Trim
OrangeTree + Pad - Reg
OrangeTree + Pad - Trim
Dataset
L / T
MSE
MAE
Time
MEM
MSE
MAE
Time
MEM
MSE
MAE
Time
MEM
MSE
MAE
Time
MEM
MSE
MAE
Time
MEM
MSE
MAE
Time
MEM
ETTh1
48-48
0.338
0.362
0.109
6.43
0.339
0.363
0.106
6.47
0.347
0.367
0.110
6.48
0.341
0.370
0.124
12.74
0.367
0.394
0.380
6.68
0.351
0.386
0.475
12.90
48-96
0.376
0.389
0.111
12.63
0.381
0.390
0.111
12.68
0.393
0.398
0.312
6.48
0.383
0.396
0.119
12.74
0.399
0.413
0.872
6.70
0.391
0.412
0.455
12.91
96-48
0.328
0.361
0.379
6.89
0.331
0.361
0.376
6.75
0.347
0.367
0.111
6.48
0.341
0.370
0.119
12.74
0.338
0.362
0.395
6.68
0.326
0.360
0.468
12.90
96-96
0.369
0.385
0.392
12.88
0.371
0.387
0.383
12.95
0.393
0.398
0.305
6.49
0.383
0.396
0.120
12.75
0.375
0.388
0.884
6.70
0.369
0.386
0.460
12.91
AVG
0.353
0.374
0.248
9.71
0.356
0.375
0.244
9.71
0.370
0.383
0.210
6.48
0.362
0.383
0.121
12.74
0.370
0.389
0.633
6.69
0.359
0.386
0.465
12.91
Appendix
Table 10: Detailed performance trade-offs in the Full MIOL Scenario across four input-output length combinations ( L,T∈{48,96} ). We compare the native OrangeTree -MIOL against the OrangeTree -IS (Idealized Specialist, trained specifically for each (L,T) pair, as the baseline) and four heuristic inference strategies. Time and Mem denote inference latency (seconds) and memory usage (GB), measured with batch sizes of 2048 (ETT), 1024 (Weather), and 192 (Solar).
OrangeTree -IS ( S1 )
OrangeTree -MIOL ( S3 )
OrangeTree -IS ( S1 )
OrangeTree -MIOL ( S3 )
Dataset
L
T
MSE
MAE
MSE
MAE
Dataset
L
T
MSE
MAE
MSE
MAE
ETTh1
48
96
0.376
0.389
0.375
0.392
ETTm2
48
96
0.179
0.255
0.180
0.262
48
192
0.437
0.425
0.425
0.422
48
192
0.247
0.304
0.246
0.305
96
96
0.369
0.385
0.364
0.389
96
96
0.168
0.249
0.171
0.255
96
192
0.419
0.418
0.409
0.417
96
192
0.234
0.295
0.234
0.296
96
336
0.465
0.440
0.438
0.436
96
336
0.292
0.331
0.295
0.335
Appendix
Table 11: Multivariate forecasting performance comparing OrangeTree -IS ( S1 ) and OrangeTree -MIOL ( S3 ) across 8 different (L,T) pairs. Bold indicates the better result.
OrangeTree
DGraFormer
CASA
IS ( S1 )
MIOL ( S3 )
IS
Trim - Reg
Trim - Trim
Pad - Reg
Pad - Trim
IS
Trim - Reg
Trim - Trim
Pad - Reg
Pad - Trim
Dataset
L/T
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
MSE
MAE
ETTh1
48-48
0.338
0.362
0.339
0.363
0.340
0.370
0.339
0.368
0.334
0.368
0.362
0.394
0.357
0.392
0.342
0.377
0.344
0.376
0.340
0.377
0.360
0.397
0.354
0.387
-
-
+0.30%
+0.28%
-
-
-0.32%
-0.44%
-1.83%
-0.45%
+6.42%
+6.60%
+5.04%
+6.07%
-
-
+0.66%
-0.02%
-0.41%
+0.04%
+5.48%
+5.51%
+3.57%
+2.80%
48-96
0.376
0.389
0.381
0.390
0.371
0.395
0.376
0.396
0.372
0.393
0.392
0.415
0.399
0.423
0.383
0.404
0.385
0.406
0.380
0.401
0.396
0.420
0.393
0.413
-
-
+1.33%
+0.26%
-
-
+1.18%
+0.43%
+0.08%
-0.36%
+5.72%
+5.09%
+7.43%
+7.11%
-
-
+0.39%
+0.54%
-0.90%
-0.68%
+3.34%
+3.91%
+2.68%
+2.20%
Appendix
Table 12: Comparative analysis of OrangeTree -MIOL (native support) versus SOTA models (CASA, DGraFormer) adapted via heuristics. We evaluate performance across randomized input-output configurations ( L,T∈{48,96} ). The IS column represents the “idealized specialist” baseline (one model trained per (L,T) pair). For other columns, values in red indicate performance degradation (MSE/MAE increase) relative to the IS baseline, while blue indicates improvement.
Time series forecasting predicts future values from ordered observations using statistical, neural, and probabilistic models to support decisions under uncertainty.
Department, State Grid Hunan Electric Power Company Limited Research Institute & Hunan Province Engineering Technology Research Center of Electric Power Multimodal Perception and Edge Intelligence, Changsha, Hunan, China. · College of Computer Science, Hunan University, Changsha, Hunan, China.