paper-with-me

홈 › Papers

LongRecipe: Recipe for Efficient Long Context Generalization in Large Language Models

2024-08-31 · Zhiyuan Hu, Yuliang Liu, Jinman Zhao, Suyuchen Wang, Yan Wang, Wei Shen, Qing Gu, Anh Tuan Luu, See-Kiong Ng, Zhiwei Jiang, Bryan Hooi

Large language models (LLMs) face significant challenges in handling long-context tasks because of their limited effective context window size during pretraining, which restricts their ability to generalize over extended sequences. Meanwhile, extending the context window in LLMs through post-pretraining is highly resource-intensive. To address this, we introduce LongRecipe, an efficient training strategy for extending the context window of LLMs, including impactful token analysis, position index transformation, and training optimization strategies. It simulates long-sequence inputs while maintaining training efficiency and significantly improves the model's understanding of long-range dependencies. Experiments on three types of LLMs show that LongRecipe can utilize long sequences while requiring only 30% of the target context window size, and reduces computational training resource over 85% compared to full sequence training. Furthermore, LongRecipe also preserves the original LLM's capabilities in general tasks. Ultimately, we can extend the effective context window of open-source LLMs from 8k to 128k, achieving performance close to GPT-4 with just one day of dedicated training using a single GPU with 80G memory. Our code is released at https://github.com/zhiyuanhubj/LongRecipe.

📄 PDF Abstract BibTeX arXiv:2409.00509

Code (1)

zhiyuanhubj/LongRecipe 공식 구현 pytorch

Tasks

8kGPU

Methods 이 논문이 사용한 방법론

Attention 설명 없음
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…
Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…
Label Smoothing Label Smoothing is a regularization technique that introduces noise for the labels. This accounts for the fact that datasets may have mistakes in them, so maximizing the…
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…
Layer Normalization Unlike batch normalization, Layer Normalization directly estimates the normalization statistics from the summed inputs…
Position-Wise Feed-Forward Layer 설명 없음

Similar Papers 제목 키워드 기반

Randomized YaRN Improves Length Generalization for Long-Context Reasoning

2026-06-22 · Manas Mehta, Fangcong Yin, Greg Durrett arxiv

Large language models (LLMs) are typically pretrained on short sequences and then extended to work on longer sequences with additional training. However, such LLMs still struggle to further generalize to very long sequen…

Coreference Resolution

Training Long-Context Vision-Language Models Effectively with Generalization Beyond 128K Context

2026-05-13 · Zhaowei Wang, Lishu Luo, Haodong Duan, Weiwei Liu 외 arxiv

Long-context modeling is becoming a core capability of modern large vision-language models (LVLMs), enabling sustained context management across long-document understanding, video analysis, and multi-turn tool use in age…

Information Retrieval

LongAlign: A Recipe for Long Context Alignment of Large Language Models

2024-01-31 · Yushi Bai, Xin Lv, Jiajie Zhang, Yuze He 외

Extending large language models to effectively handle long contexts requires instruction fine-tuning on input sequences of similar length. To address this, we present LongAlign -- a recipe of the instruction data, traini…

DiversityInstruction Following

Enhancing Action and Ingredient Modeling for Semantically Grounded Recipe Generation

2026-01-26 · Guoshan Liu, Bin Zhu, Yian Li, Jingjing Chen 외 arxiv

Recent advances in Multimodal Large Language Models (MLMMs) have enabled recipe generation from food images, yet outputs often contain semantically incorrect actions or ingredients despite high lexical scores (e.g., BLEU…

Recipe Generation

Beyond Reward Engineering: A Data Recipe for Long-Context Reinforcement Learning

2026-06-17 · Xiaoyue Xu, Sikui Zhang, Xiaorong Wang, Xu Han 외 arxiv

Long-context reasoning is an essential capability for large language models, particularly when they are deployed as autonomous agents that must reason over lengthy trajectories. Reinforcement learning (RL) has recently e…

Reinforcement Learning