Research map / Large language models / Instruction and fine-tuning
Interpreting and Steering for Safe and Correct Code Generation
Hao Yan, Ziyu Yao
George Mason University
Read the paperPlace an idea next to itCheck your own paper ↗
12measured effects
5improved
1no clear effect
6hurt
AI-extracted. The measured effects below were read by AI from the paper's full text (no summary yet). Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| Add a correctness steering direction at correctness-causal heads (DuoSteer vs CausalMD) (ablation) | CausalMD on Llama-3.1-8B-Instruct · SecCodePLT CWE-502 | C(1-V): 44.1 -> 94.1 | Improved |
| DuoSteer with correctness direction | Llama-3.1-8B-Instruct · SecCodePLT CWE-094 | correctness C: 25.5 -> 27.5 (V 51.0 -> 37.2) | Improved |
| DuoSteer for path traversal | Llama-3.1-8B-Instruct · SecCodePLT CWE-022 | C(1-V): 48.9 -> 43.0 | Hurt |
| Select heads by causal knockout rather than probe accuracy (ablation) | MD steering · SecCodePLT CWE-079 | vulnerability rate V: 52.9 -> 17.6 | Improved |
| Replace head-level causal steering with layer-level steering (ablation) | CausalMD · SecCodePLT CWE-502 | vulnerability rate V: V 19.6 vs 39.2 (LayerMD) | Hurt |
| Probe rank as predictor of causal head influence (ablation) | Head localization · Top-256 probe-ranked heads | Spearman correlation: rho in [-0.072, +0.023] | No clear effect |
| Apply hint prompting | Llama-3.1-8B-Instruct · SecCodePLT CWE-295 | vulnerability rate V: 5.9 -> 9.8 | Hurt |
| Apply hint prompting | Llama-3.1-8B-Instruct · SecCodePLT CWE-502 | correctness C: 58.8 -> 15.7 | Hurt |
| Fine-tune with SFT on safe-and-correct generations | Llama-3.1-8B-Instruct · SecCodePLT CWE-079 | vulnerability rate V: 54.9 -> 70.6 | Hurt |
| Stack DuoSteer on hint-augmented prompts | Hint prompting · SecCodePLT CWE-502 | C(1-V): 13.8 -> 52.6 | Improved |
| Apply DuoSteer to Qwen-2.5-Coder-7B-Instruct | Qwen-2.5-Coder-7B-Instruct · SecCodePLT CWE-079 | C(1-V): 62.6 -> 82.7 | Improved |
| DuoSteer under execution-based tests | Llama-3.1-8B-Instruct · SecCodePLT CWE-079 pass rate | execution pass rate: -7.9 points | Hurt |
Open problems this paper states
- “Studies only two 7-8B open-weight models; whether findings hold at 70B/405B or in closed API models is open, and white-box head access is required.” → Larger models were not tested, mostly for lack of compute. (an open problem in safety alignment after fine-tuning)
Open problems in safety alignment after fine-tuning
Do safety defenses against harmful fine-tuning hold on larger models and against adaptive attacks?
- Larger models were not tested, mostly for lack of compute. · 27 papers state it
- Defenses are tested against few attacks and not against adaptive ones. · 15 papers state it
- Safety is scored by one LLM judge or classifier that may be biased. · 15 papers state it
Closest papers by meaning
- CodeMimicry: Exploiting Safety Generalization Lag in Large Language Models via Structured Code Completion (NeurIPS 2026 · similarity 0.89)
- Instruction Tuning for Secure Code Generation (ICML 2024 · similarity 0.89)
- Navigating the Safety Landscape: Measuring Risks in Finetuning Large Language Models (NeurIPS 2024 · similarity 0.88)
- INDICT: Code Generation with Internal Dialogues of Critiques for Both Security and Helpfulness (NeurIPS 2024 · similarity 0.88)
- On the Role of Attention Heads in Large Language Model Safety (ICLR 2025 · similarity 0.88)
- Towards Understanding Safety Alignment: A Mechanistic Perspective from Safety Neurons (NeurIPS 2025 · similarity 0.88)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.