Jin, Dongming
Finite State Automata Inside Transformers with Chain-of-Thought: A Mechanistic Study on State Tracking
Zhang, Yifan, Du, Wenyu, Jin, Dongming, Fu, Jie, Jin, Zhi
Chain-of-Thought (CoT) significantly enhances the performance of large language models (LLMs) across a wide range of tasks, and prior research shows that CoT can theoretically increase expressiveness. However, there is limited mechanistic understanding of the algorithms that Transformer+CoT can learn. In this work, we (1) evaluate the state tracking capabilities of Transformer+CoT and its variants, confirming the effectiveness of CoT. (2) Next, we identify the circuit, a subset of model components, responsible for tracking the world state, finding that late-layer MLP neurons play a key role. We propose two metrics, compression and distinction, and show that the neuron sets for each state achieve nearly 100% accuracy, providing evidence of an implicit finite state automaton (FSA) embedded within the model. (3) Additionally, we explore three realistic settings: skipping intermediate steps, introducing data noise, and testing length generalization. Our results demonstrate that Transformer+CoT learns robust algorithms (FSA), highlighting its resilience in challenging scenarios.
Multi-role Consensus through LLMs Discussions for Vulnerability Detection
Mao, Zhenyu, Li, Jialong, Jin, Dongming, Li, Munan, Tei, Kenji
Abstract--Recent advancements in large language models tester receives the initial prompt detailing its role-setting, its (LLMs) have highlighted the potential for vulnerability detection, task, and the code segment to analyze. The tester is asked to a crucial component of software quality assurance. The response viewpoints from different roles in a typical software development is constrained by a maximum token limit, ensuring that the life-cycle, including both developers and testers. Preliminary evaluation of this approach indicates iterative output exchange in an attempt to reach a collectively a 13.48% increase in the precision rate, an 18.25% increase multi-perspective consensus inside the code review team. in the recall rate, and a 16.13% increase in the F1 score. The tester and the developer, equipped with their unique perspective and judgments, enter a dialectic interaction, aimed Keywords-large language models; vulnerability detection; at exploring and resolving different opinions on potential prompt engineering; software quality assurance vulnerabilities.