Rethinking Time Series Forecasting with LLMs via Nearest Neighbor Contrastive Learning

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Bogahawatte, Jayanie, Seneviratne, Sachith, Perera, Maneesha, Halgamuge, Saman
Format: Preprint
Published: 2024
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866912146707709952
author Bogahawatte, Jayanie
Seneviratne, Sachith
Perera, Maneesha
Halgamuge, Saman
author_facet Bogahawatte, Jayanie
Seneviratne, Sachith
Perera, Maneesha
Halgamuge, Saman
contents Adapting Large Language Models (LLMs) that are extensively trained on abundant text data, and customizing the input prompt to enable time series forecasting has received considerable attention. While recent work has shown great potential for adapting the learned prior of LLMs, the formulation of the prompt to finetune LLMs remains challenging as prompt should be aligned with time series data. Additionally, current approaches do not effectively leverage word token embeddings which embody the rich representation space learned by LLMs. This emphasizes the need for a robust approach to formulate the prompt which utilizes the word token embeddings while effectively representing the characteristics of the time series. To address these challenges, we propose NNCL-TLLM: Nearest Neighbor Contrastive Learning for Time series forecasting via LLMs. First, we generate time series compatible text prototypes such that each text prototype represents both word token embeddings in its neighborhood and time series characteristics via end-to-end finetuning. Next, we draw inspiration from Nearest Neighbor Contrastive Learning to formulate the prompt while obtaining the top-$k$ nearest neighbor time series compatible text prototypes. We then fine-tune the layer normalization and positional embeddings of the LLM, keeping the other layers intact, reducing the trainable parameters and decreasing the computational cost. Our comprehensive experiments demonstrate that NNCL-TLLM outperforms in few-shot forecasting while achieving competitive or superior performance over the state-of-the-art methods in long-term and short-term forecasting tasks.
format Preprint
id arxiv_https___arxiv_org_abs_2412_04806
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Rethinking Time Series Forecasting with LLMs via Nearest Neighbor Contrastive Learning
Bogahawatte, Jayanie
Seneviratne, Sachith
Perera, Maneesha
Halgamuge, Saman
Machine Learning
Artificial Intelligence
Computation and Language
Adapting Large Language Models (LLMs) that are extensively trained on abundant text data, and customizing the input prompt to enable time series forecasting has received considerable attention. While recent work has shown great potential for adapting the learned prior of LLMs, the formulation of the prompt to finetune LLMs remains challenging as prompt should be aligned with time series data. Additionally, current approaches do not effectively leverage word token embeddings which embody the rich representation space learned by LLMs. This emphasizes the need for a robust approach to formulate the prompt which utilizes the word token embeddings while effectively representing the characteristics of the time series. To address these challenges, we propose NNCL-TLLM: Nearest Neighbor Contrastive Learning for Time series forecasting via LLMs. First, we generate time series compatible text prototypes such that each text prototype represents both word token embeddings in its neighborhood and time series characteristics via end-to-end finetuning. Next, we draw inspiration from Nearest Neighbor Contrastive Learning to formulate the prompt while obtaining the top-$k$ nearest neighbor time series compatible text prototypes. We then fine-tune the layer normalization and positional embeddings of the LLM, keeping the other layers intact, reducing the trainable parameters and decreasing the computational cost. Our comprehensive experiments demonstrate that NNCL-TLLM outperforms in few-shot forecasting while achieving competitive or superior performance over the state-of-the-art methods in long-term and short-term forecasting tasks.
title Rethinking Time Series Forecasting with LLMs via Nearest Neighbor Contrastive Learning
topic Machine Learning
Artificial Intelligence
Computation and Language
url https://arxiv.org/abs/2412.04806