Skip to content

Make sense of
long AI answers.

Turn the answer you saved into something you understand. Read one idea at a time, ask about any passage, and test yourself. Paste an answer or upload a PDF.

Start reading free Try it below. No sign-up needed.
Transformer attention Sample answer
Section 1 of 6

Why attention at all

Imagine reading a long answer and reaching the word ‘it’. To understand that word, you often need to look back: does it refer to the experiment, the result, or the question? The useful context might be nearby, or several sentences away. A model needs some way to connect the word it is processing with information elsewhere in the text. Attention provides a way to make those connections without treating every surrounding word as equally useful.

The weights form a mixture of the value vectors:

zi=∑j=1nαijvj,∑j=1nαij=1z_i = \sum_{j=1}^{n} \alpha_{ij}v_j, \qquad \sum_{j=1}^{n}\alpha_{ij}=1

For example, weights of 0.70.7, 0.20.2, and 0.10.1 give z=0.7v1+0.2v2+0.1v3z=0.7v_1+0.2v_2+0.1v_3.

Some earlier sequence models compressed an input into a single fixed-size representation before producing an output. That created a bottleneck, especially for longer inputs. Attention instead lets a position draw on multiple available representations, assigning different weights to them. The key idea is selective access: keep the information available, then decide which parts contribute to the current representation. These weights are learned computations, not a person consciously choosing where to look.

One idea at a time. The whole answer is still here.

Split Into Digestible Bites

6 sectionsSections

Transformer attention, explained

Imagine reading a long answer and reaching the word ‘it’. To understand that word, you often need to look back: does it refer to the experiment, the result, or the question? The useful context might be nearby, or several sentences away. A model needs some way to connect the word it is processing with information elsewhere in the text. Attention provides a way to make those connections without treating every surrounding word as equally useful.

The weights form a mixture of the value vectors:

zi=∑j=1nαijvj,∑j=1nαij=1z_i = \sum_{j=1}^{n} \alpha_{ij}v_j, \qquad \sum_{j=1}^{n}\alpha_{ij}=1

For example, weights of 0.70.7, 0.20.2, and 0.10.1 give z=0.7v1+0.2v2+0.1v3z=0.7v_1+0.2v_2+0.1v_3.

Some earlier sequence models compressed an input into a single fixed-size representation before producing an output. That created a bottleneck, especially for longer inputs. Attention instead lets a position draw on multiple available representations, assigning different weights to them. The key idea is selective access: keep the information available, then decide which parts contribute to the current representation. These weights are learned computations, not a person consciously choosing where to look.

Make It Yours

Your typeface, your spacing, your reading light. Highlight the parts you want to remember, right in the preview.

Appearance
Text size
20px
Typeface
Line spacing
Line width
Alignment
Highlighting
Your reading spacelight theme
03 · TRANSFORMER ATTENTION

Scaled dot product

Each query is compared with every allowed key by taking a dot product. This produces a score for each possible connection. The scores are divided by the square root of the key dimension, then a softmax converts them into nonnegative weights that sum to one. Finally, those weights are applied to the corresponding value vectors, and the weighted values are added together. The result is a new representation containing a mixture of information from the positions that were available.

The complete calculation is:

Attention⁡(Q,K,V)=softmax⁡ ⁣(QKTdk)V\operatorname{Attention}(Q,K,V)=\operatorname{softmax}\!\left(\frac{QK^{\mathsf T}}{\sqrt{d_k}}\right)V

Here dkd_k is the key dimension. With dk=64d_k=64, divide the scores by 64=8\sqrt{64}=8 before applying softmax.

Why divide before applying softmax? As the vector dimension grows, unscaled dot products can become large in magnitude. Very separated scores can make softmax concentrate almost all its weight on one position, leaving weak gradients for learning. Scaling helps control that effect. Separately, a mask can exclude connections that must not be used. In causal language modeling, for example, a token cannot attend to future tokens. The weighting happens only over the positions the mask allows.

Highlight, Then Ask

Select any text to highlight it. Choose Ask and a popup opens beside it, without leaving your place: hints first, a quick quiz, a simple explanation, or a straight answer.

Keep several questions open and fold them to their title bar. Every question asked about a document stays with it, and any one opens as a full chat you can save to your library.

Queries, keys, valuesSelect any text

Attention starts by projecting each token’s representation into three vectors: a query, a key, and a value. The query describes what information this position is looking for. The key supplies something other positions can compare their queries against. The value contains information that can be carried into the result. These are numerical vectors produced by learned transformations, not labels or questions written in ordinary language.

Interactive sample · Prewritten replies, no AI request.

Personalized Quizzes

Practice with questions grounded in your document. Check the source, review missed concepts, and write the takeaway in your own words.

Try a sample question1 of 1

Why scale by the square root of the key dimension?

Choose your answer

Sample quiz. Your practice takeaway stays on this page; it is not saved or sent to AI.

Also in Aria

  • Upload a PDF

    Lecture notes and papers become sections to read. Equations and scanned pages can be read by your own AI.

  • Every highlight in one place

    The Highlights tab gathers what you marked, by document, and opens each one at its passage.

  • Code and diagrams, shown properly

    Pasted code is recognised and coloured, and diagrams in answers are drawn, not left as text.

FAQ

No. You can paste material into your library and use the reading modes, display controls, search, and pins without an AI key.

Add your own provider API key in AI settings. Choose a chat model and a quiz model separately. Requests use your provider account, and that provider bills you for usage.

Yes. Paste your notes or an AI answer into your library. You can also chat inside Aria and save an answer or the whole conversation to read later.

Yes. Upload a PDF in Add text. Aria keeps the file and shows its real pages, equations and figures included, where you can highlight and ask about any passage. Its text is also read in your browser for Text view, focus mode and quizzes; for scanned pages or equations, your own AI provider can read it instead, with your key.

Yes. Select a passage while reading and choose Ask. A popup opens beside the text, with hints, a quick quiz, a simple explanation, or a straight answer. Each question is kept, and you can reopen the ones asked about a document.

Reading modes change how you navigate the document, not its wording. Switch between sections, focus mode, and the complete text.

No. The landing-page demos use prewritten examples. Their settings, sample answers, and takeaways stay in this page and are not saved to your account.

Yes. Your account includes library export, document and chat deletion, library clearing, and account deletion. See the Privacy page for details about storage and AI providers.

Make room for understanding.

Bring the next long answer to Aria.
Make space for the parts worth keeping.

Start reading free