--- license: cc-by-sa-4.0 tags: [interpretability, probing, pythia] --- # cls-ner: probes for NER: PER, ORG, LOC on entity tokens (UNER English EWT) Linear probes of the NeurIPS 2026 paper *Geometrically Disentangling Concept Learning from the Language Modeling Loss* (Wang, Mallinar, Belkin, Warstadt) for the task `NER` (`ner` in the code at https://github.com/YpLarryWang/concept-energy). These are the probes behind the paper's numbers. They are part of the [disentangle-concept-learning](https://huggingface.co/disentangle-concept-learning) release: one dataset of AGOP matrices (`agop`) and one dataset of probes for each of the paper's 12 tasks (`cls-*`, `reg-*`). At every layer and checkpoint there are 3 real probes and 3 control probes. The paper's Concept Energy (CE) is the mean Optimization Engagement (OE) of the real probes with the AGOP of the same layer and checkpoint minus the mean OE of the control probes, and its decodability (selectivity) is the mean score of the real probes minus the mean score of the control probes. `probes.csv` gives the OE and score of every probe. ## Probes Linear softmax classifier, `nn.Linear(d, K)` with bias, trained with cross-entropy. Per layer and checkpoint: 3 real probes (seeds 1001-1003) and 3 control probes (label seeds 42-44, probe seeds 4042-4044). The control task follows [Hewitt and Liang (2019)](https://aclanthology.org/D19-1275/): every word type gets one fixed random label, drawn with the class shares of the real training labels, so the control labels follow word identity rather than the concept. Score: test accuracy; a control probe is scored on its own control labels. ## Language models [Pythia-410M](https://huggingface.co/EleutherAI/pythia-410m) (24 layers, hidden size 1024) and [Pythia-1B](https://huggingface.co/EleutherAI/pythia-1b) (16 layers, hidden size 2048), at 19 checkpoints: steps 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1000, 2000, 4000, 8000, 16000, 32000, 64000, 128000 and 143000. Layer L is the output of transformer block L, before the final layer norm. Layers are numbered from 0 (0-23 for Pythia-410M, 0-15 for Pythia-1B); the paper's figures number them from 1, so layer 8 here is layer 9 there. ## Data UNER English EWT (commit 8ed072de), entity tokens (B- and I- tags merged). The official training and test splits are used, keeping the sentences with at least 4 tokens, at least 2 of them containing a letter, and no URL-like token. Classes with at least 100 training and 10 test words are kept: K = 3; train: 9,233 words (3,527 sentences); test: 1,365 words (544 sentences). Every word is read at its last sub-word token, with its whole sentence as context (one forward pass per sentence, batches of 32 sentences; model inputs are truncated to 256 tokens, beyond which no probed word lies). ## Centering Inputs: the mean of the layer's training representations (float64) is subtracted from the training and test inputs (`input_mean`). ## Training Adam (learning rate 1e-3, weight decay 1e-4 on weights and bias, default betas), batch size 256, 10 epochs; the weights after the last epoch are kept. The weights start from the PyTorch default initialization, and the probe seed fixes both the initialization and the shuffling order. ## Precision The language model runs in float16. Its block outputs are cast to float32, centered in float64 and cast back to float32. Probes are trained in float32 on a GPU, and `W` and `b` are stored in float32 without rounding. ## Files ``` pythia-410m/step.safetensors all 24 layers of one checkpoint pythia-1b/step.safetensors all 16 layers of one checkpoint probes.csv one row per probe: model, checkpoint, layer, run, seed, init_seed, k, oe, score, score_kind PROVENANCE.json format version, and the SHA-256 of the AGOP file used for each layer and checkpoint SHA256SUMS ``` Each safetensors file holds: | key | shape | dtype | content | |---|---|---|---| | `W` | [layers, 6, 3, d] | float32 | probe weights | | `b` | [layers, 6, 3] | float32 | probe biases | | `input_mean` | [layers, d] | float64 | mean subtracted from the inputs | The class names, in the order of axis 2, are in the file metadata (`classes`). Axis 1 is the run, listed in the metadata (`runs`): real_1001, real_1002, real_1003, control_42, control_43, control_44. The metadata also gives the format version (`schema`). In `probes.csv`, `run` is `real` or `control`, `seed` is the probe seed of a real probe and the label seed of a control probe, `init_seed` is the seed of the probe's initialization and shuffling order, `k` is the dimension of the probe's subspace, `oe` is its OE in bits, and `score` is its test accuracy, on the control labels for a control probe; `score_kind` names the score. ## Usage Read one checkpoint and compute the Optimization Engagement (OE) of one probe with the AGOP of the same model, checkpoint and layer (repo `disentangle-concept-learning/agop`). No language model is needed: ```python import json import numpy as np from huggingface_hub import hf_hub_download from safetensors import safe_open from safetensors.numpy import load_file path = hf_hub_download('disentangle-concept-learning/cls-ner', 'pythia-410m/step512.safetensors', repo_type='dataset') arrays = load_file(path) with safe_open(path, 'np') as f: meta = f.metadata() runs = meta['runs'].split(',') G = load_file(hf_hub_download('disentangle-concept-learning/agop', 'pythia-410m/step512.safetensors', repo_type='dataset'))['layer8'] classes = json.loads(meta['classes']) # K class names, the order of axis 2 of W layer, run = 8, runs.index('real_1001') W = arrays['W'][layer, run].astype(np.float64) # [K, d] k = len(classes) - 1 # top K - 1 right singular vectors of the class-centered weights U = np.linalg.svd(W - W.mean(0), full_matrices=False)[2][:k].T oe = np.log2(G.shape[0] * np.trace(U.T @ G @ U) / (k * np.trace(G))) ``` `oe` equals the `oe` column of `probes.csv` for this probe (model pythia-410m, checkpoint 512, layer 8, run real, seed 1001). Apply the probe to block-8 outputs `h` (float32, one row per item, 1024 columns) of Pythia-410M at step 512, read at the last sub-word token of each word, with its whole sentence as context: ```python x = (h.astype(np.float64) - arrays['input_mean'][layer]).astype(np.float32) # centering as in training logits = x @ arrays['W'][layer, run].T + arrays['b'][layer, run] # [n, K] predicted = [classes[i] for i in logits.argmax(-1)] ``` ## License and attribution Derived from [UNER English EWT](https://github.com/UniversalNER/UNER_English-EWT/tree/8ed072de2fd24022cc62458997fe96a8fe191ea4) (CC BY-SA 4.0; text from the English Web Treebank) and the [Pythia](https://github.com/EleutherAI/pythia) models (Apache-2.0). We release the probes under CC BY-SA 4.0. Please cite: ```bibtex @inproceedings{wang2026geometrically, title = {Geometrically Disentangling Concept Learning from the Language Modeling Loss}, author = {Wang, Yupei and Mallinar, Neil and Belkin, Mikhail and Warstadt, Alex}, booktitle = {Advances in Neural Information Processing Systems}, year = {2026} } ```