PromptCast: A New Prompt-based Learning Paradigm for Time Series Forecasting

TL;DR

PromptCast converts time series into text; on 311,932 PISA instances, language models achieved competitive forecasting and stronger zero-shot potential.

stat.ME 🟡 Intermediate 2022-09-20 34 views
Hao Xue Flora D. Salim
time-series forecasting prompt learning natural-language generation Transformers PISA benchmark

Key Findings

Methodology

PromptCast reformulates forecasting as sentence-to-sentence generation: historical numerical values become natural-language prompts, while future values become target answers. PISA provides aligned numerical and textual instances. The authors fine-tune T5, BART, BERT, RoBERTa, BigBird, LED, and other HuggingFace models with standard sequence-to-sequence training. Generated answers are parsed back into numbers and evaluated using RMSE, MAE, and Missing Rate.

Key Results

  • The strongest reported PromptCast models reached RMSE 6.351 on CT, 519.665 on ECL, and 8.260 on SG, with corresponding MAE values of 4.707, 350.699, and 5.785. Thus, text-based forecasting was competitive with numerical baselines, especially on CT and ECL.
  • PISA contains 311,932 instances: 110 cities in City Temperature, 50 users in Electricity Consumption Load, and 324 POIs in SafeGraph mobility. Every default example uses a 15-day history window and predicts the next day, enabling aligned comparisons with LSTM, TCN, Informer, Autoformer, and FEDformer.
  • Generation introduces a failure mode absent from numerical regressors. On CT, Missing Rate was 0.412% for ProphetNet, 0.319% for Electra, and 0.244% for BERT, showing that accurate forecasting also requires syntactically parseable answers.

Significance

The study connects time-series forecasting with the pretrained language-model ecosystem and reduces the need to build a separate architecture for every new domain. Weather, electricity, and mobility can be queried through one textual interface, making forecasting more accessible to non-specialists and suggesting conversational forecasting assistants. Its reported zero-shot advantage over conventional numerical forecasting is particularly important: it points toward models that transfer across tasks rather than systems that must be redesigned and tuned for every dataset.

Technical Contribution

The main engineering contribution is a model-agnostic data-to-text protocol. Templates encode temporal context, object identity, historical values, the forecasting question, and the target answer. The authors release paired PISA-numerical and PISA-prompt instances, chronological splits, and a reproducible benchmark. Missing Rate extends standard forecasting evaluation to generated text, while string parsing converts language outputs into numerical predictions. This permits direct comparison between language generators and LSTM, TCN, Transformer, Informer, Autoformer, and FEDformer without modifying their core architectures.

Novelty

The paper presents itself as the first attempt to address general time-series forecasting through natural-language generation rather than merely using text as an auxiliary feature. Informer, Autoformer, and FEDformer still operate in numerical space and improve attention, decomposition, or frequency modeling. PromptCast changes the task interface itself: both input and output are sentences, allowing pretrained sequence-to-sequence models such as T5 and BART to serve directly as forecasting engines.

Limitations

  • Textual serialization discretizes continuous values and can lose precision, units, or temporal structure. In addition, a model may produce an incorrect format or no extractable number, creating a failure mode measured by Missing Rate.
  • PISA is limited to three mainly daily domains and primarily one-step forecasting. It does not establish robustness for finance, industrial sensors, high-frequency streams, irregular sampling, or large multivariate systems.
  • The benchmark relies largely on templates and official default hyperparameters. It does not systematically isolate wording, numerical tokenization, quantization precision, model scale, or constrained decoding.

Future Work

Promising directions include multi-step and multivariate PromptCast, longer contexts, richer temporal language, and numerical tokenization that preserves precision. Constrained decoding could guarantee valid outputs, while probabilistic generation could express uncertainty. Larger cross-domain datasets, genuine cross-dataset zero-shot tests, retrieval of calendar or weather context, and comparisons with modern foundation models would clarify whether the observed transferability scales beyond the benchmark.

AI Executive Summary

Time-series forecasting usually feeds a numerical sequence into a specialized regressor and returns another sequence of numbers. LSTM, TCN, Transformer, Informer, Autoformer, and FEDformer have improved accuracy, but each new domain still demands data engineering, architecture choices, and tuning. PromptCast asks a more radical question: can forecasting be treated like translation, with a language model converting a description of the past into an answer about the future?

The proposed system serializes the past into sentences. A prompt may state the last 15 daily temperatures, identify a city, and ask what tomorrow’s temperature will be; the model then generates an answer sentence. The authors release PISA, containing 311,932 aligned instances from 110 cities, 50 electricity users, and 324 points of interest. T5, BART, BERT, RoBERTa, BigBird, LED, and other models are fine-tuned with standard sequence-to-sequence procedures, without changing their architectures.

The best reported text models achieve RMSE 6.351 on CT, 519.665 on ECL, and 8.260 on SG, with MAE 4.707, 350.699, and 5.785. These results are competitive with numerical baselines, although SG remains slightly behind the best numerical model. The price of linguistic flexibility is output-format failure, captured by Missing Rate. PromptCast is not yet a universal forecaster, but it offers a compelling route toward zero-shot transfer, unified interfaces, and conversational prediction.

Deep Analysis

Background

Forecasting has progressed from statistical models to LSTM, TCN, and Transformer architectures. Informer uses efficient attention, while Autoformer and FEDformer exploit decomposition and frequency information. These systems improve numerical prediction but remain task-specific and require structured inputs. In parallel, pretrained models such as BERT and T5 have shown broad transfer across language tasks. PromptCast investigates whether that transfer can extend from text to numerical temporal dynamics.

Core Problem

Given an object Um and observations x^m_{t1:tobs}, conventional forecasting predicts x^m_{tobs+1:tobs+n}. The challenge is that language models process discrete tokens, whereas time series contain continuous values, temporal periodicity, units, and sometimes multiple correlated variables. A useful interface must preserve predictive information, remain understandable, and produce an output that can be reliably converted back into a number. Cross-domain generalization is the central motivation.

Innovation

  • �� Recasts forecasting as sentence-to-sentence generation.
  • �� Releases PISA with aligned numerical and prompt versions.
  • �� Uses domain-specific templates for CT, ECL, and SG.
  • �� Adds Missing Rate to measure unparsable generations.
  • �� Applies standard HuggingFace sequence-to-sequence fine-tuning without architectural modifications.

The innovation is therefore less a new neural block than a new task formulation and benchmark protocol.

Methodology

  • �� Input: each example contains 15 historical daily observations and the next-day target, generated with a one-day sliding window.
  • �� Serialization: CT describes temperature, ECL describes daily electricity consumption, and SG describes POI visitors; a question identifies the future time step.
  • �� Models: T5, BART, Blenderbot, LED, Pegasus, ProphetNet, BigBird, Electra, BERT, and RoBERTa.
  • �� Training: standard HuggingFace Trainer and sequence-to-sequence loss, with official tokenizers and no extra output regularization.
  • �� Decoding: generated answers are string-parsed to recover numbers.
  • �� Metrics: RMSE=sqrt(mean((y-yhat)^2)), MAE=mean(|y-yhat|), and Missing Rate=(ntest-ndecoded)/ntest×100%.

Experiments

CT contains 110 cities from 2017/01/01–2020/04/30; ECL contains 50 complete users; SG contains 324 POIs from 2020/06/15–2021/09/05. Each subset uses chronological 7:1:2 train/validation/test splits. Numerical baselines include Copy Yesterday, Historical Average, Copy Last Week, AutoARIMA, LSTM, TCN, Transformer, Informer, Autoformer, and FEDformer. Ten language models are tested, generally with official defaults; deep models report five random-seed runs.

Results

Among numerical baselines, the best CT RMSE is 6.358 from FEDformer, the best ECL RMSE is 536.921 from Informer, and the best SG RMSE is 8.151 from Informer. PromptCast reaches 6.351 and 519.665 on CT and ECL with BigBird, and 8.260 on SG with RoBERTa. Corresponding MAEs are 4.707, 350.699, and 5.785. Language models are therefore competitive across domains, but generation validity must be monitored separately.

Applications

A conversational weather service could answer tomorrow’s temperature questions directly from historical records. Energy platforms could expose next-day load forecasts through natural-language interfaces, while retailers and city managers could query expected visitors for stores or POIs. Practical deployment requires cleaned time series, stable templates, robust numeric parsing, fallback behavior, and uncertainty communication.

Limitations & Outlook

Template-based serialization may discard precision, units, or complex temporal relations, while unconstrained generation can produce unparsable answers. The benchmark covers only three mostly daily domains and emphasizes one-step forecasting, so it does not establish performance for high-frequency sensors, finance, irregular sampling, or large multivariate systems. Language inference may also cost more than compact numerical models. Future work should combine continuous numerical encodings, constrained decoding, probabilistic outputs, multi-step training, and broader cross-domain evaluation.

Plain Language Accessible to non-experts

Imagine a factory that predicts tomorrow’s production. A conventional system accepts a rigid spreadsheet: yesterday’s output, the day before yesterday’s output, and so on. It calculates a number, but every new factory may need a different machine and a new setup process.

PromptCast turns the spreadsheet into a short note: “Factory A produced 100 units on Monday, 120 on Tuesday, and 115 on Wednesday. How many will it produce Thursday?” A language assistant reads the note and writes an answer. Weather, electricity, and visitor counts can all use the same style of note, even though their numbers have very different sizes. PISA is a large collection of such questions, with 311,932 examples.

