HyperAIHyperAI

Command Palette

Search for a command to run...

3 months ago

MoTCoder: Elevating Large Language Models with Modular of Thought for Challenging Programming Tasks

Jingyao Li Pengguang Chen Bin Xia Hong Xu Jiaya Jia

MoTCoder: Elevating Large Language Models with Modular of Thought for Challenging Programming Tasks

Abstract

Large Language Models (LLMs) have showcased impressive capabilities in handling straightforward programming tasks. However, their performance tends to falter when confronted with more challenging programming problems. We observe that conventional models often generate solutions as monolithic code blocks, restricting their effectiveness in tackling intricate questions. To overcome this limitation, we present Module-of-Thought Coder (MoTCoder). We introduce a framework for MoT instruction tuning, designed to promote the decomposition of tasks into logical sub-tasks and sub-modules. Our investigations reveal that, through the cultivation and utilization of sub-modules, MoTCoder significantly improves both the modularity and correctness of the generated solutions, leading to substantial pass@1 improvements of 5.9% on APPS and 5.8% on CodeContests. MoTCoder also achieved significant improvements in self-correction capabilities, surpassing the current SOTA by 3.3%. Additionally, we provide an analysis of between problem complexity and optimal module decomposition and evaluate the maintainability index, confirming that the code generated by MoTCoder is easier to understand and modify, which can be beneficial for long-term code maintenance and evolution. Our codes are available at https://github.com/dvlab-research/MoTCoder.

Code Repositories

dvlab-research/motcoder
Official
pytorch
Mentioned in GitHub

Benchmarks

BenchmarkMethodologyMetrics
code-generation-on-appsMoTCoder-7B-V1.5
Competition Pass@1: 21.18
Interview Pass@1: 32.63
Introductory Pass@1: 54.26
code-generation-on-appsMoTCoder-32B-V1.5
Competition Pass@1: 27.84
Interview Pass@1: 44.49
Introductory Pass@1: 68.44
code-generation-on-codecontestsMoTCoder-7B-v1.5
Test Set pass@1: 20.77
Val Set pass@1: 16.72
code-generation-on-codecontestsMoTCoder-15B
Test Set pass@1: 26.34
Val Set pass@1: 20.35

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing
Get Started

Hyper Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp
MoTCoder: Elevating Large Language Models with Modular of Thought for Challenging Programming Tasks | Papers | HyperAI