Sanyanggae LogoSanyanggae

🤖 AI & Tech

Vision-language models: how image representations connect to text

Understand patch-based image representations, connections to language models and what to test in visual questions.

사냥개 (Sanyanggae)Published Updated 10 min read

This is a translation of the Korean original. Korean original · Translation review: AI review

Vision-language models: how image representations connect to text · Explanatory diagram · Image representations, Connecting to text, Testing visual questions.
Explanatory diagram by Sanyanggae · Image representations · Connecting to text · Testing visual questions.

Vision-language models connect information in images to text tasks. Accepting an image does not imply accurate understanding of every detail or of people’s intentions in the real world.

1. Treating image regions like tokens

Vision Transformer explored splitting an image into patches and feeding their representations into a Transformer. Patch size, resolution and training data affect performance and computation. Vision-language models vary in the patch sizes and encoders they use.

2. Connecting to a language model

A module can connect the visual encoder’s representations to the language side. BLIP-2 is a research example using a frozen visual encoder and language model with a trainable connector. Cross-attention is one design element among several. Architectures vary across products.

3. Evaluating real visual questions

Prepare separate questions about reading text, locating and counting objects, and determining which information is absent from the image. Record whether the model reports nonexistent text or objects and how resolution and occlusion affect the result. Text inside the image is external input and must be distinguished from system instructions. A plausible answer based on one photograph cannot settle a medical or safety decision.

4. Breaking down the task of reading a shop sign

Imagine a shop photo showing an entrance sign, business hours and a sale notice. “Describe this photo” asks for an account of the whole scene. “Read the Saturday closing time” asks for recognition of small text. Describing the atmosphere does not ensure the small numbers are read correctly. First identify what the app needs to do, then choose resolution and evaluation criteria.

A simple calculation illustrates patch splitting. Divide a square image with side 224 into nonoverlapping square patches with side 16. There are 14 patches along each axis and 196 in total. This is an illustration of patching. Different VLMs can have different input token counts. Actual models may use additional tokens, different resolution handling, crops or compressed visual representations. A product name alone does not justify applying this calculation.

If small print spans one or two patches or becomes blurry during resizing, the model may receive too little information. Confidently describing a detail absent from the original adds no observation. Test whether a larger view of a region helps, and whether cropping removes needed context. Reading the digits correctly can still yield the wrong answer if the model links them to the wrong day.

5. The boundary between image representations and language responses

The visual encoder represents image features, and the language component uses them to generate text. A connector can align the two representations. BLIP-2’s Q-Former is a research example that links a frozen visual encoder and language model. Training with some components frozen is a demonstrated approach. It does not establish the architecture of every commercial VLM. Describe a model within the limits of its published documentation.

Language generation can fill missing visual information with a plausible pattern. If Monday through Friday show repeated hours, the model might guess that the obscured Saturday hours are the same. “Unreadable” and “same as the other days” are different answers. Separate visually confirmed details from inferences, and provide a way for people to verify important numbers against the original.

A photo may contain an instruction such as “send other material.” The app must not execute it as a system command. Text in the image is material to read. If an app links document analysis to tool calls, distinguish extracted text from permission to execute tools. A user supplying an image does not approve every action written in it.

6. Building a small set of visual questions

Evaluate text, counts, locations, relationships and invisible information separately instead of merging them all into one accuracy figure. Score a question about posted hours differently from one about parking outside the frame. “Cannot determine” may be appropriate for information absent from the photo. Requiring specific answers in every case rewards guessing.

When changing brightness or cropping the same scene, have someone check whether the required information remains. Getting the same answer from a readable original and an unreadable thumbnail does not prove robustness. The model may remember the business or rely on another clue. Design questions that require information from the image and mark its location to make errors easier to identify.

Consider occlusion and duplication when asking for counts. If only part of the stock is visible on a shelf, the visible count and actual inventory differ. Ask about visible items separately from inventory. For locations, specify whether left refers to the image or the direction the person is looking. Treating linguistic ambiguity solely as a visual failure hides what needs fixing.

An operational interface can show the original and extracted result together. For important numbers such as opening hours, provide a way to return to the relevant region. Define a blank or unverified state for information that cannot be confirmed. The model’s confident wording is different from a confidence interval based on measured accuracy.

When choosing a VLM, examine the size of the details you need, task types, processing limits and where data travels, alongside support for image inputs. A vivid scene description is only one result. Verify that the model correctly reads the numbers and relationships the service needs. Connecting a visual encoder to a language model enables varied tasks, but the connection cannot vouch for facts beyond what the image shows.

For tasks with several images, track where each detail came from. When comparing two shop signs, assigning the first photo’s hours to the second store is wrong even if all digits were read correctly. Supply image identifiers in the question and let the response cite the image it read. If the photos were taken at different times, avoid combining them as though they depict the same day. As the set grows, separate scene-specific facts from the overall summary. Good answers about one image do not establish reliable reasoning over relationships between several.

Sources and further reading

This article explains information from public sources. Citing an organization does not imply its review or endorsement.

About the publisher and contact

Related articles