[Proposal] Sparse probing: optional groups argument so rows from one prompt can't straddle the split
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Ambito
- machine-learning
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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)
- Lingua principale
- Python
- Stelle
- 3.9k
- Fork
- 708
- Merge medio
- 1g 17h
- PR unite (30g)
- 70
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
-
[Proposal] RoBERTa masked-LM adapter for TransformerBridgeForse già presa @Canonik l’ha presa oggi. Apertacomplexity-moderate new-architecture TransformerBridge
TransformerLensOrg/TransformerLens#1870 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[Proposal] Backward Lens: support gated MLP gate/ up/ down gradient factorsForse già presa @janmenjayap l’ha presa 7 giorni fa. Apertacomplexity-moderate enhancement TransformerBridge
TransformerLensOrg/TransformerLens#1832 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug Report] _BLOCK_LIST_ATTRS hardcoded name list silently drops Raven's blocks from composition-score / head-label analysisForse già presa @LightWork666 l’ha presa 16 giorni fa. Apertabug complexity-moderate TransformerBridge
TransformerLensOrg/TransformerLens#1791 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[Proposal] SVD Circuits: singular-vector decomposition of a head's QK/ OV into causally-validated subfunctionsForse già presa @janmenjayap l’ha presa 28 giorni fa. Apertacomplexity-high enhancement TransformerBridge
TransformerLensOrg/TransformerLens#1767 · 3 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
[Proposal] Relevance Lens (R-lens): a RelP/ LRP-based transport-matrix estimator for Jacobian Lens (J-lens) fit, readout, and interventionForse già presa @janmenjayap l’ha presa 30 giorni fa. Apertacomplexity-high enhancement TransformerBridge
TransformerLensOrg/TransformerLens#1755 · 6 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di TransformerLensOrg/TransformerLens
Issue simili
-
first
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
AcademySoftwareFoundation/rmtc#54 · 1 commento ·
-
feature/cohorts feature/feature-flags team/feature-flags
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
License examples/ as MITForse già presa @PGrayCS l’ha presa oggi. Apertadocumentation enhancement example good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
speedyk-005/yasbd-lib#383 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
interactions-py/interactions.py#1827 ·
-
Managed start can fail when OpenVMM reads its control capability before NVX writes itForse già presa @ppenna l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno