Virgil: Navigating Explainability for Transformer-based Language Models

arXiv cs.CL Papers

Summary

Virgil is an interactive system designed to help users discover and compare explainability tools for transformer-based language models through a curated knowledge base and unified interface.

arXiv:2608.25555v1 Announce Type: new 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.
Original Article
View Cached Full Text

Cached at: 08/27/26, 09:22 AM

# Virgil: Navigating Explainability for Transformer-based Language Models
Source: [https://arxiv.org/html/2608.25555](https://arxiv.org/html/2608.25555)
Martino Ciaperoni \(✉\)Sezer KutlukAffiliation:Scuola Normale Superiore, Pisa, ItalyE\-mail[\{name\.surname\}@sns\.it](mailto:{name.surname}@sns.it)Benedetta MuscatoAffiliation:Scuola Normale Superiore, Pisa, ItalyE\-mail[\{name\.surname\}@sns\.it](mailto:{name.surname}@sns.it)Marta Marchiori ManerbaAffiliation:University of Turin, ItalyE\-mail[\{name\.surname\}@unito\.it](mailto:{name.surname}@unito.it)Fosca GiannottiAffiliation:Scuola Normale Superiore, Pisa, ItalyE\-mail[\{name\.surname\}@sns\.it](mailto:{name.surname}@sns.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\.

## 1Introduction

Transformer\-based language models are widely deployed across many applications, including high\-stakes domains such as law and healthcare\[[8](https://arxiv.org/html/2608.25555#bib.bib1)\]\. However, their decision processes remain difficult to interpret, raising concerns about hallucinations and unexpected behaviors\[[8](https://arxiv.org/html/2608.25555#bib.bib1)\]\. 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](https://arxiv.org/html/2608.25555#bib.bib4)\]\. 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](https://arxiv.org/html/2608.25555#bib.bib3),[8](https://arxiv.org/html/2608.25555#bib.bib1)\]\.

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](https://huggingface.co/spaces/Explainability4LanguageModels/Virgil)and a video demonstration can be found at[https://www\.youtube\.com/watch?v=Ybs8IYztL8k](https://www.youtube.com/watch?v=Ybs8IYztL8k)\.

## 2Virgil Architecture

Virgil is implemented in Python and provided as a web application built withStreamlit111[https://streamlit\.io](https://streamlit.io/)\. The source code is publicly available at[https://github\.com/maciap/Virgil](https://github.com/maciap/Virgil), which also contains the full list of explainers included in Virgil\.

Overview\.Virgil follows a modular architecture with three components: aknowledge basestoring structured descriptions of explainers, aretrieval enginethat identifies explainers matching user requirements, and anexploration enginethat allows users to interactively explore the identified explainers\. As illustrated in[Figure1](https://arxiv.org/html/2608.25555#S2.F1), Virgil is accessible through a user\-friendly interface\.

![Refer to caption](https://arxiv.org/html/2608.25555v1/images/light_mode_screenshot.jpg)

![Refer to caption](https://arxiv.org/html/2608.25555v1/workflow.png)

Figure 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](https://arxiv.org/html/2608.25555#bib.bib2)\]\) and compared with three textual fields of explainer cards, namely 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](https://arxiv.org/html/2608.25555#bib.bib7)\]and parameters, producing explanations and useful visualizations\. It also supports side\-by\-side comparison of explainers \(*comparative view*\)\.

## 3Using 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 survey222https://forms\.gle/nsME36PGQvum7Fh3Aassessing 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 runsInput×Gradient\[[4](https://arxiv.org/html/2608.25555#bib.bib6)\]using a pretrained sentiment classifier\. However, the attribution scores appear unstable across similar inputs\. The user therefore switches to the comparison view and evaluatesIntegrated Gradients\[[5](https://arxiv.org/html/2608.25555#bib.bib5)\], which produces more stable attributions\.[Figure2](https://arxiv.org/html/2608.25555#S3.F2)showsIntegrated Gradientsmore clearly highlighting “good” as driving the positive prediction\. The user then queries “counterfactual” and runsPolyjuice\[[7](https://arxiv.org/html/2608.25555#bib.bib8)\]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\.

Figure 2:Token\-level attribution scores computed in Virgil usingInput×Gradient\(left\) andIntegrated Gradientsfor the example input "The movie was good"\.
## 4Conclusion

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\.

### Acknowledgements

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

- \[1\]N\. Calderon and R\. Reichart\(2025\)On behalf of the stakeholders: trends in nlp model interpretability in the era of llms\.InProceedings of NAACL: Long Papers,pp\. 656–693\.Cited by:[§1](https://arxiv.org/html/2608.25555#S1.p1.1)\.
- \[2\]J\. Ferrando, G\. Sarti, A\. Bisazza, and M\. R\. Costa\-jussà\(2024\)A primer on the inner workings of transformer\-based language models\.arXiv preprint arXiv:2405\.00208\.Cited by:[§1](https://arxiv.org/html/2608.25555#S1.p1.1)\.
- \[3\]N\. Reimers and I\. Gurevych\(2019\)Sentence\-bert: sentence embeddings using siamese bert\-networks\.InProceedings of EMNLP\-IJCNLP,pp\. 3982–3992\.Cited by:[§2](https://arxiv.org/html/2608.25555#S2.p4.1)\.
- \[4\]K\. Simonyan, A\. Vedaldi, and A\. Zisserman\(2014\)Deep inside convolutional networks: visualising image classification models and saliency maps\.InICLR Workshop,Cited by:[§3](https://arxiv.org/html/2608.25555#S3.p4.1)\.
- \[5\]M\. Sundararajan, A\. Taly, and Q\. Yan\(2017\)Axiomatic attribution for deep networks\.InProceedings of ICML,pp\. 3319–3328\.Cited by:[§3](https://arxiv.org/html/2608.25555#S3.p4.1)\.
- \[6\]T\. Wolfet al\.\(2020\)Transformers: state\-of\-the\-art natural language processing\.InProceedings of EMNLP: System Demonstrations,Cited by:[§2](https://arxiv.org/html/2608.25555#S2.p5.1)\.
- \[7\]T\. Wu, M\. T\. Ribeiro, J\. Heer, and D\. Weld\(2021\)Polyjuice: generating counterfactuals for explaining, evaluating, and improving models\.InProceedings of ACL,pp\. 6707–6723\.Cited by:[§3](https://arxiv.org/html/2608.25555#S3.p4.1)\.
- \[8\]H\. Zhao, H\. Chen, F\. Yang, N\. Liu, H\. Deng, H\. Cai, S\. Wang, D\. Yin, and M\. Du\(2024\)Explainability for large language models: A survey\.ACM Trans\. Intell\. Syst\. Technol\.15\(2\),pp\. 20:1–20:38\.External Links:[Document](https://dx.doi.org/10.1145/3639372)Cited by:[§1](https://arxiv.org/html/2608.25555#S1.p1.1)\.

Similar Articles

Applied Explainability for Large Language Models: A Comparative Study

arXiv cs.CL

A comparative study evaluating three explainability techniques (Integrated Gradients, Attention Rollout, SHAP) on fine-tuned DistilBERT for sentiment classification, highlighting trade-offs between gradient-based, attention-based, and model-agnostic approaches for LLM interpretability.

Can Language Model Agents be Helpful Circuit Explainers in Mechanistic Interpretability?

arXiv cs.AI

This paper investigates whether language model agents can automate the explanation phase of mechanistic interpretability by introducing AgenticInterpBench, a benchmark with 84 semi-synthetic circuits, and HyVE, an agentic explainer that iteratively hypothesizes, validates, and explains circuit components. Experiments show promise but identify reliable validation as a key obstacle.

Transformers Explained Visually

Hacker News Top

An interactive tool that visually explains the architecture of Transformer models, using GPT-2 to illustrate key components like embedding, attention mechanisms, and output predictions.