Once you have vector representations the "similarity" scores are just basic linear algebra. It's fundamentally no different than any other IR/recsys task.
A good overview is chapter 6 of the Stanford NLP group's IR book [0].
Engineering LLMs still requires a good foundation in the basics of ML/NLP so it's worth the time to catch up a bit.
0. https://web.archive.org/web/20231207074155/https://nlp.stanf...