AdaptiveLLM: A Framework for Selecting Optimal Cost-Efficient LLM for Code-Generation Based on CoT Length
Junhang Cheng, Fang Liu, Chengru Wu, Li Zhang

TL;DR
AdaptiveLLM introduces a dynamic framework that automatically assesses task difficulty using Chain-of-Thought lengths and selects the most cost-efficient LLM, significantly improving code generation performance while reducing resource use.
Contribution
It presents a novel difficulty-aware model selection framework for LLM-based code generation, leveraging CoT length analysis and machine learning for cost-performance optimization.
Findings
7.86% improvement in pass@1 score
88.9% reduction in resource consumption
15% accuracy improvement over single models
Abstract
While Large Language Models (LLMs) have significantly advanced code generation efficiency, they face inherent challenges in balancing performance and inference costs across diverse programming tasks. Dynamically selecting the optimal LLM based on task difficulty and resource constraints offers a promising approach to achieve an optimal balance between efficiency and performance. However, existing model selection methods are resource-intensive and often neglect cost efficiency. Moreover, these approaches rely on human-annotated difficulty labels that are frequently inaccessible in real-world settings and may not align with the LLM's own assessment of task difficulty. In this paper, we introduce AdaptiveLLM, a framework that dynamically selects optimal LLMs for a given coding task by automatically assessing task difficulty. Our framework first estimates task difficulty using…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsText Readability and Simplification · Topic Modeling · Software Engineering Research
