Financial Numerical Prediction and Allocation as Token Generation

arXiv:2608.09880 · cs.CV, cs.LG · Submitted 2026-08-10 · Read on arXiv

Xu Ouyang, Moontae Lee

University of Illinois Chicago

cs.CV, cs.LG

Submitted: 2026-08-10

Updated: 2026-08-11

Code: https://github.com/meta-llama/llama-models

License: http://creativecommons.org/licenses/by/4.0/

Importance score: 75/100

The gist: FinATOM introduces a unified, head-free interface for three-step stock-return forecasting and dynamic five-ETF allocation, using a causal language model to represent forecasts and decisions directly

Terminology

Summary

FinATOM introduces a unified, head-free interface for three-step stock-return forecasting and dynamic five-ETF allocation, using a causal language model to represent forecasts and decisions directly through constrained token generation. The forecasting model autoregressively emits volatility-standardized return tokens and is trained with ordinal and ranking supervision followed by a one-epoch token-level policy stage. The allocation model generates normalized long-only weights; supervised fine-tuning imitates a causal mean–variance anchor, and DAPO-augmented GRPO optimizes realized 21-day Sharpe subject to anchor consistency. In 2023–2025 ETF tests, the allocation policy improves pooled gross Sharpe from 1.428 to 1.529 and net Sharpe under a 5-bp transaction-cost model from 1.394 to 1.494. The multimodal allocation input attains the highest three-period mean Sharpe of 1.540, with its clearest advantage in 2025. On FinTexTS, the SFT and policy strategies achieve 73.52%/2.68 and 73.72%/2.69 cumulative-return/Sharpe, respectively. These results support the feasibility of direct language-model token generation for financial numerical prediction and decision-making, while motivating broader tests across assets, regimes, and random seeds.

The paper studies whether the language model itself can serve as the numerical decision interface. Direct generation offers several attractive properties: the output is auditable, mechanically parseable, and compatible with both supervised fine-tuning and token-level policy optimization. Nevertheless, numerical token generation is not a trivial replacement for a regression head. Ordinary number strings have irregular tokenization and do not preserve numerical order; unconstrained decoding can produce malformed forecasts or portfolio weights that violate long-only and budget constraints; supervised targets can inadvertently incorporate future information; and token cross-entropy alone need not optimize the return–risk criterion used in deployment. A credible token-native design therefore requires an ordered numerical vocabulary, an explicit output grammar, a continuous decoding rule, causal supervision, and an objective aligned with the downstream financial decision.

FinATOM provides this design without adding a task-specific numerical head to the standard language-model vocabulary projection. The same causal Llama 3.2 1B backbone supports two complementary tasks. For stock forecasting, the prompt combines a 64-session price-derived table with market context, SEC-filing summaries, and FinTexTS news organized at macro, sector, related-company, and target-company levels. The model autoregressively emits ordered tokens for the consecutive D1, D2, and D3 returns. Conditional expectations under the token distributions recover continuous return scores for cross-sectional ranking while preserving the discrete generation trace. For portfolio allocation, the prompt combines a visible 20-day return window, risk and correlation statistics, macroeconomic news, and the previous portfolio state. The model directly emits five long-only ETF weights, whose normalized values constitute the deployed action.

The allocation task further separates causal imitation from outcome-based improvement. Supervised fine-tuning learns a mean–variance anchor computed only from information observable at the decision date, followed by shrinkage and deterministic quantization. A subsequent DAPO-augmented GRPO stage samples legal allocation sequences and rewards their realized 21-day Sharpe while penalizing excessive deviation from the causal anchor. Future returns enter only this policy reward: they are absent from both the prompt and the supervised target. The language model therefore first learns a stable, fully specified allocation grammar and is then optimized against the financial objective directly, without introducing a separate policy, value, or reward head.

