Abstract
This paper addresses a cross-modal learning framework, where the objective is to enhance the performance of supervised learning in the primary modality using an unlabeled, unpaired secondary modality. Taking a probabilistic approach for missing information estimation, we show that the extra information contained in the secondary modality can be estimated via Nadaraya-Watson (NW) kernel regression, which can further be expressed as a kernelized cross-attention module (under linear transformation). This expression lays the foundation for introducing The Attention Patch (TAP), a simple neural network add-on that can be trained to allow data-level knowledge transfer from the unlabeled modality. We provide extensive numerical simulations using real-world datasets to show that TAP can provide statistically significant improvement in generalization across different domains and different neural network architectures, making use of seemingly unusable unlabeled cross-modal data.
Introduction
In modern machine learning, we often encounter scenarios where a primary dataset is labeled but limited in scale or scope. Simultaneously, there may exist a secondary modality that is rich in information but lacks labels and has no direct alignment (pairing) with the primary data. Traditional semi-supervised learning requires unlabeled data to share the same format as labeled data, while standard cross-modal learning typically requires paired samples (e.g., an image and its specific caption).
This research bridges this gap by answering: How can we leverage an unlabeled, unpaired secondary modality to improve a supervised task in a primary modality? We propose The Attention Patch (TAP), a module that allows models to "borrow" knowledge from these previously unusable data sources.
Methodology: From Kernel Regression to Attention
The core of our approach treats the problem as one of "missing information estimation." We derive a solution that connects classical non-parametric statistics with modern deep learning architectures.
1. Nadaraya-Watson (NW) Regression
We demonstrate that the missing information from a secondary modality can be estimated using NW kernel regression. This non-parametric method estimates the conditional expectation of a variable by weighting the values of nearby points in the feature space.
2. The Attention Bridge
Crucially, we prove that under linear transformations, the NW regression formulation is mathematically equivalent to a kernelized cross-attention module. This provides a theoretical foundation for the cross-attention mechanism, framing it as a form of regression that estimates latent representations.
The Attention Patch (TAP) Architecture
Based on the theoretical equivalence between attention and regression, we propose TAP as a plug-and-play neural network add-on. The module operates as follows:
- Query: It takes the output of an intermediate layer in the primary network.
- Keys and Values: It compares this query against a batch of unlabeled secondary data (the "Keys") to extract a relevant representation (the "Values").
- Integration: This representation is concatenated back into the primary network's flow.
Because TAP is a modular "patch," it can be inserted into existing architectures, such as CNNs or Transformers, with minimal modification to the original pipeline.
Experimental Evaluation
We evaluated TAP across four diverse domains to demonstrate its generalizability:
- Computer Vision (MNIST): Using split images where the top half was the primary (labeled) modality and the bottom half was the secondary (unlabeled/unpaired) modality.
- Healthcare (Activity): Utilizing Electrodermal Activity (EDA) as primary and Thoracic Electrical Bioimpedance (TEB) as secondary data.
- Remote Sensing (Crop): Combining optical satellite features (primary) with radar readings (secondary).
- Multimodal Sentiment (Memotion 7K): Enhancing meme image classification (primary) with text captions (secondary) using pre-trained EfficientNet and RoBERTa backbones.
Key Results
TAP consistently outperformed baseline models and control variants:
- Consistent Generalization Gains: On the Activity dataset, TAP improved accuracy from 36.9% to 38.1%. On the Crop dataset, accuracy increased from 71.5% to 74.1%.
- Implicit Alignment: Analysis of kernel values revealed that the model learned to align modalities in a shared information space without explicit pairs. Samples from different modalities sharing the same hidden label showed significantly higher kernel weights.
- Scaling with Data: In line with Theorem 1, performance improved as the reference batch size of unlabeled data increased, confirming that more "unusable" data leads to lower estimation error.
Conclusion
TAP provides a principled, statistically grounded method for cross-modal knowledge transfer. By treating attention as a form of kernel regression, we enable supervised models to benefit from vast amounts of unlabeled, unpaired data. Future work will focus on optimizing memory overhead associated with large reference batches and developing automated methods for selecting the most beneficial secondary modalities for a given task.
Summary updated