Transformers as Multi-task Learners: Decoupling Features in Hidden Markov Models

Yifan Hao, Chenlu Ye, Chi Han, Tong Zhang
6/2/2025
cs.LGcs.AI

No confident code implementation found for this paper.

Abstract

Transformer based models have shown remarkable capabilities in sequence learning across a wide range of tasks, often performing well on specific task by leveraging input-output examples. Despite their empirical success, a comprehensive theoretical understanding of this phenomenon remains limited. In this work, we investigate the layerwise behavior of Transformers to uncover the mechanisms underlying their multi-task generalization ability. Taking explorations on a typical sequence model, i.e, Hidden Markov Models, which are fundamental to many language tasks, we observe that: first, lower layers of Transformers focus on extracting feature representations, primarily influenced by neighboring tokens; second, on the upper layers, features become decoupled, exhibiting a high degree of time disentanglement. Building on these empirical insights, we provide theoretical analysis for the expressiveness power of Transformers. Our explicit constructions align closely with empirical observations, providing theoretical support for the Transformer's effectiveness and efficiency on sequence learning across diverse tasks.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{hao2025transformers,
  title  = {Transformers as Multi-task Learners: Decoupling Features in Hidden Markov Models},
  author = {Yifan Hao and Chenlu Ye and Chi Han and Tong Zhang},
  year   = {2025},
  eprint = {2506.01919},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2506.01919v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2506.01919.svg)](https://codeofpaper.com/paper/2506.01919)

Discussion