QuantCode Model: Specializing Language Models for Executable Algorithmic Trading Code
Alexey Chernysh, Orkhan Ekhtibarov, Dmitry Zmitrovich
Key points
From the paper's conclusion- We study two complementary mechanisms for specializing language models for algorithmic trading: continued pretraining on algorithmic-trading framework code and supervised fine-tuning on agent-validated request-to-code pairs.
- Continued pretraining improves single-turn Judge Pass from 41.5% to 47.5% for Qwen3.5-397B-A17B and from 27.8% to 33.0% for Qwen3.6-35B-A3B. SFT applied after continued pretraining yields a larger gain for Qwen3.6-35B-A3B, reaching 58.2% Judge Pass and 83.5% successful backtests.
- Continued pretraining and SFT improve Judge Pass and successful backtests for algorithmic trading code generation.
Abstract
Large language models are strong general-purpose code generators, but executable algorithmic trading remains a demanding specialization target: a model must translate a natural-language strategy specification into correct program logic for a specialized trading framework, execute on historical data, produce trades, and remain semantically faithful to the request. We study two complementary mechanisms for specializing language models for this setting: continued pretraining on algorithmic-trading framework code and supervised fine-tuning (SFT) on agent-validated request-to-code pairs. Evaluation is centered on QuantCode-Bench, our 400-task benchmark for Backtrader strategy generation, together with a repository-level SWE-bench-like track. Continued pretraining improves single-turn Judge Pass from 41.5% to 47.5% for Qwen3.5-397B-A17B and from 27.8% to 33.0% for Qwen3.6-35B-A3B. SFT applied after continued pretraining yields a larger gain for Qwen3.6-35B-A3B, reaching 58.2% Judge Pass and 83.5% successful backtests; in agentic evaluation it raises first-turn success from 22.3% to 58.3% and final success after up to 10 turns from 47.5% to 79.5%. Continued pretraining alone improves first-turn agentic success but lowers final success after repair from 47.5% to 32.5%, consistent with degraded instruction following, whereas SFT improves both. We also identify a capability-retention failure: domain specialization degrades parser-conformant structured tool calling, and targeted recovery SFT restores tool-call formatting but not the base checkpoint's repository-level agent performance. The results show that framework-oriented pretraining, validated SFT, and explicit capability-retention evaluation address distinct failure modes in domain-specific executable code generation.
Read the paper
Discussion · 1
Science Skim's AI key points, plus readers' public thoughts
- We study two complementary mechanisms for specializing language models for algorithmic trading: continued pretraining on algorithmic-trading framework code and supervised fine-tuning on agent-validated request-to-code pairs.
- Continued pretraining improves single-turn Judge Pass from 41.5% to 47.5% for Qwen3.5-397B-A17B and from 27.8% to 33.0% for Qwen3.6-35B-A3B. SFT applied after continued pretraining yields a larger gain for Qwen3.6-35B-A3B, reaching 58.2% Judge Pass and 83.5% successful backtests.
- Continued pretraining and SFT improve Judge Pass and successful backtests for algorithmic trading code generation.
Readers' thoughts
No reader thoughts yet.
Related papers
- MintEval: Do LLMs Implement the Trading Strategy You Asked For? A Behavioural-Equivalence Benchmark for Natural-Language-to-Strategy CodearXiv · 2026
- Reliable Before Profitable: QuantHarness for Governing Financial Strategy Development with LLM AgentsarXiv · 2026
- Quant-Arena: Benchmarking LLM Agents for Quantitative Trading ResearcharXiv · 2026
- Beyond Benchmarks: Can Small Open-Weight Models Get Real Coding Work Done?arXiv · 2026
- SWE-Critix: Post-Training Generalist Verifiers for Assessing Coding-Agent TrajectoriesarXiv · 2026
- FINCOSMOS: An Open-World Evaluation Paradigm for Agents in FinancearXiv · 2026