The contributions are threefold: they introduce a shared constrained token interface for autoregressive three-step return forecasting and normalized five-ETF allocation, without an additional task-specific numerical head; they develop a causal allocation pipeline that combines a fully specified mean–variance teacher, ordinal token supervision, and DAPO-augmented GRPO aligned with realized portfolio Sharpe; and they provide chronological allocation evidence across three test periods, a controlled input-modality ablation, and an exploratory FinTexTS SFT-to-policy comparison, while separating within-protocol evidence from contextual comparison with the published baseline.

For the portfolio allocation task, the universe is ordered as GLD, SPY, TLT, UUP, and XLE. Let Rt ∈ R20×5 be the strictly visible return window ending at decision date t, with sample mean µt and covariance Σt. The continuous teacher solves a mean-variance optimization with a turnover penalty, where W = w ≥ 0, 1⊤ w = 1, wi ≤ 0.5. The first date omits the turnover term. Thus the target is causal but path dependent: the previous quantized anchor is both prompt state and optimization state. The solution is shrunk and discretized using largest-remainder allocation on a 50-unit grid, enforces a 1000-unit budget, and assigns at least one grid step to every asset. The normalized state is passed to the next date. This is a designed causal teacher, not future-return ground truth.

The prompt contains the 20-day return table, annualized risk and correlations, calendar fields, daily macro-financial news, asset order, and the previous anchor. A target answer has the form.... Every boundary, ETF tag, and value receives sequence cross-entropy. At the five value positions, an additional Gaussian ordinal target over 0, 50,..., 1000 is used. At inference, the expectation over the value vocabulary is computed and the row is normalized to sum to one; a degenerate row falls back to equal weight. The policy stage samples G = 8 legal allocation sequences. For raw token action, deployed weights are normalized. Using only returns t + 1:t + 21, the reward is the Sharpe of the deployed weights minus a penalty on deviation from the anchor, with invalid parses assigned −5. Group advantages are computed and set to zero for effectively constant-reward groups. The token-level clipped objective uses asymmetric clipping bounds [0.80, 1.28]. Training uses three passes and behavior-KL early stopping at 0.03, but the reference-KL coefficient is zero. This is best described as DAPO-augmented GRPO: it combines group-relative advantages with DAPO’s decoupled Clip-Higher and token-level update, but does not implement dynamic batch replenishment or overlong reward shaping. Neither the loss nor any KL term compares predictions with future target weights.

For the forecasting task, the causal prompt is processed by the same backbone architecture, which emits D1, D2, and D3 bucket tokens sequentially so that each generated prefix conditions the next horizon. Conditional means over the ordered bucket distributions are rescaled by trailing volatility and compounded into the continuous score used for top-20 ranking. SFT learns train-only, volatility-standardized bins, while the one-epoch policy stage samples complete paths and updates the same three bucket positions using the five-component financial reward. The forecasting prompt contains 64 sessions of return, gap, and range features; risk, return, and drawdown summaries; market and sector context; four levels of paired news; and filing summaries. For h ∈ 1, 2, 3, the target is the consecutive one-day return, divided by trailing 20-day volatility known at t and clipped to [−8, 8]. Forty-one quantile bins are fit on training targets pooled across training tickers and horizons; each bin has a center equal to the conditional expectation of the standardized return given the bin. The fixed grammar is. SFT computes Gaussian ordinal CE only at the three bucket slots and adds a same-date, per-horizon pairwise ranking loss with coefficient 0.5. The scaffold is fixed rather than learned as ordinary answer text.

Decoding is genuinely autoregressive. The D1 argmax bucket is appended before evaluating D2, and D2 is appended before D3. Numerical values remain conditional expectations, then are rescaled by trailing volatility and compounded into a three-day ranking score. Thus the discrete prefix and continuous score serve complementary roles. The evaluated one-epoch policy stage samples G = 4 legal autoregressive trajectories and forms complete decision-date stock cross-sections. Five reward components are whitened within each group and combined as R = 0.40Rstep + 0.25Rpath + 0.05Rdir + 0.25Rrank + 0.05Rtop20. A clipped token-PPO update is applied only at the three sampled bucket positions. KL coefficient 0.02 compares current action probabilities with cached source-SFT probabilities; no second reference network or reward head is instantiated. This mechanism is distinct from the allocation stage’s zero-reference-KL DAPO-augmented GRPO.

