wikillm

Paper · 2025-01-06 · cs.LG

From Tables to Time: Extending TabPFN-v2 to Time Series Forecasting

Casts forecasting as tabular regression: time, calendar, seasonal and known-future covariate features per time step, fed to a pretrained TabPFN-v2 (11M parameters) that predicts the whole horizon in one pass, with no time-series pretraining. Author-reported: competitive on GIFT-Eval, state of the art on covariate-informed fev-bench. Cannot extrapolate trends; about 30x slower than two baselines.

Time series forecastingTabular foundation modelIn-context learningtime-seriesforecastingtabularfoundation-modelzero-shot

arXivPDFCodeMarkdown11 min read

AI-compiled by claude-haiku-5-5 on 2026-10-19, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.

In plain words

Forecasting usually means training or picking a model built for sequences of numbers. This paper takes a different route: it turns the series into an ordinary table. Each row is one moment in time, described by clues such as the position in the sequence, the hour of the day, the day of the week, and the dominant repeat-cycles found in the data. The known future clues are filled in for the rows that have not happened yet.

A model that was pretrained only on general synthetic tables then reads the past rows with their known values and fills in the future rows in one pass. Nothing is trained on time series. The model is small, and it is good at repeating patterns and at using outside information you already know for the future. It struggles when the series keeps going up or down beyond anything it has seen.

TL;DR

  • Forecasting is cast as tabular regression: features per time step, plus the observed history as targets §3.
  • The regressor is TabPFN-v2, pretrained on synthetic tabular tasks, with 11M parameters, and no time-series pretraining or fine-tuning [abstract; §3].
  • Univariate and covariate-informed forecasting use the same formulation; the paper reports competitive univariate results and the strongest covariate-informed results (author-reported).
  • Its known limits are trend extrapolation and inference cost per series §5.1, §6.

Problem

Foundation models for zero-shot forecasting are mostly sequence models that are trained on time series and that are built around autoregressive or seq2seq decoding §2. Covariates whose future values are known are hard to use with them §1. The paper asks whether a tabular foundation model can forecast if the temporal structure is supplied as features §1.

Scope: the method uses only covariates that are known for future time points, such as holidays, and not unknown ones such as weather §3.1, Time-varying Covariates. It does not use lagged or autoregressive features, because those need past predictions §3.1, Combining all Features.

Method

Formulation. A series is split into C observed points for the history and H points for the horizon. A feature matrix X of shape (C+H) by D is built with one row per time step. The first C rows are the training context, with the observed targets as y_train. The last H rows are the queries §3.1; §3.2. The paper states the setup as the conditional distribution P(y_{C+1:H} | y_{1:C}, Z_{1:C+H}) §2. Every future point is predicted in one non-autoregressive forward pass §1; §2.

Features. Each row concatenates four blocks §3.1, Time-varying Covariates:

  1. Running index: Φ_index(t) = t, one value; the first time step is 0 §3.1, Running Index.
  2. Calendar: eight cyclic components, from the finest clock unit (seconds) up to the coarsest (months), each encoded as cos and sin of 2πt/P_i, plus the calendar year as a non-cyclic feature. That is 17 values §3.1, Calendar Features; app., Implementation of Calendar Features.
  3. Automatic seasonal features: the top-k periodicities of each series, found by the spectral procedure in alg. 1. Each detected frequency f_i contributes cos(2πf_i t) and sin(2πf_i t), so 2k values §3.1, Automatic Seasonal Features.
  4. Known-future covariates z_t, if any: D_z values §3.1.

The total width is D = 18 + 2k + D_z §3.1, Combining all Features.

Automatic seasonal extraction alg. 1; app., auto-seasonal algorithm:

  1. Remove a linear trend by least squares §3.1.
  2. Apply a Hann window, which reduces spectral leakage §3.1.
  3. Zero-pad the windowed signal by a factor of two, to improve frequency resolution §3.1.
  4. Take the real-valued DFT and set the zero-frequency (DC) bin to zero §3.1.
  5. Select local maxima of the magnitude spectrum, then keep the k largest by magnitude §3.1.
  6. Convert frequencies to periods and round them to the nearest integer; drop zero and duplicate periods alg. 1.
