labmlai / inspectus

LLM Analytics
MIT License
618 stars 23 forks source link

Visualization of Attention for Next Predicted Token #7

Closed FUTUREEEEEE closed 4 months ago

FUTUREEEEEE commented 5 months ago

Hi there,

First of all, thanks for your great work on this project!

I noticed in the demo that the visualization focuses on the input token sequence "The quick brown fox jumps over the lazy dog." This is helpful, but I was wondering if there is a way to visualize the attention of the next predicted token. This would be incredibly valuable for understanding the model's "thinking" process and providing better explanations.

Is it possible to implement this feature, or are there any existing tools or methods that could achieve this?

Thank you!

lakshith-403 commented 5 months ago

Actually, each token in the visualisation already represents the next predicted token based on the previous sequence. Just select any token to see the attentions of it.