Gram-Anchored Prompt Learning for Vision-Language Models via Second-Order Statistics
Organizations: All authors are with Southwestern University of Finance and Economics, Chengdu, Sichuan, China.
Abstract
Parameter-efficient prompt learning has become the de facto standard for adapting Vision-Language Models (VLMs) to downstream tasks. Existing approaches predominantly focus on aligning text prompts with first-order visual features (i.e., spatial feature maps). While effective for fine-grained semantic discrimination, we argue that relying solely on first-order information is insufficient for robust adaptation, as these spatially entangled features are highly susceptible to domain shifts and local noise. In this work, we propose Gram-Anchored Prompt Learning (GAPL) for Vision-Language Models via Second-Order Statistics, a framework that synergizes local semantic alignment with global structural consistency. Methodologically, we introduce an additional second-order statistical stream via Gram matrices that augments the standard first-order spatial interaction. By anchoring prompts to these second-order priors, our approach enables language representations to dynamically adapt to statistical distribution shifts across diverse domains. Extensive experiments indicate the effectiveness of the second-order features, and show compelling performances of GAPL on various benchmarks.
Figures & tables
| Method | Source | Target (OOD Variants) | Average | |||
|---|---|---|---|---|---|---|
| ImageNet | -V2 | -Sketch | -A | -R | ||
| CoOp [ 37 ] | 71.51 | 64.20 | 47.99 | 49.71 | 75.21 | 59.28 |
| CoCoOp [ 36 ] | 71.02 | 64.07 | 48.75 | 50.63 | 76.18 | 59.91 |
| KgCoOp [ 30 ] | 70.66 | 64.10 | 48.97 | 50.69 | 76.70 | 60.12 |
| MaPLe [ 13 ] | 70.72 | 64.07 | 49.15 | 50.90 | 76.98 | 60.27 |
| TCP [ 31 ] | 71.20 | 64.60 | 49.50 | 51.20 | 76.73 | 60.51 |
| Method | Average Performance | ImageNet | Caltech101 | OxfordPets | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Base | Novel | HM | Base | Novel | HM | Base | Novel | HM | Base | Novel | HM | |
| CoOp [ 37 ] | 82.69 | 63.22 | 71.66 | 76.47 | 67.88 | 71.92 | 98.00 | 89.81 | 93.73 | 93.67 | 95.29 | 94.47 |
| CoCoOp [ 36 ] | 80.47 | 71.69 | 75.83 | 75.98 | 70.43 | 73.10 | 97.96 | 93.81 | 95.84 | 95.20 | 97.69 | 96.43 |
| KgCoOp [ 30 ] | 80.73 | 73.60 | 77.00 | 75.83 | 69.96 | 72.78 | 97.72 | 94.39 | 96.03 | 94.65 | 97.76 | 96.18 |
| MaPLe [ 13 ] | 82.28 | 75.14 | 78.55 | 76.66 | 70.54 | 73.47 | 97.74 | 94.36 | 96.02 | 95.43 | 97.76 | 96.58 |
| TCP [ 31 ] | 84.13 | 75.36 | 79.50 | 77.27 | 69.87 | 73.38 | 98.23 | 94.67 | 96.42 | 94.67 | 97.20 | 95.92 |
| Statistic Design | Source | Cross-domain |
|---|---|---|
| ImageNet | Average | |
| Diagonal only | 72.90 | 61.12 |
| Diagonal + Variance | 72.90 | 61.10 |
| Full Gram Matrix | OOM | |
| -V2 | -Sketch | -A | -R | Average | |
|---|---|---|---|---|---|
| 0.1 | 62.40 | 49.00 | 49.00 | 77.10 | 59.38 |
| 0.3 | 64.23 | 49.77 | 49.70 | 77.50 | 60.30 |
| 0.5 | 65.85 | 50.13 | 50.30 | 77.53 | 60.95 |
| 0.7 (Final) | 66.43 | 50.13 | 50.43 | 77.50 | 61.12 |
| 0.9 | 66.43 | 49.90 | 50.23 | 77.27 | 60.96 |
| Source | Target (OOD Variants) | Average | ||||||
|---|---|---|---|---|---|---|---|---|
| ImageNet | -V2 | -Sketch | -A | -R | ||||
| ✓ | 70.80 | 63.00 | 48.90 | 47.10 | 76.06 | 58.77 | ||
| ✓ | ✓ | 70.60 | 63.70 | 49.20 | 50.25 | 76.10 | 59.81 | |
| ✓ | ✓ | 72.90 | 65.53 | 49.40 | 48.10 | 77.45 | 60.12 | |
| ✓ | ✓ | ✓ | 72.90 | 66.43 | 50.13 | 50.43 | 77.50 | 61.12 |
| Setting | Source | Target (OOD Variants) | |||
|---|---|---|---|---|---|
| ImageNet | -V2 | -Sketch | -A | -R | |
| V0 (Ours) | 72.90 | 66.43 | 50.13 | 50.43 | 77.50 |
| V12 (Deep) | 73.00 | 65.50 | 48.60 | 47.30 | 74.60 |