Introduction
Deep neural networks have achieved remarkable success in text classification but often operate as "black boxes," hindering their adoption in high-stakes domains where trust and transparency are paramount. While post-hoc explanation methods exist, they frequently suffer from a lack of faithfulness to the model's actual decision-making process. ProtoLens addresses this by introducing a novel architecture that provides inherent, fine-grained interpretability at the sub-sentence level. By extracting specific text spans and aligning them with human-understandable "prototypes," ProtoLens explains its predictions through direct analogy.
Methodology
ProtoLens moves beyond coarse sentence-level analysis by focusing on sub-sentence granularity. Its architecture consists of three primary components:
- Prototype-aware Span Extraction: Utilizing a Dirichlet Process Gaussian Mixture Model (DPGMM), the model identifies and extracts relevant text spans of flexible lengths. This allows the model to isolate specific phrases that drive the classification.
- Prototype Alignment: To ensure internal prototypes remain human-interpretable, an alignment mechanism adaptively pushes prototype vectors toward the embeddings of real-world representative sentences from the training set. This prevents "concept drift" into abstract mathematical spaces.
- Interpretable Classifier: A transparent Logistic Regression layer processes the similarity scores between extracted spans and prototypes. This allows for a clear view of how much each prototype contributes to the final label.
Experimental Setup
The model was evaluated across seven diverse benchmarks, including sentiment analysis (IMDB, Yelp, Amazon), domain-specific reviews (Hotel, Steam), and topic categorization (DBPedia, Consumer Complaint). ProtoLens, utilizing an MPNet encoder, was compared against state-of-the-art prototype-based models like ProtoryNet and ProSeNet, as well as large language models like Llama-3-8b.
Results and Discussion
ProtoLens demonstrates that interpretability does not require a performance trade-off. It consistently outperformed existing prototype-based baselines; for example, achieving an accuracy of 0.903 on the IMDB dataset compared to ProtoryNet's 0.871. Notably, ProtoLens also surpassed Llama-3-8b in zero-shot settings across all tested datasets, often by margins exceeding 10%.
The qualitative strength of the model is evident in its ability to ground predictions in specific, aligned prototypes. As shown in the table below, the model identifies clear linguistic concepts (e.g., acting performance vs. plot quality) and assigns them appropriate weights for the target class.
Ablation studies confirmed that both the Diversity Loss (which keeps prototypes distinct) and the Alignment mechanism are critical. Removing these components led to significant degradation in both classification accuracy and the semantic coherence of the generated explanations.
Conclusion
ProtoLens represents a significant step forward in interpretable NLP, providing faithful, fine-grained explanations without sacrificing predictive power. By grounding its reasoning in prototypical examples, it offers a more human-like approach to text classification. Future work will explore the integration of ProtoLens with larger generative models to combine their linguistic breadth with the transparency of prototype-based learning.
Summary updated