0Pricing
NLP Academy · Lektion

Die Idee der Attention

Das Modell auf das Wesentliche fokussieren lassen

Die Idee der Attention ist eine kostenlose NLP Academy-Lektion auf CoddyKit. Dies ist Lektion 1 von 4. Du kannst die komplette Lektion unten kostenlos lesen – dann übst du sie direkt im Browser mit einem integrierten Code-Editor und einem KI-Tutor rund um die Uhr. Sie ist Teil des NLP Academy-Lernpfads, und dein Fortschritt wird über Web und CoddyKit-App synchronisiert. Der NLP Academy-Kurs umfasst insgesamt 4 Lektionen.

Teile dieser Lektion wurden noch nicht übersetzt und werden auf Englisch angezeigt.

Why Attention?

When you read a sentence, you do not weigh every word equally. Attention gives a model that same power to focus on what matters. 🎯

The Bottleneck Problem

Older models squeezed a whole sentence into one fixed vector. That bottleneck lost detail, especially for long inputs that carry many ideas.

Look Back at Everything

Instead of one summary vector, attention lets the model look back at every input word whenever it needs to, picking what is relevant right now.

Attention as Weights

Attention assigns each word a weight between 0 and 1. Higher weight means more focus; the weights for one step always add up to 1.

A Weighted Average

The output is a weighted average of the input vectors. Words with big weights shape the result; words with tiny weights barely matter.

weights = [0.7, 0.2, 0.1]
output = sum(w * v for w, v in zip(weights, vectors))

Translation Example

Translating "the cat sat" into French, the model can align each output word to the right source word instead of guessing from one blob.

Soft, Not Hard

Attention is soft: it spreads focus across all words by degree, rather than hard-picking just one. That makes it smooth and trainable.

Computing Relevance

To set the weights, the model scores how relevant each word is to the current step, then turns those scores into a probability spread.

Softmax Turns Scores Into Weights

Raw scores can be any number, so softmax squashes them into positive weights that sum to 1 and emphasize the largest score.

import numpy as np
def softmax(s):
    e = np.exp(s - np.max(s))
    return e / e.sum()

Handling Long Inputs

Because it can reach any word directly, attention keeps long-range links intact. The first word can still influence the last with no decay.

Why It Changed NLP

Attention freed models from reading strictly in order. That single idea became the foundation of the Transformer and modern language models. 🚀

Quick Check

Let us check the core intuition behind attention.

Recap

You learned that attention weights every input word by relevance and blends them into a focused output. That focus is what powers modern NLP. ✨

Häufig gestellte Fragen

Ist die Lektion „Die Idee der Attention“ kostenlos?

Ja — der vollständige Text von „Die Idee der Attention“ ist hier im Web kostenlos zu lesen. Um sie interaktiv zu üben (integrierter Code-Editor und 24/7 KI-Tutor) und den Rest des NLP Academy-Kurses freizuschalten, upgrade auf CoddyKit PRO. Der NLP Academy-Kurs umfasst insgesamt 4 Lektionen.

Was lerne ich in „Die Idee der Attention“?

Das Modell auf das Wesentliche fokussieren lassen Du übst NLP Academy mit praktischem Code, den du direkt im Browser ausführst, und ein 24/7 KI-Tutor beantwortet deine Fragen während du die Lektion bearbeitest.

Brauche ich Erfahrung, um NLP Academy zu starten?

Keine Vorkenntnisse erforderlich. NLP Academy auf CoddyKit ist für Anfänger bis fortgeschrittene Lernende strukturiert, sodass du hier starten oder von Anfang an beginnen und in deinem eigenen Tempo voranschreiten kannst. Dies ist Lektion 1 von 4.

Wie lange dauert die Lektion „Die Idee der Attention“?

Die meisten CoddyKit-Lektionen dauern etwa 5–10 Minuten. Jede ist kompakt und interaktiv, sodass du stetig Fortschritte machst und genau dort weitermachst, wo du aufgehört hast – im Web und in der App.

Kann ich in dieser NLP Academy-Lektion Code schreiben und ausführen?

Ja. Jede NLP Academy-Lektion enthält einen integrierten Code-Editor, sodass du echten Code direkt in deinem Browser schreibst und ausführst und sofort KI-Feedback erhältst — ohne lokale Einrichtung erforderlich.

Alle Lektionen in diesem Kurs

  1. Die Idee der Attention
  2. Self-Attention Schritt für Schritt
  3. Multi-Head-Attention und Positionen
  4. Im Inneren des Transformer-Blocks
← Zurück zu NLP Academy