[Proposal] Sparse probing: optional groups argument so rows from one prompt can't straddle the split
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Área
- machine-learning
Línea de trabajo
Start with sparse_probing.py:251 and inspect fit_sparse_probe and sweep_sparse_probe, then review the guide’s leakage section and existing split tests. An open linked pull request (#1824) is already working on this proposal, so check its changes before considering any contribution. Done means group IDs do not cross the split, invalid groupings raise clearly, the supplied fixture scores near chance, the guide covers grouped splitting, and the listed checks pass.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Proposal
Add an optional groups: Integer[torch.Tensor, "example"] to fit_sparse_probe and sweep_sparse_probe that holds out whole groups, defaulting to today's row-level split when omitted (sparse_probing.py:251).
Motivation
The guide already warns that rows sharing a source prompt must not straddle the split, but nothing in the API lets a caller act on it. Flattening [batch, pos, d_model], where every position of a document carries that document's label, is the normal way to build features and has no safe form today.
Pitch
On 40 groups of 8 rows: each group a shared identity vector plus noise, labels assigned per group at random, so the honest answer is no signal:
def grouped(n_groups=40, per_group=8, d=64, seed=0):
g = torch.Generator().manual_seed(seed)
ident = torch.randn(n_groups, d, generator=g) * 3.0
rows = ident.repeat_interleave(per_group, 0) + torch.randn(n_groups * per_group, d, generator=g)
labels = (torch.rand(n_groups, generator=g) < 0.5).long().repeat_interleave(per_group)
return rows, labels, torch.arange(n_groups).repeat_interleave(per_group)
X, y, groups = grouped(seed=0)
fit_sparse_probe(X, y, k=8, seed=0).metrics.f1 # 0.805
Row-level F1 is 0.72–0.81 across seeds 0-3 where a group-held-out split gives 0.38–0.70. The probe is reading group identity out of the training rows of the same group, and nothing in the result says so.
groupsassigns each row a group id; the stratified split partitions groups instead of rows, both classes still on both sides.- Omitting it changes nothing, so no existing result moves.
Acceptance:
- No group id appears in both
train_indicesandtest_indices - Clear raise when the grouping can't keep both classes on both sides
- The fixture above scores near chance with
groupssupplied - Guide's leakage section shows the
groupsform -
make unit-testpasses -
uv run mypy .passes
Checklist
- I have checked that there is no similar issue in the repo (required)
- Lenguaje dominante
- Python
- Estrellas
- 3.9k
- Forks
- 708
- Merge medio
- 1 d 18 h
- PR fusionados (30 d)
- 65
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 62/100
TransformerLensOrg/TransformerLens#1868 ·
Los mantenedores suelen responder en 1 día
-
[Bug Report] run_with_hooks(remove_batch_dim=True) raises AttributeError when a hook returns NonePosiblemente ocupada @Mudassiruddin7 la tomó hoy. Abiertobug complexity-simple TransformerBridge
TransformerLensOrg/TransformerLens#1863 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[Bug Report] `remove_batch_dim=True` with batch `size > 1`: the three caching paths disagreePosiblemente ocupada @Mudassiruddin7 la tomó hace 1 día. Abiertobug complexity-simple TransformerBridge
TransformerLensOrg/TransformerLens#1858 · 3 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[Bug Report] `get_caching_hooks` fires for alias names in `names_filter` but caches only under the canonical keyPosiblemente ocupada @Mudassiruddin7 la tomó hace 1 día. Abiertobug complexity-moderate TransformerBridge
TransformerLensOrg/TransformerLens#1857 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[Bug Report] get_caching_hooks slices the wrong axis when remove_batch_dim=True is combined with pos_slicePosiblemente ocupada @JoeyTan21 la tomó hace 1 día. Abierto
TransformerLensOrg/TransformerLens#1856 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de TransformerLensOrg/TransformerLens
Issues similares
-
Link Checker ReportAbiertoautomated issue report
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
RapidAI/RapidOCRDocs#119 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
btclib-org/btclib-node#1833 ·
Los mantenedores suelen responder en 1 día
-
IRIS reader: no-data velocity bins (DB_VEL, DB_VELC) returned as 0.0 m/s instead of NaNPosiblemente ocupada @syedhamidali la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 2 días
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 80/100
elodin-sys/elodin#890 ·
Los mantenedores suelen responder en 1 día