[Bug Report] Inspect RemoteBridge silently ignores attention_mask
Los mantenedores suelen responder en 1 día
@emerardd ya está trabajando en esto.
Desde el 5/10/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Describe the bug
The Inspect backend silently drops an attention_mask passed to RemoteBridge.forward() or run_with_cache(). InspectDriver.forward() accepts the argument in **kwargs, but its profile request contains only input IDs, capture keys, interventions and the logits flag. The HF provider consequently runs an unmasked forward. Returned logits and cached activations can therefore reflect padding as real context, even though RemoteBridge later applies the supplied mask when aggregating loss.
Code example
import torch
from transformer_lens.model_bridge.remote_bridge import RemoteBridge
bridge = RemoteBridge.boot_inspect("gpt2", provider="tl_bridge", device="cpu")
tokens = torch.tensor([[0, 0, 7, 8]])
mask = torch.tensor([[0, 0, 1, 1]])
logits, cache = bridge.run_with_cache(tokens, attention_mask=mask)
On dev at 6affbe99, an offline driver probe for this input sent input_ids=[0, 0, 7, 8] with no attention_mask in the provider request. A separate random tiny eager GPT-2 control compared the provider-equivalent unmasked forward with a masked forward using mask-derived positions: the final-logit maximum difference was about 0.159, while the masked result matched the unpadded [7, 8] control within 3e-8. These checks establish the request omission and its numerical consequence; a live downloaded-model Inspect run was not used for this report.
System Info
TransformerLens installed from source with uv; Windows, Python 3.12.10, Torch 2.11.0+cpu, Transformers 5.13.0. Reproduced on current dev at 6affbe99.
Additional context
The omission spans sources/inspect/driver.py, profiles.py, and transformers_provider.py. This is separate from the local Bridge position-id fix (#1610) and the direct vLLM driver padding fix (#1804).
I plan to propagate and validate a single-sequence 2-D mask through the HF-backed Inspect path, handle padding positions consistently, and add regressions covering logits, captures and masked loss. Providers that cannot honor masks should reject them explicitly before execution; tl_bridge_vllm and third-party provider capabilities need their own handling.
Checklist
- I have checked that there is no similar issue in the repo
- Lenguaje dominante
- Python
- Estrellas
- 3.9k
- Forks
- 708
- Merge medio
- 1 d 10 h
- PR fusionados (30 d)
- 82
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
-
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 patternAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
TransformerLensOrg/TransformerLens#1979 ·
Los mantenedores suelen responder en 1 día
-
[Proposal] Demo: auditing a published LLM-written weight edit (Weight-Space Programming, Qwen3.5-0.8B loop fix) with TransformerBridgePosiblemente ocupada @emerardd la tomó hace 1 día. Abiertocomplexity-moderate demo TransformerBridge
TransformerLensOrg/TransformerLens#1978 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[Bug Report] `blocks.N.hook_out` never fires on OpenAI GPT because the HF block returns a listPosiblemente ocupada @ska2704 la tomó hace 2 días. Abiertobug complexity-simple TransformerBridge
Dificultad 3/5 Medio día Aptitud para principiantes 72/100
TransformerLensOrg/TransformerLens#1969 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
enhancement seen_by_maintainers TransformerBridge
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
TransformerLensOrg/TransformerLens#1957 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de TransformerLensOrg/TransformerLens
Issues similares
-
bug severity:low
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 2 días
-
curriculum documentation quality
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
githubnext/gh-aw-workshop#5367 ·
Los mantenedores suelen responder en 3 días
-
OAuth documentation for GET /api/v2/users/me/ appears inconsistent with required global read scopeAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Create Noise Latents ignores randomize_seed and produces the same noise every runPosiblemente ocupada @griptapeops la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
griptape-ai/griptape-nodes-library-diffusers#127 ·
Los mantenedores suelen responder en 1 día
-
Jenkins capacity report: metrics history is lost when archiving a month failsPosiblemente ocupada @RaphaelFakhri la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
adoptium/infrastructure#4568 ·
Los mantenedores suelen responder en 1 día