A Preliminary Study on Explaining Risk of Code Changes using LLM-Based Prediction Models
YLYalin LiuKosay Jabre
Rui AbreuZCZachariah J. CarmichaelVMVijayaraghavan MuraliAkshay PatelJun GeWeiyan SunCong Zhang
Audris MockusDavid Khavari
Peter C. Rigby +1 YLYalin Liu
Kosay Jabre

Rui Abreu
ZCZachariah J. Carmichael
VMVijayaraghavan Murali
Akshay Patel
Jun Ge
Weiyan Sun
Cong Zhang

Audris Mockus
David Khavari

Peter C. Rigby
+13
This work proposes using attention weights from an LLM-based Diff Risk Score (DRS) model to highlight risk-concentrated parts of a code change, aggregating token-level attention into interpretable code units (lines, hunks, files). Evaluated on expert-labeled changes that caused real outages, the top-2 hunks cover 53.85% of outage-causing lines while requiring review of 26.28% of changed lines on average. The approach is scalable since attention is produced during standard inference, enabling lightweight guidance in code review with low latency.

arXiv ·
· July 2, 2026