QuantCode Model: Specializing Language Models for Executable Algorithmic Trading Code
Summary
This paper studies how to specialize large language models for generating executable algorithmic trading code, showing that framework-oriented continued pretraining plus supervised fine-tuning on validated request-to-code pairs greatly improves success on the QuantCode-Bench benchmark and agentic strategy generation, while also revealing a capability-retention failure where domain specialization degrades structured tool calling.
View Cached Full Text
Cached at: 10/06/26, 08:54 AM
Paper page - QuantCode Model: Specializing Language Models for Executable Algorithmic Trading Code
Source: https://huggingface.co/papers/2609.39420
Abstract
Largelanguagemodelsarestronggeneral-purposecodegenerators,butexecutablealgorithmictradingremainsademandingspecializationtarget:amodelmusttranslateanatural-languagestrategyspecificationintocorrectprogramlogicforaspecializedtradingframework,executeonhistoricaldata,producetrades,andremainsemanticallyfaithfultotherequest.Westudytwocomplementarymechanismsforspecializinglanguagemodelsforthissetting:continuedpretrainingonalgorithmic-tradingframeworkcodeandsupervisedfine-tuning(SFT)onagent-validatedrequest-to-codepairs.EvaluationiscenteredonQuantCode-Bench,our400-taskbenchmarkforBacktraderstrategygeneration,togetherwitharepository-levelSWE-bench-liketrack.Continuedpretrainingimprovessingle-turnJudgePassfrom41.5%to47.5%forQwen3.5-397B-A17Bandfrom27.8%to33.0%forQwen3.6-35B-A3B.SFTappliedaftercontinuedpretrainingyieldsalargergainforQwen3.6-35B-A3B,reaching58.2%JudgePassand83.5%successfulbacktests;inagenticevaluationitraisesfirst-turnsuccessfrom22.3%to58.3%andfinalsuccessafterupto10turnsfrom47.5%to79.5%.Continuedpretrainingaloneimprovesfirst-turnagenticsuccessbutlowersfinalsuccessafterrepairfrom47.5%to32.5%,consistentwithdegradedinstructionfollowing,whereasSFTimprovesboth.Wealsoidentifyacapability-retentionfailure:domainspecializationdegradesparser-conformantstructuredtoolcalling,andtargetedrecoverySFTrestorestool-callformattingbutnotthebasecheckpoint’srepository-levelagentperformance.Theresultsshowthatframework-orientedpretraining,validatedSFT,andexplicitcapability-retentionevaluationaddressdistinctfailuremodesindomain-specificexecutablecodegeneration.
View arXiv pageView PDFAdd to collection
Get this paper in your agent:
hf papers read 2609\.39420
Don’t have the latest CLI?curl \-LsSf https://hf\.co/cli/install\.sh \| bash
Models citing this paper0
No model linking this paper
Cite arxiv.org/abs/2609.39420 in a model README.md to link it from this page.
Datasets citing this paper0
No dataset linking this paper
Cite arxiv.org/abs/2609.39420 in a dataset README.md to link it from this page.
Spaces citing this paper0
No Space linking this paper
Cite arxiv.org/abs/2609.39420 in a Space README.md to link it from this page.
Collections including this paper0
No Collection including this paper
Add this paper to acollectionto link it from this page.
Similar Articles
QuantCode-Bench: A Benchmark for Evaluating the Ability of Large Language Models to Generate Executable Algorithmic Trading Strategies
QuantCode-Bench is a new benchmark of 400 tasks evaluating LLMs on generating executable algorithmic trading strategies for the Backtrader framework, testing syntactic correctness, backtest execution, trade presence, and semantic alignment. The study finds that current models' main limitations lie in correctly operationalizing trading logic and API usage rather than syntax.
Post-Training Language Models for Gold-Medal Performance in Coding Competitions
This paper presents a specialization pipeline for post-training language models to achieve gold-medal performance in coding competitions, demonstrating top scores on IOI benchmarks using techniques like supervised fine-tuning and reinforcement learning.
Optimizing Models to Be Fast at Codegen (8 minute read)
Morph LLC describes three key techniques—training a speculator on coding output, auto-searching kernels on cheap GPUs, and writing a custom interconnect—to dramatically speed up open models like Qwen and DeepSeek for coding agent workloads, achieving up to 3x speculative decoding speedup and 97-162 tok/s on a $7K GPU.
I built a coding agent that gets 87% on benchmarks with a 4B parameter model, here's how
The author built SmallCode, a coding agent optimized for small local models, achieving 87% benchmark success with a 4B parameter model using techniques like compound tools, improvement loops, and token budgeting.
CodeAlchemy: Synthetic Code Rewriting at Scale
CodeAlchemy is a synthetic data generation framework that transforms publicly available code into semantically rich training data using five strategies, producing over 500 billion tokens and enabling small models to outperform much larger ones on code benchmarks.