Manuscript Offprint
arXiv:2608.25555Virgil: Navigating Explainability for Transformer-based Language Models
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Martino Ciaperoni (✉), Sezer Kutluk , Benedetta Muscato , Marta Marchiori Manerba , and Fosca Giannotti
Scuola Normale Superiore, Pisa, Italy {name.surname}@sns.it
University of Turin, Italy {name.surname}@unito.it
Abstract. Explainability for transformer-based language models is becoming crucial as these systems are deployed in high-stakes applications. As a result, the ecosystem of explainability tools is rapidly evolving, becoming richer, but also more fragmented and harder to navigate. To address this challenge, we present Virgil, an interactive system that lets practitioners and researchers, including non-experts, navigate explainability tools for transformer language models. Supported by a curated knowledge base, the system enables users to discover and compare explainability tools within a unified interface.
Keywords: Explainability · Transformers · NLP.
1 Introduction
Transformer-based language models are widely deployed across many applications, including high-stakes domains such as law and healthcare [8]. However, their decision processes remain difficult to interpret, raising concerns about hallucinations and unexpected behaviors [8]. As a result, explainability for language models has attracted growing attention, leading to a rapidly expanding landscape of explainability tools (or explainers), ranging from intuitive input attributions to mechanistic interpretability [2]. Navigating this landscape can be challenging. Although surveys offer useful overviews and taxonomies, they rarely provide guidance for selecting suitable explainers in real-world settings [1,8].
To bridge this gap, we introduce Virgil, an interactive system designed to guide users through the landscape of explainers for transformer-based language models. Named after the guide who leads Dante through the Inferno, Virgil helps users identify explainers suited to their needs through structured filters or natural-language queries over a curated knowledge base of diverse explainers. Retrieved explainers are presented through concise descriptions that highlight their key characteristics and trade-offs. In addition, Virgil enables users to directly run selected explainers and compare their outputs. Thanks to its modular architecture, Virgil can be easily extended as new explainers emerge, positioning it as a central resource for explainability of language models across both academia and industry. Virgil can be accessed at https://huggingface.co/spaces/Explainability4LanguageModels/Virgil and a video demonstration can be found at https://www.youtube.com/watch?v=Ybs8IYztL8k.
M. Ciaperoni et al.

Fig. 1. Overview of the Virgil interface. Users query the knowledge base on the left. Matching explainability tools are displayed in the center, while detailed information about selected explainers is shown on the right.
Knowledge base. At the core of the system lies a curated knowledge base of explainers, each represented by an explainer card. At the time of writing, the knowledge base contains 43 explainer cards. Cards contain structured fields describing the target macro-task (text classification or generation), model access (white-box or black-box), supported transformer architectures (encoder-only, decoder-only, or encoder-decoder), explanation scope (local or global), and expertise required to understand the explanations (non-experts, mid-experts, or experts). For each explainer, they also contain an overview, capabilities, strengths, limitations, useful references and a link to an implementation.
Retrieval engine. The retrieval engine maps user requirements to suitable explainers. Virgil supports structured queries (i.e., filters on task, model access, architecture, and explanation scope) and free-text queries describing user needs. Free-text queries are embedded using a sentence-transformer model (all-MiniLM-L6-v2 [3]) and compared with three textual fields of explainer cards, namely
Virgil: Navigating Explainability for Transformer-based Language Models
3
overview, capabilities, and strengths. Similarity scores are aggregated through a weighted ranking that assigns weights of 0.5, 0.4, and 0.1 to the three fields, respectively. Results can also be ranked by expertise requirements.
Exploration engine. After retrieving explainers matching user needs, users can select one to explore. The exploration engine presents their key characteristics and, when available, enables interactive execution of explainers with custom inputs, Hugging Face pretrained models [6] and parameters, producing explanations and useful visualizations. It also supports side-by-side comparison of explainers (comparative view).
3 Using Virgil
Virgil can be used online without coding or run locally with hardware acceleration support. Users interact with the system by querying the knowledge base to retrieve relevant explainers, which can then be selected, explored, and optionally executed.
Target audience. Virgil supports a broad range of users interested in explaining transformer-based language models, from practitioners with limited experience in explainability to researchers conducting preliminary analyses and exploring or comparing different explainers. The system can also support educational, training, and collaborative activities involving multiple stakeholders.
Preliminary user feedback. We gathered preliminary feedback from 10 anonymous researchers through a survey assessing Virgil intuitiveness, comprehensibility, and usefulness. Respondents reported that Virgil is intuitive (80% agree or strongly agree) and that the explainer descriptions are clear and useful (70% agree or strongly agree). Most participants also indicated that they would recommend Virgil to colleagues (90% likely or very likely). While encouraging, these results are limited by the small number of participants and their research-oriented background. We plan to extend this evaluation to a larger group of practitioners and researchers in future work.
Illustrative use case. As an example, consider a sentiment classification task on movie reviews where a user seeks to identify the most important tokens driving the prediction. The user queries Virgil for explainers compatible with text classification models, specifying an encoder-only transformer, white-box access, and local explanations. The system retrieves 16 results. The user first runs INPUT×GRADIENT [4] using a pretrained sentiment classifier. However, the attribution scores appear unstable across similar inputs. The user therefore switches to the comparison view and evaluates INTEGRATED GRADIENTS [5], which produces more stable attributions. Figure 2 shows INTEGRATED GRADIENTS more clearly highlighting “good” as driving the positive prediction. The user then queries “counterfactual” and runs POLYJUICE [7] to generate a counterfactual example that flips the prediction. The analysis can be further extended by inspecting internal representations to study how positive sentiment is encoded. The same workflow applies to many applications, including in high-stakes domains.
https://forms.gle/nsME36PGQvum7Fh3A
M. Ciaperoni et al.

