Simple Algorithm
Deep Learning · Emergence · 26 min

Patches, Resolution & Token Efficiency

Flexible patch sizes, native-resolution packing and merging tokens.

A ViT's cost is settled before its first block runs: the image size and the patch size fix the number of tokens, and attention's cost grows with its square. For years both were frozen at training time, and changing either at test time broke the model. A careful look at preprocessing, a pseudoinverse, sequence packing borrowed from language models and a fast matching algorithm have turned the token count into a dial you can set per deployment, per image, even per layer.

What you’ll learn

  • Compute token counts and block costs as functions of resolution and patch size, and derive the train–test discrepancy in apparent object size that FixRes corrects.
  • Derive PI-resize, the pseudoinverse rule that keeps patch tokens unchanged when the patch size changes, and explain how FlexiViT trains one model for many patch sizes.
  • Explain NaViT's sequence packing (block-diagonal attention, masked pooling, factorized position embeddings, per-image token dropping) and estimate its attention overhead.
  • Prove that proportional attention makes a merged token act exactly like its copies, and compare token merging (ToMe) with learned token pruning (DynamicViT).

Resolution, patch size and the token budget

An H×WH\times W image in P×PP\times P patches gives N=HW/P2N=HW/P^2 tokens (plus a class token), and a block of width DD costs 12ND2+2N2D12ND^2+2N^2D multiply–adds (Vision Transformers & Vision–Language Models derives it). Two dials set NN. The patch size is fixed by the trained patch embedding: at 224 pixels, ViT-B/32, B/16 and B/8 see 49, 196 and 784 patches with nearly the same number of parameters. The resolution can change freely, since attention accepts any number of tokens, as long as the position embeddings are resampled to the new grid.

Resolution buys accuracy at a steep price. DeiT-B, trained at 224 pixels and fine-tuned at other resolutions, reached the following ImageNet top-1 accuracy and throughput on one GPU:

Fine-tuning resolutionPatch tokensTop-1Images per second
160×160160\times16010079.9%609
224×224224\times22419681.8%291
320×320320\times32040082.7%134
384×384384\times38457683.1%86
From Touvron et al. (2021), Table 10. Moving from 224 to 384 pixels buys 1.3 points for 3.4 times less throughput. The position embeddings are interpolated to the new grid before fine-tuning; DeiT uses bicubic interpolation because bilinear interpolation shrinks the norm of the interpolated vectors relative to their neighbors, which hurt accuracy before fine-tuning.
Predict before you look

ViT-B/16 is fine-tuned at 384×384384\times384 instead of 224×224224\times224. By what factor does the cost of the attention scores and weighted sums, 2N2D2N^2D, grow? Count patch tokens only.

Show the answer

8.6 ×

(384/16)2=576(384/16)^2=576 patches against 142=19614^2=196: a factor 2.942.94 in NN and 2.942≈8.62.94^2\approx8.6 in N2N^2. The projections and MLP grow only by 2.942.94, so at D=768D=768 the whole block costs about 3.23.2 times as much, close to the 3.43.4-fold drop in DeiT-B's measured throughput.

Why does a model trained at one resolution do better when tested at a higher one, even before any fine-tuning? Touvron, Vedaldi, Douze & Jégou (2019) traced it to data augmentation. Training uses random resized crops, which zoom in on a random part of the image; testing resizes the whole image and takes a center crop. The same object therefore appears at different sizes:

DerivationApparent object size in training and at test time (FixRes)
  1. rtrain=KtrainσHW  rr_{\text{train}}=\frac{K_{\text{train}}}{\sigma\sqrt{HW}}\;r

    Take a square H×WH\times W image with an object rr pixels across. A random resized crop keeps a region whose area is a fraction σ2∼U[σ−2,σ+2]\sigma^2\sim U[\sigma_-^2,\sigma_+^2] of the image (aspect ratio 1 for simplicity) and resizes it to KtrainK_{\text{train}} pixels:

  2. rtest=KtestimageHW  r⟹rtestrtrain=σ KtestimageKtrainr_{\text{test}}=\frac{K^{\text{image}}_{\text{test}}}{\sqrt{HW}}\;r\qquad\Longrightarrow\qquad\frac{r_{\text{test}}}{r_{\text{train}}}=\sigma\,\frac{K^{\text{image}}_{\text{test}}}{K_{\text{train}}}

    At test time the image is resized so its side is KtestimageK^{\text{image}}_{\text{test}} and then center-cropped, which does not change the scale:

  3. E[rtestrtrain]=23 σ+3−σ−3σ+2−σ−2⏟≈ 0.708⋅256224≈0.8\E\Big[\frac{r_{\text{test}}}{r_{\text{train}}}\Big]=\underbrace{\frac23\,\frac{\sigma_+^3-\sigma_-^3}{\sigma_+^2-\sigma_-^2}}_{\approx\,0.708}\cdot\frac{256}{224}\approx0.8

    With σ2\sigma^2 uniform, σ\sigma has density 2σ/(σ+2−σ−2)2\sigma/(\sigma_+^2-\sigma_-^2). For the usual range σ2∈[0.08,1]\sigma^2\in[0.08,1] and the usual resize to 256 before a 224 crop:

  4. So objects look about 20% smaller at test than in training. Raising the test resolution by about 1/0.8=1.251/0.8=1.25 compensates, at the price of shifted activation statistics before the final pooling, which a brief fine-tuning at the test resolution repairs.

