Large language models (LLMs) have significantly advanced automatic code generation, yet most existing approaches rely on single-model inference, making their performance susceptible to model-specific limitations and failure patterns. To address this, we introduce Cross-Model Collaborative Scheduling (CMCS), a framework that enables multiple LLMs to collaboratively generate code. At its core, CMCS combines execution-guided self-correction with a peer-to-peer corrective handover mechanism, transferring unresolved problems between models to leverage their complementary strengths and mitigate the limitations of any single model. Experiments on eight code generation benchmarks show that CMCS achieves the strongest performance among the evaluated comparable-scale approaches with strong parameter efficiency. In particular, two 7B-scale models consistently outperform a much larger 30B-scale model on every benchmark where both are evaluated. When applied to proprietary models, CMCS boosts Pass@1 on APPS to 36.00%, more than three times that of the stronger individual model (11.33%). CMCS also maintains competitive accuracy when only 20% of test cases are available for diagnostic feedback. Ablation, scalability, and cost-effectiveness analyses quantify component contributions and practical deployment trade-offs. These findings indicate that cross-model collaboration offers a practical and parameter-efficient alternative to scaling up monolithic models for code generation.
Jiangping Huang, Wen-Guang Ye, Weisong Sun et al.· ACM Transactions on Software...· 0 citations