Finding Transformer Circuits with Edge Pruning

要約

言語モデルを解釈するためのパスは、多くの場合、回路、つまり動作の特定の側面を捕捉するモデルのまばらな計算サブグラフの分析を介して進みます。
最近の取り組みにより、回路を検出するタスクが自動化されました。
ただし、これらの方法は非効率的な検索アルゴリズムまたは不正確な近似に依存しているため、実際的な制限があります。
このペーパーでは、自動化された回路発見を最適化問題として枠組み化し、効果的でスケーラブルなソリューションとして *エッジ プルーニング* を提案します。
エッジ プルーニングは勾配ベースのプルーニング技術を利用しますが、ニューロンやコンポーネントを削除するのではなく、コンポーネント間の \emph{エッジ} をプルーニングします。
私たちの方法は、標準的な回路検索タスクにおける完全なモデル予測に同等に忠実でありながら、以前の方法で見つかった回路と比較してエッジの数が半分未満である GPT-2 の回路を見つけます。
エッジ プルーニングは、100,000 もの例でも効率的であり、速度の点で以前の方法を上回り、大幅に優れた回路を生成します。
また、Tracr でコンパイルされた 2 つのモデルのグラウンドトゥルース回路も完全に復元します。
その効率性のおかげで、私たちは Edge Pruning を CodeLlama-13B まで拡張しました。これは、以前のメソッドが動作するスケールの 100 倍を超えるモデルです。
この設定は、指示のプロンプトとコンテキスト内学習の背後にあるメカニズムを比較するケーススタディに使用します。
完全なモデルのパフォーマンスと一致する 99.96% 以上のスパース性を持つ 2 つの回路が見つかり、2 つの設定のメカニズムが実質的に重複していることが明らかになりました。
私たちのケーススタディは、エッジ プルーニングが解釈可能性のための実用的でスケーラブルなツールであることを示し、大規模なモデルでのみ現れる動作に光を当てます。

要約(オリジナル)

The path to interpreting a language model often proceeds via analysis of circuits — sparse computational subgraphs of the model that capture specific aspects of its behavior. Recent work has automated the task of discovering circuits. Yet, these methods have practical limitations, as they rely either on inefficient search algorithms or inaccurate approximations. In this paper, we frame automated circuit discovery as an optimization problem and propose *Edge Pruning* as an effective and scalable solution. Edge Pruning leverages gradient-based pruning techniques, but instead of removing neurons or components, it prunes the \emph{edges} between components. Our method finds circuits in GPT-2 that use less than half the number of edges compared to circuits found by previous methods while being equally faithful to the full model predictions on standard circuit-finding tasks. Edge Pruning is efficient even with as many as 100K examples, outperforming previous methods in speed and producing substantially better circuits. It also perfectly recovers the ground-truth circuits in two models compiled with Tracr. Thanks to its efficiency, we scale Edge Pruning to CodeLlama-13B, a model over 100x the scale that prior methods operate on. We use this setting for a case study comparing the mechanisms behind instruction prompting and in-context learning. We find two circuits with more than 99.96% sparsity that match the performance of the full model and reveal that the mechanisms in the two settings overlap substantially. Our case study shows that Edge Pruning is a practical and scalable tool for interpretability and sheds light on behaviors that only emerge in large models.

arxiv情報

著者 Adithya Bhaskar,Alexander Wettig,Dan Friedman,Danqi Chen
発行日 2024-06-24 16:40:54+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.CL パーマリンク