--- license: apache-2.0 language: - en - zh tags: - context compression - sentence selection - probing classifier - attention probing - RAG - LongBench pipeline_tag: text-classification --- # Sentinel Probing Classifier (Logistic Regression) This repository contains the sentence-level classifier used in **Sentinel**, a lightweight context compression framework introduced in our paper: > **Sentinel: Attention Probing of Proxy Models for LLM Context Compression with an Understanding Perspective** > Yong Zhang, Yanwen Huang, Ning Cheng, Yang Guo, Yun Zhu, Yanmeng Wang, Shaojun Wang, Jing Xiao > 📄 [Paper (Arxiv 2025)](https://arxiv.org/abs/2505.23277) | 💻 [Code on GitHub](https://github.com/yzhangchuck/Sentinel) --- ## 🧠What is Sentinel? **Sentinel** reframes LLM context compression as a lightweight attention-based *understanding* task. Instead of fine-tuning a full compression model, it: - Extracts **decoder attention** from a small proxy LLM (e.g., Qwen-2.5-0.5B) - Computes **sentence-level attention features** - Applies a **logistic regression (LR) classifier** to select relevant sentences This approach is efficient, model-agnostic, and highly interpretable. --- ## 📦 Files Included | File | Description | |-------------------------|----------------------------------------------| | `sentinel_lr_model.pkl` | Trained logistic regression classifier | | `sentinel_config.json` | Feature extraction configuration | --- ## 🚀 Usage Use this classifier on attention-derived feature vectors to predict sentence-level relevance scores: 🛠Feature extraction code and full pipeline available at: 👉 https://github.com/yzhangchuck/Sentinel ## 📈 Benchmark Results