[Bug Report] test_faithfulness_recovery_is_graded_not_binary passes or fails on the sign of float32 rounding
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 77/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- testing-qa
Direzione di ricerca
Inizia con tests/unit/tools/test_attribution_patching.py::test_faithfulness_recovery_is_graded_not_binary ed esamina come viene selezionato il circuito parziale e come viene calcolata la frazione recuperata. Esegui il test con il comando indicato nell’issue, poi verifica l’asserzione rispetto al percorso completo suggerito fino a logits. Il risultato atteso è che il test sia deterministico rispetto alle variazioni del comportamento in virgola mobile e continui a verificare il recupero graduale.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 3.9k
- Fork
- 708
- Merge medio
- 1g 4h
- PR unite (30g)
- 87
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di TransformerLensOrg/TransformerLens
-
[Bug Report] `TransformerBridge.boot_*` methods are invisible to static type checkersForse già presa @koriyoshi2041 l’ha presa 2 giorni fa. Apertabug complexity-simple TransformerBridge
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
TransformerLensOrg/TransformerLens#1980 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug Report] detect_head fails with a list of sequences and a custom tensor detection patternForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug complexity-moderate TransformerBridge
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
TransformerLensOrg/TransformerLens#1979 ·
I maintainer di solito rispondono entro 1 giorno
-
[Proposal] MiniCPM adapter (MiniCPMForCausalLM) — I'm working on itForse già presa @pablocs116 l’ha presa oggi. Aperta
TransformerLensOrg/TransformerLens#1992 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[Proposal] Pretrained J++ lenses through JacobianLens: artifact provenance and filtered readoutsAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 45/100
TransformerLensOrg/TransformerLens#1991 ·
I maintainer di solito rispondono entro 1 giorno
-
[Proposal] Demo or helper for statistical audits of activation-patching results on TransformerBridgeApertacomplexity-moderate enhancement TransformerBridge
Difficoltà 5/5 Più di una settimana Idoneità per principianti 28/100
TransformerLensOrg/TransformerLens#1988 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di TransformerLensOrg/TransformerLens
Issue simili
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
graphql-python/graphql-core#304 ·
I maintainer di solito rispondono entro 1 giorno
-
docs size:S
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
Gathin23/cleanyourtv#3464 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno