Time-LlaMA: Adapting Large Language Models for Time Series Modeling via Dynamic Low-rank Adaptation

Juyuan Zhang, Jiechao Gao, Wenwen Ouyang, Wei Zhu, Hui Yi LeongACL 2025

Abstract: Time series modeling holds significant importance in many industrial applications and has been extensively studied. A series of recent studies have demonstrated that large language models (LLMs) possess robust pattern recognition and semantic understanding capabilities over time series data. However, the current literature have yet striked a high-quality balance between (a) effectively aligning the time series and natural language modalities and (b) keeping the inference efficiency for industrial deployment. To address the above issues, we now propose the Time-LlaMA framework. Time-LlaMA first converts the time series input into token embeddings through a linear tokenization mechanism. Second, the time series token embeddings are aligned with the text prompts. Third, to further adapt the large languag model (LLM) backbone for time series modeling, we have developed a dynamic low-rank adaptation technique (DynaLoRA). DynaLoRA dynamically chooses the most suitable LoRA modules at each layer of the Transformer backbone for each time series input, enhancing the model's predictive capabilities. Our experimental results on an extensive collection of challenging open and proprietary time series tasks confirm that our proposed method achieves the state-of-the-art (SOTA) performance and have potentials for wide industrial usages.

Introduction

Time series modeling is a cornerstone of modern industrial applications, ranging from energy management to traffic forecasting. Recent research has shown that Large Language Models (LLMs), despite being pre-trained on text, possess a remarkable capacity for pattern recognition in numerical time series data. However, existing approaches often struggle to balance effective modality alignment with the inference efficiency required for real-world deployment. We introduce Time-LlaMA, a framework designed to bridge this gap by treating time series channels as tokens and employing a novel dynamic adaptation mechanism.

The Challenges of LLM-based Time Series Prediction

Current state-of-the-art methods face three primary hurdles:

  1. Modality Mismatch: Effectively aligning numerical time series with the semantic space of natural language without losing the LLM's inherent strengths.
  2. Inference Latency: Common "patching" techniques and univariate processing of multivariate data lead to significant computational overhead and slow inference.
  3. Static Adaptation: Keeping the LLM backbone frozen limits its ability to adapt to the specific nuances of diverse time series tasks, such as the difference between electricity load and weather patterns.

Methods: The Time-LlaMA Framework

Time-LlaMA addresses these challenges through three architectural innovations:

  • Channel-as-Token Embedding: Instead of patching a single timeline into many tokens, Time-LlaMA treats each variable (channel) in a multivariate dataset as an individual token. This enables the model to process all variables simultaneously in a single forward pass, avoiding the "univariate bottleneck."
  • Prompt-Based Modality Alignment: A Multi-Head Cross-Attention (MHCA) layer bridges the gap between numbers and text. Time series tokens serve as the "query," while embeddings from a descriptive text prompt act as the "key" and "value." Crucially, the text prompt bypasses the LLM backbone, which drastically reduces inference delay.
  • DynaLoRA (Dynamic Low-Rank Adaptation): Moving beyond standard static LoRA, DynaLoRA uses a "router" at each layer to dynamically select the most suitable adaptation modules for a given input. This allows the model to tailor its internal logic on the fly based on the specific characteristics of the data it's seeing.
The Time-LlaMA framework architecture, highlighting the modality alignment and DynaLoRA components.

Experimental Evaluation

We evaluated Time-LlaMA on a broad range of benchmarks, including long-term forecasting (ETT, Weather, ECL, Traffic, ILI), short-term forecasting (M4 benchmark), and few-shot scenarios (using only 5% of training data).

Key Results and Insights

Time-LlaMA achieves state-of-the-art (SOTA) performance across nearly all tested tasks, outperforming strong baselines like Time-LLM, GPT4TS, and PatchTST.

Comparison of Time-LlaMA against other state-of-the-art methods across various metrics.
  • Dynamic Adaptation is Crucial: The success of DynaLoRA indicates that different layers of the Transformer backbone should focus on different features depending on the input data type. This "mixture-of-experts" style approach allows for a more nuanced understanding of diverse datasets.
  • Efficiency and Scalability: By avoiding the patching approach, Time-LlaMA is significantly faster than its predecessors. For instance, on the Traffic dataset, it achieved an inference speed of 10.47 samples per second, compared to just 3.51 for Time-LLM.
  • Robust Few-Shot Learning: In 5% data tests, Time-LlaMA's lead was even more pronounced, demonstrating that the LLM backbone provides a powerful "warm start" that specialized models lack.

Conclusion and Future Work

Time-LlaMA demonstrates that dynamic adaptation and efficient modality alignment can unlock the full potential of LLMs for time series modeling. While currently focused on forecasting with models up to 7B parameters, future work will explore scaling to larger backbones and extending the framework to tasks like anomaly detection and classification.

Summary updated

BibTeX
@inproceedings{zhang2025time,
  author = {Juyuan Zhang and Jiechao Gao and Wenwen Ouyang and Wei Zhu and Hui Yi Leong},
  title = {{Time-LlaMA: Adapting Large Language Models for Time Series Modeling via Dynamic Low-rank Adaptation}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
  url = {https://openreview.net/forum?id=4Kv69uBmq2},
}
Figure