EffiPair: Improving the Efficiency of LLM-generated Code with Relative Contrastive Feedback
- URL: http://arxiv.org/abs/2604.05137v1
- Date: Mon, 06 Apr 2026 19:56:26 GMT
- Title: EffiPair: Improving the Efficiency of LLM-generated Code with Relative Contrastive Feedback
- Abstract summary: EffiPair is an inference-time iterative refinement framework that operates entirely at test time.<n>EffiPair consistently improves efficiency while preserving correctness.<n>With DeepSeek-Chat V3.2, EffiPair achieves up to 1.5x speedup over generation without performance feedback.
- Score: 9.090479141002605
- License: http://creativecommons.org/licenses/by/4.0/
- Abstract: Large language models (LLMs) often generate code that is functionally correct but inefficient in runtime and memory. Prior approaches to improving code efficiency typically rely on absolute execution feedback, such as profiling a single program's runtime or memory usage, which is costly and provides weak guidance for refinement. We propose Relative Contrastive Feedback (RCF), an inference-time feedback mechanism that requires no model fine-tuning or parameter updates. RCF compares two structurally similar programs for the same task and highlights the differences associated with better efficiency. Building on this idea, we introduce EffiPair, an inference-time iterative refinement framework that operates entirely at test time by generating multiple candidate solutions, identifying informative program pairs with large efficiency gaps, summarizing their execution differences into lightweight feedback, and using this signal to produce more efficient solutions. By replacing isolated scalar feedback with pairwise contrastive comparisons, EffiPair provides more direct guidance while reducing profiling and prompting overhead. Experiments on code-efficiency benchmarks show that EffiPair consistently improves efficiency while preserving correctness. For instance, with DeepSeek-Chat V3.2, EffiPair achieves up to 1.5x speedup over generation without performance feedback, while reducing token usage by more than 90% compared to prior work.
Related papers
- ADaPT: Token-Level Decoupling for Efficient Large Reasoning Models [48.426487984321675]
Large reasoning models rely on long chain-of-thought to achieve strong performance, but applying such reasoning uniformly incurs high computational cost.<n>Existing efficiency-oriented methods attempt to shorten or mix reasoning strategies, yet often degrade reasoning capability.<n>We propose Adaptive Dual-Process Thinking (ADaPT), a token-level dual-process framework that explicitly decouples efficiency and correctness signals during training.
arXiv Detail & Related papers (2026-06-18T08:11:45Z) - Chiseling Out Efficiency: Structured Skeleton Supervision for Efficient Code Generation [61.72280804975896]
Large Language Models (LLMs) are capable of generating syntactically correct and functionally complete programs, greatly streamlining software development.<n>Existing approaches to bridging this efficiency gap typically involve either iteratively optimizing code after generation or fine-tuning models on corpora of efficient code.<n>EffiSkel is an efficiency skeleton-guided framework that explicitly extracts and learns efficiency skeletons-abstract, reusable structural patterns efficient code.
arXiv Detail & Related papers (2026-06-05T01:49:20Z) - SimpleMem: Efficient Lifelong Memory for LLM Agents [73.74399447715052]
We introduce SimpleMem, an efficient memory framework based on semantic lossless compression.<n>We propose a three-stage pipeline designed to maximize information density and token utilization.<n> Experiments on benchmark datasets show that our method consistently outperforms baseline approaches in accuracy, retrieval efficiency, and inference cost.
arXiv Detail & Related papers (2026-01-05T21:02:49Z) - Towards Better Correctness and Efficiency in Code Generation [47.06216040246783]
We propose an efficiency-oriented reinforcement learning framework guided by a novel performance reward.<n>Online exploration is most effective when starting from a high-correctness baseline.<n>Experiments show the effectiveness of the method, which improves code correctness by 10.18% and runtime efficiency by 7.75% on a 7B model.
arXiv Detail & Related papers (2025-08-24T16:47:19Z) - Afterburner: Reinforcement Learning Facilitates Self-Improving Code Efficiency Optimization [46.33639431414019]
Large Language Models generate functionally correct solutions but often fall short in code efficiency.<n>We introduce a novel test-time iterative optimization framework to address this.
arXiv Detail & Related papers (2025-05-29T12:14:29Z) - Evaluating Language Models for Efficient Code Generation [13.175840119811]
We introduce Differential Performance Evaluation (DPE) to reliably evaluate Large Language Models (LLMs)
DPE focuses on efficiency-demanding programming tasks and establishing an insightful compound metric for performance evaluation.
As a proof of concept, we use DPE to create EvalPerf, a benchmark with 121 performance-challenging coding tasks.
arXiv Detail & Related papers (2024-08-12T18:59:13Z) - Federated Learning of Large Language Models with Parameter-Efficient
Prompt Tuning and Adaptive Optimization [71.87335804334616]
Federated learning (FL) is a promising paradigm to enable collaborative model training with decentralized data.
The training process of Large Language Models (LLMs) generally incurs the update of significant parameters.
This paper proposes an efficient partial prompt tuning approach to improve performance and efficiency simultaneously.
arXiv Detail & Related papers (2023-10-23T16:37:59Z) - Building an Efficiency Pipeline: Commutativity and Cumulativeness of
Efficiency Operators for Transformers [68.55472265775514]
We consider an efficiency method as an operator applied on a model.
In this paper, we study the plausibility of this idea, and the commutativity and cumulativeness of efficiency operators.
arXiv Detail & Related papers (2022-07-31T18:01:06Z) - FastRE: Towards Fast Relation Extraction with Convolutional Encoder and
Improved Cascade Binary Tagging Framework [13.4666880421568]
We propose a fast relation extraction model (FastRE) based on convolutional encoder and improved cascade binary tagging framework.
FastRE achieves 3-10x training speed, 7-15x inference speed faster, and 1/100 parameters compared to the state-of-the-art models.
arXiv Detail & Related papers (2022-05-05T07:59:51Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.