Skip to content
Back to skills

Cross Attention Conditioning

ASecurity

Validate and run deterministic LDM-style cross-attention conditioning between latent features and modality tokens.

  • 247 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 9, 2026
developmentpythonangular

Security analysis

A100/100

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill cross_attention_conditioning --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cross Attention Conditioning?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Cross Attention Conditioning
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-cross-attention-conditioning/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-cross-attention-conditioning)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
---
name: cross_attention_conditioning
description: Validate and run deterministic LDM-style cross-attention conditioning between latent features and modality tokens.
---

# Cross-Attention Conditioning

Use this skill when an LDM experiment must prove that conditioning tokens influence latent denoising features through cross-attention. It is suitable for reduced recovery, shape checks, and prompt/conditioning module tests. Do not use it to choose sampler settings or evaluate image quality.

## Inputs

- Latent feature matrix used as query input.
- Conditioning token matrix used as key/value input.
- Projection matrices for query, key, and value.
- Optional mask for unavailable conditioning tokens.

## Outputs

- Conditioned feature matrix.
- Attention probabilities with rows summing to one.
- Shape validation errors for incompatible inputs.
- Diagnostics showing conditioning sensitivity.

## Workflow

1. Validate that feature and token inputs are rectangular numeric matrices.
2. Project latent features to queries and conditioning tokens to keys and values.
3. Compute scaled dot-product attention with stable softmax.
4. Return conditioned values and probability diagnostics.
5. Keep sampling choices and final image decisions outside this module's contract.

## Validation

Run `python scripts/cross_attention.py --output /tmp/attention.json`. The included tests check probability normalization, output shape, conditioning sensitivity, and shape errors.

## Limitations

This is a deterministic reference implementation for mechanism validation. Production LDMs use tensor libraries, batched multi-head attention, residual blocks, and learned encoders.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…