LangTime: A Language-Guided Unified Model for Time Series Forecasting with Proximal Policy Optimization
You can access the well pre-processed datasets from [Google Drive].
Please download the contents and place them under the ./dataset directory in the project root.
LangTime is designed to be compatible with various pre-trained Large Language Models (LLMs) as its backbone for time series forecasting. Currently, we officially support the following models:
- Qwen2-0.5B-Instruct: [Hugging Face]
Please download the model contents and place them under the
./llm/qwen2directory in the project root. - GPT2: [Hugging Face]
To use GPT2 as the backbone, please download its model files and place them accordingly (e.g., under
./llm/gpt2).
To get started with LangTime, follow these steps:
First, clone the repository and navigate to the project directory:
git clone https://github.com/niuwz/LangTime.git
cd LangTimeThen, install the required dependencies. It's recommended to use a virtual environment, for example, using Conda:
conda create -n langtime python=3.10
conda activate langtime
pip install -r requirements.txtYou can run an example script to see LangTime in action. For instance, to train a model on a sample dataset:
# Example for single-domain pre-training
bash scripts/pre-train/single_domain/ETTh1.sh
# Example for multi-domain pre-training
bash scripts/pre-train/mix_domain/mix.shNote: Expect extended data loading times at the start of training, particularly for channel-rich datasets like Electricity or Traffic.
To evaluate a trained LangTime model, you can use the run_eval.py script. An example script is provided for convenience:
bash scripts/eval/eval_example.shOur implementation adapts Time-Series-Library as the code base and have extensively modified it to our purposes. We thank the authors for sharing their implementations and related resources.
If you find our work useful, please consider citing:
@article{niu2025langtime,
title={LangTime: A Language-Guided Unified Model for Time Series Forecasting with Proximal Policy Optimization},
author={Niu, Wenzhe and Xie, Zongxia and Sun, Yanru and He, Wei and Xu, Man and Hao, Chao},
journal={arXiv preprint arXiv:2503.08271},
year={2025}
}If you have any questions or suggestions, feel free to open an issue or contact us via niuwenzhe@tju.edu.cn