TL;DR
This paper introduces SWE-IF, a new benchmark and taxonomy (VERICODE) for evaluating Large Language Models (LLMs) in code generation. It moves beyond just functional correctness to incorporate "vibe check" aspects like code style and documentation, finding that a combination of functional correctness and instruction following best predicts human preference.
What Problem Does This Paper Address?
The rise of "vibe coding" – where users iteratively refine code with LLMs until it "feels right" – highlights a gap in current code evaluation. Traditional metrics like pass@k only measure functional correctness, ignoring crucial non-functional aspects that humans consider, such as readability, intent preservation, and adherence to coding standards. This disconnect means LLMs can achieve high scores on functional benchmarks while still failing to satisfy users in real-world scenarios. The authors hypothesize that instruction following is the missing piece in bridging this gap.
Methods
The core contribution is the VERICODE taxonomy, a set of 30 verifiable code instructions categorized into Coding Style, Logic & Code Patterns, Documentation, Error Handling, and Library Constraints. Each instruction is paired with a deterministic verifier, often leveraging Python linters like Ruff. This taxonomy is used to create SWE-IF, an augmented evaluation testbed that combines traditional functional tests with these new instruction-following checks. SWE-IF supports two interaction patterns: single-turn generation (all instructions at once) and multi-turn editing (instructions introduced sequentially). The authors also developed an LLM-based system to select relevant and non-conflicting instructions for each query.
Datasets
The paper augments two existing benchmarks:
- BigCodeBench: Used for real-world programming tasks.
- LiveCodeBench: Used for algorithmic and contest programming problems.
The augmented versions are named Big-SWE-IF and Live-SWE-IF, respectively. The authors also use LMArena, a large source of human preference data for coding, to correlate their metrics with human judgments.
Key Insights and Ideas
- "Vibe Check" is More Than Just Functionality: Human preference in coding is a complex mix of functional correctness and adherence to non-functional instructions.
- Instruction Following is Crucial: While functional correctness is important, instruction following emerges as a key differentiator, especially for advanced models.
- Non-Functional Constraints Hurt Functionality: Adding non-functional instructions, even simple ones, can lead to a noticeable decrease in functional correctness (functional regression).
- Multi-Turn Editing Aids Instruction Following: Models are better at following instructions when they are introduced sequentially in a multi-turn editing process, though this comes at the cost of increased functional regression.
- Position Matters: Models exhibit biases in instruction following, with single-turn generation favoring the first instruction (primacy bias) and multi-turn editing favoring the last (recency bias).
- Different Tasks Value Different Aspects: For real-world coding, instruction following is more critical, while for algorithmic tasks, functional correctness holds a slight edge.
Key Results
- Adding just five non-functional instructions can cause functional regression rates of 5-10% for top models on benchmarks like Live-SWE-IF.
- Even the best-performing LLMs struggle with multiple instructions, with success rates dropping significantly as the number of constraints increases. For instance, under five instructions, task-level success rates can fall below 50%.
- Multi-turn editing consistently yields higher instruction-following scores (e.g., 3-8% advantage on Live-SWE-IF) compared to single-turn generation.
- A composite score combining functional correctness and instruction following shows the strongest correlation with human preference, outperforming either metric alone. For example, on Big-SWE-IF, the optimal blend for Spearman correlation was 70% instruction following.
Limitations and Future Work
- Language Focus: The current study is Python-centric, though the framework is designed to be language-agnostic.
- Function-Level Tasks: The evaluation focuses on function-level tasks, which are a starting point but don't fully capture the complexity of real-world repository-level tasks.
- Deterministic Verifiers: While reliable and scalable, deterministic verifiers cannot capture subjective or open-ended requirements (e.g., API design, algorithmic elegance).
- Future Work: The authors suggest extending the framework to handle more complex, open-ended requirements, potentially using LLM-as-a-judge verification, and applying it to other languages and broader settings like repository-level benchmarks.
Summary updated