The prediction holds for a ResNet-50 trained at 224 pixels: tested without any retraining, its top-1 accuracy was 77.0% at 224, 78.4% at 288 and 77.7% at 384. Training at 128 pixels and fine-tuning briefly at 224 reached 77.1%, slightly above training at 224 throughout, in less total training time. Training at low resolution and fine-tuning at high resolution is common for ViTs too: by default, both ViT and DeiT pretrain at 224 pixels and fine-tune at 384.

One model for every patch size

The patch size is the more powerful dial: at fixed resolution, halving it quadruples the tokens. But a ViT trained with one patch size fails at others. Evaluating a pretrained ViT at a new patch size by bilinearly resizing its patch-embedding weights and position embeddings degrades accuracy quickly as the patch size departs from the trained one (Beyer et al., 2023).

One culprit is the token's magnitude. Resize a non-negative patch and the weights both from p×pp\times p to 2p×2p2p\times2p, and their inner product grows about fourfold, since four times as many similar products are summed: the tokens entering the first block come out far larger than any the network was trained on. What should be preserved is the token itself.

DerivationPI-resize: the pseudoinverse of a resize
  1. ⟨Bx,ω^⟩=⟨x,ω⟩  for all x⟺B⊤ω^=ω\langle B\mathbf x,\hat{\boldsymbol\omega}\rangle=\langle\mathbf x,\boldsymbol\omega\rangle\ \ \text{for all }\mathbf x\quad\Longleftrightarrow\quad B^\top\hat{\boldsymbol\omega}=\boldsymbol\omega

    Bilinear resizing from p×pp\times p to q×qq\times q is linear: resize⁡(x)=Bx\operatorname{resize}(\mathbf x)=B\mathbf x for a matrix B∈Rq2×p2B\in\R^{q^2\times p^2} acting on the flattened patch (each channel separately). We want new weights ω^\hat{\boldsymbol\omega} whose token on the resized patch equals the old token:

  2. ω^=B(B⊤B)−1ω=(B⊤)+ω⟹⟨Bx,ω^⟩=x⊤B⊤B(B⊤B)−1ω=⟨x,ω⟩\hat{\boldsymbol\omega}=B(B^\top B)^{-1}\boldsymbol\omega=(B^\top)^+\boldsymbol\omega\quad\Longrightarrow\quad\langle B\mathbf x,\hat{\boldsymbol\omega}\rangle=\mathbf x^\top B^\top B(B^\top B)^{-1}\boldsymbol\omega=\langle\mathbf x,\boldsymbol\omega\rangle

    When upsampling (q≥pq\ge p), the samples along each axis lie at most one source pixel apart and span the whole patch, so no nonzero patch resizes to zero: BB has full column rank, B⊤BB^\top B is invertible, and the minimum-norm solution satisfies the equation exactly, for every patch:

  3. Ex[(x⊤ω−x⊤B⊤ω^)2]=∥ω−B⊤ω^∥2  ⟹  ω^=(B⊤)+ω\E_{\mathbf x}\big[(\mathbf x^\top\boldsymbol\omega-\mathbf x^\top B^\top\hat{\boldsymbol\omega})^2\big]=\norm{\boldsymbol\omega-B^\top\hat{\boldsymbol\omega}}^2\ \ \Longrightarrow\ \ \hat{\boldsymbol\omega}=(B^\top)^+\boldsymbol\omega

    When downsampling, information is lost and no ω^\hat{\boldsymbol\omega} works for every patch. Minimizing the expected squared error for patches x∼N(0,I)\mathbf x\sim\mathcal N(\mathbf 0,I) gives a least-squares problem with the same pseudoinverse solution:

