atlas

Research map / Large language models / Agents, code and math

Divide-and-Conquer Meets Consensus: Unleashing the Power of Functions in Code Generation

NeurIPS 2024 · Large language models › Agents, code and math · approach: Code generation benchmarks · 1 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.

Proposes FunCoder, a code generation framework that recursively divides problems into a tree of sub-functions and conquers them bottom-up, selecting each function via a functional consensus based on input-output agreement among sampled candidates.

Problem

LLMs struggle with code generation for complex requirements; plan-and-solve decomposition fixes plans upfront, multi-agent frameworks are heavy, and self-generated tests are often unreliable, so self-refinement can mislead.

Approach

Dynamic divide-and-conquer: the model introduces sub-function stubs during generation, forms a dependency tree, implements children first and composes them bottom-up; at each node, candidates are chosen by maximal pairwise behavioral similarity on LLM-generated inputs (functional consensus) instead of self-written assertions.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use Funcoder instead of the strongest reported baselineGPT-3.5 · HumanEvalPass@1: 82.9 -> 85.4Helped
Use Funcoder instead of the strongest reported baselineGPT-4 · HumanEvalPass@1: 91.0 -> 94.5Helped
Use Funcoder instead of the strongest reported baselineGPT-3.5 · MBPPPass@1: 76.0 -> 78.5Helped
Use Funcoder instead of the strongest reported baselineGPT-4 · MBPPPass@1: 77.1 -> 79.5Helped
Use Funcoder instead of the strongest reported baselineGPT-3.5 · xCodeEval AllPass@1: 23.2 -> 31.4Helped
Use Funcoder instead of the strongest reported baselineGPT-4 · xCodeEval AllPass@1: 44.0 -> 48.6Helped
Use Funcoder instead of the strongest reported baselineGPT-3.5 · MATH OverallEM-gpt: 48.6 -> 54.0Helped
Use Funcoder instead of Cumulative ReasoningGPT-4 · MATH OverallEM-gpt: 72.2 -> 78.2Helped
Add divide-only decomposition (ablation)Funcoder on GPT-3.5 · HumanEvalPass@1: 68.3 -> 72.6Helped
Add bottom-up conquer after divide (ablation)Funcoder on GPT-3.5 · HumanEvalPass@1: 72.6 -> 78.7Helped
Replace consensus with Self-Test@11 (ablation)Two-pass Funcoder on GPT-3.5 · HumanEvalPass@1: 85.4 -> 80.5Hurt
Replace consensus with Clustering@11 (ablation)Two-pass Funcoder on GPT-3.5 · HumanEvalPass@1: 85.4 -> 75.0Hurt

Surprising findings

Limitations

Experimental setup

Datasets: HumanEval MBPP xCodeEval MATH

Benchmarks: HumanEval MBPP xCodeEval MATH

Metrics: Pass@1 EM-GPT (GPT-4 judged equivalence)

Baselines: Standard prompting CodeT Reflexion LDB MetaGPT Parsel Chain-of-Thought Program-of-Thought Self-Refine Cumulative Reasoning

Builds on: Parsel CodeT Reflexion Program-of-Thought Self-Refine

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