Dynamic image tiling

Also known as: AnyRes · any-resolution · dynamic high-resolution

On this page 7

Dynamic image tiling is a preprocessing strategy in which a high-resolution image is resized to a grid that matches its aspect ratio and then cut into fixed-size tiles, each of which is encoded separately by the same vision encoder, usually alongside a low-resolution global thumbnail. In multimodal AI, it is the standard way to let a vision-language model read small text, dense charts and fine detail without retraining an encoder that was built for a single small input size.

The technique is also known as AnyRes, any-resolution processing or dynamic high-resolution input. It sits between the image and the multimodal projector, so it changes how many visual tokens the language model receives rather than how the model reasons about them.

Why fixed-resolution encoders need tiling

Tiling exists because most vision encoders were pretrained at one small square resolution. Encoders in the CLIP and SigLIP families typically expect inputs of 224, 336, 384 or 448 pixels per side, and their position embeddings are learned for exactly that grid of patches. A scanned invoice of 2480 by 3508 pixels squeezed into 336 by 336 pixels loses roughly 99 percent of its pixels, and characters shrink below the size a patch can resolve.

Simply feeding a larger image into the encoder is not a reliable fix. Interpolating position embeddings to an unseen grid size degrades feature quality, and the cost of self-attention grows quadratically with the number of patches. Tiling sidesteps both problems: every tile is presented at the native encoder resolution, so the encoder always sees the input distribution it was trained on.

The following table summarizes the typical native input sizes that tiling schemes are built around.

Encoder setupTile size in pixelsPatch sizePatches per tile
ViT-L/14 at 336336 x 33614576
SigLIP at 384384 x 38414729
InternViT at 448448 x 448141024 before merging
ViT-B/16 at 224224 x 22416196
Common encoder input sizes used as tile sizes

How dynamic image tiling works step by step

A dynamic tiling pipeline makes three decisions per image: which grid to use, how to resize the image into that grid and whether to add a global view. The word dynamic refers to the first decision, because the grid changes with each image instead of being fixed in advance.

  1. Enumerate candidate grids, such as 1×1, 1×2, 2×1, 2×2, 1×3 and 3×2, up to a maximum tile budget.
  2. Select the best-fitting grid by comparing each candidate aspect ratio with the image aspect ratio, often preferring the option that wastes the fewest pixels or upscales the least.
  3. Resize and pad the image to the selected grid resolution, for example 672 x 1008 pixels for a 2×3 grid of 336-pixel tiles.
  4. Split into tiles and encode each tile independently with the shared vision encoder.
  5. Add a thumbnail of the whole image at native resolution to preserve global layout.
  6. Concatenate the visual tokens in a fixed order, sometimes with separator or newline tokens that mark row boundaries.

The thumbnail is essential because tiles have no view of the whole scene. Without it, a model can read every word on a poster yet fail to describe its overall composition or locate an object that straddles a tile boundary. Separator tokens play a related role by telling the language model where each row of tiles ends, which helps it reconstruct two-dimensional layout from a one-dimensional token sequence.

Grid selection and the visual token budget

The maximum tile count is the main cost lever. Each tile adds hundreds of visual tokens, so a configuration that allows twelve tiles plus a thumbnail can produce several thousand tokens for one image. That number competes directly with text in the context window and raises prefill latency and memory use.

Many implementations reduce tokens per tile with pixel shuffle or token merging, which folds neighboring patch features into fewer, wider tokens. Merging a 32 x 32 patch grid into a 16 x 16 grid, for instance, cuts a tile from 1024 to 256 tokens at a modest loss in fine detail. The table below shows how the budget scales.

Grid plus thumbnailTiles encodedTokens at 576 per tileTokens at 256 per tile
1×1 grid21,152512
2×2 grid52,8801,280
3×3 grid105,7602,560
3×4 grid137,4883,328
Approximate visual tokens for different grid sizes

Because the budget grows linearly with tile count, production systems often expose it as a setting. A low tile cap suits natural photographs and fast chat, while a high tile cap suits documents, screenshots and charts where every glyph matters.

Dynamic tiling compared with other high-resolution strategies

Dynamic tiling is one of several answers to the resolution problem in vision-language models. The main alternative is native dynamic resolution, in which the encoder accepts a variable number of patches directly and uses two-dimensional rotary position encoding, so no image is cut into separate tiles. Other designs add a dedicated high-resolution encoder branch or crop regions on demand.

StrategyCore ideaMain strengthMain weakness
Single fixed resizeDownscale to encoder sizeLowest token costLoses small text and detail
Fixed grid tilingSame grid for every imageSimple batchingDistorts unusual aspect ratios
Dynamic image tilingGrid chosen per aspect ratioReuses pretrained encoderTile seams and token growth
Native dynamic resolutionVariable patch count in one passNo seams, global attentionEncoder must be trained for it
Region cropping on demandZoom into selected areasSpends tokens only where neededNeeds a reliable selection step
High-resolution input strategies in vision-language models

In practice the choice depends on whether the encoder can be retrained. Teams that build on a frozen or lightly tuned CLIP-style encoder usually choose tiling, whereas teams that pretrain their own vision tower increasingly adopt native resolution with visual token compression to control cost.

Limitations and common failure modes

Tiling improves fine-grained perception but introduces characteristic errors that practitioners should test for explicitly. The most frequent problems appear at tile edges and in very large images.

SymptomLikely causeMitigation
Words cut in half are misreadText split across tile seamsOverlapping tiles or thumbnail cross-check
Wrong counts of repeated objectsObjects duplicated near edgesAdd row separators and global view
Context window overflowsToo many tiles per imageLower tile cap or merge tokens
Slow first-token latencyLong visual prefillCache image tokens or downscale
Thin banners look stretchedPoor grid match for extreme ratiosAllow 1×4 or 4×1 grids
Typical symptoms, causes and mitigations

A further limitation is that tiles are encoded without attention between them, so relationships across tiles are only modeled later inside the language model. This makes tiling weaker than native-resolution designs on tasks such as spatial reasoning across a full page or GUI grounding on very wide screenshots.

A plain-language summary

An AI model that looks at pictures often has small eyes. It can only take in a small square image at a time. A large page of text, shrunk to that size, turns into a blur.

Dynamic image tiling solves this like reading a big map with a magnifying glass. The model cuts the picture into small squares that fit its eyes. It looks at each square closely. It also takes one quick look at the whole picture, shrunk down, so it knows how the pieces fit together.

The trade-off is effort. More squares mean more detail but slower answers, so systems choose how many squares to use for each picture.

An example from practice

An insurance claims team uses a vision-language model to extract figures from scanned repair invoices. Each scan arrives at about 2480 by 3508 pixels. With a single 336-pixel resize, the model misreads line-item amounts in a large share of documents, because digits shrink to two or three pixels in height.

The engineers enable dynamic image tiling with a cap of twelve tiles plus a thumbnail. For the tall A4 page, the pipeline selects a 3×4 grid, encodes twelve detailed tiles and one global view, and merges tokens to 256 per tile, for roughly 3,300 visual tokens per page.

Extraction accuracy on amounts and dates rises substantially in their internal tests, and the remaining errors cluster on numbers that cross tile seams. The team adds a verification prompt that checks totals against the thumbnail-based layout, accepting about twice the latency per page in exchange for far fewer manual corrections.