HyperAIHyperAI

Command Palette

Search for a command to run...

AllocFlow: End-to-End-Generierung von Portfolio-Handelsaktionen aus rohen Marktdaten

Annan Wang Yuchen Xie Yu Cen Leon Liangyu Chen Qianyu Julie Zhu Xin Li Tianyi Wei Weisi Lin

Zusammenfassung

Realistisches Portfoliomanagement erfordert die Umwandlung verrauschter Marktbeobachtungen in koordinierte, simultane Allokationen über mehrere Anlagewerte unter gemeinsamen Kapitalrestriktionen. Fortschritte bei Prognosemodellen und der Alpha-Entdeckung helfen, Gelegenheiten zu identifizieren. Herkömmliche Pipelines entkoppeln jedoch häufig die Signalprognose von der Portfoliokonstruktion, wodurch das Lernen möglicherweise nicht auf die Allokationsund Ausführungsziele ausgerichtet ist. Wir stellen AllocFlow vor, ein End-to-End-Flow-Matching-Framework, das gemeinsame Portfolioallokationen direkt aus rohen Multi-Asset-Markthistorien generiert. Um Abhängigkeiten zwischen Portfoliopositionen zu erfassen, setzt AllocFlow einen Cross-Asset-Flow-Transformer ein, der auf zeitliche Marktrepräsentationen konditioniert ist, um kontinuierliche, vorzeichenbehaftete Positionsgewichte über alle Instrumente gemeinsam zu erzeugen. Um die Stichprobenineffizienz und Instabilität beim Erlernen kontinuierlicher Allokationsrichtlinien von Grund auf zu adressieren, etablieren wir ein zweistufiges Trainingsschema: Strategie-überwachte Imitation formt eine strukturierte Verteilung von Kandidatenportfolios, gefolgt von gruppenrelativem Reinforcement Learning (RL), das gemeinsame Entscheidungen anhand von finanziellen Belohnungen auf Portfolioebene und einer eingefrorenen Referenzrichtlinie verfeinert. Auf stündlichen Kryptowährungs-Perpetual-Futures erhöht die RL-Verfeinerung die annualisierte Nettorendite der Imitationsrichtlinie von 27,79 % auf 51,38 % und deren Calmar-Ratio von 0,955 auf 4,043, wobei die Lehrerstrategie in jeder Metrik übertroffen wird; AllocFlow erreicht eine Calmar-Ratio von 4,90 auf sechs weiteren Monaten ungesehener Daten aus dem Jahr 2026 ohne erneutes Training.

One-sentence Summary

Researchers from Nanyang Technological University, Stanford University, and MIT propose AllocFlow, an end-to-end flow-matching framework that uses a cross-asset flow Transformer to generate joint portfolio allocations directly from raw market histories and employs strategy-supervised imitation followed by group-relative reinforcement learning to refine policies, lifting hourly crypto futures net return from 27.79%27.79\%27.79% to 51.38%51.38\%51.38% and Calmar ratio from 0.9550.9550.955 to 4.0434.0434.043, and reaching a Calmar ratio of 4.904.904.90 on six further months of unseen 2026 data without retraining.

Key Contributions

  • AllocFlow is an end-to-end flow-matching framework that maps raw multi-asset market histories directly to complete joint portfolio allocations using a frozen financial encoder and a cross-asset flow Transformer that generates signed position weights for all instruments simultaneously.
  • The training procedure uses strategy-supervised imitation to form structured candidate portfolios, then applies group-relative reinforcement learning with a frozen policy reference to refine the joint allocations using portfolio-level financial rewards.
  • On hourly cryptocurrency perpetual futures, this refinement increases the annualized net return from 27.79% to 51.38% and the Calmar ratio from 0.955 to 4.043, surpassing the teacher policy on every metric, and reaches a Calmar ratio of 4.90 on six months of unseen 2026 data without retraining.

Introduction

Algorithmic trading increasingly relies on learned signals, market representations, and reinforcement learning for alpha discovery, but a better forecast or alpha does not by itself determine a better trade; its value depends on how it is converted into coordinated positions and implemented under shared capital and costs. Prior work often optimizes intermediate forecasts or individual signals separately, while direct portfolio reinforcement learning struggles with noisy returns, sparse rewards, trading costs, and uninformed exploration in high-dimensional continuous action spaces. The authors introduce AllocFlow, a cross-asset flow Transformer that maps raw multi-asset market histories directly to signed position weights, using imitation learning from an alpha-based strategy to initialize structured portfolio proposals and then group-relative reinforcement learning with a frozen reference to refine portfolio-level rewards. They evaluate the approach on cryptocurrency perpetual futures, where it surpasses its teacher and alternative action models on return, Sharpe ratio, and Calmar ratio.

Method