The ETF allocation dataset is constructed for five liquid ETFs: GLD, SPY, TLT, UUP, and XLE, from January 2018 to October 2025. For each decision date t, the LLM receives a chronological text table covering the latest 20 trading days, with the relative day, calendar date, and each ETF’s close-to-close return expressed as integer basis points. The prompt also includes annualized volatility, the 5 × 5 return-correlation matrix computed from the same window, and the previous portfolio allocation. Macroeconomic news is collected through NewsAPI from major publishers, including Bloomberg, Reuters, CNBC and other widely followed outlets. Articles concerning monetary policy, inflation, growth, employment, trade, energy, and geopolitical risk are grouped by date and summarized by DeepSeek-V4 into an approximately 100-word daily news block. For stock forecasting, FinTexTS covers 100 large U.S. companies from 2019 to 2023 and pairs their price histories with text derived from approximately one million news articles and SEC filings. Its textual information is organized into macro-, sector-, related-company-, and target-company-level blocks. For each stock and decision date, the LLM receives the latest 64 trading sessions as a text table containing close-to-close returns, opening gaps, and intraday high–low ranges in integer basis points. The prompt additionally reports trailing volatility, multi-horizon returns, drawdown from the 52-week high, and same-day market and sector context.

Three expanding chronological experiments train on 2018–2022 and test 2023 (249 days), train 2019–2023 and test 2024 (251 days), and train 2020–2024 and test January–October 2025 (209 days). SFT runs five epochs with batch size 1, gradient accumulation 4, learning rate 2 × 10−4, bfloat16, LoRA rank 64, scale 128, dropout 0.05, ordinal width 0.8, and ordinal coefficient 1. The policy stage runs one epoch with learning rate 3 × 10−5, group size 8, and temperature 1. The modality ablation reruns this same SFT-to-policy pipeline while changing only the included market modalities; dates, asset order, and the previous anchor remain available in every arm. The final 20 training dates are excluded because they lack a fully contained future reward window. Metrics use daily returns, zero risk-free rate, and 252-day annualization. Pooled evaluation concatenates all 709 test days; net Sharpe charges 5 basis points per unit of one-way turnover. For stock forecasting, the universe contains 100 FinTexTS equities. Context and bucket construction use training observations before 2022, 2022 is validation, and the reported test contains 239 trading days through December 19, 2023. Stocks are ranked by decoded three-day return; the top 20 are equally weighted and rebalanced every three sessions with 5-bp one-way costs. The policy stage uses group size 4, a policy learning-rate decay from 10−6 to 10−7, and KL coefficient 0.02 to cached SFT action probabilities.

Allocation prompts contain observations stamped no later than t. The causal target is recomputed sequentially inside each experiment, so the previous-anchor state cannot cross from test into training. Reward windows begin at t + 1 and are separate from prompt fields; terminal training dates without 21 future sessions are dropped. Forecast volatility, bin boundaries, and bin centers are estimated from training data only, and ranking losses compare stocks sharing the same decision date.

For portfolio wt, next-session gross return is w⊤t r t+1. One-way turnover is 1/2 ∥w t − w t−1∥1; net return subtracts 0.0005 times turnover. Annual return is daily mean times 252, volatility is daily standard deviation times 252, and Sharpe is their ratio. Deterministic expectation decoding is used throughout. The causal target and equal weight are numerical references, while the allocation SFT-to-policy comparison holds the backbone, grammar, context, and decoder fixed. In the stock experiment, FinATOM SFT and Policy also share a common split, decoder, and backtest; only their comparison with the published FinTexTS row is contextual rather than controlled.

