[Bug Report] test_faithfulness_recovery_is_graded_not_binary passes or fails on the sign of float32 rounding
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 77/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 領域
- testing-qa
調査の方向性
まず tests/unit/tools/test_attribution_patching.py::test_faithfulness_recovery_is_graded_not_binary から始め、部分的な回路がどのように選択され、復元された割合がどのように計算されるかを調べてください。issue に記載されたコマンドでテストを実行し、その後、logits までの提案された完全なパスと照らしてアサーションを確認してください。完了条件は、浮動小数点の挙動の違いがあってもテストが決定的であり、段階的な復元を引き続き検証することです。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
tests/unit/tools/test_attribution_patching.py::test_faithfulness_recovery_is_graded_not_binary fails deterministically on my machine, both inside the full unit suite and on its own, while CI is green on the same commit.
The partial circuit is readout[: len(readout) // 2], the first 23 of the 46 edges into the last position. In enumeration order those are all edges into the layer-0 Q/K/V/MLP inputs and the layer-1 Q/K inputs. None of them feeds the logits reader. _EdgeScoringToyBridge is linear, so with every edge into logits ablated, no clean signal reaches the metric. The recovered fraction is therefore exactly 0 in exact arithmetic: building the toy in float64 gives 6.5e-17. In float32 the 0.0 < check comes down to the sign of the rounding error, which is positive on CI and negative here.
Code example
On dev at a1fe5d4d, with no local changes:
uv run pytest tests/unit/tools/test_attribution_patching.py -k faithfulness_recovery_is_graded_not_binary
> assert 0.0 < report.recovered < 1.0
E AssertionError: assert 0.0 < -1.3424525621271817e-08
System Info
- Installed from source with
uv - Linux under WSL2 on Windows, CPU only
- Python 3.12, torch 2.11.0, transformers 5.13.0
Additional context
Suggestion: pick the partial circuit so it contains at least one complete path to logits (for example by including the embed→logits edge), so the "recovers part" claim holds structurally. Simply switching to the second half isn't enough on its own: it recovers 0.30 with the float32 toy, but 1.12 with the float64 toy (a different random draw), so the < 1.0 bound isn't guaranteed either.
Checklist
- I have checked that there is no similar issue in the repo (required)
The checklist box is honest: I searched issues and PRs and found nothing about this test.
- 主要言語
- Python
- スター
- 3.9k
- フォーク
- 708
- 平均マージ
- 1日 4時間
- マージ済み PR(30日)
- 87
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TransformerLensOrg/TransformerLens のほかの issue
-
[Bug Report] `TransformerBridge.boot_*` methods are invisible to static type checkers対応中かも @koriyoshi2041 が 2 日前に担当しました。 オープンbug complexity-simple TransformerBridge
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
TransformerLensOrg/TransformerLens#1980 ·
メンテナーはふだん 1 日以内に返信
-
[Bug Report] detect_head fails with a list of sequences and a custom tensor detection pattern対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug complexity-moderate TransformerBridge
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
TransformerLensOrg/TransformerLens#1979 ·
メンテナーはふだん 1 日以内に返信
-
[Proposal] MiniCPM adapter (MiniCPMForCausalLM) — I'm working on it対応中かも @pablocs116 が今日担当しました。 オープン
TransformerLensOrg/TransformerLens#1992 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
[Proposal] Pretrained J++ lenses through JacobianLens: artifact provenance and filtered readoutsオープン
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
TransformerLensOrg/TransformerLens#1991 ·
メンテナーはふだん 1 日以内に返信
-
[Proposal] Demo or helper for statistical audits of activation-patching results on TransformerBridgeオープンcomplexity-moderate enhancement TransformerBridge
難易度 5/5 1週間以上 初心者へのやさしさ 28/100
TransformerLensOrg/TransformerLens#1988 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
TransformerLensOrg/TransformerLens の issue をすべて見る
似ている issue
-
bug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
graphql-python/graphql-core#304 ·
メンテナーはふだん 1 日以内に返信
-
docs size:S
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
Gathin23/cleanyourtv#3464 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信