Enhancing TimeXer with TCN and differential attention for multivariate stock forecasting
Abstract
Multivariate stock forecasting requires models that can preserve short-lived price dynamics while using auxiliary market variables without amplifying unstable cross-variable relations. TimeXer provides an Endo/Exo dual-branch architecture that separates target-sequence modeling from auxiliary-variable interaction, but its patch-level tokenization may underrepresent fine-grained local transitions, while standard Exo-branch attention may be sensitive to redundant or weakly informative variables. This paper proposes DAT-TimeXer, a structure-aware adaptation of TimeXer for closing-price forecasting. The model introduces a temporal convolutional network before tokenization to encode causal and dilated local temporal patterns at the original resolution, and applies multi-head differential attention exclusively to the Exo branch. By contrasting two independently learned attention maps, the Exo-side module refines auxiliary-variable dependencies before Endo–Exo interaction while preserving target-sequence dynamics in the Endo branch. Experiments are conducted on three Chinese A-share series and nine U.S.-listed stocks using chronological splits, training-only feature screening, and one-step and multi-step forecasting settings. DAT-TimeXer achieves the lowest mean forecasting errors among the compared models in the one-step evaluations and maintains lower errors at horizons of 1, 3, 5, and 10 in the evaluated multi-step tasks. Cross-asset ablation, chronological subperiod, statistical, and attention analyses provide further evidence for the complementary contributions of pre-tokenization TCN enhancement and Exo-specific differential attention. The added components introduce moderate computational overhead relative to TimeXer.