Algorithmic Efficiency Gap: LLMs' Suboptimal Solutions
LLMs often struggle to generate code with optimal algorithmic efficiency, frequently defaulting to suboptimal solutions (e.g., O(n) instead of O(log n) for Fibonacci) even for problems requiring advanced algorithms.
The top 3
- Top Algorithmic Efficiency Gaps for LLMs: LLMs exhibit the largest algorithmic efficiency gaps in complex domains such as dynamic programming, graph algorithms, and intricate optimization problems, frequently generating suboptimal solutions where human expertise is critical.
- LLM vs. Human Code Efficiency: Performance Gap: LLM-generated code is often 19% slower and notably more complex (higher cyclomatic complexity) than human-optimized solutions. Even strong models like GPT-4 achieve low efficiency scores (e.g., eff@1 of 0.454) on advanced algorithmic tasks, despite high functional correctness (pass@1 of 0.831).
- LLMs' Key Algorithmic Efficiency Hurdles: LLMs often generate code with higher cyclomatic complexity and exhibit over-engineering, particularly struggling with deep mathematical reasoning and problems demanding sophisticated techniques like dynamic programming or complex graph algorithms.
Sources
Open the full topic