[Bug Report] test_faithfulness_recovery_is_graded_not_binary passes or fails on the sign of float32 rounding
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 77/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Área
- testing-qa
Línea de trabajo
Empieza con tests/unit/tools/test_attribution_patching.py::test_faithfulness_recovery_is_graded_not_binary e inspecciona cómo se selecciona el circuito parcial y cómo se calcula la fracción recuperada. Ejecuta la prueba con el comando del issue y luego comprueba la aserción frente a la ruta completa sugerida hasta logits. El objetivo es que la prueba sea determinista ante variaciones del comportamiento de coma flotante y siga verificando la recuperación gradual.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 3.9k
- Forks
- 708
- Merge medio
- 1 d 4 h
- PR fusionados (30 d)
- 87
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de TransformerLensOrg/TransformerLens
-
[Bug Report] `TransformerBridge.boot_*` methods are invisible to static type checkersPosiblemente ocupada @koriyoshi2041 la tomó hace 2 días. Abiertobug complexity-simple TransformerBridge
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
TransformerLensOrg/TransformerLens#1980 ·
Los mantenedores suelen responder en 1 día
-
[Bug Report] detect_head fails with a list of sequences and a custom tensor detection patternPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertobug complexity-moderate TransformerBridge
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
TransformerLensOrg/TransformerLens#1979 ·
Los mantenedores suelen responder en 1 día
-
[Proposal] MiniCPM adapter (MiniCPMForCausalLM) — I'm working on itPosiblemente ocupada @pablocs116 la tomó hoy. Abierto
TransformerLensOrg/TransformerLens#1992 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[Proposal] Pretrained J++ lenses through JacobianLens: artifact provenance and filtered readoutsAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 45/100
TransformerLensOrg/TransformerLens#1991 ·
Los mantenedores suelen responder en 1 día
-
[Proposal] Demo or helper for statistical audits of activation-patching results on TransformerBridgeAbiertocomplexity-moderate enhancement TransformerBridge
Dificultad 5/5 Más de una semana Aptitud para principiantes 28/100
TransformerLensOrg/TransformerLens#1988 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de TransformerLensOrg/TransformerLens
Issues similares
-
bug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
graphql-python/graphql-core#304 ·
Los mantenedores suelen responder en 1 día
-
docs size:S
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
Gathin23/cleanyourtv#3464 ·
Los mantenedores suelen responder en 1 día
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día