nips234678 commited on
Commit
4ddcb05
·
verified ·
1 Parent(s): 55f23b4

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +232 -42
README.md CHANGED
@@ -1,61 +1,251 @@
1
  ---
2
- dataset_info:
3
- features:
4
- - name: id
5
- dtype: string
6
- - name: text
7
- dtype: string
8
- - name: label
9
- dtype: int32
10
- - name: domain
11
- dtype: string
12
- - name: token_count
13
- dtype: int32
14
- - name: matched_pair_id
15
- dtype: string
16
- - name: split
17
- dtype: string
18
- configs:
19
- - config_name: default
20
- data_files:
21
- - split: train
22
- path: "data/corpora/*/train_*.jsonl"
23
- - split: test
24
- path: "data/corpora/*/test_*.jsonl"
25
  ---
26
 
27
  # PoolBench
28
 
29
- **PoolBench** is a benchmark for evaluating pooling strategies for activation steering across 17 text concepts.
 
 
30
 
31
- Each concept corpus contains up to 1,000 passages per class (700 train / 300 test) sourced from real public datasets on HuggingFace. No passages are LLM-generated.
32
 
33
- ## Dataset structure
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
 
35
- Files are organised as `data/corpora/<concept>/{train,test}_{pos,neg}.jsonl`.
36
 
37
- Each JSON line has the following fields:
 
 
38
 
39
- | Field | Type | Description |
40
  |---|---|---|
41
- | `id` | string | Unique record identifier |
42
- | `text` | string | Passage text (300–500 tokens via LLaMA-3.1-8B tokenizer) |
43
- | `label` | int | 1 = concept present (positive), 0 = concept absent (negative) |
44
- | `domain` | string | Source domain (e.g. `academic`, `news`, `social`) |
45
- | `token_count` | int | Token count (LLaMA-3.1-8B tokenizer) |
46
- | `matched_pair_id` | string | Pair ID for matched-pair concepts; `null` for independently-sampled concepts |
47
- | `split` | string | `train` or `test` |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
 
49
- ## Concepts (17)
50
 
51
- `academic_tone`, `bureaucratic`, `causation`, `code_docs`, `conditionality`, `contrast`, `deference`, `depression`, `frustration`, `hedging`, `imdb_sentiment`, `legal_formality`, `narrative`, `negation_density`, `numerical_precision`, `planning`, `toxicity`
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
 
53
  ## Citation
54
 
55
  ```bibtex
56
- @misc{poolbench2026,
57
- title={PoolBench: Evaluating Pooling Strategies for Activation Steering Vectors},
58
- author={Anonymous},
59
- year={2026},
 
 
 
60
  }
61
  ```
 
 
 
1
  ---
2
+ license: apache-2.0
3
+ task_categories:
4
+ - text-classification
5
+ language:
6
+ - en
7
+ tags:
8
+ - benchmark
9
+ - pooling-strategies
10
+ - representation-learning
11
+ - mechanistic-interpretability
12
+ - probing
13
+ - steering-vectors
14
+ pretty_name: PoolBench
15
+ size_categories:
16
+ - 10K<n<100K
 
 
 
 
 
 
 
 
17
  ---
18
 
19
  # PoolBench
20
 
21
+ **PoolBench** is a diagnostic benchmark for evaluating pooling strategies in decoder-only large language models.
22
+ Every embedding pipeline implicitly chooses a pooling strategy — last token, mean pooling, attention-weighted, etc. — yet this choice is almost never studied systematically.
23
+ PoolBench provides the first controlled, multi-concept, multi-model evaluation framework for this decision.
24
 
25
+ Submitted to the **NeurIPS 2026 Datasets & Benchmarks Track**.
26
 
27
+ ---
28
+
29
+ ## What is a pooling strategy?
30
+
31
+ A *pooling strategy* is a function that maps a sequence of per-token hidden states
32
+ $\mathbf{H} \in \mathbb{R}^{T \times d}$
33
+ to a single fixed-size vector
34
+ $\mathbf{v} \in \mathbb{R}^d$.
35
+ This vector is then used for classification, similarity search, or steering.
36
+ PoolBench asks: *which pooling strategy best captures a given semantic concept in a given model at a given layer?*
37
+
38
+ ---
39
+
40
+ ## Benchmark overview
41
+
42
+ | Dimension | Value |
43
+ |---|---|
44
+ | Pooling strategies evaluated | 19 (18 unsupervised + 1 supervised) |
45
+ | Semantic concepts | 17 |
46
+ | Models | Llama-3.1-8B, Gemma-2-9B, Mistral-7B-v0.3 |
47
+ | Evaluation metrics | D1 AUROC · D2 SCP · D3 Disentanglement |
48
+ | Corpus size | 1,000 passages/concept (700 train + 300 test, balanced pos/neg) |
49
+ | Token window | 300–500 tokens (LLaMA-3.1-8B BPE tokenizer) |
50
+ | Total passages | ~33,000 |
51
+
52
+ ---
53
+
54
+ ## The 17 Concepts
55
+
56
+ Concepts span five linguistic families, chosen to cover a range of signal density and linguistic depth:
57
+
58
+ | Family | Concepts |
59
+ |---|---|
60
+ | Sparse-lexical | `hedging`, `legal_formality`, `frustration`, `numerical_precision` |
61
+ | Dense-lexical | `imdb_sentiment`, `toxicity`, `depression` |
62
+ | Syntactic/discourse | `causation`, `contrast`, `conditionality`, `negation_density` |
63
+ | Register | `academic_tone`, `code_docs`, `bureaucratic`, `narrative` |
64
+ | Semantic-abstract | `deference`, `planning` |
65
 
66
+ **Sensitive concepts:** `toxicity` and `depression` are included in all metric computations but their steered text outputs are withheld from public release (available on request for research use).
67
 
68
+ ---
69
+
70
+ ## The 19 Pooling Strategies
71
 
72
+ | Family | Strategy ID | Description |
73
  |---|---|---|
74
+ | Position-anchored | `P1_last_token` | Final non-padding token |
75
+ | | `P2_first_token` | First token (BOS position) |
76
+ | Uniform aggregation | `A1_mean` | Arithmetic mean over all tokens |
77
+ | | `A2_max` | Element-wise max |
78
+ | | `A3_min` | Element-wise min |
79
+ | | `A4_norm_weighted` | Token-norm weighted mean |
80
+ | Window | `W1_first_k` | Mean of first *k* tokens |
81
+ | | `W2_last_k` | Mean of last *k* tokens |
82
+ | | `W3_middle_k` | Mean of middle *k* tokens |
83
+ | | `W4_hierarchical` | Chunk → mean → aggregate |
84
+ | Saliency-weighted | `S1_attention` | Attention-score weighted mean |
85
+ | | `S2_gradient` | Gradient-norm weighted mean |
86
+ | | `S3_iti_probe` | Supervised ITI head-based pooling |
87
+ | Structural-linguistic | `L1_pos_filtered` | Content POS tags only (NOUN, VERB, ADJ, ADV) |
88
+ | | `L2_dependency_rel` | Dependency-arc triggered tokens |
89
+ | | `L3_entity` | Named entity spans |
90
+ | | `L4_clause` | Clause-boundary segmentation |
91
+ | | `L5_keyword` | TF-IDF top-k keywords |
92
+ | | `L6_sentence` | Sentence-boundary segments |
93
+
94
+ ---
95
 
96
+ ## The Three Evaluation Dimensions
97
 