Fig. 2. Token-level attribution scores computed in Virgil using INPUT×GRADIENT (left) and INTEGRATED GRADIENTS for the example input "The movie was good".
4 Conclusion
We introduced Virgil, an interactive system for discovering, exploring, and comparing explainers for transformer-based language models. Future work will focus on developing Virgil into a central community resource that organizes explainers for transformer-based language models, contributes to the democratization of explainability, and facilitates the translation of research advances into practice.
Acknowledgments. This work was partially supported by the ERC Advanced Grant No. 834756 (“XAI – Science and Technology for the Explanation of AI Decision Making”), by the European Union under Grant Agreement No. 101120763 (“TANGO”), and by FAIR – Future Artificial Intelligence Research (PE00000013, Spoke 1 “Human-Centered AI”), funded under the Next Generation EU programme.
Disclosure of Interests. The authors have no competing interests to declare that are relevant to the content of this article.
References
-
Calderon, N., Reichart, R.: On behalf of the stakeholders: Trends in nlp model interpretability in the era of llms. In: Proceedings of NAACL: Long Papers. pp. 656–693. Association for Computational Linguistics (2025)
-
Ferrando, J., Sarti, G., Bisazza, A., Costa-jussà, M.R.: A primer on the inner workings of transformer-based language models. arXiv preprint arXiv:2405.00208 (2024)
-
Reimers, N., Gurevych, I.: Sentence-bert: Sentence embeddings using siamese bert-networks. In: Proceedings of EMNLP-IJCNLP. pp. 3982–3992 (2019)
-
Simonyan, K., Vedaldi, A., Zisserman, A.: Deep inside convolutional networks: Visualising image classification models and saliency maps. In: ICLR Workshop (2014)
-
Sundararajan, M., Taly, A., Yan, Q.: Axiomatic attribution for deep networks. In: Proceedings of ICML. pp. 3319–3328. PMLR (2017)
-
Wolf, T., et al.: Transformers: State-of-the-art natural language processing. In: Proceedings of EMNLP: System Demonstrations (2020)
-
Wu, T., Ribeiro, M.T., Heer, J., Weld, D.: Polyjuice: Generating counterfactuals for explaining, evaluating, and improving models. In: Proceedings of ACL. pp. 6707–6723 (2021)
-
Zhao, H., Chen, H., Yang, F., Liu, N., Deng, H., Cai, H., Wang, S., Yin, D., Du, M.: Explainability for large language models: A survey. ACM Trans. Intell. Syst. Technol. 15(2), 20:1–20:38 (2024). https://doi.org/10.1145/3639372