The authors introduce AllocFlow, a framework designed to generate a complete target portfolio directly from raw market histories. The system operates through a pipeline comprising a frozen encoder for context extraction, an initialization phase via imitation learning, and a final refinement stage driven by portfolio rewards.

As shown in the figure below:

To construct a compact market context, the authors leverage a frozen financial foundation model named Kronos. Market data arrives as hourly bars containing open, high, low, close, and volume information. For each asset, normalized OHLCV data and derived amounts are converted into coarse and fine token IDs. A single forward pass yields hidden states before the logit heads, and the authors mean-pool the last eight steps of each stream to obtain one coarse and one fine market token per asset. These token pairs are interleaved and appended with their mean as a shared market token, resulting in 2Nt+12N_t + 12Nt​+1 tokens for the subsequent generation head. An instrument-to-ID mapping connects each token pair to its corresponding allocation-state token within a DiT-style flow head. This architecture allows the model to compare opportunities across assets and generate joint positions without relying on fixed asset-specific output slots.

The allocation-state tokens form a continuous action vector processed by the flow head. Starting from a noise vector z0∼N(0,I)z_0 \sim \mathcal{N}(0, I)z0​∼N(0,I), a market-conditioned velocity field evolves the vector over flow time τ∈[0,1]\tau \in [0, 1]τ∈[0,1] according to the differential equation dzτ/dτ=νθ(zτ,τ;Xt)\mathrm{d}z_\tau / \mathrm{d}\tau = \nu_\theta(z_\tau, \tau; X_t)dzτ​/dτ=νθ​(zτ​,τ;Xt​). At inference, the final state is decoded into signed target weights using the projection:

wt=1cPtz1,Pt=I−11⊤Nt,c=10w_t = \frac{1}{c} P_t z_1, \qquad P_t = I - \frac{\mathbf{11}^\top}{N_t}, \qquad c = 10wt​=c1​Pt​z1​,Pt​=I−Nt​11⊤​,c=10

The projection matrix PtP_tPt​ removes the common component to impose dollar neutrality before execution rounding, while the model retains control over relative directions, sizes, and variable gross exposure.

Because training a continuous generator solely on noisy financial rewards is highly unstable, the authors first initialize the action head using imitation learning. They design a teacher strategy called AgenticAlpha to supply causal reference demonstrations. Conditional flow matching moves noise toward each demonstrated book by minimizing the flow matching loss. To ensure the policy learns reliable relative preferences and nontrivial sizing, the authors supplement this with a direct-score readout and auxiliary losses on the estimated terminal action. The complete imitation objective is formulated as:

LIL=LFM+Lscore+0.5Lweight+0.05Lrank+0.1Lgross\mathcal{L}_{IL} = \mathcal{L}_{FM} + \mathcal{L}_{score} + 0.5\mathcal{L}_{weight} + 0.05\mathcal{L}_{rank} + 0.1\mathcal{L}_{gross}LIL​=LFM​+Lscore​+0.5Lweight​+0.05Lrank​+0.1Lgross​

This stage shapes the initial distribution of complete portfolios without forcing the policy to strictly reproduce the exact returns of the teacher.

In the second stage, the authors refine the joint decisions using a reward-guided optimization process named Flow-GRPO. For each historical context, the policy samples eight alternative portfolios through stochastic flow transitions. Each candidate is normalized to a fixed gross exposure of 0.850.850.85 and held over the same 24 forward hourly bars to compute a gross Sharpe ratio. This controlled comparison evaluates book composition rather than merely rewarding increased leverage. To prevent the policy from discarding the structure learned during imitation, a frozen copy of the imitation-learned policy serves as a soft reference. The update minimizes the reinforcement learning objective:

LRL=E[C(qi,k,Ai)+λC(qi,k,Bi,k)+βKi,k]\mathcal{L}_{RL} = \mathbb{E} \left[ \mathcal{C}(q_{i,k}, A_i) + \lambda \mathcal{C}(q_{i,k}, B_{i,k}) + \beta \mathcal{K}_{i,k} \right]LRL​=E[C(qi,k​,Ai​)+λC(qi,k​,Bi,k​)+βKi,k​]

where C\mathcal{C}C denotes the negative clipped surrogate, AiA_iAi​ represents the group-relative advantage, and the detached term Bi,kB_{i,k}Bi,k​ favors transitions scored more highly by the frozen reference. This on-policy distillation mechanism guides exploration and stabilizes training while the policy ultimately learns to maximize after-fee portfolio performance.

Experiment

The experiments evaluate a joint portfolio generation policy on time-separated cryptocurrency perpetual futures, using a fixed-notional ledger with transaction costs and comparing imitation learning against reward-refined flow-based generation. The main results show that reinforcement refinement improves after-fee return-risk outcomes over imitation and published baselines, while ablations confirm that the continuous flow-based action head, Kronos market features, and imitation-based initialization are each necessary for the gains. Qualitative trade traces further show refinement can change direction and timing rather than merely rescaling demonstrated positions, and reward design tests indicate Sharpe-based group-relative training is more effective than return-focused or deployment-misaligned objectives.

Reward refinement transforms the same frozen representation and action-head architecture from a relatively weak imitation policy into the strongest reported policy. The refined policy achieves the highest net return, Sharpe, and Calmar among all compared methods, while its drawdown is lower than every baseline and its higher turnover is already fee-adjusted. Gains come from both a larger return and a smaller drawdown, rather than return alone. The imitation-learning stage underperforms several baselines, but reward refinement lifts Calmar from below one to above four while roughly doubling net return and more than halving maximum drawdown. The refined policy improves under both drawdown-based and volatility-adjusted measures, achieving the best Sharpe and Calmar among all compared methods despite the highest turnover.

With frozen Kronos features, the flow transformer, MLP, and one-pass transformer start from similar imitation-learned portfolios, but after reward refinement the flow head improves far more in return, Sharpe, and Calmar. The categorical autoregressive head is not a viable alternative, with negative returns after imitation and no trades in the tested continuation. This supports generating complete continuous action vectors jointly rather than using simpler or sequential heads. After imitation, the flow transformer, MLP, and one-pass transformer have similar Calmar near 0.9; after RL, the flow transformer reaches above 4 while the MLP and one-pass transformer remain around 1.3 or below. The autoregressive categorical head loses money after imitation and produces no trades in the tested RL continuation. Across exploration scales, the one-pass transformer peaks near a Calmar of 1.9, well below the flow policy's final Calmar.

Kronos next-bar forecasts deployed directly through a native long-only top-K rule lose money after fees for both zero-shot and LoRA-adapted variants. Both configurations have negative return, Sharpe, and Calmar, although LoRA adaptation reduces the losses relative to zero-shot. This indicates a gap between extracting market information and converting it into a profitable portfolio. Direct deployment of Kronos forecasts under the native long-only allocation rule is unprofitable after fees for both zero-shot and LoRA-adapted settings. LoRA adaptation yields less negative return, Sharpe, and Calmar than zero-shot forecasts. The losing direct deployment shows that useful market features alone do not guarantee a profitable book without a suitable allocation head.

Reinforcement learning improves policy Calmar after imitation for every teacher signal tested. The improvement is not limited to profitable starting policies, as a loss-making short-horizon MACD policy becomes positive after RL. Teacher choice still matters, with AgenticAlpha initialization producing the strongest refined policy. Calmar improves under RL for all four teacher signals, including a negative-Calmar short-horizon MACD imitation policy. AgenticAlpha initialization leads to the highest post-RL Calmar, while Alpha101 #9 remains the weakest refined teacher. RL improvement does not require a profitable teacher, but the initial demonstrations shape the final policy quality.

Replacing the frozen Kronos encoder with a frozen iTransformer while keeping the same flow head causes severe performance losses in both imitation learning and reinforcement learning stages. The Kronos-conditioned policy improves substantially after reinforcement learning, whereas the iTransformer-conditioned policy remains deeply negative and does not recover. Market representation is therefore critical for the flow head to produce a viable portfolio. The Kronos encoder with reinforcement learning achieves the strongest return, Sharpe, and Calmar among the compared settings. Switching to an iTransformer encoder while keeping the flow head produces large negative returns and poor risk-adjusted metrics in both IL and RL stages. Reinforcement learning substantially improves the Kronos-conditioned policy but does not rescue the iTransformer-conditioned policy.

The experiments evaluate portfolio policies built on frozen market encoders and various allocation heads, using imitation learning followed by reward refinement. Reward refinement substantially improves the flow-based head on Kronos representations, yielding the best risk-adjusted performance, while direct deployment of Kronos forecasts through a native top-K rule remains unprofitable after fees. Reinforcement learning improves downstream policy quality across all teacher signals, including initially loss-making ones, and the choice of market encoder is critical, as replacing Kronos with iTransformer leads to severe performance collapse.


KI mit KI entwickeln

Von der Idee bis zum Launch – beschleunigen Sie Ihre KI-Entwicklung mit kostenlosem KI-Co-Coding, sofort einsatzbereiter Umgebung und bestem GPU-Preis.

KI-gestütztes kollaboratives Programmieren
Sofort einsatzbereite GPUs
Die besten Preise

HyperAI Newsletters

Abonnieren Sie unsere neuesten Updates
Wir werden die neuesten Updates der Woche in Ihren Posteingang liefern um neun Uhr jeden Montagmorgen
Unterstützt von MailChimp