A Survey of Word Embeddings and Text Representation: From Discrete to Contextual Representations
Main Article Content
Keywords
word embedding, text representation, pretrained language model, large language model, pointwise mutual information
Abstract
Word representation is a fundamental component of natural language processing and an important constraint on the performance of downstream tasks. Using representation form as the classification axis, this paper divides the development of word and text representation into four stages: statistical static word embeddings, feedforward-neural-network-based static word embeddings, pretrained-language-model-based dynamic word embeddings, and large-language-model-based text/sentence embeddings. The representative methods, technical routes, and relationships between successive stages are systematically reviewed. On this basis, this paper provides a unified mathematical perspective that covers the first three stages and extends to the contrastive fine-tuning route for large language models: from co-occurrence matrices to low-rank factorization and then to contextual functional factorization, representative methods at different stages can be uniformly interpreted in the form of inner product ≈ pointwise mutual information (PMI) + additional term. The PMI term is set to zero under the independence assumption in the discrete stage, estimated from type-level co-occurrence in the static stage, and dynamically generated at the token level in the dynamic stage, whereas the large language model (LLM) contrastive fine-tuning route returns to the density ratio over real co-occurring pairs. The additional term also changes across stages: it is the constant -logk in the static stage, the semantically irrelevant word-frequency term logp(x) in the dynamic stage, and a normalization constant independent of the specific sample in the LLM contrastive fine-tuning route. This paper successively derives three equivalences: skip-gram with negative sampling (SGNS) ≈ PMI - log k, the inner product of Bidirectional Encoder Representations from Transformers (BERT) ≈ PMI + log p(x), and the optimum of information noise-contrastive estimation (InfoNCE) ≈ the log density ratio. It also specifies the applicability boundary of this perspective in the LLM stage. Finally, this paper reviews intrinsic and extrinsic evaluation methods for word embedding models and discusses four future directions: multimodality, efficiency optimization, low-resource adaptation, and interpretability.
References
- [1]Bengio Y, Ducharme R, Vincent P, et al. A neural probabilistic language model[J]. Journal of Machine Learning Research, 2003, 3: 1137-1155.
- [2]Mikolov T, Chen K, Corrado G, et al. Efficient estimation of word representations in vector space[J]. arXiv preprint arXiv:1301.3781, 2013.
- [3]Mikolov T, Sutskever I, Chen K, et al. Distributed representations of words and phrases and their compositionality[C]//Advances in Neural Information Processing Systems 26, 2013: 3111-3119.
- [4]Pennington J, Socher R, Manning C. GloVe: Global vectors for word representation[C]//Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing. ACL, 2014: 1532-1543.
- [5]Bojanowski P, Grave E, Joulin A, et al. Enriching word vectors with subword information[J]. Transactions of the Association for Computational Linguistics, 2017, 5: 135-146.
- [6]Peters M, Neumann M, Iyyer M, et al. Deep contextualized word representations[C]//Proceedings of NAACL, 2018: 2227-2237.
- [7]Radford A, Narasimhan K, Salimans T, et al. Improving language understanding by generative pre-training[R]. OpenAI Technical Report, 2018.
- [8]Devlin J, Chang M W, Lee K, et al. BERT: Pre-training of deep bidirectional transformers for language understanding[C]//Proceedings of NAACL, 2019: 4171-4186.
- [9]Liu Y, Ott M, Goyal N, et al. RoBERTa: A robustly optimized BERT pretraining approach[J]. arXiv preprint arXiv:1907.11692, 2019.
- [10]Clark K, Luong M T, Le Q V, et al. ELECTRA: Pre-training text encoders as discriminators rather than generators[C]//Proceedings of ICLR, 2020.
- [11]Lan Z, Chen M, Goodman S, et al. ALBERT: A lite BERT for self-supervised learning of language representations[C]//Proceedings of ICLR, 2020.
- [12]Joshi M, Chen D, Liu Y, et al. SpanBERT: Improving pre-training by representing and predicting spans[J]. Transactions of the Association for Computational Linguistics, 2020, 8: 64-77.
- [13]Muennighoff N. SGPT: GPT sentence embeddings for semantic search[J]. arXiv preprint arXiv:2202.08904, 2022.
- [14]Jiang T, Huang S, Luan Z, et al. PromptBERT: Improving BERT sentence embeddings with prompts[J]. arXiv preprint arXiv:2201.04337, 2022.
- [15]Wang L, Yang N, Huang X, et al. Text embeddings by weakly-supervised contrastive pre-training (E5)[J]. arXiv preprint arXiv:2212.03533, 2022.
- [16]BehnamGhader P, Adlakha V, Mosbach M, et al. LLM2Vec: Large language models are secretly powerful text encoders[J]. arXiv preprint arXiv:2404.05961, 2024.
- [17]Camacho-Collados J, Pilehvar M T. From word to sense embeddings: A survey on vector representations of meaning[J]. Journal of Artificial Intelligence Research, 2018, 63: 743-788.
- [18]Wang Y, Hou Y, Che W, et al. From static to dynamic word representations: A survey[J]. International Journal of Machine Learning and Cybernetics, 2020, 11(7): 1611-1630.
- [19]Zeng J, Wang Z W, Yu Y, et al. Word embedding methods in natural language processing: A review[J]. Journal of Frontiers of Computer Science and Technology, 2024, 18(1): 24-43. (in Chinese)
- [20]Nie Z, Feng Z, Li M, et al. When text embedding meets large language model: A comprehensive survey[J]. arXiv preprint arXiv:2412.09165, 2024.
- [21]Tao C, Shen T, Gao S, et al. LLMs are also effective embedding models: An in-depth overview[J]. arXiv preprint arXiv:2412.12591, 2024.
- [22]Achiam J, Adler S, Agarwal S, et al. GPT-4 technical report[J]. arXiv preprint arXiv:2303.08774, 2023.
- [23]Touvron H, Lavril T, Izacard G, et al. LLaMA: Open and efficient foundation language models[J]. arXiv preprint arXiv:2302.13971, 2023.
- [24]van den Oord A, Li Y, Vinyals O. Representation learning with contrastive predictive coding[J]. arXiv preprint arXiv:1807.03748, 2018.
- [25]Gao T, Yao X, Chen D. SimCSE: Simple contrastive learning of sentence embeddings[C]//Proceedings of EMNLP, 2021: 6894-6910.
- [26]Salton G, Wong A, Yang C S. A vector space model for automatic indexing[J]. Communications of the ACM, 1975, 18(11): 613-620.
- [27]Sparck Jones K. A statistical interpretation of term specificity and its application in retrieval[J]. Journal of Documentation, 1972, 28(1): 11-21.
- [28]Bullinaria J A, Levy J P. Extracting semantic representations from word co-occurrence statistics: A computational study[J]. Behavior Research Methods, 2007, 39(3): 510-526.
- [29]Church K W, Hanks P. Word association norms, mutual information, and lexicography[J]. Computational Linguistics, 1990, 16(1): 22-29.
- [30]Deerwester S, Dumais S T, Furnas G W, et al. Indexing by latent semantic analysis[J]. Journal of the American Society for Information Science, 1990, 41(6): 391-407.
- [31]Hofmann T. Probabilistic latent semantic indexing[C]//Proceedings of SIGIR, 1999: 50-57.
- [32]Blei D M, Ng A Y, Jordan M I. Latent Dirichlet allocation[J]. Journal of Machine Learning Research, 2003, 3: 993-1022.
- [33]Mnih A, Hinton G. Three new graphical models for statistical language modelling[C]//Proceedings of the 24th International Conference on Machine Learning (ICML), 2007: 641-648.
- [34]Levy O, Goldberg Y. Neural word embeddings as implicit matrix factorization[C]//Advances in Neural Information Processing Systems 27, 2014: 2177-2185.
- [35]Levy O, Goldberg Y. Dependency-based word embeddings[C]//Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Short Papers), 2014: 302-310.
- [36]Kim Y, Jernite Y, Sontag D, et al. Character-aware neural language models[C]//Proceedings of the AAAI Conference on Artificial Intelligence, 2016: 2741-2749.
- [37]Le Q V, Mikolov T. Distributed representations of sentences and documents[C]//Proceedings of the 31st International Conference on Machine Learning (ICML), 2014: 1188-1196.
- [38]Huang E H, Socher R, Manning C D, et al. Improving word representations via global context and multiple word prototypes[C]//Proceedings of the 50th Annual Meeting of the Association for Computational Linguistics, 2012: 873-882.
- [39]Reisinger J, Mooney R J. Multi-prototype vector-space models of word meaning[C]//Proceedings of NAACL, 2010: 109-117.
- [40]Hochreiter S, Schmidhuber J. Long short-term memory[J]. Neural Computation, 1997, 9(8): 1735-1780.
- [41]McCann B, Bradbury J, Xiong C, et al. Learned in translation: Contextualized word vectors[C]//Advances in Neural Information Processing Systems 30, 2017: 6294-6305.
- [42]Howard J, Ruder S. Universal language model fine-tuning for text classification[C]//Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics, 2018: 328-339.
- [43]Vaswani A, Shazeer N, Parmar N, et al. Attention is all you need[C]//Advances in Neural Information Processing Systems 30, 2017: 5998-6008.
- [44]Sanh V, Debut L, Chaumond J, et al. DistilBERT, a distilled version of BERT: Smaller, faster, cheaper and lighter[J]. arXiv preprint arXiv:1910.01108, 2019.
- [45]Ethayarajh K. How contextual are contextualized word representations? Comparing the geometry of BERT, ELMo, and GPT embeddings[C]//Proceedings of EMNLP-IJCNLP, 2019: 55-65.
- [46]Gao J, He D, Tan X, et al. Representation degeneration problem in training natural language generation models[C]//Proceedings of ICLR, 2019.
- [47]Reimers N, Gurevych I. Sentence-BERT: Sentence embeddings using Siamese BERT-networks[C]//Proceedings of EMNLP-IJCNLP, 2019: 3982-3992.
- [48]Wang L, Yang N, Huang X, et al. Improving text embeddings with large language models[J]. arXiv preprint arXiv:2401.00368, 2024.
- [49]Baroni M, Dinu G, Kruszewski G. Don’t count, predict! A systematic comparison of context-counting vs. context-predicting semantic vectors[C]//Proceedings of ACL, 2014: 238-247.
- [50]Li B, Zhou H, He J, et al. On the sentence embeddings from pre-trained language models[C]//Proceedings of EMNLP, 2020: 9119-9130.
- [51]Huang J, Tang D, Zhong W, et al. WhiteningBERT: An easy unsupervised sentence embedding approach[C]//Findings of the Association for Computational Linguistics: EMNLP 2021, 2021: 238-244.
- [52]Bolukbasi T, Chang K W, Zou J, et al. Man is to computer programmer as woman is to homemaker? Debiasing word embeddings[C]//Advances in Neural Information Processing Systems 29, 2016: 4349-4357.
- [53]Faruqui M, Tsvetkov Y, Rastogi P, et al. Problems with evaluation of word embeddings using word similarity tasks[C]//Proceedings of RepL4NLP, 2016: 30-35.
- [54]Wang A, Singh A, Michael J, et al. GLUE: A multi-task benchmark and analysis platform for natural language understanding[C]//Proceedings of ICLR, 2019.
- [55]Thakur N, Reimers N, Rücklé A, et al. BEIR: A heterogeneous benchmark for zero-shot evaluation of information retrieval models[C]//Advances in Neural Information Processing Systems 34 (Datasets and Benchmarks Track), 2021. [56]Muennighoff N, Tazi N, Magne L, et al. MTEB: Massive text embedding benchmark[C]//Proceedings of the 17th Conference of the European Chapter of the Association for Computational Linguistics (EACL), 2023: 2014-2037.
- [57]Xiao S, Liu Z, Zhang P, et al. C-Pack: Packaged resources to advance general Chinese embedding[J]. arXiv preprint arXiv:2309.07597, 2023.
- [58]Radford A, Kim J W, Hallacy C, et al. Learning transferable visual models from natural language supervision[C]//Proceedings of ICML, 2021: 8748-8763.
- [59]Jia C, Yang Y, Xia Y, et al. Scaling up visual and vision-language representation learning with noisy text supervision[C]//Proceedings of ICML, 2021: 4904-4916.
- [60]Hinton G, Vinyals O, Dean J. Distilling the knowledge in a neural network[J]. arXiv preprint arXiv:1503.02531, 2015.
- [61]Conneau A, Khandelwal K, Goyal N, et al. Unsupervised cross-lingual representation learning at scale[C]//Proceedings of ACL, 2020: 8440-8451.
- [62]Houlsby N, Giurgiu A, Jastrzebski S, et al. Parameter-efficient transfer learning for NLP[C]//Proceedings of ICML, 2019: 2790-2799.
- [63]Ribeiro M T, Singh S, Guestrin C. “Why should I trust you?”: Explaining the predictions of any classifier[C]//Proceedings of KDD, 2016: 1135-1144.
- [64]Hewitt J, Liang P. Designing and interpreting probes with control tasks[C]//Proceedings of EMNLP-IJCNLP, 2019: 732-742.
- [65]Belinkov Y, Glass J. Analysis methods in neural language processing: A survey[J]. Transactions of the Association for Computational Linguistics, 2019, 7: 49-72.
