Learning from Points and Patches: A Pre-trained Hybrid Attention Transformer for Time Series Analysis
作者: Peiwang Tang, Cheng HE, Yupeng Ye, Weitai Zhang, Qinghua Sun, Defu Lian
分类: cs.LG
发布日期: 2026-10-27
备注: 12 pages. Code: https://github.com/TangPeiwang/TimeHAT
🔗 代码/项目: GITHUB
💡 一句话要点
提出TimeHAT以解决异构时间序列分析问题
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 时间序列分析 混合注意力 预训练模型 深度学习 异常检测
📋 核心要点
- 现有方法在异构时间序列分析中面临多样的时间模式和有限标注的挑战,导致可迁移表示学习困难。
- 本文提出TimeHAT框架,结合统一的点-补丁掩蔽策略和混合注意力编码器,旨在有效捕捉时间序列的多层次特征。
- 实验结果显示,TimeHAT在分类、长期预测、填补和异常检测等任务中表现优异,具有良好的迁移能力。
📝 摘要(中文)
时间序列数据由网络服务和连接系统生成,支持用户活动分析、服务监控和资源管理等应用。然而,由于多样的时间模式、可变的序列长度和有限的高质量标注,从异构时间序列中学习可迁移的表示仍然具有挑战性。为此,本文提出了TimeHAT(混合注意力变换器),这是一个通用的时间序列分析预训练框架,旨在解决学习内容和学习方式两个互补问题。通过统一的点-补丁掩蔽策略(UPPMS),模型能够捕捉细粒度的时间变化和更广泛的时间模式。同时,混合注意力编码器(HAE)结合了前缀约束的双向注意力和方向性混合注意力,以保持有效的上下文交互。实验结果表明,TimeHAT在多个真实数据集和下游任务中表现出色。
🔬 方法详解
问题定义:本文旨在解决从异构时间序列中学习可迁移表示的问题。现有方法在处理多样的时间模式和可变序列长度时,往往难以有效捕捉时间序列的特征,且高质量标注稀缺。
核心思路:论文提出了TimeHAT框架,通过统一的点-补丁掩蔽策略(UPPMS)来整合点级和补丁级的监督,支持上下文重建和因果外推,从而捕捉细粒度和广泛的时间模式。同时,混合注意力编码器(HAE)结合了不同层次的注意力机制,以增强上下文交互。
技术框架:TimeHAT的整体架构包括两个主要模块:统一的点-补丁掩蔽策略和混合注意力编码器。UPPMS负责生成多层次的时间序列特征,而HAE则通过不同的注意力机制来处理这些特征,确保模型能够有效学习。
关键创新:最重要的技术创新在于UPPMS和HAE的结合,前者通过多层次监督增强了模型的学习能力,后者则通过混合注意力机制解决了上下文交互的有效性问题。这与现有方法的单一注意力机制形成了显著区别。
关键设计:在模型设计中,UPPMS通过点级和补丁级的掩蔽策略来生成训练样本,HAE则采用前缀约束的双向注意力和方向性混合注意力,确保模型在不同层次上都能有效捕捉时间序列的特征。
🖼️ 关键图片
📊 实验亮点
实验结果表明,TimeHAT在分类、长期预测、填补和异常检测等四个下游任务中均表现出色。在多个真实数据集上,TimeHAT在少量样本和零样本迁移设置下,均展现出优于现有基线的方法,验证了其在多样时间序列分析任务中的有效性。
🎯 应用场景
TimeHAT框架在用户活动分析、服务监控和资源管理等多个领域具有广泛的应用潜力。其强大的时间序列分析能力可以帮助企业更好地理解用户行为,优化服务性能,并提高资源使用效率。未来,随着时间序列数据的不断增长,TimeHAT可能在智能决策和自动化管理中发挥更大作用。
📄 摘要(原文)
Time-series data generated by Web services and connected systems support applications such as user activity analysis, service monitoring, and resource management. However, learning transferable representations from heterogeneous time series remains challenging due to diverse temporal patterns, variable sequence lengths, and limited high-quality annotations. Despite the success of pre-training in natural language processing and computer vision, effective time-series pre-training requires strategies tailored to temporal data. We propose TimeHAT (Hybrid Attention Transformer), a general-purpose pre-training framework for time-series analysis that addresses two complementary questions: what to learn and how to learn. For what to learn, we introduce a Unified Point-Patch Masking Strategy (UPPMS) that integrates point-level and patch-level supervision within a unified framework for contextual reconstruction and causal extrapolation, enabling the model to capture both fine-grained temporal variations and broader temporal patterns. For how to learn, we develop a Hybrid Attention Encoder (HAE) that combines prefix-constrained bidirectional attention in initial layers with directional hybrid attention in deeper layers, aiming to preserve effective contextual interactions while mitigating rank degeneration. We evaluate TimeHAT across real-world datasets and four downstream tasks: classification, long-term forecasting, imputation, and anomaly detection. Experiments cover fine-tuning, few-shot, and zero-shot transfer settings, demonstrating competitive performance across diverse time-series analysis tasks. Code is available at https://github.com/TangPeiwang/TimeHAT.