python
import torch
import torch.nn.functional as F

def resize_matrix(p, q):
    """B with vec(resize(x)) = B @ vec(x), for bilinear resizing of p x p patches to q x q."""
    basis = torch.eye(p * p).reshape(p * p, 1, p, p)
    return F.interpolate(basis, size=(q, q), mode='bilinear').reshape(p * p, q * q).T

def pi_resize(w, q):
    """Patch-embedding weights (D, C, p, p) -> (D, C, q, q), keeping <resize(x), w_new> = <x, w>."""
    D, C, p, _ = w.shape
    B = resize_matrix(p, q)                                  # (q*q, p*p)
    w_new = torch.linalg.pinv(B.T) @ w.reshape(D * C, p * p).T
    return w_new.T.reshape(D, C, q, q)

For random 16×1616\times16 weights and patches, tokens computed at 2424, 3232 or 4848 pixels with pi_resize match the original ones to float precision; downsampling loses whatever the smaller patch cannot represent. PI-resized weights can be negative where the originals were not.

PI-resize matters most for a model that was never trained to be flexible: with a pretrained ViT-B/8, resizing the input and its patch embedding by the same factor kept accuracy nearly constant when upsampling only with PI-resize, among the resizing methods Beyer et al. compared.

FlexiViT goes further and trains for flexibility. At every step it draws a patch size uniformly from {48,40,30,24,20,16,15,12,10,8}\{48,40,30,24,20,16,15,12,10,8\}, all of which tile its 240×240240\times240 images exactly, so sequences range from 52=255^2=25 to 302=90030^2=900 tokens. The model stores one 32×3232\times32 patch-embedding kernel and a 7×77\times7 grid of position embeddings, both resized on the fly to the sampled size. Inside this training, where the network adapts to the resizing, plain bilinear resizing also worked well, and PI-resize helped mainly for large patches. The resulting FlexiViT-B matched ViT-B/16 and ViT-B/30 at their own patch sizes and beat both at every other, so a single set of weights spans a whole speed–accuracy curve, chosen at deployment by picking the patch size.

Native resolution: patch and pack

Vision pipelines resize every image to one square, a habit inherited from CNNs that need fixed-size batches. A transformer only needs sequences. NaViT (Dehghani et al., 2023) keeps each image at its own resolution and aspect ratio and packs the patches of several images into one sequence of fixed length, as language models pack several short documents. Four changes make it work:

  • Masked self-attention: a block-diagonal mask lets tokens attend only within their own image.
  • Masked pooling: one pooled vector per image, averaged over that image's tokens only.
  • Factorized position embeddings: separate embeddings ϕx\phi_x and ϕy\phi_y for the column and the row, summed, indexed either by the patch's absolute coordinates or by fractional ones (its position divided by the side length), so any aspect ratio has embeddings.
  • Per-image token dropping and resolution sampling: each image can lose a different random fraction of its patches during training, on a schedule if desired, and image sizes can be resampled while keeping their aspect ratios.

Greedy packing typically left less than 2% of each sequence as padding. Because smaller images and dropped tokens fit more images into each sequence, NaViT-L/16 saw five times as many images during pretraining as a ViT with the same compute, and matched the best ViT's performance with four times less compute. One NaViT also serves many resolutions at inference, so the cost–accuracy trade-off can be chosen per deployment.

python
import torch
import torch.nn.functional as F

def packed_attention(q, k, v, image_id):
    """q, k, v: (heads, T, d) for one packed sequence; image_id: (T,) source image of each token."""
    same_image = image_id[:, None] == image_id[None, :]       # (T, T) block-diagonal mask
    return F.scaled_dot_product_attention(q, k, v, attn_mask=same_image)

def masked_mean_pool(h, image_id, n_images):
    """h: (T, D) -> (n_images, D): one representation per packed image."""
    sums = torch.zeros(n_images, h.shape[1]).index_add_(0, image_id, h)
    counts = torch.bincount(image_id, minlength=n_images).clamp(min=1)
    return sums / counts[:, None]

On a sequence packing three images of 5, 3 and 7 tokens, both functions reproduce the results of processing each image on its own, to float precision. Padding can be treated as one more "image", whose tokens attend only to each other and whose pooled vector is ignored.

