TL;DR
LLMTIME demonstrates that pretrained Large Language Models (LLMs) like GPT-3 and LLaMA-2 can be powerful zero-shot time series forecasters without any task-specific fine-tuning. By tokenizing numbers digit-by-digit and framing forecasting as a next-token text prediction task, LLMs match or exceed the performance of specialized, purpose-built time series models.
What Problem Does This Paper Address?
Time series forecasting is vital for fields like finance, weather prediction, and logistics. However, deep learning has struggled to dominate time series the way it has text or vision. Time series data is highly heterogeneous, coming from diverse sources with varying scales, sampling rates, and missing values. Furthermore, the field lacks massive, cohesive pretraining datasets, meaning specialized deep learning models often fail to consistently outperform simple baselines like ARIMA or linear models.
The authors investigate a compelling question: Can the massive pattern-extrapolation capabilities and generative power of text-pretrained LLMs be transferred directly to continuous time series data in a zero-shot manner?
Methods
The authors introduce LLMTIME, a method that reformulates continuous time series forecasting into next-token text prediction. The core pipeline consists of:
- Digit-by-Digit Tokenization: Standard Byte-Pair Encoding (BPE) tokenizers break numbers into arbitrary chunks based on text frequency (e.g., "42235630" might become
[422, 35, 630]), which destroys mathematical structure. LLMTIME fixes this by forcing the model to see individual digits. For GPT-3, spaces are inserted between digits (e.g.,1 5 1). For LLaMA models, numbers are tokenized by digit by default, so spaces are omitted. Commas separate time steps, and decimal points are dropped to save context length. - Data Rescaling: To prevent wasting tokens on large numbers, the time series is scaled so that its $\alpha$-percentile equals 1. This allows the model to occasionally see and generate values larger than it has previously encountered.
- Continuous Likelihood Estimation: Although LLMs output discrete token probabilities, the authors treat the digit stream as a hierarchical softmax over continuous bins. By placing a uniform distribution within each digit bin, they convert discrete token probabilities into continuous probability densities, enabling proper log-likelihood evaluation.
Datasets
The method was evaluated across several prominent benchmarks:
- Darts: A collection of 8 real-world univariate time series datasets (e.g., AirPassengers, Wine, HeartRate) used primarily for evaluating probabilistic predictions and trend extrapolations.
- Monash: A massive forecasting archive from which the authors selected 19 representative datasets (e.g., COVID deaths, traffic hourly, bitcoin) to balance computational costs and context window limitations.
- Informer: Standard multivariate datasets (e.g., weather, electricity) widely used for benchmarking long-term transformer models. For these, LLMTIME forecasts each covariate independently.
Key Insights and Ideas
- Simplicity and Repetition Biases: LLMs function effectively as data compressors, giving them an inherent "Occam's razor" prior. They naturally favor simple, periodic, or repetitive completions. This bias aligns perfectly with the underlying structure of many time series, such as seasonal trends.
- Alignment Interventions Hurt Forecasting: Surprisingly, chat-aligned models (like GPT-4 or LLaMA-2 Chat) perform significantly worse than their base counterparts (GPT-3 or LLaMA-2 Base). Alignment techniques like Reinforcement Learning from Human Feedback (RLHF) alter tokenization behavior and degrade uncertainty calibration, making them poorer statistical forecasters.
- Native Missing Data Handling: Because LLMs process text, missing data can be represented natively using strings like
"NaN"without requiring explicit imputation techniques, outperforming traditional methods on corrupted data.
Key Results
- State-of-the-Art Zero-Shot Performance: Without a single parameter update on the target data, LLMTIME (using GPT-3 or LLaMA-2 70B) achieved the best or second-best aggregated deterministic performance (MAE) across the Darts, Monash, and Informer benchmarks, beating dedicated models like N-BEATS and TCN.
- Superior Probabilistic Forecasting: On metrics evaluating uncertainty representation (Continuous Ranked Probability Score (CRPS) and Negative Log-Likelihood), LLMTIME significantly outperformed all baselines.
- High Sample Efficiency: When historical data was restricted to small fractions of the training set, the performance of traditional models degraded rapidly, whereas LLMTIME maintained high data efficiency.
Limitations and Future Work
- Context Window Constraints: Long historical sequences cannot fit entirely within standard LLM context windows, forcing a trade-off between historical context and numerical precision.
- Independent Multivariate Forecasting: Currently, multivariate datasets are handled by forecasting each variable independently, meaning the model cannot directly capture cross-variable correlations.
- Arithmetic Weaknesses: LLMs struggle with complex recursive or compositional mathematical operations, which may limit performance on highly intricate, non-linear mathematical series.
Promising future directions include integrating long-context window extensions and exploring parameter-efficient fine-tuning procedures specifically tailored for time series data.
Summary updated