AI Dictionary › Fondamenti AI

Positional Encoding

Codifica posizionale

Definition

Positional encoding is the mechanism that tells a transformer the order of words in a sequence. Unlike recurrent networks, a transformer processes all tokens simultaneously and on its own couldn't distinguish 'the dog bites the man' from 'the man bites the dog'. Positional encoding fixes this by adding to each token numerical information about its position, like putting an order number on each train car so the model knows which comes first and which later. This information, often based on periodic mathematical functions or learned during training, is added to the token representations.

Without positional encoding, a language model would lose all notion of sequence, and with it grammar and meaning. It's a simple but essential ingredient of transformers, and its modern variants affect how well a model handles long texts and generalizes to contexts larger than those seen in training.

Definizione (italiano)

La codifica posizionale è il meccanismo che comunica a un transformer l'ordine delle parole in una sequenza. A differenza delle reti ricorrenti, il transformer elabora tutti i token contemporaneamente e da solo non saprebbe distinguere 'il cane morde l'uomo' da 'l'uomo morde il cane'. La codifica posizionale risolve questo aggiungendo a ogni token un'informazione numerica sulla sua posizione, come mettere un numero d'ordine su ciascun vagone di un treno affinché il modello sappia quale viene prima e quale dopo. Queste informazioni, spesso basate su funzioni matematiche periodiche o apprese durante l'addestramento, si sommano alle rappresentazioni dei token.

Senza codifica posizionale, un modello di linguaggio perderebbe ogni nozione di sequenza, e con essa la grammatica e il significato. È un ingrediente semplice ma essenziale dei transformer, e le sue varianti moderne influenzano quanto bene un modello gestisca testi lunghi e generalizzi a contesti più ampi di quelli visti in addestramento.

Related terms

More in Fondamenti AI

From our network

Magellano GPS — Fleet Tracking Made Simple

Real-time GPS tracking, remote engine lock, fuel and CO₂ reporting for your fleet.

Visit magellanogps.com →

From the Agora Intelligence blog

More on agora-intelligence.com →

📱 Download the Android app (beta) iOS coming soon

Say what you mean. Get what you need.

Grace Certified — the AI coach that trains and certifies your prompt engineering — by Agora Intelligence.