In the world of quantitative finance, the standard operating procedure has long been a two-step dance: first, build a model to forecast future prices (alpha discovery), and second, feed those forecasts into an optimizer to decide what to buy or sell (portfolio construction). While logical, this decoupling often leads to a "translation error" where the model learns signals that don't actually translate into profitable, executable trades.
AllocFlow proposes a radical shift: an end-to-end framework that skips the intermediate forecast entirely, generating joint portfolio allocations directly from raw market history.
TL;DR
AllocFlow is an end-to-end generative framework that uses a cross-asset flow Transformer to map raw market data directly to optimal portfolio weights. By combining strategy-supervised imitation learning with group-relative reinforcement learning, it achieves a Calmar ratio of 4.043 on cryptocurrency futures—more than doubling the performance of the expert strategy it was trained to imitate.
What Problem Does This Paper Address?
Traditional trading pipelines are "decoupled." A machine learning model might be great at predicting that Bitcoin will go up by 1%, but it doesn't account for the fact that trading into that position might cost 1.5% in fees, or that the position overlaps too much with existing risk in Ethereum.
The authors identify three main challenges in moving to an end-to-end "data-to-action" model:
- Coordination: Portfolio management is a joint decision problem; you can't decide on one asset without considering the others under a shared capital constraint.
- Noise: Financial data is notoriously noisy, making it nearly impossible for Reinforcement Learning (RL) agents to learn profitable strategies from scratch.
- Action Space: Portfolios exist in a continuous, high-dimensional space. Standard RL exploration (like adding Gaussian noise) is often too "jittery" to find structured, meaningful allocations.
Methods
AllocFlow utilizes a sophisticated two-stage architecture and training recipe:
- The Architecture: The system uses a frozen Kronos encoder (a foundation model for financial time series) to compress raw OHLCV (Open, High, Low, Close, Volume) data into market tokens. These tokens are fed into a cross-asset flow Transformer. Instead of outputting a single "best" action, this generative head learns to transform simple noise into a vector of signed position weights (the "target book").
- Stage 1: Imitation Learning (IL): To solve the "learning from scratch" problem, the model first imitates a teacher strategy (AgenticAlpha). This "warm-up" teaches the model the basic structure of a portfolio—which assets to favor and what reasonable position sizes look like.
- Stage 2: Flow-GRPO (Reinforcement Learning): Once the model has a "plausible" starting point, it is refined using Group-Relative Policy Optimization. The model generates multiple candidate portfolios for the same market context, compares their 24-hour financial rewards (Sharpe ratio), and updates the policy to favor the winners. Crucially, it uses a "frozen policy reference" to ensure the RL doesn't drift into nonsensical, over-leveraged territory.
Datasets
The researchers evaluated AllocFlow on hourly cryptocurrency perpetual futures.
- Universe: A dynamic "Top 20" assets by volume, reconstituted weekly.
- Timeline: Training and in-sample testing ran from January 2020 to October 2024.
- Out-of-Sample (OOS): The primary test period was November 2024 to December 2025.
- Extended OOS: To test robustness, they ran the model on unseen data from January to June 2026 without any retraining.
Key Insights and Ideas
- Flow Matching > Gaussian Policies: The authors found that flow-matching (a generative technique similar to those used in image generation) is far superior to standard Gaussian noise for RL in finance. It allows the model to propose "coherent" alternative portfolios rather than just twitching individual asset weights.
- Surpassing the Teacher: One of the most striking findings is that the RL refinement stage doesn't just copy the teacher; it improves upon it. By exploring around the teacher's suggestions, AllocFlow found more efficient ways to manage risk and timing, eventually doubling the teacher's Calmar ratio.
- End-to-End works: The model learns to be a "price taker" that implicitly understands trading costs. Because the RL reward is calculated after fees, the model naturally learns to avoid low-conviction trades that would be eaten alive by commissions.
Key Results
AllocFlow demonstrated dominant performance across several metrics compared to both its teacher and state-of-the-art alpha-mining baselines:
- Annualized Net Return: Jumped from 27.79% (after imitation) to 51.38% (after RL refinement).
- Calmar Ratio: Improved from 0.955 to 4.043. For context, the teacher strategy only achieved a 1.733.
- Maximum Drawdown (MDD): The RL refinement significantly de-risked the strategy, cutting the MDD from 29.10% to 12.81%.
- Generalization: On the unseen 2026 data, the model maintained its edge, reaching a Calmar ratio of 4.90.
- Baselines: AllocFlow outperformed 11 different "pure-RL" methods (like PPO, SAC, and DQN) trained from scratch, most of which actually lost money when accounting for fees.
Limitations and Future Work
- Market Impact: The current model assumes the agent is a "price taker" (i.e., its trades are small enough not to move the market). In very large-scale institutional trading, this assumption breaks down.
- Asset Universe: The study focuses on a liquid, 20-asset crypto universe. Scaling this to thousands of stocks would require significant changes to the cross-asset attention mechanism to manage computational complexity.
- Frozen Backbone: While the frozen Kronos encoder provides stability, it might eventually become "stale" if market regimes shift fundamentally. Future work could explore periodic, slow-moving updates to the representation layer.
Summary updated