## 4 Foundations of Recommendation Systems and LLM Integration
### LLMs in NLP vs. Recommendation  
While both natural language processing (NLP) and recommendation systems utilize large language models (LLMs), they differ in primary objectives, data methodologies, and technical structures. Within linguistics, scrutinizing speech comprehension and production addresses issues such as sentiment analysis, summarization, or translation [3; 17]. BERT [3], GPT [68], and T5 [26] have all mastered these tasks because of their text structure and semantic understanding of natural language.  
On the other hand, recommender systems focus on predicting users' interests and creating tailored suggestions for specific items. This requires modeling user behaviors, their interactions, and historical data within temporal frameworks. The BERT4 Rec [6] extension that uses BERT for sequential recommendation is one such adapted LLM, as well as ChatGPT-based systems [69] which enable users to search for items in an e-commerce context through dialogue.  
* Data Modalities and Pretraining Objectives: Most LLMs are pretrained on large unstructured corpora such as Wikipedia, where they learn from the structure and semantics of free-form text [26]. In contrast, recommendation systems rely on semi-structured and structured inputs, including user-item interaction logs, ratings, metadata, and reviews [70]. These data types require different pretraining objectives. For example, BERT4 Rec [6] employs masked language modeling tailored to sequential behavior, while CoLLM [71] leverages rich textual metadata for generative recommendation.
* Architectural Adaptations: Transformers remain the backbone of NLP due to their capacity to model long-range dependencies [22]. T5 reformulates diverse tasks into a unified text-to-text schema [26]. In recommendation systems, architecture design shifts toward hybrid or specialized models. XLNet4 Rec [32; 34] focuses on autoregressive learning over behavior sequences, while GraphRipple [72] integrates graph-based user-item relationships for deeper contextual modeling.
* Evaluation Criteria: Evaluation frameworks differ notably. NLP tasks employ BLEU for translation [73], ROUGE for summarization [74], and perplexity for generative fluency. In contrast, recommender systems use metrics such as NDCG, Recall, Precision, and CTR to assess ranking and personalization quality [14]. BERT4 Rec demonstrates improved NDCG over collaborative filtering baselines [6], and ChatGPT has shown promising gains in CTR when adapted for dialogue-based recommendation [69].
* Context Representation: NLP systems derive context from linguistic dependencies across tokens and sentences [3]. Advances like DeBERTa enhance contextual encoding through disentangled attention [61]. Recommendation systems, on the other hand, use behavioral context such as clickstreams, timestamps, and user intent history. CoLLM [71] integrates such multimodal context to adapt recommendations to evolving user needs.  
* Challenges within Domains: NLP faces issues including ambiguity, polysemy, and generalization across domains [75; 76]. Recommendation systems contend with data sparsity, cold-start problems, and real-time responsiveness [77]. UPRec [78] introduces user-aware pretraining to combat sparsity, while GPT4 Rec [4] employs prompt-based tuning to efficiently personalize recommendations in real time with low overhead.  
Foundational insights guide our understanding of how LLMs can be customized for use in recommendations, which we will be the focus of the next section.