mlsanityData to 13 Oct 2026

Steering Code LLMs with Activation Directions for Language and Library Control

arXiv 2603.23629 ↗First posted 24 Mar 2026cs.LGcited by 0

Not on the map. Why?

Abstract (arXiv)

Code LLMs often default to particular programming languages and libraries under neutral prompts. We investigate whether these preferences are encoded as approximately linear directions in activation space that can be manipulated at inference time. Using a difference-in-means method, we estimate layer-wise steering vectors for five language/library pairs and add them to model hidden states during generation. Across three open-weight code LLMs, these interventions substantially increase generation toward the target ecosystem under neutral prompts and often remain effective even when prompts explicitly request the opposite choice. Steering strength varies by model and target, with common ecosystems easier to induce than rarer alternatives, and overly strong interventions can reduce output quality. Overall, our results suggest that code-style preferences in LLMs are partly represented by compact, steerable structure in activation space.

Key facts. No citing papers in the map yet (data through 13 Oct 2026). Builds on 8 of its 9 references that are in the map. First posted on arXiv 24 Mar 2026.

Builds on

8 of 9 references.

References · 8

  1. 2017Interpretability Beyond Feature Attribution: Quantitative Testing with Concept Activation Vectors (TCAV)cited by 1,316
  2. 2023Steering Llama 2 via Contrastive Activation Additioncited by 1,042
  3. 2024Refusal in Language Models Is Mediated by a Single Directioncited by 1,009
  4. 2023Steering Language Models With Activation Engineeringcited by 873
  5. 2024Programming Refusal with Conditional Activation Steeringcited by 200
  6. 2024Improving Instruction-Following in Language Models through Activation Steeringcited by 153
  7. 2025A Study of LLMs' Preferences for Libraries and Programming Languagescited by 20
  8. 2026ODESteer: A Unified ODE-Based Steering Framework for LLM Alignmentcited by 19

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2025SWE-IF: Aligning Code Evaluation with Human Preference
  2. 2024Learning Code Preference via Synthetic Evolution
  3. 2026UNBIND: UNlearning By INference-time Directional Steering for Code LLMs
  4. 2026Minimal Prompt Perturbations Lead to Code Vulnerabilities: Prompt Fragility and Hidden-State Signals in Coding LLMs
  5. 2026Subjective Code Preferences in Experts and Large Language Models ↗
  6. 2025Breaking the Mirror: Activation-Based Mitigation of Self-Preference in LLM Evaluators
  7. 2025Learning to Align Human Code Preferences
  8. 2025Artificial or Just Artful? Do LLMs Bend the Rules in Programming? ↗