Table 2 shows that the policy stage is unchanged from SFT at three-decimal Sharpe in 2023, but improves both sides of the ratio in 2024 and 2025. Annual return rises by 0.52 and 1.31 percentage points, respectively, while volatility falls by 0.07 and 0.04 points. The 2024 policy also exceeds the causal teacher’s Sharpe (1.564 versus 1.407), indicating that policy optimization is not merely reproducing the SFT target; the reversal in 2023 and 2025 shows that the gain remains regime dependent. Equal weighting earns more raw return in 2024–2025, but at substantially higher volatility and larger drawdown. The pooled comparison in Table 3 avoids averaging annual ratios. Policy optimization raises gross Sharpe by 0.101 and net Sharpe by 0.100, while average one-way turnover increases only from 1.481% to 1.537% (5.6 basis points per day). Its gross Sharpe of 1.529 is within 0.011 of the causal target’s 1.540. Together, these results suggest that the policy stage mainly improves the return–risk tradeoff rather than exploiting extra trading intensity.

Table 4 isolates the contribution of news and time-series context using the same SFT-to-policy training pipeline, while retaining dates, asset order, and the previous causal anchor in every arm. The combined input obtains the highest simple mean Sharpe, 1.540, exceeding time series only by 0.061 and news only by 0.104. The annual pattern is not uniform: time series only leads the combined model by just 0.004 in 2023 and 0.001 in 2024, whereas news plus time series leads by 0.190 over time series only and by 0.180 over news only in 2025. Thus, recent returns and risk statistics provide the more stable standalone signal, while macroeconomic news appears complementary when the 2025 regime makes it informative. Because the table contains only three single-run periods, the result supports regime-dependent complementarity rather than a statistically general claim that adding news always helps.

Within the common FinATOM protocol, the one-epoch policy stage raises cumulative return from 73.52% to 73.72% and Sharpe from 2.68 to 2.69. The small increment indicates that most of the strategy performance is already learned during SFT; policy optimization provides a modest refinement rather than a wholesale change in the ranking signal. Relative to the published FinTexTS row, the policy strategy is higher by 19.74 percentage points in cumulative return (36.6% relative) but only 0.02 in Sharpe. This divergence between terminal wealth and risk-adjusted efficiency suggests that the large return gap may reflect compounding, exposure, timing, or other protocol differences rather than uniformly superior forecasts. Because the published baseline does not share the same split and the table lacks matched volatility, drawdown, and turnover, it does not establish cross-system dominance. The supported conclusions are narrower: the head-free token score sustains a high-Sharpe top-20 strategy, and the evaluated policy stage improves it slightly without destabilizing performance.

The allocation results support a more specific interpretation than a uniform benefit from reinforcement learning. D…

Improvements for AI systems

Based on the paper, here are specific improvements for AI systems and what the improved systems can do:

1. Token-Native Numerical Output with Ordered Vocabulary and Constrained Grammar

  • Replace regression heads with a fixed, ordered numerical token vocabulary (e.g., 41 quantile bins for returns, 50-unit grid for weights) that preserves numerical order.

  • Enforce an explicit output grammar (e.g., ...) so all generated outputs are mechanically parseable and satisfy constraints (long-only, budget sum-to-one, minimum allocation per asset).

  • Use continuous decoding (conditional expectation over token distributions) to recover real-valued predictions while keeping the discrete trace for auditability.

  • Improved system capability: Generate valid, constraint-satisfying numerical decisions (portfolio weights, multi-step forecasts) directly as text, with no post-hoc repair or separate numerical head, and full auditability of the token sequence.

2. Causal Supervision to Prevent Look-Ahead Bias

  • Construct supervised targets strictly from information observable at decision time (e.g., mean–variance optimization on a visible 20-day return window with turnover penalty, using the previous quantized anchor as state).

  • Exclude future returns from prompts and supervised targets; future data enters only via a separate reward function during policy optimization.

  • Improved system capability: Train decision-making models that are genuinely causal and robust to temporal leakage, producing allocations and forecasts that do not inadvertently memorize future information, especially in financial time-series tasks.

