Paper deep dive
In-Context Inpainting for Time Series Forecasting
Thang Nguyen, Dung Nguyen, Romero Morais, Truyen Tran
Intelligence
Status: succeeded | Model: Gemma-4-26B-A4B | Prompt: intel-v1 | Confidence: 92%
Last extracted: 8/26/2026, 4:51:53 AM
Summary
The paper introduces ICI-Time, a framework that reframes time series forecasting as a visual inpainting task using Large Vision Models (LVMs). It transforms time series data into area charts, uses in-context learning with example pairs to prompt the LVM, and inpaints the missing forecast region. The method requires no fine-tuning or architectural modifications, demonstrating competitive performance against deep learning baselines across epidemiology, meteorology, and power systems datasets.
Entities (12)
Relation Signals (9)
ICI-Time â employs â In-Context Learning
confidence 95% ¡ applies visual in-context learning
ICI-Time â evaluatedon â ETT
confidence 95% ¡ power systems... ETT
ICI-Time â evaluatedon â ILI
confidence 95% ¡ Extensive experiments across epidemiology... ILI
ICI-Time â evaluatedon â Weather
confidence 95% ¡ meteorology... Weather
ICI-Time â uses â Large Vision Models
confidence 95% ¡ ICI-Time... leveraging the generalisation power of large vision models (LVMs)
ICI-Time â transforms â Time Series
confidence 90% ¡ transforms time series into structured visual representations (area charts)
ICI-Time â outperforms â Informer
confidence 85% ¡ ICI-Time outperforms the baselines in most cases... comparing against... Informer
ICI-Time â outperforms â Pyraformer
confidence 85% ¡ ICI-Time outperforms the baselines in most cases... comparing against... Pyraformer
ICI-Time â outperforms â LogTrans
Cypher Suggestions (0)
No Cypher suggestions yet.
Abstract
Abstract:We propose ICI-Time, a novel framework that reframes time series forecasting as a visual inpainting task, leveraging the generalisation power of large vision models (LVMs). Unlike methods that require specialised temporal architectures and extensive domain-specific training, ICI-Time transforms time series into structured visual representations (area charts) and applies visual in-context learning, reformulating forecasting as pattern completion within a grid-structured prompt that pre-trained vision transformers can solve without fine-tuning or architectural modification. Temporal dependencies are represented through spatial layout, with a consistent, invertible mapping between numerical and visual domains. Extensive experiments across epidemiology, meteorology, and power systems demonstrate that ICI-Time performs competitively against deep learning baselines and shows promising adaptability under limited-data settings, introducing a new paradigm that bridges temporal and visual domains.
Tags
Links
- Source: https://arxiv.org/abs/2608.23855v1
- Canonical: https://arxiv.org/abs/2608.23855v1
Trouble viewing inline? Open PDF directly â
Full Text
40,729 characters extracted from source content.
Expand or collapse full text
ICI-Time: In-Context Inpainting for Adaptable Time Series Forecasting Thang Nguyen Dung Nguyen Romero Morais Truyen Tran Affiliation: Applied Artificial Intelligence Initiative, Deakin University, Geelong, Victoria 3216, Australia E-mail minh.t.nguyen@deakin.edu.au Abstract We propose ICI-Time, a novel framework that reframes time series forecasting as a visual inpainting task, leveraging the generalisation power of large vision models (LVMs). Unlike methods that require specialised temporal architectures and extensive domain-specific training, ICI-Time transforms time series into structured visual representations (area charts) and applies visual in-context learning, reformulating forecasting as pattern completion within a grid-structured prompt that pre-trained vision transformers can solve without fine-tuning or architectural modification. Temporal dependencies are represented through spatial layout, with a consistent, invertible mapping between numerical and visual domains. Extensive experiments across epidemiology, meteorology, and power systems demonstrate that ICI-Time performs competitively against deep learning baselines and shows promising adaptability under limited-data settings, introducing a new paradigm that bridges temporal and visual domains. Keywords: Time-series forecasting Visual prompting Inpainting In-context learning 1 Introduction Time series forecasting is a foundational problem in machine learning, underpinning applications across finance, epidemiology, power systems, and climate modeling. Despite decades of progress, forecasting remains inherently challenging due to complex temporal dependencies, multi-scale variability, non-stationarities, and the scarcity of labeled data in many real-world settings. Deep learning approaches have achieved state-of-the-art results [13, 35], but they typically require domain-specific architectures and extensive training or fine-tuning when adapting to new domains or tasks. This reliance on task-specific engineering limits their scalability and hinders generalisation, especially in low-data regimes. In contrast, foundation models in language [3, 27] and vision [2] have demonstrated unprecedented generalisation through in-context learning (ICL)âthe ability to solve new tasks purely through exposure to examples at inference time, without parameter updates. Recent efforts have explored ICL for temporal data using large language models (LLMs) [36] or time series models [14], but leveraging large vision models (LVMs) for time series forecasting remains an open challenge, primarily because temporal signals are not natively visual. Figure 1: Visual prompting for time series forecasting via image-based in-context learning. Input sequences are converted into images and arranged in a grid: the first row holds an in-context inputâoutput example pair, the second row holds the query with the missing forecast (gray). A pre-trained large vision model inpaints the missing region, and the prediction (red) is recovered through a de-imaging process. In this paper, we introduce ICI-Time (In-Context Inpainting for Time series), a novel framework that redefines time series forecasting as a promptable visual inpainting task. ICI-Time (i) transforms time series into visual representations (area charts), (i) assembles inputâoutput example pairs and the query instance into a grid-like visual prompt, (i) employs a pre-trained LVM to forecast by completing the missing region of the imageâanalogous to pattern completion, and (iv) translates the generated chart back to numerical time series. As shown in Figure 1, the LVM infers the task from the in-context example pair (x1,y1)(x_1,y_1) and inpaints the forecast for the query xqx_q (shown in red), all without task-specific fine-tuning. Crucially, the LVM is used off-the-shelf, without any modification. This paradigm therefore (i) removes the need to train domain-specific models, (i) supports rapid adaptation to new forecasting tasks through flexible visual prompting, and (i) exploits the rich pattern recognition capabilities of LVMs without architectural changes or additional supervision. Our contributions are fourfold: ⢠A cross-modal forecasting framework that bridges temporal and visual domains, enabling fast adaptation using off-the-shelf vision transformers. ⢠A new formulation of visual in-context learning for time series, extending ICL beyond its NLP roots to a paradigm where temporal prediction is solved through visual prompts and inpainting. ⢠A carefully designed bidirectional mapping between time series and visual spaces that represents temporal dependencies via spatial layout and is invertible, ensuring no loss of forecasting fidelity during transformation. ⢠Strong empirical validation in epidemiology (ILI), meteorology (Weather), and power systems (ETT), where ICI-Time matches strong Transformer-based baselines without any training and is markedly more robust in low-data regimes. Our findings suggest that visual reasoning models can generalise to temporal tasks when equipped with suitable representations, opening a new research direction in harnessing cross-modal transfer for time series analysis. 2 Related Work Visual In-context Learning In-context learning (ICL) allows a model to condition at inference time on contextual inputâoutput examples and generate the output for a new input without parameter updates, providing a shortcut to adaptability in AI [5]. While text-based ICL emerged in autoregressive language models, Visual In-Context Learning (VICL) trains deep networks to fill in patches of grid-like images [2]. Pioneering works such as Painter [25] and SegGPT [26] showed that generalist vision models can perform diverse tasksâfrom depth estimation to semantic segmentationâby treating them as inpainting conditioned on visual examples. In the temporal domain, WeatherGFM [33] applied this paradigm to multi-modal weather data using grid-based prompts. However, general-purpose VICL for univariate time series forecasting using simple line plots remains underexplored, and key factors such as informative example selection [32] have been studied for semantic tasks but not for temporal dynamics. Our work bridges this gap by designing a visual prompting scheme that activates the forecasting capability of LVMs without parameter updates. Foundation Models and Time Series Foundation models have enabled new solutions for time series forecasting [31, 24, 30]. Early work adapted LLMs: Chronos [1] and Time-LLM [8] tokenise time series via quantization or text encoding, but such methods often struggle with the âmodality gapâ between continuous numerical data and discrete text tokens [16]. A newer wave of âvision-firstâ models has emerged: VisionTS [4] shows that visual Masked Autoencoders pre-trained on ImageNet can serve as zero-shot forecasters by reconstructing masked time-series images, but requires a pre-training task aligned with forecasting; ViTime [29] trains a foundation model in a binary image metric space for robust probabilistic forecasting. This vision-first trend has since accelerated: VisionTS++ [22] continually pre-trains the visual backbone on large-scale time-series corpora to narrow the modality gap, DMMV [20] fuses decomposition-based multi-modal views with LVMs for long-term forecasting, and OccamVTS [15] and SVTime [21] distil the predictive priors of LVM forecasters into lightweight networks. These results strengthen the evidence that visual priors transfer to temporal data, yet each still depends on continual pre-training, fine-tuning, or distillation. Unlike these approaches, which require task-aligned pre-training, architectural adaptation, or knowledge transfer into new weights, we investigate the âfree lunchâ hypothesis [4] using standard line plots, pre-trained generalist models, and in-context visual conditioningâwithout task-aligned pre-training. Image-based Representation for Time-series Forecasters Transforming time series into images bypasses the constraints of numerical sequence modeling; a recent survey [16] categorises such transformations into line plots, heatmaps, and spectral images. VisionTS [4] and TimesNet [28] use periodicity-based heatmaps to capture long-term dependencies, but these lose the âshapeâ of the data, whereas line plots preserve the continuity and topology critical for visual pattern recognition. ViTST [11] converts irregularly sampled series into line graphs for classification, and Time-VLM [34] and VLM-TSC [18] feed line plots to Vision-Language Models, showing that explicit connectivity cues outperform scatter plots or text descriptions; DePlot [12] and ChartLlama [7] further prove that LVMs can extract precise numerical semantics from charts. Most recently, TimeOmni-VL [6] unifies time-series understanding and generation within a single visionâlanguage model and identifies low-loss bidirectional imageâseries conversion as a prerequisite for numerically faithful generationâindependently corroborating a central design principle of our frameworkâbut attains it through large-scale multi-task training on a purpose-built corpus. Yet most existing image-based forecasters [19, 10, 23] train a decoder from scratch or fine-tune the vision backbone, Time-VLM merely augments forecasting with a vision-language model, and unified models such as TimeOmni-VL remain training-intensive. In contrast, we reframe forecasting entirely as visual reasoning: we use a pre-trained visual prompting model [2] as-isâno fine-tuning, no external modulesâand design a prompting scheme that leverages its inherent ICL ability to forecast directly from line plot grids. 3 Preliminaries 3.1 Time Series Forecasting Let ââCĂLX ^CĂ L represent a multivariate time series, where L is the total length and C is the number of channels. We partition X into historical series IââCĂTIX_I ^CĂ T_I and future series PââCĂTPX_P ^CĂ T_P, with L=TI+TPL=T_I+T_P. tjX_t^j is the series value at the t-th timestep and the j-th channel. The objective is to develop a predictor f:âCĂLIââCĂLPf:R^CĂ L_I ^CĂ L_P that maps a lookback window of length LIL_I to a prediction horizon of length LPL_P. Here TIT_I and TPT_P represent the total available data for training and evaluation, while LIL_I and LPL_P define the modelâs fixed input and output dimensions, where TIâŤ(LI+LP)T_I (L_I+L_P). 3.2 In-context Learning In-context Learning (ICL) enables a model to answer a query without task-specific training or fine-tuning: the model is given a sequence of âsimilarâ inputâoutput pairs (i,i)i=1H\(x_i,y_i)\_i=1^H before the query qx_q, and produces the output ^q y_q directly. This contrasts with standard supervised learning, where inputâoutput pairs are used to train or fine-tune the model. 4 Method Time series forecasting traditionally requires specialised architectures and training procedures tailored to temporal data. We challenge this paradigm by leveraging the in-context learning capabilities of Large Vision Models (LVMs) through visual prompting: time series are transformed into visual representations and the LVM forecasts via inpainting, eliminating the need for domain-specific architectures and model training or tuning, and allowing rapid adaptation to new domains even with limited data. We call this the in-context inpainting approach to time series forecasting. Our framework (Fig. 2) comprises four components: (1) visual case-based selection from historical data, (2) conversion of time series into information-dense images, (3) an off-the-shelf LVM performing in-context inpainting, and (4) a back-conversion mechanism recovering the original time series. Figure 2: The ICI-Time framework: (1) example selection from historical data (top-left); (2) time-series-to-image transformation (bottom-left); (3) in-context visual prompting with a pretrained LVM [2] that inpaints the visual prompt (top-right); and (4) image-to-time-series conversion with denoising and curve extraction (bottom-right). The rightmost image shows the original series in black and the forecast in red. 4.1 Visual Case-Based Forecasting Task examples enable LVMs to learn in-context, so it is crucial to select examples relevant to the query. This resembles case-based reasoningâsolving new problems by recalling and adapting similar past problems and their solutionsâwith the LVM acting as a nonlinear case interpolator in image space. To enable this, we build a searchable database from IX_I by partitioning the historical series into overlapping windows via a sliding window, each consisting of a lookback component of length LIL_I and a prediction component of length LPL_P. For each valid starting position sâ1,âŚ,TIâ(LI+LP)+1sâ\1,âŚ,T_I-(L_I+L_P)+1\: Ws=s,s=I[:,s:s+LI],I[:,s+LI:s+LI+LP].W_s= \x_s,y_s \= \X_I[:,s:s+L_I],X_I[:,s+L_I:s+L_I+L_P] \. (1) This database hist=Wss=1SD_hist= \W_s \_s=1^S enables pattern matching during forecasting: given the query window WqW_q, we compute the Euclidean distance between normalised inputs, dâĄ(Wq,Ws)=âÂŻqâÂŻsâ2d(W_q,W_s)=|| x_q- x_s||_2, and select the best example as Wsâ=argâminWsâĄdâ(Wq,Ws)W_s^*= _W_sd(W_q,W_s). 4.2 Visual Representation of Time Series The next step transforms numerical time series into visually interpretable formats, using normalization and boundary visualization procedures that balance information preservation and visual clarity. Image Height The image height parameter normalizes the variety of numerical scales into image sizes typically used in LVMs. Example and query windows are normalised separately. Example images For the i-th example window Wi=i,iW_i=\x_i,y_i\, we apply min-max scaling to both components using shared statistics: ÂŻââmiMiâmi,âi,i, zâ z-m_iM_i-m_i, â\x_i,y_i\, (2) where mi=minâĄ(imin,imin)m_i= (x_i^min,y_i^min) and Mi=maxâĄ(imax,imax)M_i= (x_i^max,y_i^max). After normalization, ÂŻi x_i and ÂŻi y_i are plotted into separate figures. The vertical axis extends from hexamplemin=minâĄ(ÂŻi,ÂŻi)h_example^min= ( x_i, y_i) to hexamplemax=1.25ĂmaxâĄ(ÂŻi,ÂŻi)h_example^max=1.25Ă ( x_i, y_i). The scale hexample=hexamplemaxâhexampleminh_example=h_example^max-h_example^min serves as explicit prior knowledge transferred to the query. Query images For a query window Wq=q,qW_q=\x_q,y_q\, we normalise using the inputâs local statistics: ÂŻqâqâqminqmaxâqmin x_qâ x_q-x_q^minx_q^max-x_q^min and ÂŻqâqâqminqmaxâqmin y_qâ y_q-x_q^minx_q^max-x_q^min for the unknown target. The vertical axis range is hquerymin=minâĄ(ÂŻq)h_query^min= ( x_q) to hquerymax=hquerymin+hexampleh_query^max=h_query^min+h_example, which ensures visual consistency. Image Width Our implementation uses fixed 224Ă224224Ă 224 pixel images. To handle varying sequence lengths, we adjust the x-axis limits: xlimiân=[1,LI]xlim_in=[1,L_I] for lookback components and xlimoâuât=[LI+1,LI+LP]xlim_out=[L_I+1,L_I+L_P] for prediction components. The invertibility of our visual representation function g:âCĂLPââg:R^CĂ L_P necessitates preserving the parameters θi=imin,imax _i=\x_i^min,x_i^max\ so that the inverse gâ1:âââCĂLPg^-1:I ^CĂ L_P can denormalize visual predictions via ^i=^inormâ (imaxâimin)+imin y_i= y_i^norm¡(x_i^max-x_i^min)+x_i^min. 4.3 Visual Prompting and Time Series Recovery The example and query images constitute a visual prompt; the LVM fills the empty region by producing an image I via in-context learning, capturing forecasting patterns from the examples. We then recover the numerical series ^qââCĂLP y_q ^CĂ L_P from I in two steps. Image Denoising We binarize, ^binaryâ(r,c)=1 I_binary(r,c)=1 if ^â(r,c)>Ď I(r,c)>Ď, apply a bitwise NOT to obtain ^inv I_inv, then apply morphological opening, ^opened=(^invâ)â I_opened=( I_inv ) , where K is a 3Ă33Ă 3 structuring element. The final clean image is ^clean=NOTâ(^opened) I_clean=NOT( I_opened). Boundary Curve Extraction We extract ^q y_q by finding the uppermost foreground pixel in each column: for a cleaned image of height h, the boundary coordinate is yi=hâminâĄrâŁ^cleanâ(r,ci)=1â1y_i=h- \r I_clean(r,c_i)=1\-1. To ensure continuity, we interpolate fâĄ(c)f(c) such that fâĄ(ci)=yif(c_i)=y_i and sample the curve at LPL_P equidistant points to obtain the final sequence ^q y_q. 5 Experimental Results 5.1 Datasets We evaluate ICI-Time across three diverse and widely benchmarked domains (summarised in Table 1): ILI11 1 https://gis.cdc.gov/grasp/fluview/fluportaldashboard.html (Influenza-Like Illness), weekly influenza-like illness patient data collected by the US CDC from 2002 to 2021, whose clear seasonal patterns and long historical record make it particularly valuable for evaluating retrieval-based strategies; Weather22 2 https://w.bgc-jena.mpg.de/wetter/, 21 meteorological indicators such as air temperature and humidity, recorded at 10-minute intervals throughout 2020; and ETT33 3 https://github.com/zhouhaoyi/ETDataset (Electricity Transformer Temperature), series from two electric transformers at 15-minute (âmâ) and hourly (âhâ) resolutions, yielding four datasets: ETTh1, ETTh2, ETTm1, and ETTm2. Table 1: Summary Statistics of Benchmark Datasets. Characteristic ILI Weather ETTh1/2 ETTm1/2 Number of Features 7 21 7 7 Number of Timesteps 966 52,696 17,420 69,680 5.2 Experimental Settings We adopt the data split setting from Nie et al. [17] with one key modification: we merge the training and validation data into a single database as we do not need to train or fine-tune a model, thereby enlarging our dataset. We use a look-back window L=96L=96 for our model and all Transformer-based baselines. Prediction lengths follow Nie et al. [17], with Tâ24,36,48,60Tâ\24,36,48,60\ for ILI and Tâ96,192,336,720Tâ\96,192,336,720\ for the other datasets. We adopt channel independence, forecasting each variable separately, a technique proven effective in deep learning approaches [17, 4, 29]. We report Mean Squared Error (MSE) and Mean Absolute Error (MAE), comparing against Transformer-based baselines: Informer [35] (ProbSparse self-attention), Pyraformer [13] (pyramid attention), and LogTrans [9] (log-sparse attention). Baseline results are sourced from Nie et al. [17] when available, with additional experiments conducted to fill gaps. All experiments maintain consistent configurations to ensure fair comparison. 5.3 Forecasting Performance Sanity check: We implemented a nearest-neighbour baseline that simply reuses the first example from the input sequence as the prediction for all future time steps, to test whether LVMs simply copy the example over. Its results are poor compared to Transformer-based models and to ICI-Time, confirming that the generalisation power of LVMs comes from leveraging their vast source of visual patterns. Full-data Results Forecasting results are presented in Table 2. ICI-Time outperforms the baselines in most cases, especially on the MAE metric (23 out of 24 cases, with the remaining case being second best). This demonstrates that off-the-shelf visual in-context models can perform competitive time-series forecasting without training. The MSE metric is sensitive to noise and more reflective of the training square-loss function; in our case, noise can be suppressed by averaging over multiple runs, each using a different near-optimal prompting example. Table 2: Per-horizon performance comparison of various forecasting methods on full training data. Best results are in bold. The smaller the better. Dataset Prediction ICI-Time Informer Pyraformer LogTrans ICI-Time Informer Pyraformer LogTrans MSE MAE ETTh1 96 0.812 0.941 0.774 0.878 0.598 0.769 0.672 0.740 192 1.116 1.007 0.797 1.037 0.718 0.786 0.680 0.824 336 1.228 1.038 1.205 1.238 0.746 0.784 0.897 0.932 720 1.291 1.144 0.977 1.135 0.757 0.857 0.788 0.852 ETTh2 96 0.288 1.549 0.645 2.116 0.357 0.952 0.597 1.197 192 0.402 3.792 0.788 4.315 0.426 1.542 0.683 1.635 336 0.449 4.215 0.907 1.124 0.455 1.642 0.747 1.604 720 0.419 3.656 0.963 3.188 0.466 1.619 0.783 1.540 ETTm1 96 0.578 0.626 0.543 0.600 0.471 0.560 0.510 0.546 192 0.673 0.725 0.557 0.837 0.527 0.619 0.537 0.700 336 0.749 1.005 0.754 1.124 0.570 0.741 0.655 0.832 720 1.059 1.133 0.908 1.153 0.687 0.845 0.724 0.820 ETTm2 96 0.198 0.355 0.435 0.768 0.288 0.462 0.507 0.642 192 0.241 0.595 0.730 0.989 0.318 0.586 0.673 0.757 336 0.324 1.270 1.201 1.334 0.372 0.871 0.845 0.872 720 0.379 3.001 3.625 3.048 0.412 1.267 1.451 1.328 Weather 96 0.219 0.354 0.896 0.458 0.232 0.405 0.556 0.490 192 0.280 0.419 0.622 0.658 0.273 0.434 0.624 0.589 336 0.399 0.583 0.739 0.797 0.339 0.543 0.753 0.652 720 0.443 0.916 1.004 0.869 0.410 0.705 0.934 0.675 ILI 24 3.136 4.657 1.420 4.480 1.068 1.449 2.012 1.444 36 2.875 4.650 7.394 4.799 1.014 1.463 2.031 1.467 48 3.572 5.004 7.551 4.800 1.098 1.542 2.057 1.468 60 2.709 5.071 7.662 5.278 0.985 1.543 2.100 1.560 5.4 Analysis of Design Choices We ablate the key design decisions in ICI-Time: the height and width settings of the visual encoding, and the post-processing applied during time series recovery. Table 3 reports results averaged over all prediction horizons; each ablation column replaces exactly one component of the full model. Height Settings The vertical axis encodes value magnitude. We compare our proposed htransferh_transfer (Section 4.2), which transfers the height scale from examples to queries via hquerymax=hquerymin+hexampleh^max_query=h^min_query+h_example, against h1.5h_1.5, a fixed scaling factor of 1.5 for all inputs. htransferh_transfer consistently outperforms h1.5h_1.5 across ETT and Weather, reducing the average MSE by 9.2% to 18.5% (largest on ETTh1), suggesting that maintaining visual scale consistency between examples and queries enables more effective pattern recognition. ILI is the exception, where the fixed scaling attains a lower average error. Width Settings The horizontal axis represents time. Our proposed wdiffw_diff uses distinct temporal resolutions for input and target images (LI/224L_I/224 and LP/224L_P/224 respectively), preserving the native resolution of each component, whereas wevenw_even uses LP/224L_P/224 uniformly for both, shifting the input to the rightmost position. wdiffw_diff outperforms wevenw_even on all six datasets, reducing the average MSE by 1.8% to 5.1% on ETT and Weather and by 10.7% on ILI, indicating that preserving the native temporal resolution of the input consistently benefits forecasting. Post-processing A critical challenge in recovering time series from generated images is the disconnection problemâa large forecasting error at the first prediction step, at the boundary between the input and the predicted values. We apply a Gaussian smoothing decay, weighting wi=exp(â0.5â (i/Ď)2)w_i= (-0.5¡(i/Ď)^2) with Ď=window/3Ď=window/3, which smoothly blends the last input point into the predictions over approximately 10 time steps. Compared with raw recovery, smoothing improves the average MSE on all six datasets, by 0.7% to 2.2%, with the largest gain on ILI. Table 3: Ablation of design choices, averaged over all prediction horizons. Each ablation column replaces one component of the full model (ICI-Time = htransferh_transfer + wdiffw_diff + smoothing). Best results are in bold. The smaller the better. Dataset h1.5h_1.5 wevenw_even Raw ICI-Time h1.5h_1.5 wevenw_even Raw ICI-Time MSE MAE ETTh1 1.365 1.151 1.126 1.112 0.780 0.719 0.712 0.705 ETTh2 0.446 0.411 0.394 0.390 0.462 0.443 0.430 0.426 ETTm1 0.860 0.795 0.777 0.765 0.597 0.573 0.570 0.564 ETTm2 0.316 0.293 0.288 0.286 0.368 0.354 0.351 0.348 Weather 0.369 0.341 0.340 0.335 0.324 0.315 0.316 0.314 ILI 2.934 3.440 3.141 3.073 0.996 1.127 1.064 1.041 Few-shot adaptation We evaluate few-shot adaptation by restricting all methods to the first 1%1\%, 5%5\%, or 10%10\% of the training data, following Zhou et al. [36]; this simulates forecasting well beyond the temporal range of the training data. Informer and Pyraformer are trained under the same restricted protocol. Since ICI-Time leverages historical samples directly as in-context examples, we implemented a masking procedure to prevent data leakage: when retrieving examples at test time, the initial portion of the test inputs IX_I that would be unavailable in a real deployment is replaced with zeros, so distances are computed against zero-filled rather than actual historical values. This preserves the benefit of retrieval while maintaining the integrity of the few-shot conditions. The results are presented in Table 4 (10%10\%), Table 5 (5%5\%), and Table 6 (1%1\%), all reporting per-horizon results; at 5%5\% and 1%1\%, only the horizons providing sufficient data to train the baselines are included. ICI-Time maintains robust performance across restricted data regimes, often achieving errors that are multiples lower than the baselines. For instance, on ETTh2 (9696 pred. length) with 10%10\% data, ICI-Time achieves an MSE of 0.317, while Informer and Pyraformer struggle at 4.047 and 4.065, respectively. At 1%1\%, only ETTm1, ETTm2, and Weather provide sufficient sequence length to train the Transformer-based baselines; even in these extreme cases ICI-Time dominates, e.g., on ETTm2 (9696 pred. length) it maintains an MSE of 0.208, whereas Informerâs error increases to 1.984. Figure 3 plots the MAE as a function of training data size for the Weather dataset (96 pred. length). As data decreases from 10%10\% to 1%1\%, the MAE of Informer increases from 0.389 to 0.514 (+32.1%+32.1\%) and Pyraformer from 0.360 to 0.487 (+35.3%+35.3\%), whereas ICI-Time remains remarkably stable, moving only from 0.234 to 0.242 (+3.4%+3.4\%). This highlights the superior data efficiency and adaptability of ICI-Time in low-resource settings. Figure 3: MAE of ICI-Time, Informer, and Pyraformer on the Weather dataset across percentages of training data, at prediction length T=96T=96. Table 4: Per-horizon few-shot performance of ICI-Time, Informer, and Pyraformer using only the first 10% of training data. Best results are in bold. The smaller the better. Dataset Prediction ICI-Time Informer Pyraformer ICI-Time Informer Pyraformer MSE MAE ETTh1 96 1.046 2.113 1.998 0.687 1.170 0.984 192 1.310 1.913 1.987 0.793 1.000 0.978 336 1.407 2.099 2.382 0.834 1.021 1.053 720 1.281 2.332 1.550 0.800 1.067 0.909 ETTh2 96 0.317 4.047 4.065 0.376 1.602 1.591 192 0.447 3.996 4.452 0.445 1.533 1.661 336 0.511 4.082 4.797 0.488 1.568 1.721 720 0.461 4.867 4.404 0.480 1.736 1.650 ETTm1 96 0.743 1.641 1.570 0.560 0.937 0.934 192 0.888 2.037 1.726 0.622 1.104 0.996 336 0.971 2.188 1.998 0.655 1.126 1.017 720 1.140 2.799 1.920 0.727 1.273 1.029 ETTm2 96 0.195 3.080 2.142 0.291 1.376 1.164 192 0.222 3.440 3.031 0.310 1.449 1.393 336 0.323 2.944 2.479 0.374 1.349 1.258 720 0.384 4.052 3.064 0.416 1.599 1.377 Weather 96 0.232 0.357 0.288 0.234 0.389 0.360 192 0.292 0.425 0.364 0.277 0.427 0.400 336 0.398 0.720 0.465 0.339 0.534 0.439 720 0.478 0.698 0.466 0.411 0.528 0.436 ILI 24 4.412 7.675 8.341 1.268 2.019 2.142 36 4.491 7.595 7.606 1.308 2.020 2.018 48 4.757 7.665 7.591 1.320 2.037 2.019 60 3.969 8.118 7.950 1.261 2.114 2.080 Table 5: Per-horizon few-shot performance of ICI-Time, Informer, and Pyraformer using only the first 5% of training data; only the prediction horizons providing sufficient data to train the Transformer-based baselines are shown. Best results are in bold. The smaller the better. Dataset Prediction ICI-Time Informer Pyraformer ICI-Time Informer Pyraformer MSE MAE ETTh1 96 1.176 1.802 2.225 0.743 0.976 0.998 192 1.416 1.770 1.869 0.853 0.972 0.957 336 1.353 2.069 1.478 0.833 1.015 0.907 ETTh2 96 0.316 3.720 4.609 0.375 1.546 1.706 192 0.444 3.884 4.946 0.448 1.532 1.758 336 0.501 4.319 3.898 0.482 1.624 1.549 ETTm1 96 1.140 1.690 1.669 0.667 0.996 0.941 192 1.404 1.828 1.882 0.749 1.033 1.004 336 1.402 2.115 2.074 0.765 1.087 1.003 720 1.177 2.180 2.062 0.740 1.084 1.065 ETTm2 96 0.209 2.707 2.197 0.304 1.304 1.185 192 0.232 3.084 2.567 0.323 1.398 1.285 336 0.337 2.917 2.548 0.382 1.365 1.268 720 0.382 3.573 3.368 0.417 1.502 1.442 Weather 96 0.247 0.441 0.405 0.244 0.447 0.438 192 0.308 0.563 0.441 0.285 0.500 0.448 336 0.409 0.646 0.444 0.352 0.540 0.430 720 0.486 0.578 0.471 0.415 0.519 0.451 ILI 24 4.621 7.453 7.707 1.312 2.002 2.046 Table 6: Per-horizon few-shot performance using only the first 1% of training data; only the datasets shown provide sufficient data to train the Transformer-based baselines. Best results are in bold. The smaller the better. Dataset Prediction ICI-Time Informer Pyraformer ICI-Time Informer Pyraformer MSE MAE ETTm1 96 0.960 1.682 1.851 0.641 0.963 1.045 192 1.296 1.743 1.526 0.743 1.004 0.922 336 1.381 1.405 1.386 0.789 0.895 0.894 ETTm2 96 0.208 1.984 2.444 0.308 1.118 1.264 192 0.234 3.631 3.029 0.324 1.478 1.402 336 0.333 3.340 3.171 0.380 1.446 1.404 Weather 96 0.225 0.511 0.499 0.242 0.514 0.487 192 0.266 0.690 0.587 0.280 0.592 0.537 336 0.366 0.729 0.871 0.339 0.645 0.724 6 Conclusion We have shown that visual reasoning can be successfully adapted to model complex temporal dynamics. By transforming time series into structured images and applying in-context inpainting with pre-trained vision models, ICI-Time bypasses the need for specialised temporal architectures and costly training or fine-tuning, while achieving competitive forecasting accuracy across diverse domains. Beyond accuracy, our results reveal a broader insight: pre-trained visual models, combined with carefully designed representations, can generalise far beyond their original modalities, challenging conventional boundaries between temporal and visual modelling. Future research may explore more advanced retrieval strategies for in-context examples, and extensions to time series anomaly detection (e.g., using forecasting error for anomaly scoring) and classification (e.g., encoding classes as visual objects). Data Availability. The datasets used in this study are publicly available on the internet at https://github.com/thuml/Autoformer. References [1] A. F. Ansari, L. Stella, C. Turkmen, X. Zhang, P. Mercado, H. Shen, O. Shchur, S. S. Rangapuram, S. Pineda Arango, S. Kapoor, et al. (2024) Chronos: learning the language of time series. Trans. Mach. Learn. Res.. Cited by: §2. [2] A. Bar, Y. Gandelsman, T. Darrell, A. Globerson, and A. Efros (2022) Visual prompting via image inpainting. Advances in Neural Information Processing Systems 35, p. 25005â25017. Cited by: §1, §2, §2, Figure 2. [3] T. Brown, B. Mann, N. Ryder, M. Subbiah, J. D. Kaplan, P. Dhariwal, A. Neelakantan, P. Shyam, G. Sastry, A. Askell, et al. (2020) Language models are few-shot learners. Advances in neural information processing systems 33, p. 1877â1901. Cited by: §1. [4] M. Chen, L. Shen, Z. Li, X. J. Wang, J. Sun, and C. Liu (2025) VisionTS: visual masked autoencoders are free-lunch zero-shot time series forecasters. In Forty-second International Conference on Machine Learning, External Links: Link Cited by: §2, §2, §5.2. [5] Q. Dong, L. Li, D. Dai, C. Zheng, J. Ma, R. Li, H. Xia, J. Xu, Z. Wu, B. Chang, et al. (2024) A survey on in-context learning. In Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing, p. 1107â1128. Cited by: §2. [6] T. Guan, S. Pan, J. Barthelemy, Z. Li, Y. Cai, C. Alippi, M. Jin, and S. Pan (2026) TimeOmni-vl: unified models for time series understanding and generation. In Proceedings of the 43rd International Conference on Machine Learning (ICML), Cited by: §2. [7] Y. Han, C. Zhang, X. Chen, X. Yang, Z. Wang, G. Yu, B. Fu, and H. Zhang (2023) ChartLlama: a multimodal llm for chart understanding and generation. In arXiv preprint arXiv:2311.16483, Cited by: §2. [8] M. Jin, S. Wang, L. Ma, Z. Chu, J. Zhang, X. Shi, P. Chen, Y. Liang, Y. Li, S. Pan, et al. (2024) Time-llm: time series forecasting by reprogramming large language models. In Proceedings of the 12th International Conference on Learning Representations (ICLR), Cited by: §2. [9] S. Li, X. Jin, Y. Xuan, X. Zhou, W. Chen, Y. Wang, and X. Yan (2019) Enhancing the locality and breaking the memory bottleneck of transformer on time series forecasting. In Advances in Neural Information Processing Systems (NeurIPS), Vol. 32. Cited by: §5.2. [10] Z. Li, S. Li, and X. Yan (2023) Time series as images: Vision transformer for irregularly sampled time series. Advances in Neural Information Processing Systems 36, p. 49187â49204. Cited by: §2. [11] Z. Li, S. Li, and X. Yan (2023) Time series as images: vision transformer for irregularly sampled time series. In Advances in Neural Information Processing Systems (NeurIPS), Vol. 36, p. 49187â49204. Cited by: §2. [12] F. Liu, J. Julian, J. M. Eisenschlos, F. Krichene, and N. Collier (2023) DePlot: one-shot visual language reasoning by plot-to-table translation. In Findings of the Association for Computational Linguistics: ACL 2023, p. 10381â10399. Cited by: §2. [13] S. Liu, H. Yu, C. Liao, J. Li, W. Lin, A. X. Liu, and S. Dustdar (2022) Pyraformer: low-complexity pyramidal attention for long-range time series modeling and forecasting. In Proceedings of the 10th International Conference on Learning Representations (ICLR), Cited by: §1, §5.2. [14] J. Lu, Y. Sun, and S. Yang (2025) In-context time series predictor. In Proceedings of the 13th International Conference on Learning Representations (ICLR), Cited by: §1. [15] S. Lyu, S. Zhong, W. Ruan, Q. Liu, Q. Wen, H. Xiong, and Y. Liang (2025) OccamVTS: distilling vision models to 1% parameters for time series forecasting. arXiv preprint arXiv:2508.01727. Cited by: §2. [16] J. Ni, Z. Zhao, C. Shen, H. Tong, D. Song, W. Cheng, D. Luo, and H. Chen (2025) Harnessing vision models for time series analysis: a survey. In Proceedings of the 34th International Joint Conference on Artificial Intelligence (IJCAI), p. 10612â10620. External Links: Document Cited by: §2, §2. [17] Y. Nie, N. H. Nguyen, P. Sinthong, and J. Kalagnanam (2023) A time series is worth 64 words: long-term forecasting with transformers. In Proceedings of the 11th International Conference on Learning Representations (ICLR), Cited by: §5.2, §5.2. [18] V. Prithyani, M. Mohammed, R. Gadgil, R. Buitrago, V. Jain, and A. Chadha (2026) On the feasibility of vision-language models for time-series classification. In Proceedings of the 59th Hawaii International Conference on System Sciences (HICSS), p. 1422â1431. Cited by: §2. [19] A. Semenoglou, E. Spiliotis, and V. Assimakopoulos (2023) Image-based time series forecasting: a deep convolutional neural network approach. Neural Networks 157, p. 39â53. External Links: Document Cited by: §2. [20] C. Shen, W. Yu, Z. Zhao, D. Song, W. Cheng, H. Chen, and J. Ni (2025) Multi-modal view enhanced large vision models for long-term time series forecasting. In Advances in Neural Information Processing Systems (NeurIPS), Vol. 38. Cited by: §2. [21] C. Shen, Z. Zhao, H. Tong, D. Song, D. Luo, Q. Wen, and J. Ni (2025) SVTime: small time series forecasting models informed by âphysicsâ of large vision model forecasters. arXiv preprint arXiv:2510.09780. Cited by: §2. [22] L. Shen, M. Chen, X. Liu, H. Fu, X. Ren, J. Sun, Z. Li, and C. Liu (2025) VisionTS++: cross-modal time series foundation model with continual pre-trained vision backbones. arXiv preprint arXiv:2508.04379. Cited by: §2. [23] S. Sood, Z. Zeng, N. Cohen, T. Balch, and M. Veloso (2021) Visual time series forecasting: an image-driven approach. In Proceedings of the Second ACM International Conference on AI in Finance, p. 1â9. Cited by: §2. [24] J. Su, C. Jiang, X. Jin, Y. Qiao, T. Xiao, H. Ma, R. Wei, Z. Jing, J. Xu, and J. Lin (2024) Large language models for forecasting and anomaly detection: a systematic literature review. CoRR abs/2402.10350. External Links: Link, Document, 2402.10350 Cited by: §2. [25] X. Wang, W. Zhang, Y. Cao, C. Shen, and T. Huang (2023) Images speak in images: a generalist painter for in-context visual learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), p. 6830â6839. Cited by: §2. [26] X. Wang, X. Zhang, Y. Cao, W. Wang, C. Shen, and T. Huang (2023) SegGPT: segmenting everything in context. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), p. 1130â1140. Cited by: §2. [27] J. Wei, X. Wang, D. Schuurmans, M. Bosma, F. Xia, E. Chi, Q. V. Le, D. Zhou, et al. (2022) Chain-of-thought prompting elicits reasoning in large language models. Advances in neural information processing systems 35, p. 24824â24837. Cited by: §1. [28] H. Wu, T. Hu, Y. Liu, H. Zhou, J. Wang, and M. Long (2023) TimesNet: temporal 2d-variation modeling for general time series analysis. In International Conference on Learning Representations (ICLR), Cited by: §2. [29] L. Yang, Y. Wang, X. Fan, I. Cohen, J. Chen, and Z. Zhang (2025) ViTime: foundation model for time series forecasting powered by vision intelligence. Transactions on Machine Learning Research. Cited by: §2, §5.2. [30] J. Ye, W. Zhang, K. Yi, Y. Yu, Z. Li, J. Li, and F. Tsung (2024) A survey of time series foundation models: generalizing time series representation with large language model. arXiv preprint arXiv:2405.02358. Cited by: §2. [31] X. Zhang, R. R. Chowdhury, R. K. Gupta, and J. Shang (2024) Large language models for time series: a survey. In Proceedings of the Thirty-Third International Joint Conference on Artificial Intelligence, IJCAI â24. External Links: ISBN 978-1-956792-04-1, Document Cited by: §2. [32] Y. Zhang, K. Zhou, and Z. Liu (2023) What makes good examples for visual in-context learning?. Advances in Neural Information Processing Systems 36, p. 17773â17794. Cited by: §2. [33] X. Zhao, Z. Zhou, W. Zhang, Y. Liu, X. Chen, J. Gong, H. Chen, B. Fei, S. Chen, W. Ouyang, et al. (2025) WeatherGFM: learning a weather generalist foundation model via in-context learning. In Proceedings of the 13th International Conference on Learning Representations (ICLR), Cited by: §2. [34] S. Zhong, W. Ruan, M. Jin, H. Li, Q. Wen, and Y. Liang (2025) Time-vlm: exploring multimodal vision-language models for augmented time series forecasting. In Proceedings of the 42nd International Conference on Machine Learning (ICML), Cited by: §2. [35] H. Zhou, S. Zhang, J. Peng, S. Zhang, J. Li, H. Xiong, and W. Zhang (2021) Informer: beyond efficient transformer for long sequence time-series forecasting. In Proceedings of the Thirty-Fifth AAAI Conference on Artificial Intelligence (AAAI), Vol. 35, p. 11106â11115. External Links: Document Cited by: §1, §5.2. [36] T. Zhou, P. Niu, X. Wang, L. Sun, and R. Jin (2023) One fits all: power general time series analysis by pretrained lm. In Advances in Neural Information Processing Systems (NeurIPS), Cited by: §1, §5.4.