FLAIRR - TS - Forecasting LLM -Agents with Iterative Refinement and Retrieval for Time Series (2025)

Abstract: Time series Forecasting with large language models (LLMs) requires bridging numerical patterns and natural language. Effective forecasting on LLM often relies on extensive pre-processing and fine-tuning. Recent studies show that a frozen LLM can rival specialized forecasters when supplied with a carefully engineered natural-language prompt, but crafting such a prompt for each task is itself onerous and ad-hoc. We introduce FLAIRR-TS, a test-time prompt optimization framework that utilizes an agentic system: a Forecaster-agent generates forecasts using an initial prompt, which is then refined by a refiner agent, informed by past outputs and retrieved analogs. This adaptive prompting generalizes across domains using creative prompt templates and generates high-quality forecasts without intermediate code generation. Experiments on benchmark datasets show FLAIRR-TS improves forecasting over static prompting and retrieval-augmented baselines, approaching the performance of specialized prompts.FLAIRR-TS provides a practical alternative to fine-tuning, achieving strong performance via its agentic approach to adaptive prompt refinement and retrieval.

## introduction recent studies demonstrate that llms can leverage their vast pre-trained knowledge to achieve competitive zero-shot and few-shot time-series forecasting (tsf) performance, often rivaling specialized models through direct prompting alone @xcite . the efficacy of llms in tsf is often stymied by the prompt engineering bottleneck. the performance of a frozen, pre-trained llm is critically dependent on the precise natural language prompt it receives. crafting optimal prompts is currently a laborious, ad-hoc process requiring significant domain expertise and iterative * work done at google manual tuning for each new dataset or scenario, limiting scalability and robust generalization @xcite . this challenge has spurred research into more sophisticated prompting strategies @xcite and test-time methods without altering weights @xcite . given that llms can iteratively refine their outputs through feedback (as in @xcite and chen and others (2025)), we explore their capability to autonomously refining their prompts at test time to enhance tsf capabilities. we introduce flairr-ts -forecasting llm-agents with iterative refinement and retrieval, a framework designed to enhance tsf capabilities of llms without any training. this approach aims to mitigate the manual prompt engineering burden while simultaneously improving prediction accuracy by grounding forecasts in relevant historical context. flairr-ts integrates a forecaster agent (f) for initial predictions, a refiner agent for iterative refinement tuning (irt), and a retrieval agent (r) that sources semantically similar historical time series segments, akin to retrieval augmented generation (rag) adapted for tsf @xcite . this entire cycle of prompt adaptation and forecast refinement occurs without any weight updates, offering a compelling alternative to costly tuning. beyond the capabilities of flairr-ts for general applicability, we also investigate the upper bounds for performance with judiciously-designed prompts. inspired by @xcite , we introduce architected strategy prompts (asps), a set of specialized prompts, which include directives for specific analytical procedures or induce particular cognitive approaches. while flairr-ts excels at automated, test-time prompt refinement without prior domain-specific tuning, asps allow exploring the performance when, manual strategy-driven design is employed for prompt improvement. our main contributions are summarized as: ## experiments our experiments utilize the informer @xcite ettm1, ettm2), electricity, and traffic. we also benchmark on several newer datasets, including weather and ilinet, and we test on 2025 data to ensure the test period is after the knowledge cutoff date of gemini. more details are in appendix f. the characteristics of all datasets (domains, frequencies, evaluated horizons h) and our approach to data integrity are provided in section f. ## conclusion flairr-ts advances the approach to prompting for time-series forecasting. its core contribution is not to surpass every hand-tuned prompt, but to significantly reduce the burden of manual tuning. the framework provides a systematic and automated process for refining prompts, ensuring consistently high performance from even simple starting instructions. through its agentic, feedback-driven interactions, flairr-ts offers a scalable pathway to unlocking the full potential of llms for forecasting across any dataset or horizon. 15430 time series forecasting with llms: traditional time series forecasting has relied on models explicitly trained for the task, from statistical methods to deep architectures like rnn variants and temporal cnns, up through recent transformerbased models (e.g. fedformer (zhou et al., 2022) and patchtst ((nie et al., 2023))) tailored for longrange sequences. these approaches require substantial training on each target dataset. in contrast, emerging research explores using pre-trained llms as general-purpose forecasters via prompting at inference time only, without gradient-based fine-tuning. xue and salim (2024) pioneered this direction with promptcast, formulating forecasting as a prompt-completion task: historical values are encoded into a textual prompt (possibly with instructions) and the llm's next-token predictions are decoded as forecasts. gruver et al. (2023) similarly represent numerical time series as token sequences and treat extrapolation as language modeling, finding that gpt-3 and llama-2 can zero-shot extrapolate time series with accuracy comparable to or exceeding specialized trained models. tnotably, these llm-based approaches leverage the models' strong sequence modeling and few-shot generalization for competitive benchmark results, without requiringabilities to achieve competitive results on standard benchmarks without any task-specific training data. nevertheless, naive prompt formulations might overlook important temporal dynamics and patterns. recent works therefore propose more advanced test-time prompting strategies. liu et al. (2024) introduce lstprompt, which splits the prediction into short-and longterm sub-tasks and guides the llm through a chainof-thought reasoning process; this method outperforms earlier prompt baselines and even approaches the accuracy of dedicated ts models. tang et al. (2024) report that enriching prompts with external knowledge (e.g. known seasonal periods or contextual clues) and using natural language rephrasings of the input can significantly improve an llm's forecasting accuracy. another technique, time-llm (jin et al., 2024), reprograms a frozen llm by mapping time-series data into textual "patches" and prepending learned prompt tokens, allowing the model to output forecasts that outperform stateof-the-art specialized forecasters without any finetuning of the llm's weights. on the other hand, zeng et al. (2022) offer a cautionary perspective: through extensive ablations, they found that removing the llm or replacing it with a simple attentionbased network in these pipelines often does not hurt performance (and sometimes improves it), calling into question how much current llm-for-ts methods truly benefit from the pre-trained language model. to push llm-based forecasting further, researchers are drawing on insights from prompt optimization and test-time reasoning. for example, wan et al. (2024) show that intelligently selecting and reusing in-context exemplars can yield larger gains than optimizing instructions alone, suggesting that careful few-shot prompt design is crucial. chen and others (2025) propose a self-verification and self-correction framework (sets) that lets the model iteratively refine its outputs at inference, achieving better accuracy scaling on complex reasoning tasks. incorporating such techniques into zero-shot forecasting prompts is an exciting direction. in summary, the literature demonstrates a nascent but growing paradigm of using pre-trained llms directly for time series forecasting, with multiple studies showing that, given the right prompts, foundation models can attain forecast accuracy rivaling traditional specialized models. while these methods demonstrate progress in leveraging llms for forecasting, the dynamic and optimal design of prompts-especially those needing to integrate complex reasoning, external knowledge, and iterative feedback-remains a key challenge. our work, flairr-ts, aims to address this by structuring the forecasting process around specialized agents for dynamic prompt adaptation and refinement.