🚀 [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}
}