Update README.md
Browse files
README.md
CHANGED
|
@@ -1,10 +1,90 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Overflow Probe (Full)
|
| 2 |
+
|
| 3 |
+
A binary MLP probe that detects **token overflow** in soft-compressed document representations [PISCO](https://arxiv.org/abs/2501.16075). Token overflow occurs when a document's information content exceeds the capacity of the compressed token budget, leading to degraded downstream QA performance.
|
| 4 |
+
|
| 5 |
+
## How It Works
|
| 6 |
+
|
| 7 |
+
The probe takes a 4096-dim vector:
|
| 8 |
+
|
| 9 |
+
| Component | Description |
|
| 10 |
+
|-----------|-------------|
|
| 11 |
+
| `mid_q` | Last hidden representation from mid layer (16) of a PISCO decoder model with standard prompt, compressed context, and question|
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
Output: probability that the compressed representation has **overflowed** (i.e., lost critical information).
|
| 15 |
+
|
| 16 |
+
## Installation
|
| 17 |
+
|
| 18 |
+
```bash
|
| 19 |
+
pip install torch huggingface_hub
|
| 20 |
+
```
|
| 21 |
+
|
| 22 |
+
## Usage
|
| 23 |
+
|
| 24 |
+
### 1. Get the class definition
|
| 25 |
+
|
| 26 |
+
The model requires the `PISCOClassifier` class to load. Grab it from this repo:
|
| 27 |
+
|
| 28 |
+
```python
|
| 29 |
+
from huggingface_hub import hf_hub_download
|
| 30 |
+
import importlib.util, sys
|
| 31 |
+
|
| 32 |
+
path = hf_hub_download("wexumin/overflow_probe_pisco_squad", "pisco_clf.py")
|
| 33 |
+
spec = importlib.util.spec_from_file_location("pisco_clf", path)
|
| 34 |
+
mod = importlib.util.module_from_spec(spec)
|
| 35 |
+
spec.loader.exec_module(mod)
|
| 36 |
+
PISCOClassifier = mod.PISCOClassifier
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
### 2. Load the model
|
| 40 |
+
|
| 41 |
+
```python
|
| 42 |
+
model = PISCOClassifier.from_pretrained("wexumin/overflow_probe_pisco_squad")
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
### 3. Run inference
|
| 46 |
+
|
| 47 |
+
```python
|
| 48 |
+
import numpy as np
|
| 49 |
+
|
| 50 |
+
# postproj: compressed doc embedding (4096-dim)
|
| 51 |
+
x = mid_q
|
| 52 |
+
|
| 53 |
+
probs = model.predict_proba(x) # (n, ) β is overflow probability
|
| 54 |
+
preds = model.predict(x) # (n,) β binary 0/1 (one can provide custom threshold parameter)
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
## Training Data
|
| 58 |
+
|
| 59 |
+
- **SQuAD** β extractive QA over Wikipedia paragraphs
|
| 60 |
+
From each each context in the dataset was reduce to just question-answering sentence and then filled with noise context to be up to 128 tokens (in terms of pisco encoder tokenzier).
|
| 61 |
+
## Architecture
|
| 62 |
+
|
| 63 |
+
```
|
| 64 |
+
β Linear(4096, 512)
|
| 65 |
+
β LayerNorm
|
| 66 |
+
β GELU
|
| 67 |
+
β Dropout(0.3)
|
| 68 |
+
β Linear(512, 128)
|
| 69 |
+
β GELU
|
| 70 |
+
β Dropout(0.2)
|
| 71 |
+
β Linear(128, 1)
|
| 72 |
+
```
|
| 73 |
+
|
| 74 |
+
## Citation
|
| 75 |
+
|
| 76 |
+
```bibtex
|
| 77 |
+
@inproceedings{belikova-etal-2026-detecting,
|
| 78 |
+
title = "Detecting Overflow in Compressed Token Representations for Retrieval-Augmented Generation",
|
| 79 |
+
author = "Belikova, Julia and Rozhevskii, Danila and Svirin, Dennis and Polev, Konstantin and Panchenko, Alexander",
|
| 80 |
+
editor = "Baez Santamaria, Selene and Somayajula, Sai Ashish and Yamaguchi, Atsuki",
|
| 81 |
+
booktitle = "Proceedings of the 19th Conference of the {E}uropean Chapter of the {A}ssociation for {C}omputational {L}inguistics (Volume 4: Student Research Workshop)",
|
| 82 |
+
month = mar,
|
| 83 |
+
year = "2026",
|
| 84 |
+
address = "Rabat, Morocco",
|
| 85 |
+
publisher = "Association for Computational Linguistics",
|
| 86 |
+
url = "https://aclanthology.org/2026.eacl-srw.59/",
|
| 87 |
+
pages = "797--810",
|
| 88 |
+
ISBN = "979-8-89176-383-8"
|
| 89 |
+
}
|
| 90 |
+
```
|