🚀 [VLDB' 25] ChatTS-14B 模型
ChatTS
专注于时间序列的理解与推理,类似于视觉/视频/音频多模态大语言模型的功能。本项目提供了 ChatTS
的代码、数据集和模型,相关论文为 ChatTS: Aligning Time Series with LLMs via Synthetic Data for Enhanced Understanding and Reasoning。
[VLDB' 25] ChatTS: Aligning Time Series with LLMs via Synthetic Data for Enhanced Understanding and Reasoning
🚀 快速开始
ChatTS
原生支持任意长度和取值范围的多变量时间序列数据。借助 ChatTS
,你可以轻松理解和推理时间序列中的形状特征和数值特征。此外,ChatTS
还能集成到现有的大语言模型(LLM)管道中,用于更多与时间序列相关的应用,可利用如 vLLMs
等现有的推理框架。
以下是一个 ChatTS
应用示例,用户可以与大语言模型交互,以理解和推理时间序列数据:

论文链接
GitHub 仓库链接
💻 使用示例
基础用法
from transformers import AutoModelForCausalLM, AutoTokenizer, AutoProcessor
import torch
import numpy as np
model = AutoModelForCausalLM.from_pretrained("./ckpt", trust_remote_code=True, device_map="auto", torch_dtype='float16')
tokenizer = AutoTokenizer.from_pretrained("./ckpt", trust_remote_code=True)
processor = AutoProcessor.from_pretrained("./ckpt", trust_remote_code=True, tokenizer=tokenizer)
timeseries = np.sin(np.arange(256) / 10) * 5.0
timeseries[100:] -= 10.0
prompt = f"I have a time series length of 256: <ts><ts/>. Please analyze the local changes in this time series."
prompt = f"<|im_start|>system
You are a helpful assistant.<|im_end|><|im_start|>user
{prompt}<|im_end|><|im_start|>assistant
"
inputs = processor(text=[prompt], timeseries=[timeseries], padding=True, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=300)
print(tokenizer.decode(outputs[0][len(inputs['input_ids'][0]):], skip_special_tokens=True))
📚 详细文档
- 该模型是在 QWen2.5-14B-Instruct(https://huggingface.co/Qwen/Qwen2.5-14B-Instruct)模型的基础上进行微调的。更多使用细节,请参考 ChatTS 仓库中的
README.md
文件。
📖 引用
- QWen2.5-14B-Instruct (https://huggingface.co/Qwen/Qwen2.5-14B-Instruct)
- transformers (https://github.com/huggingface/transformers.git)
- ChatTS 论文
📄 许可证
本模型采用 Apache 许可证 2.0 进行许可。
📝 引用格式
@article{xie2024chatts,
title={ChatTS: Aligning Time Series with LLMs via Synthetic Data for Enhanced Understanding and Reasoning},
author={Xie, Zhe and Li, Zeyan and He, Xiao and Xu, Longlong and Wen, Xidao and Zhang, Tieying and Chen, Jianjun and Shi, Rui and Pei, Dan},
journal={arXiv preprint arXiv:2412.03104},
year={2024}
}