mlsanityData to 14 Oct 2026

QuantCode Model: Specializing Language Models for Executable Algorithmic Trading Code

arXiv 2609.39420 ↗First posted 30 Sep 2026cs.CL cs.LG q-fin.TRcited by 0

On the map: LLM agents and tool use → Financial trading and forecasting agents

Abstract (arXiv)

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.

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Financial trading and forecasting agents, one of 16 directions in LLM agents and tool use. Builds on 17 of its 18 references that are in the map. First posted on arXiv 30 Sep 2026.

Builds on

17 of 18 references.

References · 17

  1. 2025Qwen3 Technical Reportcited by 8,820
  2. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
  3. 2023Code Llama: Open Foundation Models for Codecited by 2,139
  4. 2020Don't Stop Pretraining: Adapt Language Models to Domains and Taskscited by 1,565
  5. 2022Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference timecited by 1,396
  6. 2023Gorilla: Large Language Model Connected with Massive APIscited by 1,332
  7. 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
  8. 2022Editing Models with Task Arithmeticcited by 1,120
  9. 2024OpenHands: An Open Platform for AI Software Developers as Generalist Agentscited by 1,002
  10. 2023Language Models are Super Mario: Absorbing Abilities from Homologous Models as a Free Lunchcited by 694
  11. 2023An Empirical Study of Catastrophic Forgetting in Large Language Models During Continual Fine-tuningcited by 639
  12. 2026GLM-5: from Vibe Coding to Agentic Engineeringcited by 587
5 more
  1. 2024StarCoder 2 and The Stack v2: The Next Generationcited by 502
  2. 2024Training Software Engineering Agents and Verifiers with SWE-Gymcited by 336
  3. 2024Arcee's MergeKit: A Toolkit for Merging Large Language Modelscited by 194
  4. 2026QuantCode-Bench: A Benchmark for Evaluating the Ability of Large Language Models to Generate Executable Algorithmic Trading Strategiescited by 4
  5. 2026FINESSE-Bench: A Hierarchical Benchmark Suite for Financial Domain Knowledge and Technical Analysis in Large Language Modelscited by 4

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2024QuantAgent: Seeking Holy Grail in Trading by Self-Improving Large Language Model
  2. 2026Backtrader-Bench: Benchmarking LLM Agents on Algorithmic Trading with Self-Generated MCQs
  3. 2026BacktestBench: Benchmarking Large Language Models for Automated Quantitative Strategy Backtesting
  4. 2025Technical Report: Full-Stack Fine-Tuning for the Q Programming Language
  5. 2026QuantEval: A Benchmark for Financial Quantitative Tasks in Large Language Models
  6. 2025Language Model Guided Reinforcement Learning in Quantitative Trading
  7. 2026Agentic Trading: When LLM Agents Meet Financial Markets
  8. 2026Beyond Agent Architecture: Execution Assumptions and Reproducibility in LLM-Based Trading Systems