TL;DR
VeriCode is a taxonomy of 30 verifiable coding instructions (style, logic, documentation, error handling, libraries). Each instruction is checked automatically via linters and AST analysis and returns pass or fail. The researchers extended the classic BigCodeBench and LiveCodeBench benchmarks with these instructions, creating Vibe Checker (renamed SWE-IF in the paper's v2) — a test environment that evaluates both functionality and instruction following.
LLMs struggle to juggle several instructions at once. When you add 5 non-functional instructions (for example, "max 79 characters per line" + "use pathlib instead of os.path" + "Google-style docstrings"), functionality drops by about 6-7% on average (5.85% and 6.61% on the two benchmarks), even though the instructions had nothing to do with whether the code works. Even the best model satisfies all 5 instructions only 47% of the time on real-world tasks and 41% on algorithmic ones (single-turn). Models show position bias: on real-world tasks, instructions in the middle of the list are followed slightly worse than those at the beginning or end.
The method works in two modes: single-turn (all instructions at once in one prompt) preserves functionality better but follows instructions worse; multi-turn (instructions added gradually) meets the requirements better but breaks working code more often. The main takeaway: human preferences in coding tasks correlate best with a mix of functionality and instruction following (the optimum is 40-70% weight on IF), not with working code alone.
Want this for your own case? Apply this study to your task: AI adapts its method to what you are working on and writes the prompt.
Method Blueprint
VeriCode includes 5 categories of instructions:
Coding Style & Conventions (9):
- Line length, indentation, variable naming, import order
Logic & Code Patterns (9):
- Number of branches, nesting depth, function complexity, use of specific patterns
Documentation & Commenting (6):
- Docstring style (Google/NumPy/PEP 257), comments, parameter descriptions
Error Handling & Management (4):
- Exception handling, canonical error classes, specific except blocks
Library & API Constraints (2):
- Using specific libraries (pathlib instead of os.path), replacing deprecated APIs
Each instruction includes:
- A category
- A natural-language description for single/multi-turn modes
- Configurable parameters (for example,
line_length: 79 or 88) - Verifier code (returns True/False)
Example in Action
Task (our illustration, not from the paper): Write a Slack bot that sends notifications about new orders from the CRM. The code needs to be readable for the team — junior devs will be finishing it.
Prompt:
Build a Slack bot in Python that sends notifications about new orders.
Code requirements:
1. Maximum 88 characters per line
2. Use pathlib instead of os/os.path for file handling
3. Document functions with Google-style docstrings
4. Use specific exceptions instead of a generic Exception
5. Maximum 3 branches (if/elif/else) per function
The bot should:
- Read the token from a .env file
- Load order data from a JSON file
- Post a formatted message to the channelResult:
Our projection from the paper's averages, not a tested case: the code will likely work, but even the best model in the study met all five requirements only ~47% of the time, so expect at least one violation in about half of the runs. The middle instructions may slip a little more often because of position bias. Functionality may also degrade by about 6% on average — for example, the bot might not handle some file edge cases that it would have handled without the extra instructions.
If you give the same instructions gradually (first a basic bot, then "add the line-length limit," then "add pathlib," and so on), the code will meet the requirements somewhat better (best model ~49% instead of 47% on real-world tasks), but functionality will take a bigger hit (average drop about 9% instead of about 6% on BigCodeBench).
Why It Works
Our explanation (the paper reports the drop but does not test a mechanism): LLMs generate code while balancing many goals: working code, readability, style, performance. When you add explicit instructions, the model may redistribute its attention — part of its effort goes to meeting the new requirements at the expense of core functionality.
Position bias: the authors link it to the known "lost-in-the-middle" pattern, where models use the beginning and end of the context better than the middle. On real-world tasks, instructions in the middle of the list "get lost" a little even in short prompts (a few hundred tokens). Single-turn shows primacy bias (the first instruction is followed best), multi-turn shows recency bias (the last one is).
Multi-turn vs single-turn: In single-turn, the model sees the whole picture at once and prioritizes keeping the code working. In multi-turn, each iteration focuses on a local task (add a new requirement), which boosts instruction compliance but more often breaks what used to work (our explanation of the pattern the paper measured).
The correlation with human preferences shows that users intuitively judge code on both axes — whether it works and its style/patterns. For real-world tasks (BigCodeBench), the authors say instruction following plays a more critical role (best IF weight 0.4 by Pearson, 0.7 by Spearman correlation); for algorithmic tasks (LiveCodeBench) pure functionality beats pure instruction following.
Control Levers
Number of instructions: regression grows with each added instruction (on BigCodeBench, single-turn, about 2.5% at 1 instruction and 5.8% at 5). Our rule of thumb: 1-2 instructions — low risk, 3-4 — noticeable regression, 5+ — high risk. For complex tasks, split them across several prompts instead of one prompt with 5+ requirements.
Order of instructions: Put the most important ones at the beginning or end and the secondary ones in the middle. If you're using multi-turn, add critical requirements last (recency bias).
Interaction mode (our suggestion based on the trade-off): Single-turn for production code where functionality is critical. Multi-turn for prototypes or when style/patterns matter more than working code.
Instruction parameters: VeriCode supports parameter tuning — you can vary line_length (79/88/120), max_branches (2/3/4), docstring_convention (Google/NumPy/PEP257). We'd expect stricter values to raise the chance of a violation (not measured in the paper).
Prompt Template
For 1-2 instructions (the safe zone):
Write {task description}.
Code requirements:
1. {instruction_1}
2. {instruction_2}
Task: {details}For 3+ instructions (watch the functionality):
Option A — Single-turn (preserve functionality):
Write {task description}.
Code requirements (important ones at the edges):
1. {critical_instruction_1}
2. {secondary_instruction}
3. {secondary_instruction}
4. {critical_instruction_2}
Task: {details}Option B — Multi-turn (maximize instruction following):
// Round 1:
Write {task description}.
Task: {details}
// Round 2:
Add a requirement: {instruction_1}
// Round 3:
Add a requirement: {instruction_2}
// And so on, with critical requirements lastSpecific VeriCode instructions (examples):
Style:
No line longer than {79/88/120} charactersUse Google/NumPy/PEP257-style docstringsSort imports: standard library → third-party → local
Logic:
Maximum {2/3/4} branches (if/elif/else) per functionNesting depth no more than {2/3} levelsCyclomatic complexity ≤ {5/10/15}
Libraries:
Use pathlib instead of os.path/os/glob/openReplace all aliased exceptions (IOError, WindowsError) with the canonical OSError
Error handling:
Use specific except clauses instead of a generic ExceptionDon't use bare except (except for SystemExit/KeyboardInterrupt)
Limitations
⚠️ Functional regression: Adding 5 non-functional instructions lowers functionality by about 6-7% on average (5.85% and 6.61% on the two benchmarks), with a larger effect on algorithmic tasks. The more instructions, the higher the risk.
⚠️ Low success rate: Even the best models satisfy all 5 instructions at once only about 41-50% of the time (single- or multi-turn). With 3+ instructions, most advanced models fall below 50%, per the authors.
⚠️ Position bias: On real-world tasks, instructions in the middle of the list (positions 2-4 out of 5) are followed a few points worse (about 1-3 points for most models) than those at the beginning or end. The effect shows up even in short prompts; on algorithmic tasks there is no clear U-shape.
⚠️ Multi-turn trade-off: Adding instructions gradually raises compliance by 3-8% but amplifies functional regression (on BigCodeBench, 9.3% vs 5.8% drop at 5 instructions) compared with single-turn.
⚠️ Task specifics: The tests and verifiers are Python-only; the authors say the framework can be moved to other languages with their own linters. The authors say regression is amplified on algorithmic tasks.
How They Tested It
The researchers took 800+ rules from the popular Python linter Ruff, filtered them in three stages and ended up with 30 core instructions. First they removed duplicate and overly narrow rules, then tested on Gemini 2.5 Flash (BigCodeBench-Hard): anything followed 90%+ of the time without losing functionality was thrown out. They kept only the ones where even top models stumble. Each instruction got a deterministic verifier — either linter-based or via AST analysis.
Next they extended two classic benchmarks: BigCodeBench (1,140 real-world tasks) and LiveCodeBench (1,055 algorithmic ones). For each task, an LLM selector (Claude 4 Opus) picked a subset of the 30 instructions — only relevant ones that didn't conflict with each other. That produced over 10,000 checks at the level of individual instructions.
They tested 31 models from 10 families in two modes: single-turn (all instructions at once) and multi-turn (gradually). They measured two metrics: pass@1 for functionality and instruction-level/task-level success for meeting the requirements. A task counted as a success only if ALL instructions were satisfied — hence the steep drop as the number of requirements grows.
Why these conclusions: Multi-turn showed a systematic pattern — better IF, worse functionality. Our reading of why: in multi-turn, the model focuses on a local task at each iteration (add a new requirement) without seeing the full picture as it does in single-turn. Position bias looked different on the two benchmarks: a U-shape on real-world tasks (lost-in-the-middle, the middle does worse than the edges), no clear U-shape on algorithmic ones, though the primacy/recency tendencies held.
The link to human preference: They correlated the results with 800K+ votes from the LMArena coding subset. The correlation peaks with a mix of metrics (40-70% weight on IF), not with pure functionality or pure IF. On real-world tasks the best IF weight was 0.4 (Pearson) or 0.7 (Spearman), and the authors say IF matters more there, while for algorithmic tasks pure functionality beats pure IF. The authors cite Copilot Arena rankings that correlate weakly or negatively with classic benchmarks as motivation; our reading is that those benchmarks measure only half of what users value.
Resources
SWE-IF: Aligning Code Evaluation with Human Preference (v1 title: Vibe Checker)
Ming Zhong, Xiang Zhou, Ting-Yun Chang and team (Google DeepMind, UIUC, USC)
arXiv:2510.07315 (v2, June 2026)
Code, data and taxonomy: github.com/maszhongming/SWE-IF
Ruff linter: https://docs.astral.sh/ruff/rules
BigCodeBench: https://openreview.net/forum?id=YrycTjllL0
LiveCodeBench: https://openreview.net/forum?id=chfJJYC3iL
LMArena coding leaderboard: https://lmarena.ai/leaderboard/text/coding