Pseudocode
# Top-k seasonal periods of one series  [alg. 1] [app., auto-seasonal alg.]
# Input:  series (N,); k; L (Hann window length, not stated in the paper)
# Output: up to k integer periods, ordered by magnitude

def top_k_periods(series, k, L):
    # Remove a linear trend fitted by least squares  [alg. 1]
    detrended = series - (alpha * t + beta)
    # Taper with a Hann window to reduce spectral leakage  [§3.1] [alg. 1]
    smoothed = convolve(detrended, hann_window(L))
    # Pad with zeros on both sides, to twice the length  [§3.1] [alg. 1]
    padded = pad_symmetric(smoothed, length=2 * N)
    # Magnitudes of the real DFT; drop the zero-frequency bin  [§3.1]
    magnitudes = abs(rfft(padded))
    magnitudes[0] = 0
    # Local maxima of the magnitude spectrum  [alg. 1]
    peaks = local_maxima(magnitudes)
    # Frequency to period, rounded to the nearest integer  [alg. 1]
    periods = round(1 / frequencies[peaks])
    # Drop zero and duplicate periods  [alg. 1]
    periods = unique_nonzero(periods)
    # Keep the k peaks with the largest magnitude  [§3.1] [alg. 1]
    return top_k_by_magnitude(periods, magnitudes, k)

Calendar encoding (paper form; see Paper vs code):

Pseudocode
# Cyclic calendar features of one timestamp  [§3.1] [app., calendar alg.]
# Input:  timestamps (T,); periods {name: P} for the eight components
# Output: (T, 17) feature matrix

def calendar_features(timestamps, periods):
    # Calendar year, not cyclic  [§3.1]
    columns = [year_of(timestamps)]
    for name, P in periods.items():
        # Zero-based cycle index within the period  [app., calendar alg.]
        index = cycle_index(timestamps, name)
        # Paper: 2*pi*t/P_i; the code divides by P - 1 instead  [§3.1]
        angle = 2 * pi * index / P
        columns += [sin(angle), cos(angle)]
    return stack(columns)

Point and probabilistic output §3.2. The pair (X_train, y_train) is treated as a standard regression dataset. For each row of X_test, TabPFN returns an approximate posterior predictive distribution over a fixed grid of bins. The mean is used for squared-error evaluation, the median for absolute-error evaluation, and arbitrary quantiles (for example 5%, 50%, 95%) for probabilistic metrics and bands §3.2. The paper does not otherwise describe a loss or training step, since none is used.

Context. Only the most recent 4096 observations are used, after missing points are removed app., Data Preprocessing. No target normalisation is applied, because TabPFN normalises internally app., Data Preprocessing.

Units of work. Each series is an independent query. A dataset of many series therefore needs one forward pass per series §6.2.

Hyperparameters

NameValueWhereNotes
BackboneTabPFN-v2 regression checkpoint tabpfn-v2-regression-2noar4o2.ckptapp., TabPFN Model ConfigurationFixed for all experiments; no tuning or checkpoint selection
Model size11M parameters[abstract] §1Compact; no time-series pretraining
Context windowlast 4096 observationsapp., Data PreprocessingAfter removing missing points
Target normalisationnone in this methodapp., Data PreprocessingTabPFN normalises internally
Calendar periods P_i60, 60, 24, 7, 30.5, 365, 52, 12§3.1, Calendar Features app., calendar alg.Eight cyclic components, plus year
Top-k seasonal periods k5app., Temporal FeaturizationMain text leaves k open; accuracy reported as stable across reasonable k, not studied further
Detrendlinear, least squares§3.1 alg. 1
Hann window length Lnot statedalg. 1Algorithm takes L as an input; no value given anywhere in the paper
Zero-padding factor2§3.1Padded signal is twice the length
Peak selectionlocal maxima of the magnitude spectrum, DC removedalg. 1 §3.1Top k by magnitude
Period roundingnearest integeralg. 1Periods of zero are dropped
Quantile levels0.1, 0.2, …, 0.9§4.1, Evaluation MetricsFor WQL
Point forecastmean (squared error) or median (absolute error)§3.2Choice follows the metric
Inference hardware4 NVIDIA T4 GPUs, time normalised to one§6.2, fig. captionBaselines ran on one T4
Time limit per fev-bench task6 hours§4.2Two tasks exceeded it and were dropped
Trainingnone§1Zero-shot; the backbone is used as released

