FinATOM: Head-Free LLMs for Direct Financial Prediction & Allocation
FinATOM introduces a unified head-free interface where a LoRA-adapted Llama 3.2 1B model directly generates financial predictions and portfolio allocations via constrained token generation, using supervised fine-tuning with a causal mean-variance teacher and DAPO-enhanced GRPO policy optimization to improve Sharpe ratios on ETF and stock benchmarks.
Background
Traditional financial forecasting relies on task-specific regression, ranking, or policy heads, creating a disconnect between language models and the final numerical decision objects. FinATOM proposes a unified head-free interface that lets a causal language model directly represent predictions and decisions through constrained token generation, supporting both multi-step stock return prediction and dynamic ETF allocation.
Problem Statement
The core question: can a single constrained token output interface serve two distinct numerical semantic tasks?
Prediction task : autoregressively generate three-step returns (D1, D2, D3) preserving numerical order for cross-sectional ranking.
Allocation task : generate five ETF weights satisfying long-only, budget (sum=1), and single-asset cap (≤0.5) constraints, then optimize realized Sharpe via reinforcement learning.
Four technical challenges: irregular numerical tokenization, constraint violations from unconstrained decoding, lookahead leakage in supervision objectives, and misalignment between token cross-entropy and downstream return-risk criteria.
Method
4.1 Shared Token-Native Interface
Both tasks use a LoRA-adapted Llama 3.2 1B with tied vocabulary projection. Valid numerical values are learned vocabulary items scored by the tied LM readout layer — no extra regression, policy, value, or reward heads. The backbone models the autoregressive factorization pθ(yt|xt) = ∏ pθ(yt,ℓ|xt, yt,<ℓ).
Allocation token output: ETF tags plus five grid values; SFT objective = token CE + ordinal CE at value positions; decoding = expected decode then row-normalize.
Prediction token output: 41 bin tokens for D1–D3; SFT objective = ordinal CE + same-day ranking loss; decoding = autoregressive prefix then per-position expectation.
4.2 Causal Mean-Variance Teacher & Allocation SFT
Asset universe ordered as GLD, SPY, TLT, UUP, XLE. Let Rt be the strictly visible 20-day return window ending at decision day t, with sample mean μt and covariance Σt. The continuous teacher solves a mean-variance problem with annualized volatility, return, and turnover penalty versus previous anchor:
w̃t = argmin_{w∈W} √(252·w⊤Σt w) - 0.05(252μt)⊤w + 0.05·½‖w - w_{t-1}^A‖₁where W = {w≥0, 1⊤w=1, wi≤0.5}. First day omits turnover term. The objective is causal but path-dependent : previous quantized anchor serves as both prompt state and optimization state. Solution is shrunk and discretized:
w̄t = 0.85·w̃t + 0.15·1/5, a_t^A = Q_{50,1000}(1000·w̄t)Q_{50,1000} allocates on a 50-unit grid using largest-remainder method, enforcing 1000-unit budget and at least one grid step per asset. SFT target answer format: <GLD><250><SPY><200>...<XLE><150>, with Gaussian ordinal target at each value position:
q_{jk} ∝ exp[-(k - k_j^*)^2 / 2(0.8)^2], L_SFT = L_tok + Σ_{j=1}^5 CE(q_j, p_j)Inference uses conditional expectation â_j = Σ_k p_{jk} v_k, row-normalized to 1; degenerate rows fall back to equal weight.
4.3 DAPO-Enhanced GRPO Policy Optimization
Policy stage samples G=8 valid allocation sequences. Reward uses only t+1 to t+21 returns: realized Sharpe minus anchor deviation penalty:
R_{tg} = Sh(w_{tg}; t+1:t+21) - 8·½‖z_{tg} - w_t^A‖₁Invalid parses receive -5. Group advantage: A_{tg} = (R_{tg} - R̄_t) / max(s_t, 0.65) Token-level clipped objective uses decoupled Clip-Higher (lower 0.80, upper 1.28) with group-relative advantage:
L_pol = -1/M · Σ min(ρ_{tℓg} A_{tg}, clip(ρ_{tℓg}, 0.80, 1.28) A_{tg})Training uses three passes and behavior-KL early stopping at 0.03, but reference-KL coefficient is zero . This is best described as DAPO-enhanced GRPO: combines group-relative advantage with DAPO's decoupled Clip-Higher and token-level updates, without dynamic batch replenishment or overlong reward shaping. No loss or KL term compares predictions against future target weights.
4.4 Prediction Objective & Autoregressive Decoding
Prediction prompt includes 64 trading days of return, gap, and range features; risk/return/drawdown summaries; market/sector context; four-tier paired news and filing summaries. For h∈{1,2,3}, target is single-day return standardized by 20-day trailing volatility then clipped:
r_{t,h} = P_{t+h}/P_{t+h-1} - 1, z_{t,h} = clip(r_{t,h}/σ_{t,20}, -8, 8)41 quantile bins fitted on training targets, each with center c_k = E[z|b=k]. Fixed grammar: <|forecast_start|><D1><b12><D2><b19><D3><b07><|forecast_end|>. SFT computes Gaussian ordinal CE only at three bin positions, adds same-day cross-sectional ranking loss with coefficient 0.5.
Decoding is truly autoregressive : argmax bin of D1 is appended before evaluating D2, D2 before D3. Numerical values kept as conditional expectation ẑ_{t,h} = Σ_k p_{t,h,k} c_k, then scaled by σ_{t,20} and compounded into three-day ranking score.
4.5 Prediction Policy Optimization
Single policy stage samples G=4 valid autoregressive trajectories forming full cross-section of stocks for the decision day. Five reward components combined after within-group whitening:
R = 0.40·R_step + 0.25·R_path + 0.05·R_dir + 0.25·R_rank + 0.05·R_top20Clipped token-PPO update applied at three sampled bin positions. KL coefficient 0.02 compares current action probabilities against cached source SFT probabilities; no second reference network or reward head instantiated.
Experiments
Experimental Setup
ETF Allocation Dataset : daily multimodal dataset for five liquid ETFs (GLD, SPY, TLT, UUP, XLE) from Jan 2018 to Oct 2025. Each decision day LLM receives latest 20 trading days as time-ordered text tables with relative dates and per-ETF close returns (integer basis points). Macroeconomic news collected via NewsAPI, summarized by DeepSeek-V4 into ~100-word daily news blocks.
FinTexTS Prediction Dataset : covers 2019–2023 for 100 large US companies, pairing price history with ~1M news articles and SEC filings. Text organized by macro, sector, related-company, and target-company tiers.
Allocation Experiments : three expanding-window backtests — train 2018–2022 test 2023 (249 days), train 2019–2023 test 2024 (251 days), train 2020–2024 test 2025 Jan–Oct (209 days). Pooled evaluation concatenates all 709 test days; net Sharpe charges 5 bps per unit one-way turnover.
Prediction Experiments : 100 FinTexTS stocks, 239 trading days. Rank by decoded three-day return, top-20 equal-weight, rebalance every three trading days, 5 bps one-way cost.
Main Results
ETF Allocation
Policy stage matches SFT on three-decimal Sharpe in 2023 but improves both sides of the ratio in 2024 and 2025. 2024 annualized return up 0.52 pp, volatility down 0.07 pp; 2025 return up 1.31 pp, volatility down 0.04 pp. 2024 policy Sharpe 1.564 exceeds causal teacher 1.407 , showing policy optimization does more than replicate SFT target. Pooled comparison: policy optimization lifts gross Sharpe by 0.101 (1.428→1.529), net Sharpe by 0.100 (1.394→1.494), while average one-way turnover rises only from 1.481% to 1.537% (5.6 bps daily), gross Sharpe 1.529 vs causal teacher 1.540 gap of just 0.011.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
