arXiv · 2609.26102
Post-Hoc Attention Steering of Large Language Models for Robust Code Understanding under Obfuscation
Abstract
Code obfuscation is widely used in software systems and malware to conceal program logic and hinder analysis, posing significant challenges for both human developers and automated tools. While large language models (LLMs) have shown strong capabilities in code understanding, their robustness to obfuscation remains poorly understood. Our preliminary study shows that LLM performance significantly degrades on obfuscated code, suggesting a reliance on superficial lexical cues rather than deep semantic reasoning. To address this limitation, we propose CodeSteer, a novel attention steering approach that reallocates model attention toward semantically relevant program elements, including backward slices for output prediction and control-flow paths for execution reasoning. Our method integrates lightweight program analysis with inference-time attention steering to guide LLMs toward the core input-to-output dependencies of a program. Experiments across multiple models and datasets demonstrate that CodeSteer significantly improves performance on obfuscated code, often recovering comparable accuracy to the level of unobfuscated programs. We also show CodeSteer's practical utility through a case study on buffer overflow detection, highlighting its potential for malware/vulnerability analysis and reverse engineering of obfuscated code.
Explore related subjects
Keep this discovery
Explore connections, maps & timelines
Xiaokai Rong, Aashish Yadavally, Tien N. Nguyen. 2026-08-20. Post-Hoc Attention Steering of Large Language Models for Robust Code Understanding under Obfuscation. https://arxiv.org/abs/2609.26102
Cite the original work for its findings. Save a collection to share your selection of sources.