Skip to main content
QUICK REVIEW

[Paper Review] Position Prediction as an Effective Pretraining Strategy

Shuangfei Zhai, Navdeep Jaitly|arXiv (Cornell University)|Jul 15, 2022
Natural Language Processing TechniquesComputer Science8 citations
TL;DR

This paper proposes MP3 (Masked Patch Position Prediction), a novel self-supervised pretraining method for Transformers that trains models to predict the position of image or audio patches from their content alone, without positional embeddings. The approach achieves performance comparable to state-of-the-art self-supervised methods and enables models without positional encodings to outperform supervised baselines on vision and speech benchmarks.

ABSTRACT

Transformers have gained increasing popularity in a wide range of applications, including Natural Language Processing (NLP), Computer Vision and Speech Recognition, because of their powerful representational capacity. However, harnessing this representational capacity effectively requires a large amount of data, strong regularization, or both, to mitigate overfitting. Recently, the power of the Transformer has been unlocked by self-supervised pretraining strategies based on masked autoencoders which rely on reconstructing masked inputs, directly, or contrastively from unmasked content. This pretraining strategy which has been used in BERT models in NLP, Wav2Vec models in Speech and, recently, in MAE models in Vision, forces the model to learn about relationships between the content in different parts of the input using autoencoding related objectives. In this paper, we propose a novel, but surprisingly simple alternative to content reconstruction~-- that of predicting locations from content, without providing positional information for it. Doing so requires the Transformer to understand the positional relationships between different parts of the input, from their content alone. This amounts to an efficient implementation where the pretext task is a classification problem among all possible positions for each input token. We experiment on both Vision and Speech benchmarks, where our approach brings improvements over strong supervised training baselines and is comparable to modern unsupervised/self-supervised pretraining methods. Our method also enables Transformers trained without position embeddings to outperform ones trained with full position information.

Motivation & Objective

  • To develop a self-supervised pretraining strategy that reduces reliance on complex reconstruction objectives like masked autoencoders.
  • To investigate whether positional understanding can be learned purely from content, without explicit positional supervision.
  • To evaluate whether removing positional embeddings during pretraining can still yield strong downstream performance.
  • To explore the effectiveness of position prediction as a pretext task in comparison to content reconstruction.
  • To demonstrate that Transformers can learn strong inductive biases for spatial or temporal structure through position prediction alone.

Proposed method

  • The model is trained to predict the position of each input token (e.g., image patch or audio frame) using a linear classifier head, treating position prediction as a multi-class classification problem.
  • During pretraining, positional information is removed from all tokens, and only a random subset of tokens (context tokens) are used as keys and values in the self-attention mechanism.
  • The attention mechanism is modified so that queries from all tokens attend to keys and values from only the context tokens, enforcing reasoning about position from partial context.
  • The training objective is cross-entropy loss between predicted and true positions, with no reconstruction of pixel or spectral values.
  • After pretraining, the position prediction head is removed and replaced with a downstream task head (e.g., classification), and absolute positional embeddings are added during fine-tuning.
  • The method is applied to both vision (ImageNet, CIFAR) and speech (Google Speech Commands) benchmarks with consistent performance gains.

Experimental results

Research questions

  • RQ1Can Transformers learn positional relationships between input tokens solely from their content, without any positional supervision?
  • RQ2How does position prediction as a pretext task compare to masked reconstruction in terms of downstream performance and efficiency?
  • RQ3Can a Transformer trained without positional embeddings outperform one trained with them, when pretraining with position prediction?
  • RQ4Does the difficulty of the position prediction task vary between vision and speech data, and how does partial positional supervision affect performance?
  • RQ5What inductive biases does MP3 learn, and how do attention patterns in the model reflect this during inference?

Key findings

  • On the ImageNet-1K benchmark, MP3 achieves 80.2% top-1 accuracy with a ViT-Base model, outperforming supervised training and matching state-of-the-art self-supervised methods.
  • On the Google Speech Commands dataset, MP3 improves test accuracy from 91.9% (supervised baseline) to 94.2%, a 2.3% absolute gain, even with only 5% of patches providing positional information.
  • The model achieves near-perfect position prediction accuracy (98.7%) on vision data when all patches are visible, indicating strong capacity to learn spatial relationships.
  • Despite no positional embeddings during pretraining, MP3 learns strong localization patterns in deeper layers (e.g., layers 6, 10, 11), suggesting implicit positional understanding emerges from content.
  • The method reduces computational cost by using sparse attention (only context tokens as keys/values), making pretraining more efficient than full self-attention.
  • Fine-tuning with MP3 pretraining yields better performance than supervised pretraining, even when the latter uses full positional embeddings.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.