98
+ ### D1 Concept Separability (AUROC)
99
+ Linear probe AUROC measuring how well a pooling strategy separates positive from negative passages for each concept.
100
+ Training: 5-fold OOF on 700 train passages per class.
101
+ No labels from the test split are used for D1 training.
102
+
103
+ ### D2 — Steered Concept Prevalence (SCP)
104
+ Measures whether a pooling strategy's steering vector (DiffMean) actually *steers* generated text toward the target concept.
105
+ A Classifier B (fine-tuned BERT) scores each steered generation.
106
+ SCP = correlation between alpha (steering strength) and Classifier B score.
107
+
108
+ ### D3 — Disentanglement
109
+ Measures whether steering toward concept A avoids contaminating a linguistically-distant (LD) and linguistically-close (LC) neighbour concept.
110
+
111
+ $$\text{Disent}_c = 1 - \frac{\Delta_B}{\Delta_A}$$
112
+
113
+ Where $\Delta_A$ = SCP on target concept, $\Delta_B$ = SCP on neighbour concept under the same steering vector.
114
+
115
+ ---
116
+
117
+ ## Dataset Structure
118
+
119
+ ```
120
+ poolbench/
121
+ {concept}/
122
+ train_pos.jsonl # 700 positive training passages
123
+ train_neg.jsonl # 700 negative training passages
124
+ test_pos.jsonl # 300 positive test passages
125
+ test_neg.jsonl # 300 negative test passages
126
+ ```
127
+
128
+ Each JSONL record:
129
+ ```json
130
+ {
131
+ "id": "academic_tone_train_pos_0001",
132
+ "text": "...",
133
+ "label": 1,
134
+ "domain": "academic",
135
+ "token_count": 347,
136
+ "matched_pair_id": null,
137
+ "split": "train"
138
+ }
139
+ ```
140
+
141
+ Fields:
142
+ - `id` — unique identifier with concept, split, class, and index
143
+ - `text` — passage text (300–500 LLaMA-3.1-8B tokens except `toxicity`/`deference`)
144
+ - `label` — 1 = positive, 0 = negative
145
+ - `domain` — source domain (e.g., `academic`, `news`, `social`, `legal_us`)
146
+ - `token_count` — exact token count under LLaMA-3.1-8B tokenizer
147
+ - `matched_pair_id` — non-null for matched-pair concepts (negative is a controlled rewrite of the positive)
148
+ - `split` — `train` or `test`
149
+
150
+ ---
151
+
152
+ ## Corpus Construction
153
+
154
+ Positive and negative passages were constructed under strict controls:
155
+
156
+ - **700/700 train, 300/300 test per concept** — balanced classes to avoid probe bias
157
+ - **300–500 token window** — enforced by LLaMA-3.1-8B BPE tokenizer at build time
158
+ - **≥3 source domains per concept** — prevents domain vocabulary from confounding pooling strategy comparisons
159
+ - **±25 token matching rule** — for matched-pair concepts, the positive and its negative rewrite differ by ≤25 tokens
160
+ - **MD5-based deduplication** — within-class, cross-class, and train/test leak checks
161
+ - **Seed-word contamination filter** — negatives must not contain the concept's seed words
162
+
163
+ See the [GitHub repository](https://github.com/2023mc21517-arch/poolbench) for full construction notes and per-concept source tables.
164
+
165
+ ### Source datasets
166
+
167
+ | Concept family | Sources |
168
+ |---|---|
169
+ | Academic/Scientific | `gfissore/arxiv-abstracts-2021`, `qiaojin/PubMedQA` |
170
+ | Legal/Government | `lex_glue` (scotus, eurlex), `FiscalNote/billsum` |
171
+ | News | `cc_news` |
172
+ | Social | `sentence-transformers/reddit`, `Yelp/yelp_review_full` |
173
+ | Math | `meta-math/MetaMathQA`, `AI-MO/NuminaMath-CoT` |
174
+ | Code | `code_search_net` (python, java, javascript, ruby) |
175
+ | Sentiment/Toxicity | `yin001/imdb_dataset_positive_negative`, `tdavidson/hate_speech_offensive`, `google/civil_comments`, Surge-AI toxicity CSV |
176
+ | Depression | `mrjunos/depression-reddit-cleaned`, `dlb/mentalreddit` |
177
+ | Politeness | `Intel/polite-guard` |
178
+ | How-to | `gursi26/wikihow-cleaned` |
179
+
180
+ ---
181
+
182
+ ## Quick Start
183
+
184
+ ```python
185
+ from datasets import load_dataset
186
+
187
+ # Load one concept
188
+ ds = load_dataset("nips234678/poolbench", data_dir="academic_tone")
189
+
190
+ # Load all concepts
191
+ from pathlib import Path
192
+ concepts = [
193
+ "academic_tone", "bureaucratic", "causation", "code_docs",
194
+ "conditionality", "contrast", "deference", "depression",
195
+ "frustration", "hedging", "imdb_sentiment", "legal_formality",
196
+ "narrative", "negation_density", "numerical_precision",
197
+ "planning", "toxicity",
198
+ ]
199
+ for concept in concepts:
200
+ ds = load_dataset("nips234678/poolbench", data_dir=concept)
201
+ ```
202
+
203
+ To reproduce the full pipeline from activations to leaderboard:
204
+ ```bash
205
+ git clone https://github.com/2023mc21517-arch/poolbench.git
206
+ cd poolbench
207
+ pip install -e ".[dev]"
208
+
209
+ # Download corpus
210
+ huggingface-cli download nips234678/poolbench --repo-type dataset --local-dir data/corpora
211
+
212
+ # Run full pipeline (requires GPU, ~8h per model on A100)
213
+ python scripts/run_model.py --model mistral7b --device cuda:0
214
+ ```
215
+
216
+ ---
217
+
218
+ ## Related Artifacts
219
+
220
+ | Artifact | Link | Contents |
221
+ |---|---|---|
222
+ | BERT Scorer Models (D2) | [nips234678/poolbench-bert-scorers](https://huggingface.co/nips234678/poolbench-bert-scorers) | 17 fine-tuned BERT classifiers (one per concept) used as Classifier B for D2 SCP scoring |
223
+ | Activation Files | [nips234678/poolbench-activations](https://huggingface.co/datasets/nips234678/poolbench-activations) | Per-model per-layer hidden states (.npy) for all 3 models — enables D1 evaluation without re-running inference (~390 GB) |
224
+ | Steered Outputs | [nips234678/poolbench-steered-outputs](https://huggingface.co/datasets/nips234678/poolbench-steered-outputs) | Generated texts from D2 SCP evaluation for 15 non-sensitive concepts across all 3 models |
225
+ | Code & Leaderboard | [GitHub](https://github.com/2023mc21517-arch/poolbench) | Evaluation pipeline, pooling strategy implementations, community submission workflow |
226
+
227
+ ---
228
+
229
+ ## Ethical Considerations
230
+
231
+ - **Toxicity and depression concepts** include passages containing toxic language and expressions of psychological distress, respectively. These are sourced from publicly available datasets with established research use. Steered text outputs for these two concepts are withheld from public release.
232
+ - **No personal information** — all passages are sourced from public corpora with no PII.
233
+ - **Model outputs** — steered generation outputs are research artifacts demonstrating steering vector magnitude effects; they are not endorsements of the content.
234
+ - **Intended use** — evaluation of pooling strategies in language model representations. Not intended for clinical use, content moderation in production, or as training data for generation models.
235
+
236
+ ---
237
 
238
  ## Citation
239
 
240
  ```bibtex
241
+ @dataset{poolbench2026,
242
+ title = {{PoolBench}: A Diagnostic Benchmark for Pooling Strategies in Decoder-Only Language Models},
243
+ author = {Anonymous},
244
+ year = {2026},
245
+ publisher = {HuggingFace},
246
+ url = {https://huggingface.co/datasets/nips234678/poolbench},
247
+ note = {Submitted to NeurIPS 2026 Datasets \& Benchmarks Track}
248
  }
249
  ```
250
+
251
+ *Citation will be updated with full author list and DOI upon paper acceptance.*