AI Dictionary › Fondamenti AI
Accumulo del gradiente
Gradient accumulation is a technique that simulates a larger training batch than the available memory would directly allow. Instead of updating the weights after every small batch, the gradients computed over several consecutive batches are summed, and the weight update only happens after a preset number of batches has been accumulated. This achieves the effect of a large batch while using hardware with limited memory.
Gradient accumulation is a technique that simulates a larger training batch than the available memory would directly allow. Instead of updating the weights after every small batch, the gradients computed over several consecutive batches are summed, and the weight update only happens after a preset number of batches has been accumulated. This achieves the effect of a large batch while using hardware with limited memory.
At each step, the model computes gradients on a small batch, but instead of applying them immediately it adds them to those from previous steps. Only after a certain number of accumulated steps does the optimizer apply the overall update to the weights, as if it had been computed on one larger batch.
It is particularly useful when training large-scale models on GPUs with limited memory, preserving the training stability typical of large batches without needing more expensive hardware. It is a common technique in distributed training and in fine-tuning large language models.
It is a practical engineering solution that emerged to work around hardware memory limits when training increasingly large neural networks.
L'accumulo del gradiente è una tecnica che permette di simulare un batch di addestramento più grande di quello che la memoria disponibile consentirebbe direttamente. Invece di aggiornare i pesi dopo ogni piccolo batch, i gradienti calcolati su più batch successivi vengono sommati, e l'aggiornamento dei pesi avviene solo dopo aver accumulato un numero prestabilito di batch. Questo consente di ottenere gli effetti di un batch grande usando hardware con memoria limitata.
A ogni passo il modello calcola i gradienti su un batch piccolo, ma invece di applicarli subito li aggiunge a quelli dei passi precedenti. Solo dopo un certo numero di passi accumulati l'ottimizzatore applica l'aggiornamento complessivo ai pesi, come se fosse stato calcolato su un unico batch più grande.
È particolarmente utile quando si addestrano modelli di grandi dimensioni su GPU con memoria limitata, permettendo di mantenere la stabilità di addestramento tipica dei batch grandi senza dover disporre di hardware più costoso. È una tecnica comune nell'addestramento distribuito e nel fine-tuning di modelli linguistici di grandi dimensioni.
È una soluzione ingegneristica pratica emersa per superare i limiti di memoria hardware nell'addestramento di reti neurali sempre più grandi.
From our network
AGORÀ Intelligence — Enterprise AI Governance Platform
Govern AI at scale: policies, adoption and measurable results on your data. Built for boards and C-suite.
Visit agora-intelligence.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.