Paper Reading AI Learner

Lizard: An Efficient Linearization Framework for Large Language Models

2025-07-11 21:19:18
Chien Van Nguyen, Ruiyi Zhang, Hanieh Deilamsalehy, Puneet Mathur, Viet Dac Lai, Haoliang Wang, Jayakumar Subramanian, Ryan A. Rossi, Trung Bui, Nikos Vlassis, Franck Dernoncourt, Thien Huu Nguyen

Abstract

We propose Lizard, a linearization framework that transforms pretrained Transformer-based Large Language Models (LLMs) into flexible, subquadratic architectures for infinite-context generation. Transformer-based LLMs face significant memory and computational bottlenecks as context lengths increase, due to the quadratic complexity of softmax attention and the growing key-value (KV) cache. Lizard addresses these limitations by introducing a subquadratic attention mechanism that closely approximates softmax attention while preserving the output quality. Unlike previous linearization methods, which are often limited by fixed model structures and therefore exclude gating mechanisms, Lizard incorporates a gating module inspired by recent state-of-the-art linear models. This enables adaptive memory control, supports constant-memory inference, offers strong length generalization, and allows more flexible model design. Lizard combines gated linear attention for global context compression with sliding window attention enhanced by meta memory, forming a hybrid mechanism that captures both long-range dependencies and fine-grained local interactions. Moreover, we introduce a hardware-aware algorithm that accelerates the training speed of our models. Extensive experiments show that Lizard achieves near-lossless recovery of the teacher model's performance across standard language modeling tasks, while significantly outperforming previous linearization methods. On the 5-shot MMLU benchmark, Lizard improves over prior models by 18 points and shows significant improvements on associative recall tasks.

Abstract (translated)

我们提出了Lizard,这是一种线性化框架,能够将基于Transformer的大型语言模型(LLMs)转化为灵活且次二次架构,用于无限上下文生成。随着上下文长度的增加,基于Transformer的LLMs会面临显著的记忆和计算瓶颈,这是由于softmax注意力机制的二次复杂度以及不断增长的关键值(KV)缓存导致的。Lizard通过引入一种接近于softmax注意力但保持输出质量的次二次注意力机制来解决这些问题。 不同于以往的线性化方法往往因固定模型结构而无法包含门控机制(gating mechanisms),Lizard借鉴了最近最先进的线性模型,集成了一种门控模块。这使得Lizard能够实现自适应内存控制、常量内存推理、强大的长度泛化能力,并且允许更灵活的设计。 Lizard结合了带有元记忆增强的滑动窗口注意力和用于全局上下文压缩的门控线性注意机制,形成了一种混合机制,既能捕捉长距离依赖关系也能处理细粒度局部交互。此外,我们还引入了一个硬件感知算法,以加速模型训练速度。 广泛的实验表明,Lizard在标准语言建模任务上实现了对教师模型性能近乎无损的恢复,并且在之前的方法中显著超越。特别是在5-shot MMLU基准测试中,Lizard相较于先前的模型提高了18个点的成绩,并在关联回忆(associative recall)任务中表现出显著改进。

URL

https://arxiv.org/abs/2507.09025

PDF

https://arxiv.org/pdf/2507.09025.pdf


Tags
3D Action Action_Localization Action_Recognition Activity Adversarial Agent Attention Autonomous Bert Boundary_Detection Caption Chat Classification CNN Compressive_Sensing Contour Contrastive_Learning Deep_Learning Denoising Detection Dialog Diffusion Drone Dynamic_Memory_Network Edge_Detection Embedding Embodied Emotion Enhancement Face Face_Detection Face_Recognition Facial_Landmark Few-Shot Gait_Recognition GAN Gaze_Estimation Gesture Gradient_Descent Handwriting Human_Parsing Image_Caption Image_Classification Image_Compression Image_Enhancement Image_Generation Image_Matting Image_Retrieval Inference Inpainting Intelligent_Chip Knowledge Knowledge_Graph Language_Model LLM Matching Medical Memory_Networks Multi_Modal Multi_Task NAS NMT Object_Detection Object_Tracking OCR Ontology Optical_Character Optical_Flow Optimization Person_Re-identification Point_Cloud Portrait_Generation Pose Pose_Estimation Prediction QA Quantitative Quantitative_Finance Quantization Re-identification Recognition Recommendation Reconstruction Regularization Reinforcement_Learning Relation Relation_Extraction Represenation Represenation_Learning Restoration Review RNN Robot Salient Scene_Classification Scene_Generation Scene_Parsing Scene_Text Segmentation Self-Supervised Semantic_Instance_Segmentation Semantic_Segmentation Semi_Global Semi_Supervised Sence_graph Sentiment Sentiment_Classification Sketch SLAM Sparse Speech Speech_Recognition Style_Transfer Summarization Super_Resolution Surveillance Survey Text_Classification Text_Generation Time_Series Tracking Transfer_Learning Transformer Unsupervised Video_Caption Video_Classification Video_Indexing Video_Prediction Video_Retrieval Visual_Relation VQA Weakly_Supervised Zero-Shot