atlas

Research map / Large language models / Reasoning and chain of thought

EffiLearner: Enhancing Efficiency of Generated Code via Self-Optimization

NeurIPS 2024 · Large language models › Reasoning and chain of thought · approach: Efficient LLM serving · 5 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 EffiLearner, a training-free self-optimization loop where an LLM revises its generated code using line-level execution-time and memory profiles, improving efficiency of correct code on EffiBench, HumanEval, and MBPP.

Problem

LLM-generated code is often correct but inefficient in execution time and memory usage, and existing feedback methods focus mainly on correctness rather than efficiency.

Approach

Feed line-level execution-time and memory profiles (from line_profiler and memory_profiler) back to the same LLM over several iterations so it can revise code to reduce overhead, while only keeping code that passes open test cases.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use overhead-profile feedback for iterative code self-optimizationStarCoder2-15B · EffiBenchET (s): 0.93 -> 0.12; 87.1%Helped
Use overhead-profile feedback for iterative code self-optimizationStarCoder2-15B · EffiBenchTMU (Mb*s): 22.02 -> 2.03; 90.8%Helped
Use overhead-profile feedback for iterative code self-optimizationDeepSeek-6.7B-Ins · EffiBenchMU (Mb): 259.73 -> 36.97; 85.8%Helped
Use overhead-profile feedback for iterative code self-optimizationGPT-3.5-Turbo-0301 · EffiBenchET (s): 0.36 -> 0.28; 22.2%Helped
Use overhead-profile feedback for iterative code self-optimizationCodeLlama-70B · EffiBenchET (s): 0.52 -> 0.47; 9.6%Helped
Use overhead-profile feedback for iterative code self-optimizationStarCoder2-15B · EffiBenchMU (Mb): 26.35 -> 27.67; -5.0%Hurt
Replace detailed profiler feedback with no additional feedback (ablation)CodeLlama-70B · EffiBenchET (s): 0.52 -> 0.79; -51.9%Hurt
Replace detailed profiler feedback with result metrics (ET, MU, TMU) (ablation)CodeLlama-70B · EffiBenchTMU (Mb*s): 203.92 -> 1270.93; -523.2%Hurt
Use memory-profiler feedback only instead of both profiles (ablation)CodeLlama-70B · EffiBenchET (s): 0.52 -> 0.53; -1.9%Hurt
Use execution-time-profiler feedback only instead of both profiles (ablation)CodeLlama-70B · EffiBenchET (s): 0.52 -> 0.51; 1.9%Hurt
Increase self-optimization from one to five steps (ablation)GPT-3.5-Turbo-0301 · EffiBenchET (s): 0.33 -> 0.28Helped
Increase self-optimization from one to five steps (ablation)CodeLlama-70B · EffiBenchTMU (Mb*s): 14.91 -> 14.53Helped

Surprising findings

Limitations

Experimental setup

Datasets: EffiBench HumanEval MBPP HumanEval-Plus MBPP-Plus

Benchmarks: EffiBench HumanEval MBPP

Metrics: Execution Time (ET) Normalized Execution Time (NET) Max Memory Usage (MU) Normalized Max Memory Usage (NMU) Total Memory Usage (TMU) Normalized Total Memory Usage (NTMU) pass@1

Baselines: Unsupervised Self-Refine Result-Aware Self-Refine Self-Edit PIE Critic Supersonic

Builds on: Self-Refine EffiBench EvalPlus Self-Debug

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