Results

Author-reported. The paper reports results in figures only; no per-task numbers appear in the text, and the appendix per-task tables are commented out in the source app., Additional Results on GIFT-Eval. The figures are not reproduced here.

Setup. Univariate: GIFT-Eval, 97 tasks over 23 datasets, scored by MASE and WQL, aggregated as in §4.1, Evaluation Metrics. Covariate-informed: fev-bench, 28 of the 100 tasks that include known future covariates, scored by MASE and WQL §4.2. Baselines are all public before September 2025 §4.1 footnote. ChronosX and COSMIC are not in the comparison because they are not public §2 footnote.

SettingMetricReported outcome (text)Source
GIFT-Eval, 97 tasks, univariateMASE, WQLRanks closely behind TiRex, Toto-1.0 and Moirai-2; matches TimesFM-2.0 and Chronos-Bolt, with a much smaller model§4.1 Results and its figure
fev-bench, 28 tasks with known future covariatesMASE, WQLStrongest overall; outperforms TiRex and Chronos-Bolt (Base) when covariates are used; Toto-1.0 gains less§4.2 Results and its figure
Synthetic covariate classesMASE, WQLCovariates help most classes (pulses, ramps, random walks, composite); no gain for linear trends§5.3 Findings
Backbone swap to TabDPT-TSpoint accuracyMeaningful but well below TabPFN-TS; roughly Chronos-Bolt-Tiny level; evaluated on 78 of 97 tasks§5.4
Context length 1024 to 10,000MASE, WQLLonger context helps; gains diminish past 4096; WQL rises slightly at 10,000app., Context Length vs. Accuracy
Featurization ablation, 81 smallest tasksWQL, MASEIndex alone or auto-seasonal alone are weak; all feature types together are best§5.5 and its figure
Inference time, 97 GIFT-Eval tasksruntime per taskAbout 30x Chronos-Bolt-Base and TimesFM-2.0 under equal hardware assumptions§6.2 and its figure

Interpretation of the mechanism: with sin(t) alone the embedding is not injective, and the model reconstructs odd but not even harmonics; with sin(t) and cos(t) it reconstructs all tested harmonics up to a frequency limit §5.2; fig. in §5.2.

Paper vs code

Code: official repository PriorLabs/tabpfn-time-series, Apache-2.0, at commit 9fdd765105e4fac9163bc729b62343ebcdc9e2cb (cloned for this card). The repository is the authors' own project; the abstract links it. The code has moved beyond the paper, so the differences below are recorded as found.

  • Backbone version. The paper uses the TabPFN-v2 checkpoint tabpfn-v2-regression-2noar4o2.ckpt app., TabPFN Model Configuration. The code pins TABPFN_MODEL_VERSION = "v3.5" and requires tabpfn>=9.1.0 defaults.py pyproject.toml. Reproducing the paper's numbers needs the v2 checkpoint, which the code does not select by default.
  • Number of seasonal periods. The paper uses k=5 app., Temporal Featurization. The code default is max_top_k = 12 auto_features.py; the GIFT-Eval wrapper uses the defaults tabpfn_ts_wrapper.py; a test asserts 12 test_pipeline.py.
  • Point forecast. The paper uses the mean for squared error and the median for absolute error §3.2. The predictor defaults tabpfn_output_selection to "median" predictor.py.
  • Zero padding. Both paper algorithms pad symmetrically, with zeros on both sides alg. 1 app., auto-seasonal alg.. The code appends zeros only at the end: padded_values[:N_original] = values auto_features.py.
  • Hann window. The paper's algorithm takes a window length L, with no value given alg. 1. The code uses np.hanning over the series length auto_features.py.
  • Frequency or period. The paper's feature formula uses frequencies f_i §3.1, Automatic Seasonal Features, but its algorithm returns periods alg. 1. The code uses periods directly: the angle is 2π·t/period auto_features.py.
  • Calendar denominator. The paper writes 2πt/P_i §3.1. The appendix algorithm and the code use P_i − 1 as the denominator app., calendar alg. basic_features.py.
  • Peak threshold and selection. The paper keeps the k largest peaks alg. 1. The code also discards peaks below 5% of the maximum magnitude, falls back to all bins when no peaks exist, and removes duplicates after rounding auto_features.py auto_features.py.
  • Detrend default. The static function defaults to first_diff auto_features.py, but the generator passes its config, which uses linear auto_features.py.
  • Missing and sparse series. The paper drops missing points app., Data Preprocessing. The code also fills series with zero or one valid value with zeros tabpfn_ts_wrapper.py, which the paper does not mention.
  • Running index. The paper says 0 for the first time step of the series §3.1. The code slices to the last 4096 points and drops missing ones before it generates features, so the index counts from the start of the slice and counts observed rows tabpfn_ts_wrapper.py basic_features.py.
  • Inference mode. The paper ran on local T4 GPUs §6.2. The wrapper's default mode is the cloud client tabpfn_ts_wrapper.py predictor.py.
  • Fixed feature width. The paper's width is 18 + 2k + D_z §3.1. The code always emits max_top_k sin/cos pairs, filling unused slots with zeros auto_features.py.
  • Covariates. Only covariates present in both the context and the future are used, and missing future values produce a warning pipeline.py. This agrees with the paper's requirement §4.2.
  • Quantiles. The default levels are 0.1 to 0.9 defaults.py, as in the paper's WQL §4.1.

