When Models Know but Can't Linearly Say: Relational Encoding Limits Linear Vulnerability Classification in Code LLMs
Large language models can detect vulnerable code, yet the form of vulnerability encoding in their representations remains unclear.
ProofPaper ↗
Key points
- We analyze 8 code models spanning 6.7B-15B parameters on C programs using three datasets (DELTASECOMMITS, SVEN, and PRECISE-BUGS), comparing two diagnostic tasks on the same representations: identifying what patterns the code instantiates, and determining whether it is vulnerable.
- Models encode the first with high fidelity.
- Under the studied paired C-code datasets and linear-probing setup, vulnerability information is more accessible as a paired relational signal-whether code A is riskier than code B-than as a globally separable categorical label.
- This structural difference has implications for classification: the model reliably ranks which code is riskier but standard classifiers on isolated samples achieve limited accuracy because vulnerable and secure samples form overlapping distributions in representation space.
Sources (1)
- [1]When Models Know but Can't Linearly Say: Relational Encoding Limits Linear Vulnerability Classification in Code LLMsarXiv (AI, ML, NLP, CV, robotics, multi-agent) · Oct 19, 08:26 PM
Large language models can detect vulnerable code, yet the form of vulnerability encoding in their representations remains unclear.
We analyze 8 code models spanning 6.7B-15B parameters on C programs using three datasets (DELTASECOMMITS, SVEN, and PRECISE-BUGS), comparing two diagnostic tasks on the same representations: identifying what patterns the code instantiates, and determining whether it is vulnerable.
Extractive summary: sentences quoted from the sources.
Before this
- Oct 19, 2026Evaluating Agents on Highly Subjective Tasks
- Oct 19, 2026Introducing Clairic, a new System One class of extraction models
- Oct 19, 2026Reasoning-Aware Multicalibrated Reliability Predictors for Language Models
- Oct 19, 2026Push-based KV transfer to improve TTFT and TPOT for disaggregated inference in vLLM
- Oct 18, 2026Acharya 2.0: An AI Tutor for Self-Learning Subjects in Hindi
- Oct 17, 2026A Cross-Domain Evaluation of Prompting Techniques for Large Language Models