atlas

Research map / Large language models / Language, safety and interpretability

Magicoder: Empowering Code Generation with OSS-Instruct

ICML 2024 · Large language models › Language, safety and interpretability · approach: Controlled text generation · 26 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Introduces OSS-Instruct, which prompts gpt-3.5-turbo with open-source code snippets to synthesize 75K coding instruction pairs, used to finetune CodeLlama-7B and DeepSeek-Coder-6.7B into Magicoder models, with Evol-Instruct continuation yielding MagicoderS variants.

Problem

Synthetic instruction data for code generated by LLMs (Self-Instruct, Evol-Instruct) relies on narrow predefined tasks and heuristics, inheriting LLM biases and limiting diversity and realism.

Approach

Use random 1-15 line snippets from real open-source code (starcoderdata) as seeds so a teacher LLM generates a self-contained coding problem and solution, giving diverse, realistic, controllable instruction data; it is orthogonal to Evol-Instruct and can be combined with it.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Add OSS-Instruct tuningCodeLlama-7B · HumanEval+pass@1 (%): 34.1 -> 55.5Helped
Add Evol-Instruct continuation after OSS-InstructMagicoder-CL (CodeLlama-7B) · HumanEval+pass@1 (%): 55.5 -> 66.5Helped
Add OSS-Instruct tuningCodeLlama-7B · DS-1000 completion overallpass@1: 28.0 -> 29.9Helped
Add Evol-Instruct continuation after OSS-InstructMagicoder-CL (CodeLlama-7B) · DS-1000 completion overallpass@1: 29.9 -> 37.5Helped
Train on non-Python data (32K) (ablation)CodeLlama-7B · HumanEval+pass@1: 34.1 -> 44.5Helped
Train on Python-only data (43K) instead of both sources (ablation)Magicoder-CL (CodeLlama-7B) · MultiPL-E other languagesaverage pass@1: 37.8 -> 32.7Hurt
Train on non-Python data only instead of both sources (ablation)Magicoder-CL (CodeLlama-7B) · HumanEval+pass@1: 55.5 -> 44.5Hurt
Replace OSS-Instruct data with comment-function pairs (ablation)CodeLlama-7B · MultiPL-Epass@1: 29.6 -> 24.1Hurt
Replace OSS-Instruct data with comment-function pairs (ablation)CodeLlama-7B · HumanEval+pass@1: 34.1 -> 34.1No clear effect
Use 20K OSS-Instruct data generated by Mixtral (ablation)CodeLlama-7B · HumanEval+pass@1: 34.1 -> 55.5Helped
Remove partially implemented/noisy samples (ablation)CodeLlama-7B trained on OSS-Instruct · HumanEval+pass@1: 55.5 -> 54.9Hurt

Surprising findings

Limitations

Experimental setup

Datasets: starcoderdata evol-codealpaca-v1 HumanEval MBPP DS-1000 GSM8K APPS

Benchmarks: HumanEval HumanEval+ MBPP MBPP+ MultiPL-E DS-1000 APPS

Metrics: pass@1

Baselines: CodeLlama-Python-7B WizardCoder-CL-7B WizardCoder-SC-15B WizardCoder-CL-34B GPT-3.5 Turbo GPT-4 Turbo DeepSeek-Coder-Instruct-6.7B StarCoder CodeGen-Mono

Builds on: Self-Instruct Evol-Instruct Code Alpaca WizardCoder EvalPlus

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy