All papersAI for finance
Generate a whole portfolio at once from raw prices Paper: 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 Lin · arXiv · Posted 15 Nov 2026 · 26 min read · arXiv 2611.19937
1 The problem Show in original Trading pipelines split forecasting from portfolio building. A right forecast can still make a bad trade . Positions share one pool of capital, so they must be chosen together . RL from scratch is noisy and unstable. 4.043 Calmar ratio after RL, up from 0.955 after imitation.
2 What they tested Show in original They test hourly crypto perpetual futures , from November 2024 to December 2025. The universe is the top 20 assets, rebuilt every week. They charge a 5 bps fee, the highest they found. They compare four alpha-mining baselines and many ablations. 3 What they found Show in original RL lifts return from 27.79% to 51.38% . Drawdown falls from 29.10% to 12.81% . It beats its teacher on every metric. On six more months, the Calmar is 4.90 , with no retraining. In a chart AllocFlow after RL has the highest Sharpe ratio of all policies From Table 1 0 1 2 3 Net daily Sharpe ratio (higher is better) AlphaGen 1.242 Sharpe AlphaSAGE 1.396 Sharpe R&D-Agent-Quant 0.967 Sharpe AlphaAgent 1.048 Sharpe AllocFlow (IL) 0.954 Sharpe AllocFlow (RL) 2.192 Sharpe
Hover, tap or focus a bar to read its exact value.
Show as table Policy Sharpe AlphaGen 1.242 AlphaSAGE 1.396 R&D-Agent-Quant 0.967 AlphaAgent 1.048 AllocFlow (IL) 0.954 AllocFlow (RL) 2.192
5 Watch out Show in original This is a backtest on crypto futures. It is not investment advice. The result is for one market and a set of fee assumptions. The teacher is the authors' own method. Maximum drawdown and Sharpe come from a single period , with five seeds. Jump to A The abstract1 Introduction2 Related works3 Method3.1 Generating a portfolio from compact market context3.2 Imitation learning3.3 Refining joint decisions with portfolio rewards4 Experiments4.1 Model training4.2 Evaluation design4.3 Quantitative results5.1 The profit comes from the joint action generation, not from Kronos5.2 Demonstrations start the action space; RL creates the value5.3 Market representation5.4 The effect of flow-head size5.5 Reward choice and the RL objective6 ConclusionA Appendix A: mathematical clarificationsB Appendix B: implementation and training detailsC Appendix C: accounting and comparison detailsD Appendix D: additional related contextE Appendix E: terminologyW Words to knowEvery detail from the paper Cards follow the paper's own order. Dotted words link to Words to know. Numbers match the paper.
A The abstract Show in original The problem Real portfolio work turns noisy market data into joint positions across many assets. All positions share one pool of capital. Forecasting models and alpha discovery help find opportunities. But usual pipelines split forecasting from portfolio building. That can leave learning out of line with the allocation and execution goals. The method AllocFlow is an end-to-end flow-matching framework.It generates joint portfolio allocations straight from raw multi-asset market histories. A cross-asset flow Transformer reads temporal market representations. It generates continuous, signed position weights for all instruments together. Two-stage training Learning continuous allocation policies from scratch is unstable and wastes samples. So training has two stages. Stage 1: strategy-supervised imitation shapes a structured set of candidate portfolios. Stage 2: group-relative reinforcement learning (RL) refines joint decisions. It uses portfolio-level financial rewards and a frozen policy reference. The results Test: hourly cryptocurrency perpetual futures. RL refinement lifts the annualized net return of the imitation policy from 27.79% to 51.38%. It lifts the Calmar ratio from 0.955 to 4.043. It beats the teacher strategy on every metric. On six more months of unseen 2026 data. AllocFlow reaches a Calmar ratio of 4.90, with no retraining. 1 Introduction Show in original Background Algorithmic trading moved from explicit rules. Statistical portfolio building toward learned signals, policies and market representations. Classical portfolio theory balances expected return and risk. Modern machine learning pulls out richer predictive signals. Financial foundation models learn reusable representations of price histories. Language-model agents and reinforcement learning (RL) increasingly automate alpha discovery. The gap A better forecast or alpha does not alone give a better trade. Its value depends on how it becomes positions, mixes with other chances. Is carried out through rebalancing. Tuning these middle signals one by one can leave a gap. The gap is between what a model learns and what an account needs. Why joint decisions An account must pick how much to put in each instrument, in. Which direction, under shared capital and exposure limits. A right direction can still lead. To a bad trade if the position is too big. Copies another exposure or costs too much to change. Coordinated long and short positions can use relative chances without a large directional bet. So each position must be judged against the others. The challenges The goal is joint trading decisions for the whole portfolio. The input is raw market data. The action form must express coordinated positions. Training must find profitable allocations in a large continuous space. History gives noisy outcomes and no single best portfolio label. Pretraining gives useful representations but not a trading policy. RL can optimize financial outcomes. But blind exploration must find position links and sizing from noisy returns. Trading costs can also favor doing nothing when a candidate has too little expected gain. The proposal AllocFlow is a cross-asset flow Transformer. It generates continuous, signed position weights from pretrained temporal market representations. Training separates two jobs: learning trading structure, and improving portfolio outcomes. First, imitation of an alpha-based strategy trains a randomly initialized action head. It teaches relative position preferences, direction and scale. That gives RL a coherent starting region. The teacher's own result is not the final goal. Then group-relative RL compares candidate portfolios under shared market outcomes. With a frozen reference to guide updates. What end-to-end means "End-to-end" means raw market histories map to executable target weights. There is no middle forecast, alpha score or optimizer. The pretrained encoder stays frozen, as in end-to-end vision-language and robot policies. The focus is cryptocurrency perpetual futures. They trade around the clock, allow long and short positions at the same fee. And have a liquid, weekly rotating universe. Headline results On hourly crypto perpetual futures. RL refinement lifts the annualized net return from 27.79% to 51.38%. The Sharpe ratio goes from 0.954 to 2.192. The Calmar ratio goes from 0.955 to 4.043, over 14 months. So AllocFlow beats its own teacher on every metric. On six more months of 2026 data it reaches a Calmar of 4.90. With no retraining. Each part matters Each part of the design is needed. Under the same RL goal. A parameter-matched Gaussian policy reaches a Calmar of at most 1.92. Direct differentiable optimization of the same reward reaches at most 1.74. RL from a randomly initialized head loses 75% per year. Contributions Contribution (i). Joint action generation from market histories.A frozen financial encoder condenses each asset's history. A cross-asset flow Transformer makes the signed target book in one decision. Contribution (ii). Strategy-guided refinement: imitation, then group-relative RL with a frozen reference.Contribution (iii). Strong results beyond the teacher.RL lifts the imitation Calmar from 0.955 to 4.043, more than twice the teacher's 1.733. Swapping the action head, encoder, teacher or reward. Or dropping imitation, each gives a lower Calmar. Figure 1 Figure 1 shows after-cost performance from 01 Jan 2020 to 31 Dec 2025. A dashed line marks the start of the out-of-sample period. One curve shows cumulative PnL on fixed notional. Another shows profits reinvested each quarter. Color shows the rolling 365-day annualized Sharpe. 3 Method Show in original From market bars to a portfolio From Figure 2a Raw hourly bars per asset Frozen Frozen Kronos market tokens Trained Flow head makes one book Project to dollar neutral Ledger turns changes into trades Each asset gets a coarse and a fine token. Four Euler steps run at inference.
Overview A market representation gives a compact context. Does not say how to trade across assets. AllocFlow generates a full target portfolio from raw histories. A frozen encoder condenses the histories. Imitation gives the generator a useful starting distribution. Reward-guided refinement then improves the decisions (Figure 2). 3.1 Generating a portfolio from compact market context Show in original Why decide together Portfolio weights should be decided together. A position's value depends on the other exposures. On how neutral the whole book is. Data arrive as hourly bars. Each bar holds the open, high, low and close prices. The traded volume (OHLCV) for one hour. Actions and the ledger At market time t, the eligible assets and their histories are the input. The policy outputs signed target weights relative to a fixed account notional. Positive weights are longs. Negative weights are shorts. Execution rounds the target and applies it after one bar. In the fixed-notional ledger, the trade is the change between the new and old target. Names outside each target list get zero weight. So the model learns the wanted book. And the ledger finds orders and fees from changes to it. The frozen encoder Attention over every bar of every asset would make the context too long. So they freeze Kronos. A financial foundation model pretrained to predict the next bar from tokenized OHLCV. They use its temporal representation, not its next-bar forecast. Each asset's normalized OHLCV and derived amount become coarse and fine token IDs. One forward pass gives two hidden states. The coarse decoder context and the fine dependency-layer output. They mean-pool the last eight steps of each stream. This gives one coarse and one fine market token per asset. No next-bar token is sampled. No predicted price goes to the policy. Why only the representation Kronos is made for forecasting, not trading. Its own forecasts lose money after fees, zero-shot and after LoRA adaptation (Table 3). So AllocFlow takes only its representation and learns every trading decision in the flow head. The flow head input They interleave the token pairs and add their mean as a shared market token. That gives 2Nt + 1 tokens for the DiT-style flow head. Where Nt is the number of eligible assets. An instrument-to-ID mapping links each pair. To the allocation-state token whose output is that asset's weight. So the head compares opportunities across assets while generating positions together. Membership, size and order can change at inference, with no fixed asset-specific output slots. "End-to-end" means this bars-to-weights path. Kronos stays frozen. How the flow generates The allocation-state tokens form a continuous action vector. A flow model can generate alternative complete books instead of picking positions one by one. Start from random noise. A market-conditioned velocity field moves the vector over flow time between 0 and 1. Flow time is not market time. Each update changes the whole vector. Four Euler steps run at inference. The decoder The final state is decoded as w = (1/c) times P times z. With c = 10 (Equation 1). P removes the common component, so the weights sum to zero (dollar neutral) before rounding. The model still picks relative directions, sizes and variable gross exposure. The evaluated decoder has no extra hard gross cap. Dollar neutrality alone does not mean beta neutrality or bounded risk (Appendix A.2). Holdings enter the ledger, not the policy input. Section 5.5 shows adding them extends AllocFlow to closed-loop control. Why flow matching Why flow matching? Three reasons. First, the action is a joint distribution over complete books. For example when several correlated assets could take the same short. Second, group-relative RL needs coherent alternatives. A flow samples complete books. A diagonal Gaussian perturbs one mean book coordinate by coordinate. Third, the stochastic flow sampler gives the closed-form transition likelihoods that Flow-GRPO uses. A parameter-matched Gaussian policy with the same goal reaches under half the flow policy's Calmar. See Section 5.1. 3.2 Imitation learning Show in original Stage 1: imitation learning From Figure 2b Teacher strategy makes target books Add noise to each book Train noise-to-book flow Add score, weight, rank, gross losses Only the frozen Kronos encoder starts from pretrained weights.
Why imitate first A generator trained only on financial rewards would have. To find coordinated books through noisy outcomes and costs. So the action head starts random and trains by imitation on causal strategy decisions. Only the frozen Kronos encoder starts from pretrained weights. The teacher The teacher is AgenticAlpha, the authors' own method. It combines effective alphas mined by AlphaGen and AlphaSAGE. Each alpha set manages half of the capital (Appendix B.1). Other common teachers test whether refinement depends on this one (Section 5.2, Table 4). These are historical strategy actions, not hindsight-optimal portfolios. Imitation gives plausible directions. Scale for exploration, without making the teacher's return the final goal. Flow matching loss Conditional flow matching moves noise toward each demonstrated book. With a scaled teacher book, noise. A sampled flow time. The loss trains the velocity to point from noise to the book (Equation 2). This teaches a distribution over complete allocations. Added losses Useful search proposals also need reliable relative preferences and real sizing. So the flow loss gains a direct-score readout and losses on the estimated final action. The imitation loss adds five terms (Equation 3). Flow loss + score loss + 0.5 x weight loss + 0.05 x rank loss + 0.1 x gross loss. The ranking term keeps which assets the teacher favors. The weight and gross terms keep direction, relative size and book scale. Appendix A.1 discusses the no-trade case with uninformative returns. Imitation shapes where RL begins. It need not copy a teacher action. 3.3 Refining joint decisions with portfolio rewards Show in original Stage 2: group-relative RL From Figure 2c Sample 8 candidate books Scale each to gross 0.85 Hold 24 hours, score each Flow-GRPO compares the group Frozen Frozen IL reference anchors updates All candidates face the same future market path.
Sampling candidates Imitation makes books meaningful, but cannot show which changes improve outcomes. Flow-GRPO compares complete candidate books under the same future market path. For each historical context. The old policy samples G = 8 candidates through K = 10 stochastic flow transitions. Each is held fixed over the same H = 24 forward hourly bars. The reward To compare composition, not extra leverage. Each decoded book is scaled to gross exposure g0 = 0.85 before scoring. The reward is the annualized Sharpe of the candidate's gross returns over the 24 bars. This is Equation 4. All candidates of a state face the same path at the same gross exposure. So the reward compares book composition under control. What kind of problem it is Stage 2 is a contextual bandit over target books. As in standard portfolio RL for liquid markets. The policy is a price taker whose trades do not move prices. So holdings affect outcomes only through trading costs. Costs come with each change of the target book. The reward measures the quality of a complete book. Without the credit-assignment noise of long path-dependent rollouts. All reported results use the deployed after-fee ledger. Where the policy sets its own exposure every hour. The update Financial rewards are noisy, so free updates could throw away structure learned from demos. A frozen copy of the imitation policy stays as a soft reference. And only the action head updates. The group-relative advantage is the reward minus the group mean. Divided by the group spread, clipped to between -5 and 5. The update loss adds three parts (Equation 5). A clipped surrogate on the reward advantage. A second clipped surrogate (weight 0.1) favoring transitions the frozen reference scores higher. A penalty (weight 0.004) on drift of transition means from the reference. The ratio clip is 10-3. Appendix B.3 gives the sampler details. After training The reference guides exploration without forcing exact imitation. After training, the same head makes target books with four deterministic Euler steps. The reward ablation (Table 7) examines the choice of financial objective. 4 Experiments Show in original The main test asks whether generating a joint target book improves realized after-fee outcomes. First: compare imitation with its RL continuation under the same model and ledger. Then: place the complete policy beside published alpha-mining methods. Section 5 studies which design choices explain the gaps. 4.1 Model training Show in original Stage 1 The randomly initialized action head trains in two stages while the Kronos encoder stays frozen. Stage 1: AgenticAlpha makes a target portfolio for each historical context. Using only information available then. The head learns by flow matching. Auxiliary losses keep the teacher's sizes, asset preferences and total exposure. This gives plausible complete portfolios before the policy must improve outcomes. Stage 2 Stage 2: the policy generates eight alternative portfolios for each training context. Each is scaled to 0.85 gross exposure. Held over the same next 24 hourly bars. Each gets a gross Sharpe score. Flow-GRPO compares the eight and updates the head toward better ones. A frozen copy of the imitation policy anchors the updates. Demos and reward windows exclude the test period. The fixed-book reward guides training. The backtest judges changing target books after fees. At test time, four Euler steps make each target portfolio. 4.2 Evaluation design Show in original The market They use cryptocurrency perpetual futures,. Which are futures without expiry that can be held long or short. The reason: granular historical records are free and public over long periods. Training and test samples are split strictly in time. Time split and universe Kronos pretraining ends in June 2024. Before the hourly test from November 2, 2024 to December 31, 2025. So the frozen encoder has no test-period information. Each week, the eligible list is recomputed. It holds the 20 assets with the highest trading volume in the prior 60 days. This causal list tests a changing opportunity set. Not a list picked with knowledge of the whole test. The ledger and fees All targets enter a fixed-notional ledger after one bar. Orders are changes from current to target weights, including entries. Exits when the list changes. They cost 5 basis points (bps, 0.01%) per unit of absolute traded weight. This fee is the highest of base-tier taker fees at major venues. Fees in earlier crypto papers. The median half-spread of the traded contracts is only 0.24 bps (Appendix C.3). Metrics Metrics: arithmetic annualized net return, additive maximum drawdown (MDD), net daily Sharpe, Calmar. Average daily turnover (TO). Together they test profit, downside exposure and the trading needed (Appendix C.1). Baselines Published alpha-mining baselines use one multi-asset signal-to-allocation pipeline. AllocFlow generates weights directly. The IL-to-RL comparison keeps the frozen encoder and head the same. So it is the more direct test of reward refinement. Teacher strategies and native long-only Kronos use are studied in Section 5. 4.3 Quantitative results Show in original IL to RL Reward refinement improves both sides of the return and risk trade-off (Table 1). Net annualized return rises from 27.79% after IL to 51.38% after RL. MDD falls from 29.10% to 12.81%. So the Calmar gain comes from a larger numerator. A smaller drawdown, not from return alone. Both stages share the frozen representation and head. So this is the main proof that the reward stage improves the generated portfolio. The AllocFlow (RL) rows are means with standard deviations over five random seeds. AllocFlow after RL has the highest Sharpe ratio of all policies From Table 1 0 1 2 3 Net daily Sharpe ratio (higher is better) AlphaGen 1.242 Sharpe AlphaSAGE 1.396 Sharpe R&D-Agent-Quant 0.967 Sharpe AlphaAgent 1.048 Sharpe AllocFlow (IL) 0.954 Sharpe AllocFlow (RL) 2.192 Sharpe
Hover, tap or focus a bar to read its exact value.
Show as table Policy Sharpe AlphaGen 1.242 AlphaSAGE 1.396 R&D-Agent-Quant 0.967 AlphaAgent 1.048 AllocFlow (IL) 0.954 AllocFlow (RL) 2.192
Table 1 in full Policy Return MDD Sharpe AlphaGen 35.42 20.60 1.242 AlphaSAGE 31.30 23.36 1.396 R&D-Agent-Quant 20.69 18.53 0.967 AlphaAgent 29.12 26.93 1.048 AllocFlow (IL) 27.79 29.10 0.954 AllocFlow (RL) 51.38 +-2.04 12.81 +-1.51 2.192 +-0.086
Table 1: main results (return and MDD in percent; TO is average daily turnover) (part 1 of 2)
Published baselines share a signal-to-allocation pipeline. AllocFlow generates positions directly.
Policy Calmar TO AlphaGen 1.720 0.248 AlphaSAGE 1.340 1.255 R&D-Agent-Quant 1.117 0.397 AlphaAgent 1.081 0.651 AllocFlow (IL) 0.955 1.143 AllocFlow (RL) 4.043 +-0.379 1.976 +-0.047
Table 1: main results (return and MDD in percent; TO is average daily turnover) (part 2 of 2)
Published baselines share a signal-to-allocation pipeline. AllocFlow generates positions directly.
Robustness The gain also holds under a harder trading profile. Average daily turnover rises from 1.143 to 1.976, and the return already deducts the fees. Net daily Sharpe also rises. Figure 1 shows after-cost PnL trending up over a test window longer than a year. The rolling 365-day Sharpe stays near 2 for much of the out-of-sample period. Figure 3 zooms into two trading decisions that RL changed. Against baselines Against outside methods, the final policy has the highest reported net return. Calmar in Table 1. The strongest listed alpha baseline reaches 1.720 Calmar. This compares whole signal-to-position pipelines, which matters because AllocFlow decides positions jointly. Six more months Longer out-of-sample test. With no retraining, the same policy reaches a Sharpe of 2.06.A Calmar of 4.90 on January to June 2026 (Table 12). That extends the out-of-sample period to 20 months. More than twice the test windows of recent crypto RL methods. 5.1 The profit comes from the joint action generation, not from Kronos Show in original Heads compared They compare the flow head with an MLP, a one-pass Transformer. A sequential autoregressive categorical head (Table 2). If frozen Kronos features alone explained the gain. Simpler heads would gain as much from RL. The first three reach similar Calmar after imitation. The flow head improves from 0.955 to 4.043 after RL. The MLP. One-pass Transformer reach only 1.307 and 0.960. So the difference appears in refinement,. Which fits a distribution over complete continuous books for portfolio-level search. Only the flow head gains a lot from RL From Table 2 After IL After RL
0 1 2 3 4 5 Calmar ratio before and after RL Flow Transformer 0.955 Calmar 4.043 Calmar MLP 0.912 Calmar 1.307 Calmar One-pass Transformer 0.878 Calmar 0.960 Calmar
Hover, tap or focus a bar to read its exact value.
Show as table Head After IL (Calmar) After RL (Calmar) Flow Transformer 0.955 4.043 MLP 0.912 1.307 One-pass Transformer 0.878 0.960
More on the heads The autoregressive head's imitation book loses money. Its tested RL continuation makes no trades,. Which fits the idea that poor proposals make group-relative gains hard. All heads share the same GRPO code and differ only in the policy kernel. The one-pass Transformer is a parameter-matched stochastic policy that samples books from a Gaussian. Across exploration scales sigma. It reaches a Calmar of at most 1.92 (Table 2b). Against 4.043 for the flow policy. It stays below 1 in four other settings. From imitation policies of similar quality (Calmar 0.878 and 0.955). RL adds 3.1 to the flow policy's Calmar. That is three times its gain for the Gaussian policy. Table 2 in full: action-head comparison with frozen Kronos Head IL return (%) IL Sharpe IL Calmar Flow Transformer 27.79 0.954 0.955 MLP 27.31 0.935 0.912 One-pass Transformer 27.78 0.949 0.878 Autoregressive -35.51 -1.189 -0.480
Table 2a: action-head comparison (part 1 of 2)
NT means an observed no-trade outcome, for which risk-adjusted ratios are not meaningful.
Head RL return (%) RL Sharpe RL Calmar Flow Transformer 51.38 2.192 4.043 MLP 20.12 0.856 1.307 One-pass Transformer 20.85 0.786 0.960 Autoregressive NT NT NT
Table 2a: action-head comparison (part 2 of 2)
NT means an observed no-trade outcome, for which risk-adjusted ratios are not meaningful.
Setting Calmar after RL Gaussian, sigma = 0.05 -0.55 Gaussian, sigma = 0.1 -0.62 Gaussian, sigma = 0.2 0.96 Gaussian, sigma = 0.4 1.92 Gaussian, sigma = 0.8 -0.12 Flow head 4.043 +-0.379
Table 2b: Calmar after RL, Gaussian one-pass Transformer against the flow head
The sigma = 0.2 run is the one in Table 2a. Same GRPO objective.
Trading Kronos directly Could Kronos's own next-bar forecasts be traded directly? Deployed with their native long-only top-K ranking rule, both zero-shot. LoRA-adapted forecasts lose money after fees (Table 3). This shows the gap between extracting market information and turning it into a profitable book. Kronos-direct Return (%) Sharpe Calmar Zero-shot -44.502 -0.469 -0.438 LoRA -34.570 -0.391 -0.312
Table 3: Kronos forecasts with native long-only deployment
These portfolios use a different allocation rule.
5.2 Demonstrations start the action space; RL creates the value Show in original Teacher variation Does imitation just copy a profitable expert, or give structured books that RL can improve? They test four causal strategies as teachers. AgenticAlpha, MACD (12h, 26h), MACD (48h, 104h) and Alpha101 #9. For each, they train a new random head by imitation. Then continue it with RL on the same ledger (Table 4). Calmar improves in every pair, even for short-horizon MACD, whose IL policy loses money. So the RL gain does not need a profitable teacher. Teacher After IL After RL AgenticAlpha 0.955 4.043 MACD (12h, 26h) -0.559 1.856 MACD (48h, 104h) 0.538 2.114 Alpha101 #9 0.401 1.068
Table 4: policy Calmar by teacher signal
Initialization Initialization still matters. AgenticAlpha gives the strongest refined policy among these teachers. AllocFlow beats this teacher on every metric: Calmar 4.043 against 1.733. This fits the two-stage design: demos give nontrivial directions and sizes. And reward feedback picks better portfolios from that start. Imitation is necessary Imitation is necessary. Flow-GRPO from a random head, with the same encoder, sampler, reward. RL steps, gives no meaningful trading. The reference terms are off, as there is no imitation policy. It stays at the level of an untrained head and loses 75% per year. With 4.8 times more RL steps, roughly the total compute of IL. RL, its gross exposure drifts to 4.5 times the capital. Its drawdown exceeds the capital. Why Random candidate books make reward differences mostly noise, so the group-relative advantage carries little information. Imitation gives coherent books, which makes the comparison informative. None of 11 pure-RL methods trained from scratch reaches the Sharpe of BTC buy-and-hold. AllocFlow has four times the Sharpe of the best of them. With one quarter of its drawdown (Appendix C.4). Leading crypto RL methods also guide their agents with hindsight-optimal oracles. Zoom into local decisions Aggregate ratios do not show what changed in single trades. Figure 3 aligns prices with the teacher, IL. RL positions around two opposite turning points. AUCTION: RL turns short about 11 hours before the peak. While the teacher and IL stay long through much of the decline. The asset falls 22.1% over the next 24 hours. RL earns +0.76% asset PnL against -1.78% for IL. 1000PEPE: RL covers its short and turns long about 11 hours before the bottom. The asset rises 30.0% over the next 24 hours. RL earns +1.29% against -0.07% for IL. A caution Refinement can change the sign and timing of decisions in either direction. These windows explain a mechanism, not how often it happens across the portfolio. 5.3 Market representation Show in original The flow head can learn a useful book only if its tokens keep trading-relevant information. Replacing frozen Kronos with a frozen iTransformer. With the flow head kept, loses heavily after both IL. RL (Table 5). Reward refinement does not recover the Kronos-conditioned result. With the losing Kronos-direct deployment. This shows good features pay off only when a suitable head learns. To allocate from them. Encoder and stage Return Sharpe Calmar Kronos, IL 27.79 0.954 0.955 Kronos, RL 51.38 2.192 4.043 iTransformer, IL -141.58 -5.359 -0.850 iTransformer, RL -119.29 -7.119 -0.846
Table 5: encoder replacement with a flow head (annualized arithmetic net return, percent)
5.4 The effect of flow-head size Show in original Same frozen Kronos representation and two-stage training (Table 6). A 12-layer head is slightly stronger than the 32-layer head after IL. Both improve a lot under RL: the 12-layer head reaches a Calmar of 3.728. The deeper head gets the higher final return and Calmar. Depth and stage Return Sharpe Calmar 12 layers, IL 29.37 0.999 1.033 12 layers, RL 46.74 2.109 3.728 32 layers, IL 27.79 0.954 0.955 32 layers, RL 51.38 2.192 4.043
Table 6: flow-head depth with frozen Kronos (after-fee return in percent)
5.5 Reward choice and the RL objective Show in original Reward comparison The group-relative update can only prefer behavior the reward can tell apart. Table 7 compares Sharpe, cumulative return, mean return. A risk-adjusted-return reward against the IL start. Cumulative return gives the highest annualized return. The Sharpe-trained policy has the smallest MDD and the highest Calmar. It also trades more than the return-focused variants. So its lower downside is not just from trading less. The risk-adjusted-return variant loses money. So nominal risk adjustment does not by itself give a useful signal. Training on Sharpe gives the best Calmar From Table 7 0 1 2 3 4 5 Calmar ratio (higher is better) Sharpe 4.043 Calmar Cumulative return 3.611 Calmar Mean return 3.395 Calmar IL initialization 0.955 Calmar
Hover, tap or focus a bar to read its exact value.
Show as table Training reward Calmar Sharpe 4.043 Cumulative return 3.611 Mean return 3.395 IL initialization 0.955
A note on the chart The chart leaves out the risk-adjusted-return reward, whose Calmar is negative (-0.372). Table 7 in full: reward ablation Training reward Return MDD Sharpe IL initialization 27.79 29.10 0.954 Sharpe 51.38 12.81 2.192 Cumulative return 60.62 16.79 2.150 Mean return 58.36 17.19 2.051 Risk-adjusted return -10.63 28.60 -0.480
Table 7: reward ablation (return and MDD in percent) (part 1 of 2)
Training reward Calmar TO IL initialization 0.955 1.143 Sharpe 4.043 1.976 Cumulative return 3.611 1.658 Mean return 3.395 1.613 Risk-adjusted return -0.372 2.070
Table 7: reward ablation (return and MDD in percent) (part 2 of 2)
Deployment-aligned objectives Deployment-aligned objectives. Putting gross exposure or fees into the reward lowers deployed performance (Appendix B.4).Scaling the Sharpe by gross exposure raises the MDD to 18.1%. Lowers the Calmar from 4.043 to 2.76. Charging fees lowers turnover to 1.30 but raises the MDD to 26.0% (Calmar 1.98). With holdings as extra input. The closed-loop policy reaches a Calmar of 4.59 with a turnover of 1.38. A no-trade band at execution raises the Sharpe to 2.46 and the Calmar to 5.75. Policy gradients and direct optimization Policy gradients versus direct optimization. They back-propagate the same differentiable reward through the deterministic 4-step ODE. They start from the same IL checkpoint. This is called DRaFT. It reaches a Calmar of at most 1.74 across four settings. Flow-GRPO reaches 4.043 (Appendix C.5). Policy gradients need only reward values. So they also work on grid-rounded rewards such as deployed PnL. Group-relative scoring standardizes and clips rewards within a group. Each pathwise gradient follows one realized price path and mainly raises turnover. The stochastic sampler also gives the closed-form likelihoods that Flow-GRPO optimizes. 6 Conclusion Show in original What it does AllocFlow turns raw multi-asset histories into complete signed portfolios with a cross-asset flow model. Strategy-supervised imitation sets up structured, nontrivial trading actions. Group-relative RL with a frozen reference then improves their portfolio performance. What supports it Gains across four demonstration priors support this progression. Architecture comparisons show market representations must be paired with an action model. That model must express coordinated allocations and support reward-based updates. The outcome Together they give a profitable case of direct joint portfolio decision-making. It beats its teacher on every metric. Holds on six more months of unseen data. It extends directly to closed-loop control. A Appendix A: mathematical clarifications Show in original A.1 A no-trade condition From a zero book, take expected returns, a proportional trading cost. A risk penalty that is zero for the zero book. If every expected return is no larger than the cost. The zero book is a global best (a short proof by Holder's inequality). This also holds when the feasible set is limited to dollar-neutral books. It motivates biasing early portfolio proposals toward useful trading. A.1 Zero-book groups A group of identical zero books gets identical rewards, so the group-relative advantages are zero. The reward surrogate then gives no direction for that group. This does not make zero a trap in general. Stochastic exploration, nonzero categorical probability and reference regularization can still move a policy. The zero-book results are for other heads refined after IL. Section 5.2 reports the no-imitation control. A.2 Dollar and factor neutrality The decoder projection P is idempotent, and it maps every latent to the dollar-neutral subspace. But if returns follow a factor model, factor exposure is the weights times the betas. It need not vanish when the weights sum to zero. Example: weights (a, -a) with betas (2, 1) give exposure a. So dollar neutrality cannot prove beta neutrality, sector neutrality or bounded drawdown. A.2 Execution rounding Rounding each position to a grid of width q can leave a residual net position. With fixed notional A. Nearest-grid rounding gives a net bound of N times q over 2A. The recorded A = 10 and q = 0.1 mean 0.01 steps in normalized weights. Single-name clipping in the teacher or factor pipeline may also change neutrality. Exact deployed neutrality would need a final feasible projection,. Which the reported system does not assume. B Appendix B: implementation and training details Show in original B.1 Market context and demonstration construction The reference strategy The reference universe is the top 20 assets by trailing 60-day traded amount. It is rebuilt weekly on Sunday. The reference strategy computes a signal per asset, then runs an allocation pipeline. Pipeline: temporal smoothing over 24 hourly bars. Volatility scaling with target 0.05, a gross cap of 10 units. Then a per-name clip of +-2 units, and a 0.1-unit execution grid. Demos are the allocations divided by the fixed notional A = 10. AgenticAlpha AgenticAlpha is built only from training data. AlphaGen and AlphaSAGE each mine alphas on the training period and combine them linearly. AgenticAlpha joins the two at portfolio level. Each alpha set manages half the capital. The two halves form one portfolio that goes through the pipeline above. Table 8 lists the five largest-weight alphas from each method. The authors will release all alphas. Source Alpha expression Weight AlphaGen Ref(Greater($vwap,-2.0),1d) +0.1494 AlphaGen WMA(Greater(Div(-5.0,Std(Greater($low,-0.5),48d)),-0.01),12d) -0.1476 AlphaGen Log($vwap) +0.0207 AlphaGen Less(2.0,Greater(Less(Greater($open,Mul($vwap,-2.0)),1.0),$open)) -0.0049 AlphaGen Sub($volume,Max(Greater(Div(5.0,$volume),0.01),1d)) +0.0020 AlphaSAGE Div(Pow(Less($open,5.0),$high),$volume) +0.0238 AlphaSAGE TsMad(Add(-5.0,Mul(TsDiv($volume,12),10.0)),48) -0.0229 AlphaSAGE TsRank(Sub(-30.0,$high),120) +0.0218 AlphaSAGE TsStd(TsDiv(Rank(Mul(0.01,Mul(Abs($vwap),-0.5))),120),120) -0.0192 AlphaSAGE Sign(Mul(-1.0,TsDelta($vwap,336))) -0.0188
Table 8: the five AlphaGen and five AlphaSAGE alphas with the largest absolute weights
Window lengths are in hourly bars.
Policy Return MDD Sharpe and Calmar AgenticAlpha (teacher) 33.92 19.57 1.472 and 1.733 AllocFlow after IL 27.79 29.10 0.954 and 0.955 AllocFlow after IL + Flow-GRPO 51.38 +-2.04 12.81 +-1.51 2.192 +-0.086 and 4.043 +-0.379
Table 9: teacher, imitation and refined policy on the same ledger with a 5 bps fee
Imitation alone stays below the teacher, because it matches the teacher's books, not its return. RL then beats the teacher on every metric.
The encoder The encoder uses window-normalized OHLCV and derived amount channels, clipped to between -5 and 5. The last eight coarse and eight fine token states are pooled separately per asset. Those summaries, a cross-asset market summary, asset identity embeddings. Calendar information condition the action head. The encoder width is read from the loaded checkpoint. They use the Kronos-base checkpoint. B.2 Supervised auxiliary objectives The weight, gross and score losses use a Huber loss with a unit threshold. The weight loss compares action-scaled weights with the teacher's. The gross loss compares total exposure. The score loss compares the direct-score output. They supervise action-scaled weights, so their size is comparable to the flow loss. Empty demonstrated books are left out of these three averages. Ranking and flow time The ranking term averages over asset pairs whose teacher weight gap exceeds 0.01. It is a logistic loss on the order of each pair. Flow time is sampled as 0.999(1 - U), with U from a Beta(1.5, 1.0) distribution. The velocity network uses 1,000 time buckets. These goals encourage fidelity. Do not force the policy to copy the teacher's smoothness or turnover. B.3 Stochastic flow transitions and loss normalization For K transitions, the step size is 1/K. The noise coefficient is 0.7. The stochastic sampler adds scaled Gaussian noise at each step (Equations 12 to 14). All evaluated transitions occur before flow time 1, which avoids the terminal singularity. Setting the noise coefficient to 0 gives an Euler update. Training uses ten stochastic transitions. Deployment uses four deterministic Euler transitions from a seeded Gaussian latent. So "deterministic" means repeatable for a given timestamp seed, not zero initial noise. Dimension normalization The scalar transition statistic is a per-asset mean log density (Equation 15). So the ratio q is the N-th root of the full joint transition likelihood ratio. This normalization changes the clipped surrogate and must be kept in a reproduction. It is not an exact untempered joint-policy likelihood-ratio estimator. Two surrogates Both clipped surrogates share one definition (Equation 16). The ratio clip is 10-3. And the reference advantage is clipped to between -5 and 5, with gradients stopped. Both use the same sampled transition and normalized ratio, but express different preferences. One is realized portfolio reward. The other is relative support by the reference policy. Reference term The reference term is a scaled Gaussian divergence (Equation 17). The denominator uses the diffusion coefficient, not the full transition variance. The on-policy distillation surrogate uses a detached difference of reference. Old-policy log densities on the same transition. The reference is a frozen IL trading policy, with no hindsight text hints. There is no EMA teacher and no noise-only optimization. Dropout is off in rollout and likelihood recomputation. Gradients update only the action head. The training loop The frozen backbone encodes each context. Equation 3 trains the head before a copy is kept as the reference. Refinement samples eight old-policy stochastic paths per context. Stores their states and mean log densities. Final portfolios are decoded, rescaled to gross 0.85 and scored on the forward return window. After group-relative advantages, the trainable and reference heads recompute the sampled densities. Equation 5 averages over contexts, candidates and ten transitions to update the head. Deployment Deployment keeps the head but uses the shorter deterministic path. A timestamp seeds the initial latent. Four Euler steps make the action, which is centered and divided by c = 10. The rounded target enters the next ledger bar. Scoring compares fixed candidate books over a local horizon. Deployment makes a sequence whose changes cost fees. B.4 Closed-loop variant and deployment-aligned objectives They start from one Flow-GRPO policy. Give its head the current holdings as extra input. For each asset, six holdings features are embedded by a two-layer MLP. Added to that asset's action token. The features are the position, its signed logarithm, whether it is held. And the gross and net exposure of the book. The last MLP layer starts at zero, so training starts exactly from the trained policy. Training runs 2000 steps with a learning rate of 10-5 and batch size 16. Training objective MDD Sharpe and Calmar TO AllocFlow (gross-normalized Sharpe) 12.81 2.192 and 4.043 1.976 Sharpe scaled by gross exposure 18.1 1.76 and 2.76 2.07 Sharpe after fees 26.0 1.37 and 1.98 1.30 Closed loop with holdings input 11.9 2.15 and 4.59 1.38
Table 10: deployment-aligned objectives
The alternatives are single runs with the same seed as the closed-loop variant.
B.5 Gaussian one-pass Transformer It is a bidirectional stochastic Transformer policy with about 1.0B parameters. Matched to the flow head. It reads the same tokens. It outputs a mean book and samples actions from a Gaussian. Stage 2 uses the same GRPO code. Eight candidates per state, the same 24-bar gross-normalized Sharpe reward. Same clipping, KL and distillation terms. And 2000 steps. The sigma = 0.2 run is the one in Table 2a. Settings other than sigma = 0.4 trade about three times the book per day. B.6 Recorded configuration and reproducibility boundaries Component Recorded setting Market cadence and universe Hourly; dynamic top 20; weekly reconstitution Backbone Frozen Kronos-base with its base tokenizer Main flow head 32 layers; 32 attention heads; head dimension 48; about 1.03B parameters IL dropout and time sampling 0.2; 0.999(1 - U), U from Beta(1.5, 1.0); 1,000 time buckets Action scale and execution grid c = 10; grid 0.1 allocation units for notional 10 IL auxiliary coefficients Score 1.0; weight 0.5; ranking 0.05; gross 0.1 RL sampler 8 candidates; 10 stochastic transitions; noise coefficient 0.7 RL objective Ratio clip 10-3; advantage clip 5; reference coefficient 0.004; OPD 0.1 Inference 4 Euler steps; timestamp-seeded initial noise Execution cost 5 bps per absolute traded weight; net daily metrics
Table 11: training and inference configuration
C Appendix C: accounting and comparison details Show in original C.1 Ledger metrics and timing The accounting The grid-rounded target made from bars up. To time t becomes the position for the next bar. Gross return is the target times the next return. Turnover is the sum of absolute target changes. Net return is gross return minus 0.0005 times turnover (Equation 18). Turnover is measured on changes of the target book. The metrics Sum net return and turnover per day. D is the number of evaluated days. Annualized return uses a 365-day year. Sharpe is the 365-day-scaled mean daily net return over its standard deviation. TO is the mean daily turnover. MDD is the largest peak-to-trough drop in cumulative net return. Calmar is annualized return over MDD (Equations 19 and 20). The risk-free benchmark is zero. A zero-book run has no meaningful Sharpe or Calmar, so tables show No Trade (NT). Limits Native data alignment gives 423-425 evaluation days across methods. A common arithmetic convention does not equalize fills, rebalancing or asset availability. Additive drawdown can exceed 100% in this bookkeeping, as for some negative baselines. Such values do not mean a funded account could continue after insolvency. Training rewards Training rewards use fixed candidate weights over H forward hourly returns. The code's after-cost variants compare the candidate with the model's deterministic previous-bar portfolio. Penalize that change. That differs from replaying a whole future sequence of hourly decisions and their rebalancing costs. C.2 The 2026 out-of-sample period Table 12 compares the original test with January to June 2026. Using the same trained policy with no retraining. The 2026 test also settles funding for each contract on its own 4-hour. Or 8-hour schedule. Using the exchange's funding history. On the original test. Settling funding this way keeps every metric within its variation across seeds. Period Return MDD Sharpe and Calmar Nov 2024 to Dec 2025 (Table 1) 51.38 +-2.04 12.81 +-1.51 2.192 +-0.086 and 4.043 +-0.379 Jan to Jun 2026 (new) 62.53 12.77 2.06 and 4.90
Table 12: out-of-sample periods
C.3 Trading fees and bid-ask spread The 5 bps fee is the highest of actual base-tier fees at major perpetual-futures venues. Fees in earlier crypto papers (Table 13). Higher volume tiers, discounts and maker orders only lower rates. Discounts: 10% when paying in BNB on Binance, up to 40% for staking on Hyperliquid. The backtest charges the base-tier taker fee. It does so on every change of the target book at every hourly rebalance. A policy trading toward a target could use limit orders. Those pay a maker fee of at most 2 bps. All methods are tested with the same fee. Spread AllocFlow trades high-volume USD-margined perpetual contracts on Binance, re-picked each week by 60-day volume. These have deep order books and are typically quoted at one tick of spread. Half a tick is 0.24 bps of price for the median traded asset-hour. Under 5% of the 5 bps fee. It is 0.44 bps when weighted by traded volume, and 0.006 bps for BTC. Venue Type Taker Maker Binance USD-M CEX 5.0 2.0 OKX CEX 5.0 2.0 Hyperliquid DEX 4.5 1.5 Coinbase International CEX 4.0 2.0
Table 13 (left): base-tier perpetual-futures fees at major venues, in bps
Paper Market Fee Borrageiro et al. BitMEX perpetual, 5 min 5 EarnHFT Binance, second-level 2 MacroHFT Binance, minute-level 2 ArchetypeTrader crypto long-short, 10 min 2 FineFT Binance perpetual, 5 min 2 AllocFlow (ours) crypto perpetual, 1 h 5
Table 13 (right): fees per trade in published crypto trading papers, in bps
C.4 Pure-RL baselines They train three recent methods (MARS, ReCAP, DeepAries). Eight classic RL algorithms from scratch on this data. Each uses its published architecture and hyperparameters, adapted to the rotating universe. Data, split, fee and ledger are the same as AllocFlow. Long-only methods stay long-only. For each classic algorithm they train long-only. Long-short variants (19 agents in total) and report the better. It is long-only in every case. Method Return MDD Sharpe MARS 25.9 52.3 0.50 DeepAries -13.1 89.1 -0.15 ReCAP -253.1 409.5 -2.03 DDPG -19.4 83.9 -0.23 PPO -35.9 106.3 -0.41 A2C -55.8 129.2 -0.63 SAC -59.3 130.0 -0.67 TD3 -80.5 151.1 -0.91 MADDPG -6.8 45.3 -0.10 MAPPO -48.3 114.3 -0.58 DQN -76.7 129.4 -1.06 BTC buy-and-hold 23.8 37.7 0.55 AllocFlow (IL + Flow-GRPO) 51.38 +-2.04 12.81 +-1.51 2.192 +-0.086
Table 14: pure-RL trading methods trained from scratch
Returns are annualized arithmetic returns on fixed notional, so very high turnover with the fee can go below -100%.
C.5 Direct differentiable optimization Set-up Table 15 lists the four DRaFT settings of Section 5.5. The loss joins the Sharpe reward with an L1 anchor to the IL book. A penalty on gross exposure. All runs start from the same IL checkpoint. They back-propagate the gross-normalized 24-bar Sharpe through the deterministic 4-step ODE for 2000 steps. Why policy gradients Policy gradients are preferable for three reasons. First, Flow-GRPO needs only reward values. So it also works on books rounded to the execution grid. Such as deployed after-fee PnL,. Which give no useful pathwise gradient. Second, each pathwise gradient follows one 24-hour price path. So a larger reward weight mainly raises turnover, to 3.59. 4.50 per day in DRaFT 2 and 4. Group-relative scoring standardizes rewards within a group and clips the advantage, which resists heavy-tailed returns. Third, the stochastic sampler that makes diverse books also gives closed-form likelihoods for Flow-GRPO. Setting Learning rate Reward and anchor weight Calmar, Sharpe, TO IL start - - 0.955, 0.954, 1.143 DRaFT 1 10-5 0.1 and 1.0 1.14, 1.07, 1.17 DRaFT 2 10-5 1.0 and 1.0 1.04, 0.87, 3.59 DRaFT 3 5 x 10-5 0.1 and 1.0 1.74, 1.41, 1.19 DRaFT 4 10-5 1.0 and 0.1 0.95, 0.80, 4.50 Flow-GRPO (ours) - - 4.043, 2.192, 1.976
Table 15: DRaFT against Flow-GRPO from the same IL checkpoint
D Appendix D: additional related context Show in original Forecasting, control and execution Generating a portfolio does not remove the links between forecasting, control and execution. Formulaic alphas stay useful as readable signals and can supply strategy demos. Dynamic trading theory models the cost of adjusting toward a target. Deep hedging learns actions under trading constraints. So choosing a target book. Choosing the cost-aware path to it are related but different problems. AllocFlow learns the first. Its sequence is judged through a fee-charging ledger. Section 5.5 shows holdings-conditioned control extends AllocFlow directly. Adjacent work Adjacent preprints: adversarial inverse-RL trading with demos from many behaviors. And AlphaZeroBeta for market-neutral portfolio RL. Generative portfolio research also uses diffusion to model market environments. Decision-weighted flow matching targets distributions useful for downstream stochastic optimization. These works motivate separating what is generated from how it is used. In AllocFlow, a sample is the joint signed action itself. And the same action model joins imitation and RL. E Appendix E: terminology Show in original Term Definition Bar Market data aggregated over one fixed time interval; AllocFlow uses 1-hour bars. OHLCV The open, high, low and close prices and the traded volume within a bar. Kronos A financial foundation model pretrained to predict the next bar from tokenized OHLCV sequences; AllocFlow keeps it frozen and uses its hidden states as features. Perpetual future A futures contract without expiry that can be held long or short; holders of long and short positions exchange periodic funding payments. Long-short target book The signed weights over the eligible assets that the policy outputs every hour; positive weights are long and negative weights are short. Gross exposure The sum of absolute weights. Turnover (TO) The average daily sum of absolute weight changes. Basis point (bps) 0.01%; a 5 bps fee costs 0.05% of the traded value. Sharpe ratio Annualized mean of daily net returns divided by their standard deviation. Maximum drawdown (MDD) The largest peak-to-trough loss of cumulative net return. Calmar ratio Annualized net return divided by MDD. Teacher strategy The strategy whose portfolios the action head imitates in stage 1.
Table 16: terminology
Words to know Basis point: One hundredth of one percent.Calmar ratio: Annualized net return divided by the largest peak-to-trough loss.Flow matching: A way to train a model that moves random noise toward real samples.Group-relative RL: RL that scores a group of candidates against each other on the same task.Imitation learning: Training a model to copy the actions of a teacher.Maximum drawdown: The largest drop from a peak to a later low.Perpetual future: A futures contract with no expiry that can be held long or short.Reinforcement learning: Training a model from rewards earned by its own actions.Sharpe ratio: Average return divided by how much returns vary.Target book: The signed weights across all assets that the policy outputs.Ask AI about this paper Stuck on a word or an idea? Ask in plain words. The answer comes from the write-up on this page.
Ask AI about this paper Explain it like I am new to AI How would a finance team use this? What are the limits?
Jump to