Transforming LLMs into Cross-modal and Cross-lingual Retrieval Systems

Frank Palma Gomez, Ramon Sanabria, Yun-Hsuan Sung, Daniel Cer, Siddharth Dalmia, Gustavo Hernández Ábrego

Abstract: Frank Palma Gomez, Ramon Sanabria, Yun-hsuan Sung, Daniel Cer, Siddharth Dalmia, Gustavo Hernandez Abrego. Proceedings of the 21st International Conference on Spoken Language Translation (IWSLT 2024).

2024.

Introduction

While Large Language Models (LLMs) have achieved remarkable success in text-based tasks across hundreds of languages, speech technology continues to face a significant data bottleneck. The primary challenge lies in the scarcity of paired datasets where speech is matched with its corresponding transcript. Traditional speech-to-text retrieval systems, often structured as Dual Encoders, typically require separate, specialized models for speech and text that must be meticulously aligned through extensive pre-training. This research explores a novel alternative: can we leverage the existing multilingual knowledge of a text-heavy LLM and simply "teach" it to treat audio as another language?

Methodology

The researchers propose a Dual Encoder (DE) architecture utilizing PaLM 2 XXS as the backbone. The workflow involves several key steps to bridge the gap between audio and text modalities:

  1. Audio Discretization: Raw waveforms are processed using a pre-trained speech encoder (Universal Speech Model) followed by k-means clustering. This transforms continuous audio into discrete "audio tokens," effectively creating a vocabulary for sounds.
  2. LLM Expansion: The LLM’s embedding layer is extended to incorporate these new audio tokens. From the model's perspective, an audio token becomes just another entry in its dictionary, analogous to a text word.
  3. Dual Encoder Training: The system employs two "towers" sharing the same PaLM 2 weights. One tower processes audio tokens, while the other processes text transcripts.
  4. Contrastive Learning: The model is trained using a contrastive loss function to maximize the similarity (dot product) between a speech sample and its correct transcript while minimizing similarity with other transcripts in the batch.
  5. Task Prefixes: Simple text prefixes (e.g., [English Speech]) are added to help the model navigate the multi-modal space more effectively.
The Dual Encoder architecture showing the speech and text towers sharing LLM weights and a projection layer, optimized via contrastive loss.

Experimental Setup and Datasets

The model was trained on CoVoST-2, a large multilingual speech-to-text corpus, using only 21 languages (approximately 900 hours of audio). Evaluation was conducted on the FLEURS dataset to test Speech-to-Text (S2T) retrieval across 102 languages. Additionally, WikiMatrix parallel text was used to enhance cross-lingual translation retrieval capabilities.

Results and Key Insights

The proposed PaLM 2 DE achieved a significant performance milestone, reaching a Recall@1 of 86.7% averaged across 102 languages. This substantially outperforms the previous state-of-the-art model, mSLAM, which scored 76.9%.

Transcript retrieval performance (R@1) for the proposed model compared to mSLAM, highlighting strong performance on both seen and unseen languages.

Cross-modal and Zero-shot Transfer

A striking finding is the model's ability to generalize from 21 training languages to 102 evaluation languages. Because the underlying LLM already possesses a deep understanding of the text for the 81 "unseen" languages, it only needs to learn the mapping between audio tokens and its existing multilingual text space. By discretizing audio, the researchers essentially treat speech as a "dialect" of text, leveraging the "semantic glue" inherent in the LLM's pre-trained weights. Furthermore, the model demonstrates cross-modal alignment, matching speech in one language to translations in another without explicit paired training data for those specific combinations.

Conclusion and Future Work

This work demonstrates that LLMs can be efficiently transformed into cross-modal retrieval systems with significantly less speech data (1/10th of previous baselines). However, limitations remain, such as the dependency on high-quality speech tokenizers and a performance gap in extremely low-resource languages like Burmese or Khmer. Future research may explore extending this "audio-as-text" approach to generative tasks or investigating the performance of even more compact LLMs in similar cross-modal contexts.

Summary updated

BibTeX
@misc{gomez2024transforming,
  author = {Frank Palma Gomez and Ramon Sanabria and Yun-Hsuan Sung and Daniel Cer and Siddharth Dalmia and Gustavo Hernández Ábrego},
  title = {{Transforming LLMs into Cross-modal and Cross-lingual Retrieval Systems}},
  year = {2024},
  eprint = {2404.01616},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2404.01616},
}
Figure