Pitfalls

  • Wrong backbone. Using the current default pins the v3.5 model, not the v2 checkpoint in the paper. Set the model path explicitly to reproduce the paper.
  • k=5 versus 12. Copying k=5 from the paper into the released code changes the default. Decide which one you mean and say it.
  • Feature width. The width 18 + 2k + D_z holds only if k periods are found. With fewer periods, the code keeps the full width and zero-fills, so consumers must not assume the paper's exact count.
  • Running index. Its origin is the start of the slice after missing points are dropped, not the start of the full series. Calendar features come from timestamps and are not affected in the same way. Gaps in the timestamps make the two disagree.
  • Mean or median. The paper picks the point estimate by metric; the code picks the median by default. A squared-error evaluation with the code's default is not the paper's choice.
  • Frequency units. The feature formula uses frequency f, the algorithm returns periods. Use period p with angle 2πt/p, as the code does, and do not feed the period in as a frequency.
  • Calendar denominator. P versus P − 1 changes every calendar feature. Pick one deliberately; the code uses P − 1.
  • Hann length. L is unspecified. The code's choice (the series length) gives different spectra from any fixed window.
  • Trend extrapolation. Future values outside the context range are not extrapolated, for linear and exponential trends §5.1. Covariates do not help linear-trend series §5.3. The authors say this comes from the pretraining objective and is structural §6.1.
  • Cost. Each series is a separate forward pass, and full attention scales as O(L²) in sequence length §6.2. Two fev-bench tasks exceeded the 6-hour limit §4.2; TabDPT was evaluated on 78 of 97 tasks for compute reasons §5.4.
  • Covariate scope. Only known-future covariates are supported. Unknown future covariates such as weather are out of scope §3.1.
  • Results. All comparisons are author-reported. The text gives no per-task or aggregate numbers, only figures, and the figure numbers should be checked against the compiled paper before quoting them.

Lineage

  • Builds on: TabPFN and its successor TabPFN-v2, the tabular foundation model used as the backbone without modification §2.
  • Alternative backbone tested: TabDPT, a tabular foundation model pretrained on real tables §5.4.
  • Compared against: statistical methods (Seasonal Naive, AutoETS, AutoARIMA, AutoTheta), DeepAR and TFT on the univariate side, and TiRex, Toto-1.0, TimesFM-2.0, Chronos-Bolt, Moirai-2 and Sundial as pretrained forecasters §4.1 §4.2.
  • Superseded by: not known from the paper.

Source and license

Adapted from “From Tables to Time: Extending TabPFN-v2 to Time Series Forecasting” by Shi Bin Hoo, Samuel Müller, David Salinas, Frank Hutter (arXiv:2501.02945), used under CC BY 4.0. Changes: condensed and restructured for implementation, with tables, equations and algorithms taken from the paper and its code, each cited to its source. Not affiliated with or endorsed by the authors. Code citations refer to https://github.com/PriorLabs/tabpfn-time-series at commit 9fdd765105e4 (Apache-2.0). Any quoted code is shown under that license.