ChatPaper.aiChatPaper

TPTT: Trasformare i Transformer Pre-addestrati in Titani

TPTT: Transforming Pretrained Transformer into Titans

June 21, 2025
Autori: Fabien Furfaro
cs.AI

Abstract

I recenti progressi nei modelli linguistici di grandi dimensioni (LLM) hanno portato a notevoli avanzamenti nell'elaborazione del linguaggio naturale, ma le loro esigenze computazionali e di memoria rimangono una sfida significativa, in particolare per l'inferenza a contesto lungo. Introduciamo TPTT (Transforming Pretrained Transformer into Titans), un nuovo framework per potenziare i modelli Transformer preaddestrati con meccanismi di attenzione linearizzata efficiente e una gestione avanzata della memoria. TPTT utilizza tecniche come Memory as Gate (MaG) e attenzione linearizzata mista (LiZA). È completamente compatibile con la libreria Hugging Face Transformers, consentendo un adattamento senza soluzione di continuità di qualsiasi LLM causale attraverso un fine-tuning efficiente dei parametri (LoRA) senza la necessità di un riaddestramento completo. Dimostriamo l'efficacia di TPTT sul benchmark MMLU con modelli di circa 1 miliardo di parametri, osservando miglioramenti sostanziali sia in termini di efficienza che di accuratezza. Ad esempio, Titans-Llama-3.2-1B raggiunge un aumento del 20% nell'Exact Match (EM) rispetto alla sua baseline. Analisi statistiche e confronti con i metodi più recenti all'avanguardia confermano la scalabilità pratica e la robustezza di TPTT. Il codice è disponibile all'indirizzo https://github.com/fabienfrfr/tptt. Il pacchetto Python è disponibile su https://pypi.org/project/tptt/.
English
Recent advances in large language models (LLMs) have led to remarkable progress in natural language processing, but their computational and memory demands remain a significant challenge, particularly for long-context inference. We introduce TPTT (Transforming Pretrained Transformer into Titans), a novel framework for enhancing pretrained Transformer models with efficient linearized attention mechanisms and advanced memory management. TPTT employs techniques such as Memory as Gate (MaG) and mixed linearized attention (LiZA). It is fully compatible with the Hugging Face Transformers library, enabling seamless adaptation of any causal LLM through parameter-efficient fine-tuning (LoRA) without full retraining. We show the effectiveness of TPTT on the MMLU benchmark with models of approximately 1 billion parameters, observing substantial improvements in both efficiency and accuracy. For instance, Titans-Llama-3.2-1B achieves a 20% increase in Exact Match (EM) over its baseline. Statistical analyses and comparisons with recent state-of-the-art methods confirm the practical scalability and robustness of TPTT. Code is available at https://github.com/fabienfrfr/tptt . Python package at https://pypi.org/project/tptt/ .
PDF31June 24, 2025