Do Code Language Models Follow Tests? Paired Interventions on Program Behavior
Not on the map. Why?
Abstract (arXiv)
Visible tests specify concrete program behavior, but an improvement in benchmark accuracy does not establish that a model follows the rule expressed by those tests. We study test utilization through matched prompting controls, paired semantic interventions, and test suites selected by fault detection. Our semantic intervention holds an underspecified description and its example inputs fixed while changing the correct outputs to express one of two valid rules. Evaluation on unseen inputs measures whether both generated programs follow their respective rules. Across five models and three runs of 120 paired instances from 20 specification families, mean switching rates range from 11.1% to 65.8%. Qwen3.8-27B has the highest point estimate, followed by Qwen3.6-27B at 60.6%; their paired difference remains uncertain. Explicit descriptions elicit both rules from these two models on every instance, exposing a gap between implementation capability and adoption of test-specified rules. Correct expected outputs improve MBPP+ accuracy beyond inputs alone for all five models. On 180 tasks with fixed three-test suites, high-detection suites detect 30.3 percentage points more errors in a held-out pool dominated by reference mutants. The corresponding generation differences range from -0.6 to +1.1 points; all intervals include zero and remain compatible with some benefit. Paired interventions make test-specified rule changes measurable alongside implementation capability and benchmark correctness.
Key facts. Cited by 3 papers in the map (data through 26 Nov 2026). Submitted 28 Jul 2026.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2026: 3.
3 papers.
- 2026GTDD: Generative Test-Driven Development for AI Coding Agents with Adversarial Testingcited by 1
- 2026Test-Driven Approaches to Software Engineering with Large Language Models: A Survey of Phases, Tasks, and Agent Skillscited by 0
- 2026Do LMs Know What Variables Do? Interpreting Code Representations via Variable Rolescited by 0
- 2026Do LMs Know What Variables Do? Interpreting Code Representations via Variable Roles16 Oct 2026
- 2026GTDD: Generative Test-Driven Development for AI Coding Agents with Adversarial Testing2 Oct 2026
- 2026Test-Driven Approaches to Software Engineering with Large Language Models: A Survey of Phases, Tasks, and Agent Skills10 Sep 2026