Research
Dynamic Positional Attention Modulation for Parameter-Efficient Fine-Tuning of Large Language Models
Overview Research area: Natural Language Processing / parameter-efficient fine-tuning (PEFT) of large language models, with a focus on how positional information is used inside attention. Technical le

- arXiv
- 2610.07848
- Published
- 2026-10-06
- Authors
- Dayan Pan, Jingyuan Wang, Xie Yu
AI summary
Overview
Research area: Natural Language Processing / parameter-efficient fine-tuning (PEFT) of large language models, with a focus on how positional information is used inside attention.
Technical level: Intermediate — the paper assumes familiarity with the Transformer attention mechanism, Rotary Position Embedding (RoPE), and standard PEFT families such as LoRA and IA³.
Scope: The paper proposes and evaluates DyPAM, a PEFT method that modulates query and key representations before RoPE to adapt positional attention in a structured, input-conditioned way, tested on mathematical and commonsense reasoning benchmarks across LLaMA 3.2, Qwen3, and Gemma 3 backbones.
What This Paper Is About
Most PEFT methods (LoRA, IA³, Bone, and others) apply the same static, uniform adaptation across all layers, attention heads, feature dimensions, and input tokens, even though attention in pretrained LLMs behaves very differently across those axes — especially because RoPE makes different attention dimensions respond differently to positional distance. The goal of DyPAM is to adapt how positional information contributes to attention by multiplying query and key vectors with modulation factors that vary per token, per dimension pair, per head, and per layer, while leaving the pretrained backbone unchanged.
Key Contributions
- DyPAM, a positional-attention PEFT method. The paper introduces DyPAM (Dynamic Positional Attention Modulation) as the first parameter-efficient fine-tuning method that explicitly adapts large language models by modulating positional attention in a fine-grained, structured manner.
- Input-conditioned, dimension-wise modulation. DyPAM generates modulation features from hidden states via a lightweight low-rank projection, so different attention dimensions are dynamically adjusted according to the input context.
- Head-wise and layer-wise structural modulation. Separate learnable bias vectors for each layer and each head let different heads and network depths maintain distinct positional preferences, independent of the input.
- Aligned with RoPE structure and evaluated broadly. Modulation is applied before RoPE and shares one modulation value per RoPE dimension pair, and experiments across multiple backbone models and mathematical plus commonsense reasoning benchmarks show consistent gains over existing PEFT baselines.
Main Findings
- DyPAM beats PEFT baselines on mathematical reasoning. On LLaMA 3.2 3B, DyPAM reaches 63.58% micro-avg and 67.96% macro-avg with 0.92% trainable parameters, marked as a statistically significant improvement over the best baseline (two-sided t-test, p < 0.05). The strongest non-DyPAM results on that backbone were Bone at 63.03% micro-avg and OFT at 67.02% macro-avg.
- Gains hold on larger and smaller backbones. On Qwen3 8B, DyPAM scores 84.24% micro-avg and 83.20% macro-avg with 0.61% parameters (baselines: SHiRA 82.57% micro-avg, RoSA 81.29% macro-avg). On Gemma 3 4B, DyPAM reaches 65.28% micro-avg and 66.20% macro-avg with 0.62% parameters.
- Strong per-benchmark numbers. On LLaMA 3.2 3B, DyPAM reports 88.50 on MultiArith, 39.88 on GSM8K, 86.33 on AddSub, 25.20 on AQuA, 88.78 on SingleEq, 63.00 on SVAMP, and 84.03 on MAWPS. On Qwen3 8B it reports 99.17 on MultiArith, 76.72 on GSM8K, 91.90 on AddSub, 40.94 on AQuA, 95.28 on SingleEq, 85.50 on SVAMP, and 92.86 on MAWPS.
- DyPAM is effective across model scales. Macro-averaged mathematical accuracy on Qwen 3 scales from 66.13 (0.6B) to 69.24 (1.7B), 78.24 (4B), and 83.20 (8B), above LoRA (64.06 / 66.64 / 75.60 / 80.37), OFT (65.96 / 67.81 / 75.54 / 80.45), SHiRA (63.95 / 64.65 / 73.33 / 81.04), and RoSA (63.99 / 67.38 / 77.92 / 81.29) at every scale.
- Commonsense reasoning results are also significant on two backbones. On LLaMA 3.2 3B, DyPAM reaches 77.83 micro-avg and 74.13 macro-avg (both starred as significant), compared with OFT at 77.52 and 74.04. On Qwen3 8B it reaches 85.66 micro-avg and 84.75 macro-avg, compared with SHiRA at 85.57 and 84.51.
- Parameter efficiency. DyPAM's trainable-parameter share is 0.92% (LLaMA 3.2 3B), 0.61% (Qwen3 8B), and 0.62% (Gemma 3 4B) — comparable to or below most structured baselines such as OFT (0.73% / 0.51% / 0.75%) and Bone (1.14% / 0.81% / 1.41%).
- Motivating evidence of heterogeneity. Visualizations of Llama-3.2-3B show attention activations vary across query dimensions, heads, layers, and input tokens, with similar patterns for keys but not for values; a second figure shows RoPE causes different attention dimensions to respond differently to relative positional distance in a non-uniform, multi-scale way.
- Not reported in the available content. The ablation results for RQ3 (component contributions), hyperparameter sensitivity for RQ4, and the analysis of learned positional modulation patterns for RQ5 are not included in the provided text, and the Gemma 3 4B commonsense table is truncated mid-row. The number of training examples, epochs, and the sources of the two training datasets are also not given beyond the benchmark names.
Methodology in Plain English
The starting observation is that different parts of an LLM's attention behave differently. Some attention dimensions are more sensitive to position than others, some heads look different from other heads in the same layer, and the pattern changes depending on the token. Since RoPE rotates pairs of dimensions by amounts that vary with the index, each pair of dimensions carries a distinct positional "channel."
DyPAM exploits this. For each Transformer layer, it takes the hidden states, as well as the usual query and key projections. A small low-rank projection converts the hidden states into per-head modulation features — a rank r = 128 bottleneck with modulation embedding dimension d_e = 64. Separate learnable embedding matrices for queries and keys map those features to one score per RoPE dimension pair (d_head/2 scores), so every pair gets its own input-dependent adjustment. On top of the input-conditioned score, DyPAM adds two learned, input-independent bias vectors: one shared across the layer, and one specific to each head. The combined score passes through a sigmoid and is rescaled into a bounded factor s = 1 + α(σ(g̃) − 0.5), which with α = 0.3 keeps values between 1 − α/2 and 1 + α/2, so the model never strays far from the pretrained representation.
Both dimensions inside a RoPE pair are multiplied by the same factor, applied to the query and key vectors before RoPE, and the attention computation then proceeds normally. Because the pretrained backbone is frozen, only the DyPAM parameters train, using the standard cross-entropy language-modeling loss. The design also handles grouped-query attention: where several heads share a key projection, the key-side modulation is shared across those heads while the query-side modulation stays head-specific. Training used DeepSpeed with bfloat16 precision on NVIDIA RTX 4090 GPUs.
Why This Matters
Impact on research. The paper argues that the "one-size-fits-all" assumption behind most PEFT methods is wrong for attention in RoPE-based models, and shows that aligning adaptation with the RoPE dimension-pairing is a productive design principle. It also connects to prior work on functional specialization inside Transformers, where different layers and components play distinct roles.
Real-world applications (as framed by the benchmark tasks):
- Mathematical reasoning assistants that solve multi-step arithmetic word problems (GSM8K, MultiArith, AddSub, SingleEq, SVAMP, MAWPS, AQuA).
- Question-answering systems that must decide whether a passage supports a claim (BoolQ).
- Physical and social commonsense assistants (PIQA, Social IQA, OpenBookQA, ARC-Easy, ARC-Challenge).
- Everyday narrative and pronoun-resolution understanding (HellaSwag, WinoGrande).
Industry relevance. Fine-tuning a large model per task is expensive in compute and storage; DyPAM adapts models while training under 1% of parameters (0.61%–0.92% in the reported settings), which suits multi-task deployment where a single frozen backbone serves many lightweight, swappable adaptations. The method explicitly notes support for grouped-query attention, a common inference-efficiency choice in modern LLMs. Code is released at github.com/Beihang-BIGSCity/DyPAM and archived at Zenodo (DOI 10.5281/zenodo.20507186).
Future Directions
- Isolate which components matter. RQ3 asks which components of DyPAM contribute most to performance; the paper poses this question, but the ablations are not reported in the available content, so the individual value of the dimension-wise versus head-wise versus layer-wise terms remains to be seen.
- Map the hyperparameter landscape. RQ4 concerns sensitivity to hyperparameters such as the modulation strength α, rank r, and embedding dimension d_e; only the single setting d_e = 64, r = 128, α = 0.3 is specified here.
- Interpret the learned modulation. RQ5 asks what positional modulation patterns DyPAM learns; understanding whether the learned factors recover known positional structure would strengthen the motivation.
- Broaden the evaluation envelope. The paper covers mathematical and commonsense reasoning on LLaMA 3.2 3B, Qwen3 8B, Gemma 3 4B, and Qwen 3 scales of 0.6B to 8B; whether the same gains transfer to other task families, longer contexts, or non-RoPE positional schemes is not addressed in the provided content.
Target Audience
Researchers and engineers working on parameter-efficient fine-tuning, LLM adaptation, and attention-mechanism interpretability. It will be most useful to readers who already understand Transformer attention and RoPE and want a concrete, structure-aware alternative to uniform PEFT methods, as well as practitioners choosing an adaptation method for multi-task deployment under tight parameter budgets. Beginners will need background reading on attention and positional encoding first.
Authors’ abstract
Parameter-efficient fine-tuning (PEFT) has become a standard approach for adapting large language models to downstream tasks. However, most existing PEFT methods rely on uniform and static adaptations, without accounting for the structured heterogeneity of attention across dimensions, heads, layers, and input tokens. In practice, attention representations exhibit non-uniform behavior, and positional encoding mechanisms such as rotary positional embeddings (RoPE) induce dimension-dependent positional structure, making uniform adaptation suboptimal. In this work, we propose DyPAM (Dynamic Positional Attention Modulation), a PEFT method that adapts how positional information contributes to attention by operating directly on the query and key representations. DyPAM combines input-conditioned, dimension-wise modulation with head-wise and layer-wise structural modulation, performing fine-grained adaptation of positional attention aligned with the RoPE-induced structure without modifying the pretrained backbone. Extensive experiments on mathematical and commonsense reasoning benchmarks across multiple backbone models demonstrate that DyPAM consistently outperforms existing strong PEFT baselines.