paper-with-me

홈 › Papers

Megalodon: Efficient LLM Pretraining and Inference with Unlimited Context Length

2024-04-12 · Xuezhe Ma, Xiaomeng Yang, Wenhan Xiong, Beidi Chen, Lili Yu, Hao Zhang, Jonathan May, Luke Zettlemoyer, Omer Levy, Chunting Zhou

The quadratic complexity and weak length extrapolation of Transformers limits their ability to scale to long sequences, and while sub-quadratic solutions like linear attention and state space models exist, they empirically underperform Transformers in pretraining efficiency and downstream task accuracy. We introduce Megalodon, a neural architecture for efficient sequence modeling with unlimited context length. Megalodon inherits the architecture of Mega (exponential moving average with gated attention), and further introduces multiple technical components to improve its capability and stability, including complex exponential moving average (CEMA), timestep normalization layer, normalized attention mechanism and pre-norm with two-hop residual configuration. In a controlled head-to-head comparison with Llama2, Megalodon achieves better efficiency than Transformer in the scale of 7 billion parameters and 2 trillion training tokens. Megalodon reaches a training loss of 1.70, landing mid-way between Llama2-7B (1.75) and 13B (1.67). Code: https://github.com/XuezheMax/megalodon

📄 PDF Abstract BibTeX arXiv:2404.08801

Code (1)

xuezhemax/megalodon 공식 구현 pytorch

Tasks

State Space Models

Methods 이 논문이 사용한 방법론

Attention 설명 없음
Dropout Dropout is a regularization technique for neural networks that drops a unit (along with connections) at training time with a specified probability $p$ (a common value is…
Adam 설명 없음
Position-Wise Feed-Forward Layer 설명 없음
Linear Layer A Linear Layer is a projection $\mathbf{XW + b}$.
Layer Normalization Unlike batch normalization, Layer Normalization directly estimates the normalization statistics from the summed inputs…
BPE Byte Pair Encoding, or BPE, is a subword segmentation algorithm that encodes rare and unknown words as sequences of subword units. The intuition is that various word…
Absolute Position Encodings Absolute Position Encodings are a type of position embeddings for [Transformer-based models] where positional encodings are…

Similar Papers 제목 키워드 기반

Gecko: An Efficient Neural Architecture Inherently Processing Sequences with Arbitrary Lengths

2026-01-10 · Xuezhe Ma, Shicheng Wen, Linghao Jin, Bilge Acun 외 arxiv

Designing a unified neural network to efficiently and inherently process sequential data with arbitrary lengths is a central and challenging problem in sequence modeling. The design choices in Transformer, including quad…

Applications of Modular Co-Design for De Novo 3D Molecule Generation

2025-05-23 · Danny Reidenbach, Filipp Nikitin, Olexandr Isayev, Saee Paliwal

De novo 3D molecule generation is a pivotal task in drug discovery. However, many recent geometric generative models struggle to produce high-quality 3D structures, even if they maintain 2D validity and topological stabi…

3D Molecule GenerationDenoisingDrug Discoveryvalid

Samba: Simple Hybrid State Space Models for Efficient Unlimited Context Language Modeling

2024-06-11 · Liliang Ren, Yang Liu, Yadong Lu, Yelong Shen 외

Efficiently modeling sequences with infinite context length has long been a challenging problem. Previous approaches have either suffered from quadratic computational complexity or limited extrapolation ability in length…

4kLanguage ModelingLanguage ModellingMamba+2

Compressed Context Memory For Online Language Model Interaction

2023-12-06 · Jang-Hyun Kim, Junyoung Yeom, Sangdoo Yun, Hyun Oh Song

This paper presents a context key/value compression method for Transformer language models in online scenarios, where the context continually expands. As the context lengthens, the attention process demands increasing me…

Language ModelingLanguage ModellingmodelMulti-Task Learning

Ltri-LLM: Streaming Long Context Inference for LLMs with Training-Free Dynamic Triangular Attention Pattern

2024-12-06 · Hongyin Tang, Di Xiu, Lanrui Wang, Xiurui Geng 외

The quadratic computational complexity of the attention mechanism in current Large Language Models (LLMs) renders inference with long contexts prohibitively expensive. To address this challenge, various approaches aim to…

Chunking