Impact of Positional Encoding: Clean and Adversarial Rademacher Complexity for Transformers under In-Context Regression

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: He, Weiyi, Xing, Yue
Format: Preprint
Publié: 2025
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866912979740524544
author He, Weiyi
Xing, Yue
author_facet He, Weiyi
Xing, Yue
contents Positional encoding (PE) is a core architectural component of Transformers, yet its impact on the Transformer's generalization and robustness remains unclear. In this work, we provide the first generalization analysis for a single-layer Transformer under in-context regression that explicitly accounts for a completely trainable PE module. Our result shows that PE systematically enlarges the generalization gap. Extending to the adversarial setting, we derive the adversarial Rademacher generalization bound. We find that the gap between models with and without PE is magnified under attack, demonstrating that PE amplifies the vulnerability of models. Our bounds are empirically validated by a simulation study. Together, this work establishes a new framework for understanding the clean and adversarial generalization in ICL with PE.
format Preprint
id arxiv_https___arxiv_org_abs_2512_09275
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Impact of Positional Encoding: Clean and Adversarial Rademacher Complexity for Transformers under In-Context Regression
He, Weiyi
Xing, Yue
Machine Learning
Positional encoding (PE) is a core architectural component of Transformers, yet its impact on the Transformer's generalization and robustness remains unclear. In this work, we provide the first generalization analysis for a single-layer Transformer under in-context regression that explicitly accounts for a completely trainable PE module. Our result shows that PE systematically enlarges the generalization gap. Extending to the adversarial setting, we derive the adversarial Rademacher generalization bound. We find that the gap between models with and without PE is magnified under attack, demonstrating that PE amplifies the vulnerability of models. Our bounds are empirically validated by a simulation study. Together, this work establishes a new framework for understanding the clean and adversarial generalization in ICL with PE.
title Impact of Positional Encoding: Clean and Adversarial Rademacher Complexity for Transformers under In-Context Regression
topic Machine Learning
url https://arxiv.org/abs/2512.09275