DerivationWhat packing costs in attention
  1. 2(kn)2D−2kn2D=2k(k−1) n2D  extra multiply–adds per block2(kn)^2D-2kn^2D=2k(k-1)\,n^2D\ \ \text{extra multiply–adds per block}

    Pack kk images of nn tokens each. Processed separately, their blocks cost k(12nD2+2n2D)k(12nD^2+2n^2D). An attention kernel that computes the full masked score matrix of the packed sequence instead pays for all (kn)2(kn)^2 pairs:

  2. 2k(k−1) n2Dk (12nD2+2n2D)=n(k−1)6D+n\frac{2k(k-1)\,n^2D}{k\,(12nD^2+2n^2D)}=\frac{n(k-1)}{6D+n}

    Relative to the work that is actually needed, the overhead shrinks as the model widens and grows with the number of images packed:

  3. n=256, D=1024:256(k−1)6400=0.04, 0.12, 0.28(k=2,4,8)n=256,\ D=1024:\qquad\frac{256(k-1)}{6400}=0.04,\ 0.12,\ 0.28\quad(k=2,4,8)

    With n=256n=256 tokens per image and D=1,024D=1{,}024, packing 2, 4 or 8 images adds about 4%, 12% or 28%; at D=4,096D=4{,}096 and 8 images, about 7%. NaViT reports the same trend for 256-token images. Attention kernels that skip fully masked blocks, such as FlexAttention with a document mask (Dong et al., 2024), or that process each image's segment separately, avoid most of the waste.

Fewer tokens as you go: merging and pruning

Within an image, many patches are redundant: sky, wall, fur. Two families shrink the sequence inside the network, so that later blocks process fewer tokens.

Token merging (ToMe; Bolya et al., 2023) removes exactly rr tokens in every block, between attention and MLP, by merging similar ones with bipartite soft matching:

  1. split the tokens alternately into two sets A\mathcal A and B\mathcal B;
  2. from each token in A\mathcal A, draw one edge to its most similar token in B\mathcal B, measured by the cosine similarity of their attention keys (averaged over heads);
  3. keep the rr most similar edges;
  4. merge each kept pair by a size-weighted average, recording in ss how many patches each token now stands for;
  5. concatenate the two sets again.

Each step is a few parallel tensor operations, nearly as fast as dropping tokens at random. Keys are used because they already summarize what a token offers to attention, which made merging more accurate than comparing the tokens themselves.

DerivationProof
  1. o=∑jsj eq⊤kj/d vj∑jsj eq⊤kj/d\mathbf o=\frac{\sum_js_j\,e^{\mathbf q^\top\mathbf k_j/\sqrt d}\,\mathbf v_j}{\sum_js_j\,e^{\mathbf q^\top\mathbf k_j/\sqrt d}}

    With the copies present, token jj's sjs_j identical terms appear sjs_j times in the numerator and in the denominator of the softmax:

  2. sj eq⊤kj/d=eq⊤kj/d+log⁡sjs_j\,e^{\mathbf q^\top\mathbf k_j/\sqrt d}=e^{\mathbf q^\top\mathbf k_j/\sqrt d+\log s_j}

    Since sjea=ea+log⁡sjs_je^{a}=e^{a+\log s_j}, this is ordinary softmax attention over the merged tokens with logits q⊤kj/d+log⁡sj\mathbf q^\top\mathbf k_j/\sqrt d+\log s_j. □\square When the merged tokens differ, the average key stands in for keys that were only similar, and the equality becomes an approximation whose error grows with their dissimilarity, which is why ToMe merges only the most similar pairs. In practice proportional attention helped off-the-shelf supervised models but slightly hurt off-the-shelf MAE models, and ToMe uses it everywhere except there.

python
import torch
import torch.nn.functional as F

def bipartite_merge(x, k, size, r):
    """x: (N, D) tokens, k: (N, d) their keys, size: (N,) patches per token. Removes r tokens."""
    a, b = torch.arange(0, len(x), 2), torch.arange(1, len(x), 2)   # alternate into A and B
    sim = F.normalize(k[a], dim=-1) @ F.normalize(k[b], dim=-1).T  # cosine similarity of keys
    best_sim, best_b = sim.max(dim=-1)                             # each A token's best match
    order = best_sim.argsort(descending=True)
    src, keep = order[:r], order[r:]                               # the r closest A tokens merge
    xb, sb = x[b] * size[b, None], size[b].clone()                 # size-weighted sums in B
    xb.index_add_(0, best_b[src], x[a][src] * size[a][src, None])
    sb.index_add_(0, best_b[src], size[a][src])
    return torch.cat([x[a][keep], xb / sb[:, None]]), torch.cat([size[a][keep], sb])

