Prompting for Numerical Sequences: A Case Study on Market Comment Generation
Masayuki Kawarada, Tatsuya Ishigaki, Hiroya Takamura
TL;DR
This paper investigates prompting strategies for generating market commentary from time-series numerical data, addressing a gap in how LLMs handle sequential numeric inputs. It compares four prompt families—direct numeric sequences, linearized tables, programming-language-like prompts, and language templates—under zero- and few-shot settings using Nikkei225 data. The results show programming-language-like prompts (e.g., Python Dictionary/List) and Row linearization yield higher-quality outputs than natural-language templates or HTML/LaTeX formats, with human evaluation favoring prompt-based methods over a fine-tuned encoder–decoder baseline. The findings offer practical guidance for designing prompts for time-series data-to-text tasks and motivate extending prompting strategies to other numerical-domain generation problems.
Abstract
Large language models (LLMs) have been applied to a wide range of data-to-text generation tasks, including tables, graphs, and time-series numerical data-to-text settings. While research on generating prompts for structured data such as tables and graphs is gaining momentum, in-depth investigations into prompting for time-series numerical data are lacking. Therefore, this study explores various input representations, including sequences of tokens and structured formats such as HTML, LaTeX, and Python-style codes. In our experiments, we focus on the task of Market Comment Generation, which involves taking a numerical sequence of stock prices as input and generating a corresponding market comment. Contrary to our expectations, the results show that prompts resembling programming languages yield better outcomes, whereas those similar to natural languages and longer formats, such as HTML and LaTeX, are less effective. Our findings offer insights into creating effective prompts for tasks that generate text from numerical sequences.
