CoolFace
Apppublic

yiqing111/attention_surgery

sourceHugging Facemitupdated 10mo agoView on Hugging Face
0likes
App README

Attention Surgery: Interactive Mechanistic Interpretability

This is the backend API service for the Attention Surgery project. It provides model inference (GPT-2 Small), attention pattern ablation, and real-time metrics computation.

Features

  • Head Ablation: Zero, Mean, Random, and Previous-Layer ablation methods.
  • Importance Scoring: Gradient-based and Rollback-based head importance estimation.
  • Real-time Metrics: KL Divergence, Top-1 Changed Ratio, Perplexity Delta.
  • Logit Lens: Layer-wise prediction confidence analysis.

The frontend is hosted separately (e.g., on Vercel) and communicates with this service via REST API.