Concepts / Input Representation in Language Models

Input Representation in Language Models

The transformer is the architecture that LLMs use to process their input.

  • Programming

A Sentence That Needs Selective Focus

Read this sentence: The trophy would not fit in the suitcase because it was too big. Ask yourself what the word it refers to. Most readers instantly link it to the trophy, not the suitcase, even though both nouns appear earlier. You did not reach that answer by reading each word in isolation. Your understanding depended on which earlier words mattered for the word it, and which ones could be set aside.

What do you think happens?

In the sentence about the trophy and the suitcase, which noun does the word it refer to?

  • the trophy

  • the suitcase

Reveal answer
Answer:

the trophy

Most readers link it to the trophy even though both nouns appear earlier in the sentence. The point is that the word it depends on which earlier words matter, not simply on which words happen to appear before it.

Large language models face a version of this same problem constantly. To produce a sensible continuation of a text, a model has to decide which parts of the input deserve the most weight at that moment. This article traces how the architecture behind modern LLMs makes that kind of selective focus possible.

Where the Transformer Fits

Definition

The transformer is the architecture that LLMs use to process their input. Architecture here means the overall structural design of the model: the way its components are arranged and how information is passed between them.

When you hear that a model is a transformer, read that as a statement about how the model is built, not about what task it performs. The architecture describes the structure that processes the input; it does not by itself say whether the model is answering questions, translating, or continuing text.

The source gives the transformer a specific job in a chain of events. Input comes in, the transformer lets the model pay selective attention to different parts of that input, and the model then makes its predictions. The predictions depend on the transformer's selective focus, which is why the architecture is central to how LLMs work. The diagram below shows that order of events.

Input textcomes into the modelTransformerselective attention overthe inputPredictionsdepend on the selectivefocusentersfeeds
The order of events described in the source: input enters the transformer, the transformer applies selective attention across that input, and predictions come out.

What Selective Attention Means

Definition

Selective attention means the model does not treat every part of its input as equally important when it makes a prediction. Some parts receive more of its focus than others, and the choice depends on what the model is trying to predict.

The word selective is doing real work in that definition. The focus is chosen, not spread evenly across everything. The source is also careful about what this does not mean: selective attention is uneven emphasis across the input, not ignoring most of it. Every part of the input can still take part in the prediction; the difference lies in how much weight each part receives.

Every input partChosen input partsEqual weightUneven emphasis
A contrast between a model that gives every input part the same weight and the uneven emphasis that selective attention describes.

The source ties this ability to a benefit. Because the model can focus on the parts of the input that matter, it becomes especially good at handling the nuances and complexities of human language. Human language often depends on relationships between distant words, on ambiguity, and on context. A model that weighs different parts of an input differently has a better chance of capturing those relationships than one that treats every part the same.

Tracing One Prediction Through the Model

Follow a single prediction from start to finish. Assume a short piece of text has been given to the model as input. The input is not used in a single pass without distinction. The transformer lets the model direct its focus toward some portions of that input more than others. Only after that selective focus has shaped the model's internal processing does the model produce its prediction.

Earlier wordsparts of the inputSelective focusuneven emphasisInternal processingshaped by the focusPredictionproduced lastweighted byshapesleads to
The path the source describes: earlier words in the input are weighted by selective focus, that focus shapes internal processing, and only then does the prediction appear.

Notice what changes between the start and the end of this trace. The input stays the same, but the model's emphasis on different parts of it shifts depending on the prediction being made. A different prediction over the same text can lead the model to attend to a different set of parts. This is the core difference between selective attention and treating all input uniformly.

Following Focus Back to Earlier Words

Return to the trophy sentence and apply the tracing idea to the word it. The prediction that matters is which earlier noun the word it points to. Two nouns are available, and the source's point is that they do not receive equal consideration. Readers direct more focus to the trophy, because the surrounding meaning makes the trophy the thing that could be too big, and they set the suitcase aside for this purpose.

itword being interpretedtrophymore focussuitcaseless focusmore focusless focus
An illustration of uneven emphasis for the word it. The labels describe relative focus, not measured numbers; the source does not give specific weights.
Worked example

Tracing Focus in a Different Sentence

Maria put the book on the shelf, and then she picked up the pen. Which earlier words should carry the most focus when the model reaches the word she?

  1. 1
    Identify the target

    The word she is the point where a prediction about its referent must be made.

  2. 2
    List the candidates

    The earlier nouns are Maria, book, shelf, and pen.

  3. 3
    Apply uneven emphasis

    Selective attention means the focus is chosen. Maria, which names a person, is a more plausible referent for she than shelf or book, so it is reasonable to expect Maria to receive more of the focus.

Result

Maria should receive the most focus, and the other nouns less. This is an illustration of the idea, not a measured attention weight from a real model.

Misreadings of Selective Attention

  • Common mistake

    Thinking selective attention means the model ignores most of its input

    Why it fails

    The source states that selective attention is uneven emphasis across the input, not ignoring most of it.

    Do this instead

    Treat selective attention as a difference in how much weight each part gets, with all parts still taking part.

  • Common mistake

    Treating a high-focus word as proof that the model understands the sentence

    Why it fails

    The source ties selective focus to handling nuance and complexity, but it does not claim that focus weights explain or verify the model's reasoning.

    Do this instead

    Describe focus as where emphasis fell during a prediction, and leave the question of understanding open.

  • Common mistake

    Assuming the focus pattern is fixed for a given input

    Why it fails

    The source says the model's emphasis shifts depending on the prediction being made, so one input can yield different focus patterns.

    Do this instead

    Always tie a focus pattern to the specific prediction it was produced for.

  • Common mistake

    Confusing the transformer with a particular task

    Why it fails

    The source says the transformer is the architecture, meaning how the model is structured, rather than what job it performs.

    Do this instead

    Read the word transformer as a statement about structure, and ask separately what task the model is doing.

Why Selective Focus Helps With Language

Human language often depends on relationships between distant words, on ambiguity, and on context. The trophy sentence shows this: the link between it and its referent depends on a relationship that runs across several words. A model that can weigh different parts of its input differently has a better chance of capturing relationships like this than one that treats every part of the input the same, which is the benefit the source associates with selective focus.

Practice Tracing Focus

EASY

Take the sentence: Maria put the book on the shelf, and then she picked up the pen. Which earlier words should carry the most focus for the word she, and which should carry less? Explain your answer in terms of selective attention, not in terms of whether the model understands the story.

Hints
  • Ask what the word she has to be linked to.
  • Compare the nouns that name a person with the nouns that name objects.
  • Remember that selective attention means uneven emphasis, not ignoring all other words.

Key Takeaways

  • The transformer is the architecture that LLMs use to process their input; it describes how the model is built, not what task it performs.
  • Selective attention means uneven emphasis across the input when a model makes a prediction, not ignoring most of the input.
  • Focus is chosen according to the prediction being made, so the same input can produce different focus patterns for different predictions.
  • Selective focus helps a model handle the nuances of human language, such as distant relationships, ambiguity, and context.
  • Selective attention describes where emphasis falls during a prediction; it does not by itself establish that the model understands or explains its reasoning.

Related concepts

More concepts starting with I