This makes forecasting easier to ask for, much like asking a colleague. But the colleague can misunderstand the required answer format. If the model writes a long explanation instead of a usable number, the computer cannot record its prediction; this is why the paper measures Missing Rate. The approach is promising, but it does not remove the need for clean data, careful checking, and specialized models when accuracy or reliability is critical.

ELI14 Explained like you're 14

Think about predicting your school’s cafeteria sales. A normal program wants a neat list: Monday 100 lunches, Tuesday 120, Wednesday 115. It performs calculations and returns one number. PromptCast says: why not turn that list into a chat message—“These were the last 15 days. How many lunches will we sell tomorrow?”—and let a language model answer?

The paper tests this idea on city temperature, electricity use, and visits to places such as shops or parks. Its dataset, PISA, has 311,932 examples. Models including T5, BART, BERT, and BigBird read the past and write a future answer. It is like training a chatbot that also knows how to make forecasts!

The results are genuinely interesting. BigBird gets RMSE 6.351 on city temperature and 519.665 on electricity; a strong SG result is 8.260. Lower is generally better. But imagine asking for “How many?” and getting a paragraph, a joke, or a sentence with no readable number. That happens sometimes, so the authors count Missing Rate too.

Does this mean language models beat every forecasting program? Not at all! Sudden storms, power failures, holidays, or unusual crowds can still surprise them. They may also use more computing power than a small specialist model. Still, the idea is exciting: one chat-style interface could eventually handle many kinds of predictions.

Glossary

PromptCast

A forecasting paradigm that converts numerical histories into natural-language prompts and future values into generated answer sentences. Technically, it reframes forecasting as conditional sequence-to-sequence generation.

The paper’s central task formulation.

PISA

The Prompt-based tIme Series forecAsting dataset with 311,932 instances from CT, ECL, and SG. It includes matched numerical and textual versions.

Used for training, validation, testing, and benchmarking.

RMSE

Root Mean Square Error, which penalizes large prediction mistakes relatively strongly. It is sqrt(mean((y-yhat)^2)).

One of the main numerical accuracy metrics.

MAE

Mean Absolute Error, the average absolute distance between predictions and targets. It is easier to interpret and less sensitive to extreme errors than RMSE.

Reported alongside RMSE.

Missing Rate

The percentage of generated outputs from which no valid number can be decoded: (ntest-ndecoded)/ntest×100%. Lower is better.

Measures text-generation validity.

Zero-shot generalization

Forecasting on a new setting without task-specific retraining or tuning. It tests whether learned representations transfer across scenarios.

A claimed advantage of PromptCast over conventional numerical methods.

Open Questions Unanswered questions from this research

  • 1 How can a language interface preserve decimal precision, units, continuity, and prediction intervals while remaining flexible? The paper does not provide a universal numerical tokenization or constrained-decoding solution.
  • 2 The zero-shot claim needs testing on genuinely unseen datasets, domains, frequencies, and distributions. Three daily sources are insufficient to establish broad transfer.
  • 3 Long-horizon, multivariate, and high-frequency forecasting may create context growth, error accumulation, and substantial inference costs. Their interaction with language generation remains unresolved.

Applications

Immediate Applications

Forecasting chatbot

Customer-service agents, planners, or analysts could ask for tomorrow’s temperature, load, or visitor count in natural language. Deployment requires cleaned histories, domain templates, numeric parsing, retries, and warnings when an answer cannot be decoded.

Rapid business forecasting interface

Retail, energy, and city-management teams could prototype forecasts for new objects through a shared text interface instead of building a separate Transformer pipeline. Expected benefits are faster experimentation and lower dependence on specialized tuning.

Long-term Vision

General-purpose forecasting assistant

A future assistant could combine time series with calendars, weather, events, and user questions to answer forecasts across domains. Obstacles include reliable numerical reasoning, calibrated uncertainty, real-time data access, cost, and safety validation.

Abstract

This paper presents a new perspective on time series forecasting. In existing time series forecasting methods, the models take a sequence of numerical values as input and yield numerical values as output. The existing SOTA models are largely based on the Transformer architecture, modified with multiple encoding mechanisms to incorporate the context and semantics around the historical data. Inspired by the successes of pre-trained language foundation models, we pose a question about whether these models can also be adapted to solve time-series forecasting. Thus, we propose a new forecasting paradigm: prompt-based time series forecasting (PromptCast). In this novel task, the numerical input and output are transformed into prompts and the forecasting task is framed in a sentence-to-sentence manner, making it possible to directly apply language models for forecasting purposes. To support and facilitate the research of this task, we also present a large-scale dataset (PISA) that includes three real-world forecasting scenarios. We evaluate different SOTA numerical-based forecasting methods and language generation models. The benchmark results with various forecasting settings demonstrate the proposed PromptCast with language generation models is a promising research direction. Additionally, in comparison to conventional numerical-based forecasting, PromptCast shows a much better generalization ability under the zero-shot setting.

stat.ME cs.AI cs.CL cs.LG math.ST