AI Dictionary › Modelli AI
Architettura Decoder-only
A decoder-only architecture is a configuration of an attention-based model that uses exclusively the decoding part of the original encoder-decoder architecture, processing text in a single stream where each token can only look at the tokens preceding it, never those that follow. It is the architectural configuration underlying most modern generative language models.
A decoder-only architecture is a configuration of an attention-based model that uses exclusively the decoding part of the original encoder-decoder architecture, processing text in a single stream where each token can only look at the tokens preceding it, never those that follow. It is the architectural configuration underlying most modern generative language models.
Unlike an encoder-decoder architecture, which separates understanding an input sequence from generating an output sequence, a decoder-only model treats input and output as a single continuous stream of tokens, trained to predict each next token based on all the preceding ones. This constraint, called causal or masked attention, prevents a token from "seeing" future information during training, making the model naturally suited to both understanding and generating text.
It is the architecture chosen by the vast majority of large language models intended for generative tasks, from conversation to writing code, thanks to its conceptual simplicity and the ease with which it can be trained on enormous amounts of text simply by predicting the next token in a continuous stream.
The name distinguishes this configuration from the original encoder-decoder one and from encoder-only configurations, used mainly for text understanding tasks: "decoder-only" indicates that the model uses only the decoding block, the one designed to generate sequences one element at a time.
Un'architettura decoder-only è una configurazione di modello basato su attenzione che utilizza esclusivamente la parte decodificatrice dell'architettura originale encoder-decoder, elaborando il testo in un unico flusso in cui ogni token può guardare solo ai token che lo precedono, mai a quelli successivi. È la configurazione architetturale alla base della maggior parte dei moderni modelli linguistici generativi.
A differenza di un'architettura encoder-decoder, che separa la comprensione di una sequenza di input dalla generazione di una sequenza di output, un modello decoder-only tratta input e output come un unico flusso continuo di token, addestrato a prevedere ogni token successivo sulla base di tutti quelli precedenti. Questo vincolo, detto attenzione causale o mascherata, impedisce a un token di "vedere" informazioni future durante l'addestramento, rendendo il modello adatto sia alla comprensione sia alla generazione di testo in modo naturale.
È l'architettura scelta dalla grande maggioranza dei modelli linguistici di grandi dimensioni destinati a compiti generativi, dalla conversazione alla scrittura di codice, grazie alla sua semplicità concettuale e alla facilità con cui può essere addestrata su enormi quantità di testo semplicemente prevedendo il token successivo in un flusso continuo.
Il nome distingue questa configurazione da quella encoder-decoder originaria e da configurazioni encoder-only, usate principalmente per compiti di comprensione del testo: "decoder-only" indica che il modello utilizza solo il blocco decodificatore, quello progettato per generare sequenze un elemento alla volta.
From our network
HSE Genius — AI for Safety Data Sheets
Extract SDS data, H phrases and ECHA compliance checks in seconds, powered by AI.
Visit hsegenius.com →From the Agora Intelligence blog
📱 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.