PaTz β€” Physics-Aware Transformer with eXplainability
● API Offlinepatz_env

LIME Analysis

NOT IMPLEMENTED

LIME (Local Interpretable Model-agnostic Explanations) is not in the PaTz codebase. Local explanations are provided by Integrated Gradients + MC Dropout uncertainty.

⚠ LIME not in codebase β€” local explanations via IG + MC Dropout

LIME requires perturbation-based sampling (10–50k perturbed sequences per protein) β€” computationally prohibitive for variable-length protein sequences on a 6 GB GPU. The per-protein IG attributions in results/xai_results.json already provide local (per-protein, per-residue) explanations with better axiomatic guarantees.

How LIME Would Work on PaTz
1

For a single protein, generate N=1,000–5,000 perturbed versions by randomly masking residue windows.

2

Run each perturbation through PaTz to get GO term prediction probability changes.

3

Fit a sparse linear model (Ridge) on the perturbation neighbourhood β†’ coefficients are LIME weights.

4

Identify residue windows with highest positive/negative weight for a target GO term.

Estimated cost: 5,000 Γ— ~50ms/protein = ~4 min/protein on RTX 3050. For 525 test proteins: ~35 hours. Infeasible.
Available Local Explanation Tools
βœ“ Integrated Gradients (per-protein)

Per-residue importance map for each protein and each GO prediction. Fast (~2s/protein). Captum + Riemann fallback.

β†’ Open
βœ“ MC Dropout Uncertainty

N=20 stochastic passes β†’ predictive entropy H[p] per protein. Identifies unreliable predictions.

β†’ Open
β—‹ Attention Patterns

Pairformer 4-layer 8-head attention weights (residue–residue). Requires inference pass.

LIME vs IG β€” Why IG is Preferred for Protein Sequences
CriterionLIMEIntegrated Gradients
Explanation typeNeighbourhood linear proxyPath-integral attribution
Perturbation neededβœ“ Yes (1k–50k samples)βœ— No (50 interpolation steps)
Handles variable lengthβœ— Hard (masking ill-defined)βœ“ Yes (per-residue dim-mean)
GO-term specificityβœ“ Per-class linear fitβœ“ Per-class gradient
Completeness axiomβœ— Approximateβœ“ Exact (Captum)
Speed per protein~4 min (RTX 3050)~2 sec
Used in PaTzβœ— Not implementedβœ“ src/xai/ig.py
→ View IG Attribution→ XAI Dashboard