Evaluating Transformers Learning by Representing Self-Attention Weights as a Graph

Rebecca Leygonie, Sylvain Lobry, Laurent Wendling

2025

Abstract

Transformers architectures have established themselves as the state of the art for sequential data processing, with applications ranging from machine translation to the processing of Electronic Health Records (EHR). These complex data present a particular challenge in terms of explainability, which is a crucial aspect for their adoption in the healthcare field, subject to strict ethical and legal requirements. To address this challenge, we propose an approach to represent learning through graphs by exposing the self-attention links between tokens. We introduce a metric to assess the relevance of the connections learned by the model, in comparison with medical expertise. We apply our approach to the Behrt model, designed to predict future hospital visits based on sequences of previous visits, trained on data from the French National Health Data System. Our experiments show that our method facilitates understanding of model learning, and enables a better appreciation of the influence of diagnoses on each other, as well as of the biases present in the data, than global model evaluation measures.

Download


Paper Citation


in Harvard Style

Leygonie R., Lobry S. and Wendling L. (2025). Evaluating Transformers Learning by Representing Self-Attention Weights as a Graph. In Proceedings of the 20th International Joint Conference on Computer Vision, Imaging and Computer Graphics Theory and Applications - Volume 1: IVAPP; ISBN 978-989-758-728-3, SciTePress, pages 695-705. DOI: 10.5220/0013111400003912


in Bibtex Style

@conference{ivapp25,
author={Rebecca Leygonie and Sylvain Lobry and Laurent Wendling},
title={Evaluating Transformers Learning by Representing Self-Attention Weights as a Graph},
booktitle={Proceedings of the 20th International Joint Conference on Computer Vision, Imaging and Computer Graphics Theory and Applications - Volume 1: IVAPP},
year={2025},
pages={695-705},
publisher={SciTePress},
organization={INSTICC},
doi={10.5220/0013111400003912},
isbn={978-989-758-728-3},
}


in EndNote Style

TY - CONF

JO - Proceedings of the 20th International Joint Conference on Computer Vision, Imaging and Computer Graphics Theory and Applications - Volume 1: IVAPP
TI - Evaluating Transformers Learning by Representing Self-Attention Weights as a Graph
SN - 978-989-758-728-3
AU - Leygonie R.
AU - Lobry S.
AU - Wendling L.
PY - 2025
SP - 695
EP - 705
DO - 10.5220/0013111400003912
PB - SciTePress