arXiv:2505.12138cs.LGstat.ML2025-05被引 6

Transformer通过上下文学习隐式获取先验与正则化,解决欠定逆问题。

Transformer learns the cross-task prior and regularization for in-context learning

  • 用线性Transformer从上下文样本中推断权重向量
  • 误差随噪声、任务维数/上下文长度比和数据条件数线性增长
  • 适用于低维任务且优于传统正则化方法

Transformer在上下文学习(ICL)中展现出惊人预测能力,但其对上下文的推断机制及下游任务的实用性仍不明确。本文以逆线性回归(ILR)为研究对象,分析了在秩亏逆问题下(上下文长度小于未知权重维度),如何通过无监督学习推断底层权重向量。我们引入线性Transformer,学习从上下文示例到权重向量的逆映射。结果表明,Transformer隐式学习到了先验分布与有效正则化策略,在性能上超越传统岭回归。关键发现是:任务维度必须远低于上下文长度才能成功学习。数值验证显示,该估计器的误差与噪声水平、任务维数与上下文长度之比、输入数据条件数均呈线性关系。这些结果不仅揭示了Transformer求解病态逆问题的潜力,也为理解其知识提取机制提供了新视角。

原文摘要 · Abstract (English)

Transformers have shown a remarkable ability for in-context learning (ICL), making predictions based on contextual examples. However, while theoretical analyses have explored this prediction capability, the nature of the inferred context and its utility for downstream predictions remain open questions. This paper aims to address these questions by examining ICL for inverse linear regression (ILR), where context inference can be characterized by unsupervised learning of underlying weight vectors. Focusing on the challenging scenario of rank-deficient inverse problems, where context length is smaller than the number of unknowns in the weight vectors and regularization is necessary, we introduce a linear transformer to learn the inverse mapping from contextual examples to the underlying weight vector. Our findings reveal that the transformer implicitly learns both a prior distribution and an effective regularization strategy, outperforming traditional ridge regression and regularization methods. A key insight is the necessity of low task dimensionality relative to the context length for successful learning. Furthermore, we numerically verify that the error of the transformer estimator scales linearly with the noise level, the ratio of task dimension to context length, and the condition number of the input data. These results not only demonstrate the potential of transformers for solving ill-posed inverse problems, but also provide a new perspective towards understanding the knowledge extraction mechanism within transformers.

Transformer上下文学习逆问题正则化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。