Skip to content

ACL papers

Search ACL papers by title, author, or track. Open a paper’s abstract to read more.

Explore the ACL analysis

Search results

1,781–1,800 of 2,573

  • ACL · Findings

    pQuant: Towards Effective Low-Bit Language Models via Decoupled Linear Quantization-Aware Training

    Wenzheng Zhang, Bingzheng Liu

    Abstract

    Quantization-Aware Training from scratch has emerged as a promising approach for building efficient large language models (LLMs) with extremely low-bit weights (sub 2-bit), which can offer substantial advantages for edge deployment. However, existing methods still fail to achieve satisfactory accuracy and scalability. In this work, we identify a parameter democratization effect as a key bottleneck: the sensitivity of all parameters becomes homogenized, severely limiting expressivity. To address this, we propose pQuant, a method that decouples parameters by splitting linear layers into two specialized branches: a dominant 1-bit branch for efficient computation and a compact high-precision branch dedicated to preserving the most sensitive parameters. Through tailored feature scaling, we explicitly guide the model to allocate sensitive parameters to the high-precision branch. Furthermore, we extend this branch into multiple, sparsely-activated experts, enabling efficient capacity scaling. Extensive experiments indicate our pQuant achieves state-of-the-art performance in extremely low-bit quantization.

    Abstract source
  • ACL · Findings

    Incomplete Prompt Jailbreaks in Large Language Models

    Yeonjea Kim, Bumjin Park, Jaesik Choi

    Abstract

    Large language models (LLMs) are increasingly released as open-weight models with safeguards against harmful requests. Nevertheless, sentence completion remains vulnerable to incomplete harmful prompts. In this work, we formalize this phenomenon as incomplete prompt jailbreaks (IPJ) and provide a systematic empirical characterization of when and how incomplete prompts elicit harmful continuations. We analyze diverse attractor types associated with incomplete sentence continuation and show that LLMs systematically delay refusal until sentence termination. We further demonstrate that training models to refuse incomplete harmful prompts via parameter tuning is insufficient, failing to generalize across both content domains and attractor types. To enable fine-grained control, we identify two functional neurons: termination and continuation neurons. By clarifying their roles in sentence completion, we highlight the potential of neuron-level interventions for more precise and robust IPJ defenses.

    Abstract source
  • ACL · Findings

    A.S.E: A Repository-Level Benchmark for Evaluating Security in AI-Generated Code

    Keke Lian, Wang Bin, Lei Zhang, Libo Chen, Junjie Wang, Ziming Zhao, Yujiu Yang, Miaoqian Lin, Haotong Duan, Haoran Zhao, Shuang Liao, Mingda Guo, Quan Jiazheng, Yilu Zhong, Chenhao He, Chen Zichuan, Jie Wu, Haoling Li, Zhaoxuan Li, Jiongchi Yu, Hui LI, Dong Zhang

    Abstract

    The increasing adoption of large language models (LLMs) in software engineering necessitates rigorous security evaluation of their generated code. However, existing benchmarks often lack relevance to real-world AI-assisted programming scenarios, making them inadequate for assessing the practical security risks associated with AI-generated code in production environments. To address this gap, we introduce A.S.E (AI Code Generation Security Evaluation), a repository-level evaluation benchmark designed to closely mirror real-world AI programming tasks, offering a comprehensive and reliable framework for assessing the security of AI-generated code. Our evaluation of leading LLMs on A.S.E reveals several key findings. In particular, current LLMs still struggle with secure coding. The complexity in repository-level scenarios presents challenges for LLMs that typically perform well on snippet-level tasks. Moreover, a larger reasoning budget does not necessarily lead to better code generation. These observations offer valuable insights into the current state of AI code generation and help developers identify the most suitable models for practical tasks. They also lay the groundwork for refining LLMs to generate secure and efficient code in real-world applications.

    Abstract source
  • ACL · Findings

    Thought-Action Graph Reasoning: Faithful and Efficient Reasoning of Large Language Models via Reusing Past Experience

    Zhixiao Qi, Feng Huang, Yunqi Zhang, Shijie Zhang, Qingqing Sun, Yongfeng Huang, Minghu Jiang, Shuai Chen, Tianyi Zhang

    Abstract

    Large language models (LLMs) often hallucinate in question answering (QA) tasks due to a lack of factual knowledge. While integrating knowledge graphs (KGs) with LLMs has alleviated this issue, existing methods suffer from poor generalization or low reasoning efficiency, and critically, they overlook the learning and reuse of reasoning paths from past experiences. To address these challenges, we introduce Thought-Action Graph (TAG), a structured repository of reasoning experiences. TAG decomposes successful LLM-KG interaction trajectories into fine-grained semantic operators, which are stored in TAG constructed by the thought layer and action layer. Building upon TAG, we propose a novel KGQA paradigm \textemdash TAG-Reasoning (TAGR). TAGR first retrieves and assembles reasoning blueprints from TAG, and then guides LLM to efficiently execute on KG according to them. Through this approach, TAGR transforms the computationally expensive online exploration process of LLMs into an offline process of TAG retrieval and assembly. Experimental results on multiple KGQA benchmarks demonstrate that TAGR significantly outperforms state-of-the-art methods across key metrics, while drastically reducing the number of LLM calls and generated tokens. This work opens new avenues for building continual learning, efficient, and faithful KGQA systems.

    Abstract source
  • ACL · Findings

    Anchored Cyclic Generation: A Novel Paradigm for Long-Sequence Symbolic Music Generation

    Boyu Cao, Lekai Qian, Dehan Li, Haoyu Gu, Mingda Xu, Qi Liu

    Abstract

    Generating long sequences with structural coherence remains a fundamental challenge for autoregressive models across sequential generation tasks. In symbolic music generation, this challenge is particularly pronounced, as existing methods are constrained by the severe error accumulation inherent in autoregressive models, leading to poor performance in music quality and structural integrity. In this paper, we propose the Anchored Cyclic Generation (ACG) paradigm, which relies on anchor features from previously generated musical content to guide subsequent generation during the autoregressive process, effectively mitigating error accumulation in autoregressive methods. Based on the ACG paradigm, we further propose the Hierarchical Anchored Cyclic Generation (Hi-ACG) framework, which employs a systematic global-to-local generation strategy and is highly compatible with our specifically designed piano token, an efficient musical representation. The experimental results demonstrate that compared to traditional autoregressive models, the ACG paradigm reduces cosine distance by an average of 34.7% between predicted feature vectors and ground-truth semantic vectors. In long-sequence symbolic music generation tasks, the Hi-ACG framework significantly outperforms existing mainstream methods in both subjective and objective evaluations. Furthermore, the framework exhibits excellent task generalization capabilities, achieving superior performance in related tasks such as music completion.

    Abstract source
  • ACL · Findings

    TRUST: Towards Robust Social Bot Detection via Uncertainty-Guided Pseudo-Labeling and Graph Structure Purification

    Ruixuan Xu, Mengting Hu, Zhunheng Wang, Ming Jiang, Rui Ying, Zhen Zhang, Hang Gao, Shuaipeng Liu, Renhong Cheng

    Abstract

    Social bots threaten online platforms by mimicking human behavior and forming deceptive connections, enabling the dissemination of misinformation while evading detection. Existing graph-based detection models leverage graph neural networks (GNNs) to capture relational structures and multimodal user features. However, such models are vulnerable to deceptive message propagation, where bots deliberately interact with legitimate users. These interactions create heterophilous edges–connections between nodes with different labels (i.e. human and bot)–which undermine the homophily assumption that connected users typically share similar characteristics. In this work, we propose a novel framework to mitigate deceptive message propagation through node-level uncertainty estimation and graph structure purification. The framework comprises three key components: (1) Node uncertainty estimation employs evidential deep learning with an error-sensitive uncertainty loss to obtain calibrated node-wise uncertainty; (2) Uncertainty-guided pseudo-label generation assigns pseudo-labels to low-uncertainty nodes using a dynamic threshold; (3) Graph structure purification selectively disconnects heterophilous edges identified between differently labeled nodes. Extensive experiments on three benchmark datasets and six GNN backbones demonstrate that our framework consistently enhances detection performance and serves as an effective general-purpose enhancement module for social bot detection.

    Abstract source
  • ACL · Findings

    XGUARD: A Graded Benchmark for Evaluating Safety Failures of Large Language Models on Extremist Content

    Vadivel Abishethvarman, Bhavik Chandna, Pratik Jalan, Usman Naseem

    Abstract

    Large Language Models (LLMs) can generate content spanning ideological rhetoric to explicit instructions for violence. However, existing safety evaluations often rely on simplistic binary labels (safe/unsafe), overlooking the nuanced spectrum of risk these outputs pose. To address this, we present XGUARD, a benchmark and evaluation framework designed to assess the severity of extremist content generated by LLMs on a multi-level grading. It includes 3,840 red-teaming prompts generated using templates informed by real-world extremist scenarios from social media, forums, and news. The framework categorizes model responses into five danger levels (0–4) defined by degree of extremist endorsement, enabling nuanced analysis of failure frequency and severity. We introduce the interpretable Attack Severity Curve (ASC) to visualize vulnerabilities and compare defense mechanisms across threat intensities. Using XGUARD, we evaluate five popular LLMs and two lightweight defense strategies, revealing key insights into current safety gaps and trade-offs between robustness and expressive freedom. Our work underscores the value of graded safety metrics for building trustworthy LLMs. The code and dataset is available at https://github.com/Abishethvarman/XGUARD

    Abstract source
  • ACL · Findings

    PiCSAR: Probabilistic Confidence Selection and Ranking for Reasoning Chains

    Joshua Ong Jun Leang, Zheng Zhao, Aryo Pradipta Gema, Sohee Yang, Wai-Chung Kwan, Xuanli He, Wenda Li, Pasquale Minervini, Eleonora Giunchiglia, Shay B Cohen

    Abstract

    Best-of-n sampling improves the accuracy of large language models (LLMs) and large reasoning models (LRMs) by generating multiple candidate solutions and selecting the one with the highest reward. The key challenge for reasoning tasks is designing a scoring function that can identify correct reasoning chains without access to ground-truth answers. We propose Probabilistic Confidence Selection and Ranking for Reasoning Chains (PiCSAR): a simple, training-free method that scores each candidate generation using the joint log-likelihood of the reasoning and final answer. This method utilises both the scores of the reasoning path (reasoning confidence) and the final answer (answer confidence). PiCSAR achieves substantial gains across several benchmarks (+11.7 on AIME2024, +9.81 on AIME2025), outperforming baselines with at least 2x fewer samples in 20 out of 25 comparisons. Our analysis reveals that correct reasoning chains exhibit higher reasoning and answer confidence, justifying the effectiveness of PiCSAR.

    Abstract source
  • ACL · Findings

    DeepPresenter: Environment-Grounded Reflection for Agentic Presentation Generation

    Hao Zheng, Guozhao Mo, Xinru Yan, Qianhao Yuan, Wenkai Zhang, Xuanang Chen, Yaojie Lu, Hongyu Lin, Xianpei Han, Le Sun

    Abstract

    Presentation generation requires deep content research, coherent visual design, and iterative refinement based on observation. However, existing presentation agents often rely on predefined workflows and fixed templates. To address this, we present DeepPresenter, an agentic framework that adapts to diverse user intents, enables effective feedback-driven refinement, and generalizes beyond a scripted pipeline. Specifically, DeepPresenter autonomously plans, renders, and revises intermediate slide artifacts to support long-horizon refinement with environmental observations. Furthermore, rather than relying on self-reflection over internal signals (e.g., reasoning traces), our environment-grounded reflection conditions the generation process on perceptual artifact states (e.g., rendered slides), enabling the system to identify and correct presentation-specific issues during execution. Results on the evaluation set covering diverse presentation-generation scenarios show that DeepPresenter achieves state-of-the-art performance, and the fine-tuned DeepPresenter-9B remains highly competitive at substantially lower cost.

    Abstract source
  • ACL · Findings

    FormulaReasoning: A Dataset for Formula-Based Numerical Reasoning

    Xiao Li, Bolin Zhu, Kaiwen Shi, Sichen Liu, Yin Zhu, Yiwei Liu, Gong Cheng

    Abstract

    The application of physics formulas is a fundamental human capability in numerical reasoning. While existing datasets often rely on implicit mathematical knowledge, they rarely explicitate the underlying formulas. To address this, we introduce FormulaReasoning, a new benchmark for formula-based numerical reasoning comprising 5,324 questions requiring calculations grounded in external physics principles. We provide high-quality, fine-grained annotations in English and Chinese—including formula structures, parameter names, symbols, values, and units—curated through manual effort and LLM-assisted validation. Additionally, we provide a consolidated formula database as an external knowledge source. To further challenge model performance, we develop an extended version of the dataset by coupling multiple questions. We evaluate various architectural and methodological frameworks, including retrieval-augmented methods, modular reasoning (formula generation, parameter extraction, and calculation), and preference-based optimization. Our analysis identifies critical challenges in formula-based reasoning, highlighting significant opportunities for future methodological advancement.

    Abstract source
  • ACL · Findings

    CORD: Bridging the Audio–Text Reasoning Gap via Weighted On-policy Cross-modal Distillation

    Hu Jing, Danxiang Zhu, Xianlong Luo, Dan Zhang, Shuwei He, Yishu Lei, Shikun Feng, Hai-Tao Zheng, Jingzhou HE, Yu Sun, Hua Wu, Haifeng Wang

    Abstract

    Large Audio Language Models (LALMs) have garnered significant research interest. Despite being built upon text-based large language models (LLMs), LALMs frequently exhibit a degradation in knowledge and reasoning capabilities. We hypothesize that this limitation stems from the failure of current training paradigms to effectively bridge the acoustic-semantic gap within the feature representation space. To address this challenge, we propose CORD, a unified alignment framework that performs online cross-modal self-distillation. Specifically, it aligns audio-conditioned reasoning with its text-conditioned counterpart within a unified model. Leveraging the text modality as an internal teacher, CORD performs multi-granularity alignment throughout the audio rollout process. At the token level, it employs on-policy reverse KL divergence with importance-aware weighting to prioritize early and semantically critical tokens. At the sequence level, CORD introduces a judge-based global reward to optimize complete reasoning trajectories via Group Relative Policy Optimization (GRPO). Empirical results across multiple benchmarks demonstrate that CORD consistently enhances audio-conditioned reasoning and substantially bridges the audio–text performance gap with only 80k synthetic training samples, validating the efficacy and data efficiency of our on-policy, multi-level cross-modal alignment approach.

    Abstract source
  • ACL · Findings

    Leveraging Label Semantics and Entity Description Generation for LLM-based Fine-grained Entity Typing

    Yingying Ma, Hongliang Dai, Xia Zhang, Piji Li

    Abstract

    Fine-grained entity typing (FET) aims to assign semantically rich and contextually appropriate types to entity mentions. While recent studies have explored the use of large language models (LLMs) for this task, two key challenges persist. First, FET typically involves a large number of entity types, making it difficult for LLMs to perform accurate classification. Second, the presence of label noise in the training data introduced by automatic supervision methods hinders effective fine-tuning. To address these challenges, we propose DR-FET, a descriptor-based retrieval-augmented framework that reduces the effective label space and constructs high-precision training data under noisy supervision. Our method introduces natural language descriptors as an intermediate semantic representation for both entity mentions and types. During inference, entity descriptors are used to retrieve a small set of semantically relevant candidate types, enabling the LLM to perform fine-grained classification under explicit candidate constraints. During training, the same descriptor and retrieval mechanism is reused to identify high-confidence instances from distantly supervised data, prioritizing label precision for efficient fine-tuning. Experiments on two widely used benchmarks demonstrate that the proposed method consistently outperforms existing fine-grained entity typing approaches under noisy supervision.

    Abstract source
  • ACL · Findings

    EvoMemKG: An Evolvable Memory Agent for Multi-hop Knowledge Graph Reasoning

    Shiyu Tian, Shuyue Xing, Zhuoxin Han, Caixia Yuan, Xiaojie Wang

    Abstract

    Integrating knowledge graphs (KGs) with large language models (LLMs) enhances factual accuracy and interpretability in question answering. However, existing agent-based methods rely on static memory mechanisms that fail to address the combinatorial explosion of search spaces in multi-hop reasoning and lack continuous learning capabilities. To overcome these limitations, we propose EvoMemKG, an agent framework with a dynamic, evolvable memory mechanism specifically designed for KG reasoning. EvoMemKG features a dual-layer memory architecture: (1) a working memory that losslessly compresses retrieved triplets through clustering to manage exploration states, effectively linearizing the exponential state space expansion; and (2) an experience memory that abstracts historical reasoning paths into reusable, generalized strategies, enabling cross-task knowledge transfer and self-evolution. We further introduce a double-loop workflow that orchestrates the LLM, memory layers, and KG environment to enable end-to-end autonomous reasoning. Extensive evaluations on three KGQA datasets across two KGs demonstrate that EvoMemKG achieves state-of-the-art performance without requiring additional training or specialized tools. Notably, it achieves improvements of up to 20% over the strong baseline on complex multi-hop queries, validating the effectiveness of our dynamic memory approach.

    Abstract source
  • ACL · Findings

    Grouped Adaptive Weight Sharing (GAWS): An Inference-Efficient Adaptation Method for Large Language Models

    Eman Alsuradi, Junhyun Lee, Kyenghun Lee, Hyeonmok Ko, Fahed Jubair

    Abstract

    Although Low-Rank Adaptation (LoRA) revolutionized parameter-efficient fine-tuning, it often incurs an inference overhead due to the extra computation required by adapter layers. While most literature focuses on maximizing accuracy or minimizing parameter counts, this paper prioritizes single-request inference performance in the unmerged adapter setting, where adapters must remain decoupled from the base model at runtime. By analyzing LoRA adapters on GPUs, we identify segmented function calls as the primary source of this latency. To address this, we propose Grouped Adaptive Weight Sharing (GAWS), a novel adapter design based on structured Kronecker product decomposition. Experiments on T5-3B, GPT-2 Large, LLaMA3.2-3B, and RoBERTa-Large show that GAWS reduces latency to about 40% of the gap between the unmerged LoRA and the base model, while maintaining parameter efficiency and comparable accuracy. This positions GAWS as a Pareto-efficient solution for deploying adapted LLMs in latency-sensitive settings, balancing the high latency of compressed adapters with the accuracy of LoRA. The source code is available at:https://github.com/SamsungLabs/GAWS .

    Abstract source
  • ACL · Findings

    Astra: Activation-Space Tail-Eigenvector Low-Rank Adaptation of Large Language Models

    Kainan Liu, Yong Zhang, Ning Cheng, Yun Zhu, Yanmeng Wang, Shaojun Wang, Jing Xiao

    Abstract

    Parameter-Efficient Fine-Tuning (PEFT) methods, especially LoRA, are widely used for adapting pre-trained models to downstream tasks due to their computational and storage efficiency. However, in the context of LoRA and its variants, the potential of activation subspaces corresponding to tail eigenvectors remains substantially under-exploited, which may lead to suboptimal fine-tuning performance. In this work, we propose Astra (Activation-Space Tail-Eigenvector Low-Rank Adaptation), a novel PEFT method that leverages the tail eigenvectors of the model output activations—estimated from a small task-specific calibration set—to construct task-adaptive low-rank adapters. By constraining updates to the subspace spanned by these tail eigenvectors, Astra achieves faster convergence and improved downstream performance with a significantly reduced parameter budget. Extensive experiments across natural language understanding (NLU) and natural language generation (NLG) tasks demonstrate that Astra consistently outperforms existing PEFT baselines across 16 benchmarks and even surpasses full fine-tuning (FFT) in certain scenarios.

    Abstract source
  • ACL · Findings

    SCALER: Synthetic Scalable Adaptive Learning Environment for Reasoning

    Caijun Xu, Changyi Xiao, Zhongyuan Peng, Xinrun Wang, Yixin Cao

    Abstract

    Reinforcement learning (RL) offers a principled way to enhance the reasoning capabilities of large language models, yet its effectiveness hinges on training signals that remain informative as models evolve. In practice, RL progress often slows when task difficulty becomes poorly aligned with model capability or when training is dominated by a narrow set of recurring problem patterns.To jointly address these issues, we propose SCALER (Synthetic sCalable Adaptive Learning Environment for Reasoning), a framework that sustains effective learning signals through adaptive environment design.SCALER introduces a scalable synthesis pipeline that converts real-world programming problems into verifiable reasoning environments with controllable difficulty and unbounded instance generation, enabling RL training beyond finite datasets while preserving strong correctness guarantees. Building on this, SCALER further employs an adaptive multi-environment RL strategy that dynamically adjusts instance difficulty and curates the active set of environments to track the model’s capability frontier and maintain distributional diversity. This co-adaptation prevents reward sparsity, mitigates overfitting to narrow task patterns, and supports sustained improvement throughout training. Extensive experiments show that SCALER consistently outperforms other RL baselines across diverse reasoning benchmarks and exhibits more stable, long-horizon training dynamics.

    Abstract source
  • ACL · Findings

    Free-MAD: Consensus-Free Multi-Agent Debate

    Yu Cui, Hang Fu, Haibin Zhang, Licheng Wang, Cong Zuo

    Abstract

    Multi-agent debate (MAD) is an emerging approach to improving the reasoning capabilities of large language models (LLMs). Existing MAD methods rely on multiple rounds of interaction among agents to reach consensus, and the final output is decided by majority voting in the last round. However, this consensus-based design faces several limitations. First, multiple rounds of communication increases token overhead and limits scalability. Second, due to the inherent conformity of LLMs, agents that initially produce correct responses may be influenced by incorrect ones during the debate process, causing error propagation. Third, majority voting introduces randomness and unfairness in the decision-making phase, and can degrade the reasoning performance. To address these issues, we propose Free-MAD, an alternative and novel MAD framework that eliminates the need for consensus among agents. Free-MAD introduces a novel score-based decision mechanism that evaluates the entire debate trajectory rather than relying on the last round only. This mechanism tracks how each agent’s reasoning evolves, enabling more accurate and fair outcomes. In addition, Free-MAD reconstructs the debate phase by introducing anti-conformity, a mechanism that enables agents to mitigate excessive influence from the majority. Experiments on eight benchmark datasets demonstrate that Free-MAD significantly improves reasoning performance while requiring only a single-round debate and thus reducing token costs. We also show that compared to existing MAD approaches, Free-MAD exhibits improved robustness in real-world attack scenarios.

    Abstract source
  • ACL · Findings

    Dialectical Structured Reasoning for Explainable Multimodal Fake News Detection

    Ruichao Yang, Yufan Bian, Wei Gao, Bo-Wen Zhang, Jing Ma, Hongzhan Lin, Ziyang Luo, Xiaobin Zhu, Xu-Cheng Yin

    Abstract

    Current multimodal fake news detectors predominantly function as opaque classifiers, offering limited deductive transparency and little insight into how conflicting evidence is reconciled. To address this limitation, we propose Dialectical Structured Reasoning (DSR), a framework modeling fake news detection as an explicit dialectical process over multimodal social context. DSR instantiates two opposing agents: a Verifier, which constructs evidence paths supporting semantic consistency, and a Debunker, which actively explores exposing logical or factual contradictions. Then a differentiable Judge agent adjudicates between these competing perspectives by integrating local evidence with global parametric knowledge. Experiments on three benchmarks demonstrate that DSR achieves state-of-the-art performance while producing transparent, dialectically grounded explanations that closely mirror human reasoning process.

    Abstract source
  • ACL · Findings

    Unlocking Human-Like Visible Logic: How Logic Diagrams Boost Logic Reasoning in Large Language Models?

    Xin Wu, Yuqi Bu, Mengchen Zhao, Qingbao Huang, Yi Cai

    Abstract

    Recent advancements in large language models (LLMs) have demonstrated their remarkable capabilities in natural language understanding and generation. However, these models still struggle with formal logical reasoning, often producing coherent yet invalid conclusions due to limitations in representing boundaries and relational structures through text alone. Human cognition frequently relies on visual representations to clarify logical structures involving category membership, inclusion, and relational hierarchies. Inspired by this, we investigate whether incorporating visual logic diagrams into LLMs’ reasoning workflows can enhance their performance on formal logic tasks. We study this question in a controlled setting using syllogistic and conditional reasoning with programmatically generated Venn, Euler, and Linear diagrams. Across three Vision Language Models (VLMs) families, diagrams help in some settings but can also hurt performance, especially on logically invalid cases where models may over-rely on a single static visual instantiation. We therefore present this work as a reproducible evaluation framework and empirical analysis of when logic diagrams help or hinder language-conditioned reasoning.

    Abstract source
  • ACL · Findings

    LaMPE: Length-aware Multi-grained Positional Encoding for Adaptive Long-context Scaling Without Training

    Sikui Zhang, Guangze Gao, Ziyun Gan, Chunfeng Yuan, Zefeng Lin, Houwen Peng, Bing Li, Weiming Hu

    Abstract

    Large language models (LLMs) experience significant performance degradation when the input exceeds the pretraining context window, primarily due to the out-of-distribution (OOD) behavior of Rotary Position Embedding (RoPE). Recent studies mitigate this problem by remapping OOD positions into the in-distribution range with fixed mapping strategies, ignoring the dynamic relationship between input length and the model’s effective context window. To this end, we propose Length-aware Multi-grained Positional Encoding (LaMPE), a training-free method that fully utilizes the model’s effective context window for adaptive long-context scaling in LLMs. Motivated by the left-skewed frequency distribution of relative positions, LaMPE establishes a dynamic relationship between mapping length and input length through a parametric scaled sigmoid function to adaptively allocate positional capacity across varying input lengths. Meanwhile, LaMPE devises a novel multi-grained attention mechanism that strategically allocates positional resolution across different sequence regions to capture both fine-grained locality and long-range dependencies. Our method can be seamlessly applied to a wide range of RoPE-based LLMs without training. Extensive experiments on three representative LLMs across five mainstream long-context benchmarks demonstrate that LaMPE achieves significant performance improvements compared to existing length extrapolation methods.

    Abstract source