HyperAIHyperAI

Command Palette

Search for a command to run...

AllocFlow : génération de bout en bout d'actions de trading de portefeuille à partir de données de marché brutes

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

Résumé

La gestion de portefeuille en conditions réelles exige de convertir des observations de marché bruitées en allocations coordonnées et simultanées sur plusieurs actifs, sous contraintes de capital partagées. Les progrès des modèles de prévision et de la découverte d'alpha aident à identifier des opportunités. Cependant, les chaînes de traitement traditionnelles découplent souvent la prévision des signaux de la construction du portefeuille, ce qui peut désaligner l'apprentissage des objectifs d'allocation et d'exécution. Nous présentons AllocFlow, un cadre de flux génératif de bout en bout qui produit directement des allocations de portefeuille conjointes à partir d'historiques de marché multi-actifs bruts. Pour saisir les dépendances entre les positions du portefeuille, AllocFlow utilise un Transformer de flux inter-actifs conditionné par des représentations temporelles du marché afin de générer conjointement des pondérations de position continues et signées pour l'ensemble des instruments. Pour remédier à l'inefficacité d'échantillonnage et à l'instabilité de l'apprentissage de politiques d'allocation continues à partir de zéro, nous établissons un schéma d'entraînement en deux étapes : une imitation supervisée par une stratégie façonne une distribution structurée de portefeuilles candidats, suivie d'un apprentissage par renforcement relatif au groupe qui affine les décisions conjointes à l'aide de récompenses financières au niveau du portefeuille et d'une politique de référence gelée. Sur des contrats à terme perpétuels de cryptomonnaies en données horaires, le raffinement par apprentissage par renforcement fait passer le rendement net annualisé de la politique d'imitation de 27,79 % à 51,38 % et son ratio de Calmar de 0,955 à 4,043, surpassant la stratégie enseignante sur tous les indicateurs, et AllocFlow atteint un ratio de Calmar de 4,90 sur six mois supplémentaires de données inédites de 2026 sans réentraînement.

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.


Créer de l'IA avec l'IA

De l'idée au lancement — accélérez votre développement IA avec le co-codage IA gratuit, un environnement prêt à l'emploi et le meilleur prix pour les GPU.

Codage assisté par IA
GPU prêts à l’emploi
Tarifs les plus avantageux

HyperAI Newsletters

Abonnez-vous à nos dernières mises à jour
Nous vous enverrons les dernières mises à jour de la semaine dans votre boîte de réception à neuf heures chaque lundi matin
Propulsé par MailChimp