def proportional_attention(q, k, v, size):
    return F.softmax(q @ k.T / k.shape[-1] ** 0.5 + size.log(), dim=-1) @ v

One merging step on 197 tokens with r=8r=8 leaves 189 tokens whose sizes still sum to 197, and proportional_attention matches attention over explicitly duplicated keys and values to float precision. The released implementation also keeps the class token from being merged.

Check your understanding

ToMe with r=8r=8 runs on ViT-B/16 at 224×224224\times224: 197 tokens enter the first of its 12 blocks. How many tokens leave the last block?

  1. 189
  2. 101
  3. 5
  4. 96
Show the answer

B. 101

Every block removes exactly 8 tokens: 197−12×8=101197-12\times8=101. The later blocks, where fewer tokens remain, are the cheaper ones; ToMe's constant schedule made models up to about twice as fast.

Off the shelf, without any training, ToMe doubled the throughput of large ViTs (ViT-L at 512 pixels and ViT-H at 518) on ImageNet and raised ViT-L's on video 2.2 times, with only a 0.2–0.3% drop in accuracy in each case. Smaller models suffered more, about 4–5% for ViT-B, -S and -Ti at twice the speed, which the authors attribute to large models being deeper, so each merge changes the features less; training with ToMe reduced the drop.

Token pruning instead learns which tokens to discard. DynamicViT (Rao et al., 2021) inserts small prediction modules that score every token from its features and keep a fraction ρ\rho at each of three stages, so ρ\rho, ρ2\rho^2 and ρ3\rho^3 of the tokens survive. Hard decisions are made differentiable with Gumbel-softmax sampling, and during training dropped tokens are not removed but masked out of attention, so that the batch keeps its shape. With ρ=0.7\rho=0.7, pruning 66% of the tokens cut FLOPs by 31–37% and raised throughput by more than 40%, within 0.5% of the original accuracy.

The two differ in what they keep. Pruned tokens are gone, and with them whatever they carried; merged tokens survive as averages. Both keep a fixed number of tokens per image, so batches stay rectangular. ToMe needs no training and treats all content alike, DynamicViT learns which tokens matter, and dense tasks that expect one output per patch must undo either kind of reduction.

Key takeaways

  • N=HW/P2N=HW/P^2 tokens cost 12ND2+2N2D12ND^2+2N^2D per block: fine-tuning ViT-B/16 at 384 instead of 224 pixels means 576 instead of 196 patch tokens, 8.6 times the attention cost and about 3.2 times the block cost; DeiT-B gained 1.3 points for 3.4 times less throughput.
  • Random resized crops make objects look larger in training than at test time, by a factor of about 1/0.81/0.8 on average (FixRes); testing at a higher resolution, or training low and fine-tuning high, removes the discrepancy.
  • PI-resize, ω^=(B⊤)+ω\hat{\boldsymbol\omega}=(B^\top)^+\boldsymbol\omega, keeps patch tokens exactly unchanged when the patch size grows and is the least-squares choice when it shrinks; FlexiViT trains on random patch sizes so one set of weights serves sequences from 25 to 900 tokens.
  • NaViT packs images at native resolution and aspect ratio into fixed-length sequences with block-diagonal attention, masked pooling, factorized position embeddings and per-image token dropping, and matched the best ViT with four times less compute; the attention overhead of packing, n(k−1)/(6D+n)n(k-1)/(6D+n), shrinks with width.
  • ToMe merges rr tokens per block by bipartite soft matching on keys, with proportional attention exact for identical tokens, doubling large ViTs' throughput for a 0.2–0.3% accuracy drop without training; DynamicViT learns to prune 66% of the tokens for 31–37% fewer FLOPs within 0.5% accuracy.

Check yourself

In the interactive lesson these are scored with your confidence, and what you miss comes back for review.

Question 1

Under standard ImageNet preprocessing, why does a classifier trained at 224 pixels often do better when tested at a somewhat higher resolution?

  1. Higher resolution adds detail the network never saw, which always helps
  2. The test center crop zooms in on the object more than training crops do
  3. Random resized crops enlarge objects during training, so at the same resolution test objects look smaller; a higher test resolution restores their apparent size
  4. The position embeddings are more precise at higher resolution
