Token Weighting for Long-Range Language Modeling
Helm, Falko, Daheim, Nico, Gurevych, Iryna
–arXiv.org Artificial Intelligence
Many applications of large language models (LLMs) require long-context understanding, but models continue to struggle with such tasks. We hypothesize that conventional next-token prediction training could contribute to this, because each token is assigned equal weight. Yet, intuitively, the amount of context needed to predict the next token accurately varies greatly across different data. To reflect this, we propose various novel token-weighting schemes that assign different weights to each training token in the loss, thereby generalizing existing works. For this, we categorize token-weighting methods using a two-step framework which compares the confidences of a long-context and short-context model to score tokens. We evaluate all methods on multiple long-context understanding tasks and show that non-uniform loss weights are helpful to improve the long-context abilities of LLMs. Different short-context models can be used effectively for token scoring, including models that are much smaller than the long-context model that is trained. All in all, this work contributes to a better understanding of the trade-offs long-context language modeling faces and provides guidelines for model steering via loss-weighting based on empirical evidence. The code can be found on Github.
arXiv.org Artificial Intelligence
Mar-12-2025
- Country:
- South America > Chile
- North America
- United States
- Texas (0.04)
- Oregon > Benton County
- Corvallis (0.04)
- Louisiana > Orleans Parish
- New Orleans (0.04)
- Hawaii > Honolulu County
- Honolulu (0.04)
- Florida > Miami-Dade County
- Miami (0.04)
- Mexico > Mexico City
- Mexico City (0.04)
- Canada > Ontario
- Toronto (0.04)
- United States
- Europe
- Austria > Vienna (0.14)
- Slovenia > Drava
- Municipality of Benedikt > Benedikt (0.04)
- Middle East > Malta
- Eastern Region > Northern Harbour District > St. Julian's (0.04)
- Germany
- Berlin (0.04)
- Hesse > Darmstadt Region
- Darmstadt (0.04)
- Belgium > Brussels-Capital Region
- Brussels (0.04)
- Asia
- British Indian Ocean Territory > Diego Garcia (0.04)
- Thailand > Bangkok
- Bangkok (0.04)
- Myanmar > Tanintharyi Region
- Dawei (0.04)
- Middle East
- Jordan (0.04)
- Saudi Arabia > Asir Province
- Abha (0.04)
- Japan > Honshū
- Tōhoku > Iwate Prefecture
- Morioka (0.04)
- Chūbu > Toyama Prefecture
- Toyama (0.04)
- Tōhoku > Iwate Prefecture
- Genre:
- Research Report > New Finding (0.67)
- Industry:
- Education (0.46)
- Technology: