Transformerの潜在部分空間活性化による概念的バイアスの制御
Steering Conceptual Bias via Transformer Latent-Subspace Activation
June 23, 2025
著者: Vansh Sharma, Venkat Raman
cs.AI
要旨
本研究では、言語モデル(LLM)内の潜在部分空間を活性化することで、科学技術コード生成を特定のプログラミング言語に向けて誘導できるかどうかを検証する。まず、5つの因果的LLMを科学技術コーディングプロンプトで評価し、4つのプログラミング言語間でのベースラインバイアスを定量化した。C++またはCPPトークンに対して最も活性化されたMLP重みを摂動させる静的ニューロン帰属法は脆弱であり、プロンプトスタイルやモデルスケールにわたる一般化が限定的であることが判明した。これらの制約に対処するため、勾配精製適応活性化誘導フレームワーク(G-ACT)を開発した:プロンプトごとの活性化差分を少数の誘導方向にクラスタリングし、軽量な層ごとのプローブをオンラインで訓練・精製して適切な誘導ベクトルを選択する。LLaMA-3.2 3Bでは、このアプローチによりCPP言語への生成バイアスが確実に誘導され、平均プローブ分類精度が15%向上し、初期層(0-6)では標準ACTフレームワークと比較してプローブ分類精度が61.5%向上した。LLaMA-3.3 70Bでは、アテンションヘッドの信号がより拡散するが、主要層でのターゲット注入により言語選択が改善される。層ごとのプローブは推論オーバーヘッドを若干増加させるものの、層のサブセットのみを誘導することで実用的であり、再現可能なモデル動作を可能にする。これらの結果は、実用的なエージェントシステムにおける概念レベルの制御のためのスケーラブルで解釈可能かつ効率的なメカニズムを示している。
English
This work examines whether activating latent subspaces in language models
(LLMs) can steer scientific code generation toward a specific programming
language. Five causal LLMs were first evaluated on scientific coding prompts to
quantify their baseline bias among four programming languages. A static
neuron-attribution method, perturbing the highest activated MLP weight for a
C++ or CPP token, proved brittle and exhibited limited generalization across
prompt styles and model scales. To address these limitations, a
gradient-refined adaptive activation steering framework (G-ACT) was developed:
per-prompt activation differences are clustered into a small set of steering
directions, and lightweight per-layer probes are trained and refined online to
select the appropriate steering vector. In LLaMA-3.2 3B, this approach reliably
biases generation towards the CPP language by increasing the average probe
classification accuracy by 15% and the early layers (0-6) improving the probe
classification accuracy by 61.5% compared to the standard ACT framework. For
LLaMA-3.3 70B, where attention-head signals become more diffuse, targeted
injections at key layers still improve language selection. Although per-layer
probing introduces a modest inference overhead, it remains practical by
steering only a subset of layers and enables reproducible model behavior. These
results demonstrate a scalable, interpretable and efficient mechanism for
concept-level control for practical agentic systems.