AllocFlow: End-to-End Portfolio Trading Action Generation from Raw Market Data

Annan Wang, Yuchen Xie, Yu Cen, Leon Liangyu Chen, Qianyu Julie Zhu, Xin Li, Tianyi Wei, Weisi LinarXiv 2026 · arXiv

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:

  1. Coordination: Portfolio management is a joint decision problem; you can't decide on one asset without considering the others under a shared capital constraint.
  2. Noise: Financial data is notoriously noisy, making it nearly impossible for Reinforcement Learning (RL) agents to learn profitable strategies from scratch.
  3. 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

Abstract

Real-world portfolio management requires converting noisy market observations into coordinated, simultaneous allocations across multiple assets under shared capital constraints. Advances in forecasting models and alpha discovery help identify opportunities. However, traditional pipelines often decouple signal forecasting from portfolio construction, potentially misaligning learning with allocation and execution objectives. We present AllocFlow, an end-to-end flow-matching framework that directly generates joint portfolio allocations from raw multi-asset market histories. To capture dependencies among portfolio positions, AllocFlow employs a cross-asset flow Transformer conditioned on temporal market representations to generate continuous, signed position weights across all instruments jointly. To address the sample inefficiency and instability of learning continuous allocation policies from scratch, we establish a two-stage training scheme: strategy-supervised imitation shapes a structured distribution of candidate portfolios, followed by group-relative reinforcement learning (RL) that refines joint decisions using portfolio-level financial rewards and a frozen policy reference. On hourly cryptocurrency perpetual futures, RL refinement raises the annualized net return of the imitation policy from $27.79\%$ to $51.38\%$ and its Calmar ratio from $0.955$ to $4.043$, surpassing the teacher strategy on every metric, and AllocFlow reaches a Calmar ratio of $4.90$ on six further months of unseen 2026 data without retraining.
BibTeX
@misc{wang2026allocflow,
  author = {Annan Wang and Yuchen Xie and Yu Cen and Leon Liangyu Chen and Qianyu Julie Zhu and Xin Li and Tianyi Wei and Weisi Lin},
  title = {{AllocFlow: End-to-End Portfolio Trading Action Generation from Raw Market Data}},
  year = {2026},
  eprint = {2611.19937},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.19937},
}
Figure