HackerPapers

arXiv:2102.10882cs.CV

Conditional Positional Encodings for Vision Transformers

Xiangxiang Chu, Zhi Tian, Bo Zhang, Xinlong Wang, Chunhua Shen

Early discovery. Linked by one identifiable commenter. This paper is outside the main ranking; a mention is not an endorsement.

Abstract

We propose a conditional positional encoding (CPE) scheme for vision Transformers. Unlike previous fixed or learnable positional encodings, which are pre-defined and independent of input tokens, CPE is dynamically generated and conditioned on the local neighborhood of the input tokens. As a result, CPE can easily generalize to the input sequences that are longer than what the model has ever seen during training. Besides, CPE can keep the desired translation-invariance in the image classification task, resulting in improved performance. We implement CPE with a simple Position Encoding Generator (PEG) to get seamlessly incorporated into the current Transformer framework. Built on PEG, we present Conditional Position encoding Vision Transformer (CPVT). We demonstrate that CPVT has visually similar attention maps compared to those with learned positional encodings and delivers outperforming results. Our code is available at https://github.com/Meituan-AutoML/CPVT .

arXiv comments
Accepted to ICLR2023
Journal reference
DOI
Subjects
cs.CVComputer Vision and Pattern Recognition cs.AIArtificial Intelligence cs.LGMachine Learning

On Hacker News

Linked by 1 identifiable commenter in 1 comment across 1 thread, from Jun 2023 to Jun 2023.

Comments linking this paper, per year.

Discussed in comments1 thread

  1. Extending Context to 8K 1 comment
    • It seem the site does not allow the in-page anchor: https://kaiokendev.github.io/til#extending-context-to-8k Im not sure what is the rule in linking reddit but here is the related thread [0] Llama.cpp has also started implementing it [1] and any help will be appreciated Im sure.…

      kaiokendevView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.