[Paper Review] Domain Adaptation for Time Series Forecasting via Attention Sharing
This paper proposes Domain Adaptation Forecaster (DAF), a novel attention-based deep learning framework that improves time series forecasting under data scarcity by sharing queries and keys across source and target domains to learn domain-invariant representations, while keeping values domain-specific. DAF significantly outperforms state-of-the-art baselines on both synthetic and real-world datasets, especially when transferring across domains with different characteristics or frequencies.
Recently, deep neural networks have gained increasing popularity in the field of time series forecasting. A primary reason for their success is their ability to effectively capture complex temporal dynamics across multiple related time series. The advantages of these deep forecasters only start to emerge in the presence of a sufficient amount of data. This poses a challenge for typical forecasting problems in practice, where there is a limited number of time series or observations per time series, or both. To cope with this data scarcity issue, we propose a novel domain adaptation framework, Domain Adaptation Forecaster (DAF). DAF leverages statistical strengths from a relevant domain with abundant data samples (source) to improve the performance on the domain of interest with limited data (target). In particular, we use an attention-based shared module with a domain discriminator across domains and private modules for individual domains. We induce domain-invariant latent features (queries and keys) and retrain domain-specific features (values) simultaneously to enable joint training of forecasters on source and target domains. A main insight is that our design of aligning keys allows the target domain to leverage source time series even with different characteristics. Extensive experiments on various domains demonstrate that our proposed method outperforms state-of-the-art baselines on synthetic and real-world datasets, and ablation studies verify the effectiveness of our design choices.
Motivation & Objective
- Address the challenge of data scarcity in time series forecasting, where limited target domain data hinders model performance.
- Overcome domain shift in time series forecasting, where source and target domains exhibit distributional discrepancies.
- Design a deep learning architecture that jointly leverages abundant source data and limited target data to improve forecasting accuracy.
- Enable effective transfer learning from a source domain with rich data to a target domain with scarce data, even when domains differ in frequency or characteristics.
- Ensure the model captures both domain-invariant dynamics (via shared queries/keys) and domain-specific patterns (via private values) in temporal sequences.
Proposed method
- Propose a cross-domain attention mechanism where queries and keys are shared across source and target domains to induce domain-invariant representations.
- Use domain-specific private encoders to extract domain-dependent features, with values remaining unshared to preserve domain-specific patterns.
- Introduce a domain discriminator to adversarially train the shared attention module, encouraging alignment of query and key distributions across domains.
- Train the entire model end-to-end using a joint loss that combines forecasting loss and domain adversarial loss.
- Apply dimensionality reduction (e.g., t-SNE) to visualize and validate the alignment of query and key distributions across domains.
- Use a multi-head attention mechanism with shared attention heads for queries and keys, while maintaining separate value projections per domain.
Experimental results
Research questions
- RQ1Can attention-based models effectively transfer knowledge from a data-rich source domain to a data-scarce target domain in time series forecasting?
- RQ2Does sharing only queries and keys (while keeping values private) lead to better performance than sharing values or not sharing at all?
- RQ3How effective is the proposed domain discriminator in aligning latent representations across domains with different temporal characteristics?
- RQ4Can the model generalize across domains with different frequencies, such as daily patterns in traffic vs. weekly patterns in sales?
- RQ5What is the relative contribution of query sharing, key sharing, and value sharing to overall forecasting performance?
Key findings
- DAF outperforms all single-domain baselines and state-of-the-art domain adaptation methods on synthetic datasets, with a 16.8% MAE on the traf→elec task and 11.9% on elec→traf.
- On real-world datasets, DAF achieves a 4.1% MAE on wiki→sales and 28.0% on sales→wiki, significantly outperforming RDA and other cross-domain methods.
- Ablation studies show that sharing both queries and keys (no-adv baseline) improves performance by 0.004 MAE on average compared to not sharing either.
- The variant with shared values (v-share) performs worst, confirming that domain-specific values are crucial for accurate domain-dependent forecasting.
- Visualization of latent features using t-SNE confirms that DAF successfully aligns query and key distributions across domains, while the non-adversarial variant (no-adv) fails to do so.
- DAF generalizes effectively even when transferring from a source domain with different frequency (e.g., hourly traffic to daily sales), demonstrating robustness to domain shift.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.