3. Two-Stage Training: Supervised Imitation Followed by Outcome-Based Policy Optimization

  • Stage 1: Supervised fine-tuning (SFT) with ordinal cross-entropy and ranking loss to learn a stable, fully specified decision grammar from a causal teacher.

  • Stage 2: One-epoch policy optimization (DAPO-augmented GRPO for allocation, clipped token-PPO for forecasting) that rewards realized downstream metrics (e.g., 21-day Sharpe) while penalizing deviation from the SFT anchor.

  • Improved system capability: Combine the stability of imitation learning with the task alignment of reinforcement learning, improving risk-adjusted returns (e.g., pooled gross Sharpe from 1.428 to 1.529) without increasing turnover or destabilizing performance.

4. Multimodal Context Integration with Regime-Aware Weighting

  • Integrate heterogeneous inputs—time-series tables (returns, risk, correlations), macroeconomic news summaries, calendar fields, and previous portfolio state—into a single prompt.

  • Use modality ablation to identify which inputs drive performance in different regimes (e.g., time-series is stable; news adds value in 2025).

  • Improved system capability: Dynamically leverage complementary information sources, improving decision quality in changing market conditions (e.g., highest mean Sharpe of 1.540 with combined inputs, with clear gains in 2025).

5. Autoregressive Multi-Horizon Forecasting with Prefix Conditioning

  • Generate consecutive-day return tokens (D1, D2, D3) sequentially, where each token is conditioned on the previously generated prefix, enabling multi-step forecasts that respect temporal dependencies.

  • Compound decoded conditional expectations into a continuous ranking score for cross-sectional selection.

  • Improved system capability: Produce coherent multi-horizon forecasts (e.g., three-day returns) that outperform single-step models, supporting tasks like top-20 stock selection with high Sharpe (2.69) and cumulative returns (73.72%).

6. Reward Design with Group-Relative Advantages and Constraint Penalties

  • Use group-relative advantages (GRPO) with asymmetric clipping bounds and zero reference-KL to stabilize policy updates.

  • Penalize invalid parses and excessive deviation from the supervised anchor, while rewarding realized Sharpe over a fixed future window.

  • Improved system capability: Optimize directly for deployment criteria (e.g., Sharpe) with minimal hyperparameter sensitivity, improving net Sharpe under transaction costs (1.494 vs. 1.394) without increasing trading intensity.

7. Head-Free Interface for Multiple Tasks on a Single Backbone

  • Use the same causal language model (e.g., Llama 3.2 1B) for both forecasting and allocation, with only prompt and grammar changes, eliminating task-specific heads.

  • Improved system capability: Build versatile AI systems that handle diverse numerical decision tasks (regression, ranking, constrained optimization) with a single model, simplifying deployment and enabling transfer learning across financial applications.

Abstract

Financial prediction typically relies on task-specific regression, ranking, or policy heads, separating the language model from the numerical object ultimately evaluated. We investigate whether a causal language model can instead represent forecasts and decisions directly through constrained token generation. FinATOM introduces a unified, head-free interface for three-step stock-return forecasting and dynamic five-ETF allocation. The forecasting model autoregressively emits volatility-standardized return tokens and is trained with ordinal and ranking supervision followed by a one-epoch token-level policy stage. The allocation model generates normalized long-only weights; supervised fine-tuning imitates a causal mean--variance anchor, and DAPO-augmented GRPO optimizes realized 21-day Sharpe subject to anchor consistency. In 2023--2025 ETF tests, the allocation policy improves pooled gross Sharpe from 1.428 to 1.529 and net Sharpe under a 5-bp transaction-cost model from 1.394 to 1.494. The multimodal allocation input attains the highest three-period mean Sharpe of 1.540, with its clearest advantage in 2025. On FinTexTS, the SFT and policy strategies achieve 73.52%/2.68 and 73.72%/2.69 cumulative-return/Sharpe, respectively. These results support the feasibility of direct language-model token generation for financial numerical prediction and decision-making, while motivating broader tests across assets, regimes, and random seeds.

Sources

Related papers