r/learnmachinelearning • • 1h ago

can anyone help me understand

i ve 5+ years of experience in nodejs

i'm learning from 'build an llm from strach - Sebastian Raschka' ... chapter 3 has 'attention mechanism' .. i'm hitting the wall ..

most of the article and youtube vidoes .. it does that it does this ... i wanna understand what is happening .. any experience guys can help me out here ?

3 Upvotes

4 comments sorted by

2

u/UnderstandingOwn2913 1h ago

what is your question?

1

u/Effective_Potato_990 1h ago

What i understood, so far from the book 

  • Splitting text
  • Adding integer
  • Static Embedding 
  • Position Embedding
  • Where do i start with attention …

I understood that llm holds a value that says distance among each token in a sequence .. how how?

1

u/ModularMind8 24m ago

Small correction first: the model doesn't store a "distance" between tokens. Positional embeddings only say where each token sits. Attention works out how relevant each token is to every other token, fresh each time it runs on an input. Think of it like a lookup where every token gets three versions of itself, each made by multiplying its embedding by a learned weight matrix. For each token, you compare its query against every token's key with a dot product, which gives a similarity score. Softmax turns those scores into percentages that add up to 1. Then you take a weighted mix of all the values using those percentages. The result is a new, context-aware version of that token.

1

u/T1lted4lif3 1h ago

I think the answer to their question is "yes" someone can help with respect to what attention does