Show the answer

C. Random resized crops enlarge objects during training, so at the same resolution test objects look smaller; a higher test resolution restores their apparent size

A random resized crop keeps a fraction σ2\sigma^2 of the image and blows it up to the training size, magnifying objects by 1/σ1/\sigma. The test pipeline does not, so the expected ratio of apparent sizes is about 0.80.8. Testing at about 1.25 times the resolution compensates; going much further overshoots, and ResNet-50's accuracy fell again beyond 288 pixels.

Question 2

Why does PI-resize reproduce every patch token exactly when it enlarges the patch size from pp to q>pq>p?

  1. Because ω^=B(B⊤B)−1ω\hat{\boldsymbol\omega}=B(B^\top B)^{-1}\boldsymbol\omega satisfies B⊤ω^=ωB^\top\hat{\boldsymbol\omega}=\boldsymbol\omega, so ⟨Bx,ω^⟩=⟨x,ω⟩\langle B\mathbf x,\hat{\boldsymbol\omega}\rangle=\langle\mathbf x,\boldsymbol\omega\rangle for every patch x\mathbf x
  2. Because bilinear interpolation preserves inner products
  3. Because the network is retrained at the new patch size
  4. Because it divides the weights by (q/p)2(q/p)^2, undoing the growth of the token's magnitude
Show the answer

A. Because ω^=B(B⊤B)−1ω\hat{\boldsymbol\omega}=B(B^\top B)^{-1}\boldsymbol\omega satisfies B⊤ω^=ωB^\top\hat{\boldsymbol\omega}=\boldsymbol\omega, so ⟨Bx,ω^⟩=⟨x,ω⟩\langle B\mathbf x,\hat{\boldsymbol\omega}\rangle=\langle\mathbf x,\boldsymbol\omega\rangle for every patch x\mathbf x

Upsampling is a linear map BB with full column rank, so the pseudoinverse solves B⊤ω^=ωB^\top\hat{\boldsymbol\omega}=\boldsymbol\omega exactly, and the identity holds for all inputs. Downsampling loses information, and the same formula is then only a least-squares fit.

Question 3

NaViT packs patches from several images into one sequence. What keeps a token of one image from attending to tokens of another?

  1. Different position embeddings for each image
  2. A separate class token per image
  3. Token dropping, which removes the other images' tokens
  4. A block-diagonal attention mask that allows attention only between tokens of the same image
Show the answer

D. A block-diagonal attention mask that allows attention only between tokens of the same image

The mask zeroes the attention weights between images, so each image is processed exactly as if it were alone; masked pooling then averages each image's tokens separately to give one representation per image.

Question 4

Token merging adds log⁡sj\log s_j to the attention logit of every key jj, where sjs_j counts the patches merged into token jj. Why?

  1. To make merged tokens less important, since they are averages
  2. So that a merged token receives the attention its sjs_j constituent tokens would have received together, exactly so when their keys and values were identical
  3. To keep the attention logits from growing as tokens merge
  4. To mark merged tokens so that later blocks do not merge them again
Show the answer

B. So that a merged token receives the attention its sjs_j constituent tokens would have received together, exactly so when their keys and values were identical

eq⊤kj/d+log⁡sj=sj eq⊤kj/de^{\mathbf q^\top\mathbf k_j/\sqrt d+\log s_j}=s_j\,e^{\mathbf q^\top\mathbf k_j/\sqrt d}: one token weighted like sjs_j copies, in both the numerator and the softmax's denominator.

Further reading

  • H. Touvron, A. Vedaldi, M. Douze & H. Jégou, "Fixing the train-test resolution discrepancy," NeurIPS (2019).
  • L. Beyer et al., "FlexiViT: One model for all patch sizes," CVPR (2023).
  • M. Dehghani et al., "Patch n' Pack: NaViT, a vision transformer for any aspect ratio and resolution," NeurIPS (2023).
  • D. Bolya, C.-Y. Fu, X. Dai, P. Zhang, C. Feichtenhofer & J. Hoffman, "Token merging: Your ViT but faster," ICLR (2023).
  • Y. Rao, W. Zhao, B. Liu, J. Lu, J. Zhou & C.-J. Hsieh, "DynamicViT: Efficient vision transformers with dynamic token sparsification," NeurIPS (2021).