arXiv · 2303.08288
Attention-likelihood relationship in transformers
Abstract
We analyze how large language models (LLMs) represent out-of-context words, investigating their reliance on the given context to capture their semantics. Our likelihood-guided text perturbations reveal a correlation between token likelihood and attention values in transformer-based language models. Extensive experiments reveal that unexpected tokens cause the model to attend less to the information coming from themselves to compute their representations, particularly at higher layers. These findings have valuable implications for assessing the robustness of LLMs in real-world scenarios. Fully reproducible codebase at https://github.com/Flegyas/AttentionLikelihood.
Explore related subjects
Keep this discovery
Valeria Ruscio, Valentino Maiorca, Fabrizio Silvestri. 2023-03-15. Attention-likelihood relationship in transformers. https://arxiv.org/abs/2303.08288
Cite the original work for its findings. Save a collection to share your selection of sources.