Your idea of using cross-attention to learn the mapping between the two databases without explicit labels is an interesting approach. It aligns with the concept of self-supervised learning, where the model learns from the inherent structure and relationships within the data itself. However, there are a few considerations and potential challenges to keep in mind:
-
Trivial learning: If the masked features in database 1 are easily predictable from the remaining features, the model might learn to rely solely on those features for matching, rather than learning meaningful correspondences between the databases. To mitigate this, you can experiment with different masking strategies or introduce additional constraints to encourage the model to consider the entire context.
-
Collapse or failure: Forcing the softmax to attend to only one entry from database 2 might lead to suboptimal or unstable learning. The model might struggle to find meaningful correspondences, especially if there are multiple plausible matches or if the databases have different data distributions. Instead of hard attention, you can consider using a softmax with a temperature parameter to control the sharpness of the attention distribution, allowing for more flexibility in the matching process.
-
Evaluation and validation: Without labeled data, evaluating the quality of the learned correspondences can be challenging. You might need to rely on domain knowledge or manual inspection of a subset of matches to assess the model's performance. Additionally, you can consider using proxy tasks or downstream applications to indirectly evaluate the learned correspondences.
To improve upon your idea, you can explore the following approaches:
-
Contrastive learning: Instead of directly predicting the masked features, you can formulate the problem as a contrastive learning task. The model learns to maximize the similarity between corresponding entries from the two databases while minimizing the similarity between non-corresponding entries. This can help the model learn more robust and discriminative representations for matching.
-
Cycle consistency: You can enforce cycle consistency by training the model to map from database 1 to database 2 and then back to database 1. This can help regularize the learning process and encourage the model to learn meaningful correspondences in both directions.
-
Data augmentation: Apply data augmentation techniques to introduce variability and improve the model's generalization ability. For example, you can randomly permute or mask features, add noise to the data, or generate synthetic examples based on the available features.
Regarding adjacent literatures, unsupervised domain adaptation techniques can be relevant to your problem. These techniques aim to learn a mapping between two different domains without labeled data in the target domain. Some approaches you can explore include:
-
Adversarial domain adaptation: Use adversarial training to align the feature distributions of the two databases, making them indistinguishable to a discriminator network. This can help the model learn domain-invariant representations for matching.
-
Self-training or pseudo-labeling: Iteratively generate pseudo-labels for the target database based on the predictions of a model trained on the source database. The pseudo-labels are then used to fine-tune the model, gradually adapting it to the target domain.
-
Representation learning: Learn a shared representation space for both databases using techniques like autoencoders, variational autoencoders, or self-supervised learning. The learned representations can then be used for matching or downstream tasks.
It's worth noting that data matching is a well-studied problem in the literature, and there are various techniques and algorithms specifically designed for this task. Some popular approaches include record linkage, entity resolution, and data fusion. These methods often rely on domain-specific heuristics, similarity measures, and probabilistic models to find correspondences between databases. Exploring the data matching literature can provide you with additional insights and ideas for tackling your specific problem.