cross-attention

noun

Cross-attention is a mechanism in AI models that allows them to relate and combine information from two different sources, like text and an image. It works by letting one part of the model pay attention to relevant parts of another input while processing its own.

For example, in image generation, a text-to-image model uses cross-attention to match words in a prompt (like ‘a red cat’) with visual features in the image. This ensures the generated image aligns with the description.

For users, cross-attention improves accuracy and coherence in AI outputs, but it can also increase computational costs. A model like Stable Diffusion uses cross-attention to blend text prompts with image details, making generated images more precise but requiring more processing power.

When you type 'a futuristic city at sunset' into an AI image generator, cross-attention helps the model match 'futuristic' to skyscrapers and 'sunset' to the sky colors.

See also: Attention mechanism · prompt engineering

Découvrez nos autres services

ElpisIA, c’est tout un univers — explorez nos autres services.