LLMTimeOptions<T>
Options & Configuration · AiDotNet.Models.Options
Configuration options for LLM-Time (Zero-Shot Time Series Forecasting via LLM Tokenization).
Inheritance: ModelOptions → RegressionOptions<T> → TimeSeriesRegressionOptions<T> → LLMTimeOptions<T>
For Beginners
LLM-Time takes a surprising approach:
How It Works:
- Convert numbers to text: [1.5, 2.3, 3.1] → “1.500, 2.300, 3.100”
- Feed the text to a pretrained LLM (GPT-3, LLaMA)
- The LLM predicts the next “tokens” (which are digits of future values)
- Parse the generated text back into numbers
Key Advantages:
- Zero-shot: no training required at all
- Leverages the vast pattern knowledge of large language models
- Produces probabilistic forecasts via sampling
Trade-offs:
- Requires access to a large language model API
- Limited precision (controlled by decimal places)
- Slower than specialized time series models
How It Works
LLM-Time converts numeric time series into text strings and uses pretrained LLMs (GPT-3, LLaMA) for zero-shot forecasting by treating the task as next-token prediction on numerical text. No fine-tuning is required—the LLM backbone is frozen.
Reference: Gruver et al., “Large Language Models Are Zero-Shot Time Series Forecasters”, NeurIPS 2023.
Constructors
| Constructor | Summary |
|---|---|
LLMTimeOptions() |
Initializes a new instance with default values. |
LLMTimeOptions(LLMTimeOptions<T> other) |
Initializes a new instance by copying from another instance. |
Properties
| Property | Summary |
|---|---|
FoundationModelSize ModelSize { get; set; } |
Gets or sets the model size variant. |
double DropoutRate { get; set; } |
Gets or sets the dropout rate. |
double Temperature { get; set; } |
Gets or sets the LLM sampling temperature. |
int ContextLength { get; set; } |
Gets or sets the maximum number of historical time steps for the text prompt. |
int ForecastHorizon { get; set; } |
Gets or sets the number of future time steps to forecast. |
int HiddenDimension { get; set; } |
Gets or sets the hidden dimension of the LLM backbone. |
int NumDecimalPlaces { get; set; } |
Gets or sets the number of decimal places for numeric-to-text conversion. |
int NumHeads { get; set; } |
Gets or sets the number of attention heads. |
int NumLayers { get; set; } |
Gets or sets the number of transformer layers. |
int NumSamples { get; set; } |
Gets or sets the number of samples for probabilistic forecasting. |