LogoLogo
Continuum WebsiteContinuum ApplicationsContinuum KnowledgeAxolotl Platform
Continuum Knowledge
Continuum Knowledge
  • Continuum
  • Data
    • Datasets
      • Pre Training Data
      • Types of Fine Tuning
      • Self Instruct Paper
      • Self-Alignment with Instruction Backtranslation
      • Systematic Evaluation of Instruction-Tuned Large Language Models on Open Datasets
      • Instruction Tuning
      • Instruction Fine Tuning - Alpagasus
      • Less is More For Alignment
      • Enhanced Supervised Fine Tuning
      • Visualising Data using t-SNE
      • UMAP: Uniform Manifold Approximation and Projection for Dimension Reduction
      • Training and Evaluation Datasets
      • What is perplexity?
  • MODELS
    • Foundation Models
      • The leaderboard
      • Foundation Models
      • LLama 2 - Analysis
      • Analysis of Llama 3
      • Llama 3.1 series
      • Google Gemini 1.5
      • Platypus: Quick, Cheap, and Powerful Refinement of LLMs
      • Mixtral of Experts
      • Mixture-of-Agents (MoA)
      • Phi 1.5
        • Refining the Art of AI Training: A Deep Dive into Phi 1.5's Innovative Approach
      • Phi 2.0
      • Phi-3 Technical Report
  • Training
    • The Fine Tuning Process
      • Why fine tune?
        • Does Fine-Tuning LLMs on New Knowledge Encourage Hallucinations?
        • Explanations in Fine Tuning
      • Tokenization
        • Tokenization Is More Than Compression
        • Tokenization - SentencePiece
        • Tokenization explore
        • Tokenizer Choice For LLM Training: Negligible or Crucial?
        • Getting the most out of your tokenizer for pre-training and domain adaptation
        • TokenMonster
      • Parameter Efficient Fine Tuning
        • P-Tuning
          • The Power of Scale for Parameter-Efficient Prompt Tuning
        • Prefix-Tuning: Optimizing Continuous Prompts for Generation
        • Harnessing the Power of PEFT: A Smarter Approach to Fine-tuning Pre-trained Models
        • What is Low-Rank Adaptation (LoRA) - explained by the inventor
        • Low Rank Adaptation (Lora)
        • Practical Tips for Fine-tuning LMs Using LoRA (Low-Rank Adaptation)
        • QLORA: Efficient Finetuning of Quantized LLMs
        • Bits and Bytes
        • The Magic behind Qlora
        • Practical Guide to LoRA: Tips and Tricks for Effective Model Adaptation
        • The quantization constant
        • QLORA: Efficient Finetuning of Quantized Language Models
        • QLORA and Fine-Tuning of Quantized Language Models (LMs)
        • ReLoRA: High-Rank Training Through Low-Rank Updates
        • SLoRA: Federated Parameter Efficient Fine-Tuning of Language Models
        • GaLora: Memory-Efficient LLM Training by Gradient Low-Rank Projection
      • Hyperparameters
        • Batch Size
        • Padding Tokens
        • Mixed precision training
        • FP8 Formats for Deep Learning
        • Floating Point Numbers
        • Batch Size and Model loss
        • Batch Normalisation
        • Rethinking Learning Rate Tuning in the Era of Language Models
        • Sample Packing
        • Gradient accumulation
        • A process for choosing the learning rate
        • Learning Rate Scheduler
        • Checkpoints
        • A Survey on Efficient Training of Transformers
        • Sequence Length Warmup
        • Understanding Training vs. Evaluation Data Splits
        • Cross-entropy loss
        • Weight Decay
        • Optimiser
        • Caching
      • Training Processes
        • Extending the context window
        • PyTorch Fully Sharded Data Parallel (FSDP)
        • Train Short, Test Long: Attention with Linear Biases Enables Input Length Extrapolation
        • YaRN: Efficient Context Window Extension of Large Language Models
        • Sliding Window Attention
        • LongRoPE
        • Reinforcement Learning
        • An introduction to reinforcement learning
        • Reinforcement Learning from Human Feedback (RLHF)
        • Direct Preference Optimization: Your Language Model is Secretly a Reward Model
  • INFERENCE
    • Why is inference important?
      • Grouped Query Attention
      • Key Value Cache
      • Flash Attention
      • Flash Attention 2
      • StreamingLLM
      • Paged Attention and vLLM
      • TensorRT-LLM
      • Torchscript
      • NVIDIA L40S GPU
      • Triton Inference Server - Introduction
      • Triton Inference Server
      • FiDO: Fusion-in-Decoder optimised for stronger performance and faster inference
      • Is PUE a useful measure of data centre performance?
      • SLORA
  • KNOWLEDGE
    • Vector Databases
      • A Comprehensive Survey on Vector Databases
      • Vector database management systems: Fundamental concepts, use-cases, and current challenges
      • Using the Output Embedding to Improve Language Models
      • Decoding Sentence-BERT
      • ColBERT: Efficient and Effective Passage Search via Contextualized Late Interaction over BERT
      • SimCSE: Simple Contrastive Learning of Sentence Embeddings
      • Questions Are All You Need to Train a Dense Passage Retriever
      • Improving Text Embeddings with Large Language Models
      • Massive Text Embedding Benchmark
      • RocketQAv2: A Joint Training Method for Dense Passage Retrieval and Passage Re-ranking
      • LLM2Vec: Large Language Models Are Secretly Powerful Text Encoders
      • Embedding and Fine-Tuning in Neural Language Models
      • Embedding Model Construction
      • Demystifying Embedding Spaces using Large Language Models
      • Fine-Tuning Llama for Multi-Stage Text Retrieval
      • Large Language Model Based Text Augmentation Enhanced Personality Detection Model
      • One Embedder, Any Task: Instruction-Finetuned Text Embeddings
      • Vector Databases are not the only solution
      • Knowledge Graphs
        • Harnessing Knowledge Graphs to Elevate AI: A Technical Exploration
        • Unifying Large Language Models and Knowledge Graphs: A Roadmap
      • Approximate Nearest Neighbor (ANN)
      • High Dimensional Data
      • Principal Component Analysis (PCA)
      • Vector Similarity Search - HNSW
      • FAISS (Facebook AI Similarity Search)
      • Unsupervised Dense Retrievers
    • Retrieval Augmented Generation
      • Retrieval-Augmented Generation for Large Language Models: A Survey
      • Fine-Tuning or Retrieval?
      • Revolutionising Information Retrieval: The Power of RAG in Language Models
      • A Survey on Retrieval-Augmented Text Generation
      • REALM: Retrieval-Augmented Language Model Pre-Training
      • Retrieve Anything To Augment Large Language Models
      • Generate Rather Than Retrieve: Large Language Models Are Strong Context Generators
      • Active Retrieval Augmented Generation
      • DSPy: LM Assertions: Enhancing Language Model Pipelines with Computational Constraints
      • DSPy: Compiling Declarative Language Model Calls
      • DSPy: In-Context Learning for Extreme Multi-Label Classification
      • Optimizing Instructions and Demonstrations for Multi-Stage Language Model Programs
      • HYDE: Revolutionising Search with Hypothetical Document Embeddings
      • Enhancing Recommender Systems with Large Language Model Reasoning Graphs
      • Retrieval Augmented Generation (RAG) versus fine tuning
      • RAFT: Adapting Language Model to Domain Specific RAG
      • Summarisation Methods and RAG
      • Lessons Learned on LLM RAG Solutions
      • Stanford: Retrieval Augmented Language Models
      • Overview of RAG Approaches with Vector Databases
      • Mastering Chunking in Retrieval-Augmented Generation (RAG) Systems
    • Semantic Routing
    • Resource Description Framework (RDF)
  • AGENTS
    • What is agency?
      • Rephrase and Respond: Let Large Language Models Ask Better Questions for Themselves
      • Types of Agents
      • The risk of AI agency
      • Understanding Personality in Large Language Models: A New Frontier in AI Psychology
      • AI Agents - Reasoning, Planning, and Tool Calling
      • Personality and Brand
      • Agent Interaction via APIs
      • Bridging Minds and Machines: The Legacy of Newell, Shaw, and Simon
      • A Survey on Language Model based Autonomous Agents
      • Large Language Models as Agents
      • AI Reasoning: A Deep Dive into Chain-of-Thought Prompting
      • Enhancing AI Reasoning with Self-Taught Reasoner (STaR)
      • Exploring the Frontier of AI: The "Tree of Thoughts" Framework
      • Toolformer: Revolutionising Language Models with API Integration - An Analysis
      • TaskMatrix.AI: Bridging Foundational AI Models with Specialised Systems for Enhanced Task Completion
      • Unleashing the Power of LLMs in API Integration: The Rise of Gorilla
      • Andrew Ng's presentation on AI agents
      • Making AI accessible with Andrej Karpathy and Stephanie Zhan
  • Regulation and Ethics
    • Regulation and Ethics
      • Privacy
      • Detecting AI Generated content
      • Navigating the IP Maze in AI: The Convergence of Blockchain, Web 3.0, and LLMs
      • Adverse Reactions to generative AI
      • Navigating the Ethical Minefield: The Challenge of Security in Large Language Models
      • Navigating the Uncharted Waters: The Risks of Autonomous AI in Military Decision-Making
  • DISRUPTION
    • Data Architecture
      • What is a data pipeline?
      • What is Reverse ETL?
      • Unstructured Data and Generatve AI
      • Resource Description Framework (RDF)
      • Integrating generative AI with the Semantic Web
    • Search
      • BM25 - Search Engine Ranking Function
      • BERT as a reranking engine
      • BERT and Google
      • Generative Engine Optimisation (GEO)
      • Billion-scale similarity search with GPUs
      • FOLLOWIR: Evaluating and Teaching Information Retrieval Models to Follow Instructions
      • Neural Collaborative Filtering
      • Federated Neural Collaborative Filtering
      • Latent Space versus Embedding Space
      • Improving Text Embeddings with Large Language Models
    • Recommendation Engines
      • On Interpretation and Measurement of Soft Attributes for Recommendation
      • A Survey on Large Language Models for Recommendation
      • Model driven recommendation systems
      • Recommender AI Agent: Integrating Large Language Models for Interactive Recommendations
      • Foundation Models for Recommender Systems
      • Exploring the Impact of Large Language Models on Recommender Systems: An Extensive Review
      • AI driven recommendations - harming autonomy?
    • Logging
      • A Taxonomy of Anomalies in Log Data
      • Deeplog
      • LogBERT: Log Anomaly Detection via BERT
      • Experience Report: Deep Learning-based System Log Analysis for Anomaly Detection
      • Log-based Anomaly Detection with Deep Learning: How Far Are We?
      • Deep Learning for Anomaly Detection in Log Data: A Survey
      • LogGPT
      • Adaptive Semantic Gate Networks (ASGNet) for log-based anomaly diagnosis
  • Infrastructure
    • The modern data centre
      • Enhancing Data Centre Efficiency: Strategies to Improve PUE
      • TCO of NVIDIA GPUs and falling barriers to entry
      • Maximising GPU Utilisation with Kubernetes and NVIDIA GPU Operator
      • Data Centres
      • Liquid Cooling
    • Servers and Chips
      • The NVIDIA H100 GPU
      • NVIDIA H100 NVL
      • Lambda Hyperplane 8-H100
      • NVIDIA DGX Servers
      • NVIDIA DGX-2
      • NVIDIA DGX H-100 System
      • NVLink Switch
      • Tensor Cores
      • NVIDIA Grace Hopper Superchip
      • NVIDIA Grace CPU Superchip
      • NVIDIA GB200 NVL72
      • Hopper versus Blackwell
      • HGX: High-Performance GPU Platforms
      • ARM Chips
      • ARM versus x86
      • RISC versus CISC
      • Introduction to RISC-V
    • Networking and Connectivity
      • Infiniband versus Ethernet
      • NVIDIA Quantum InfiniBand
      • PCIe (Peripheral Component Interconnect Express)
      • NVIDIA ConnectX InfiniBand adapters
      • NVMe (Non-Volatile Memory Express)
      • NVMe over Fabrics (NVMe-oF)
      • NVIDIA Spectrum-X
      • NVIDIA GPUDirect
      • Evaluating Modern GPU Interconnect
      • Scalable Hierarchical Aggregation and Reduction Protocol (SHARP)
      • Next-generation networking in AI environments
      • NVIDIA Collective Communications Library (NCCL)
    • Data and Memory
      • NVIDIA BlueField Data Processing Units (DPUs)
      • Remote Direct Memory Access (RDMA)
      • High Bandwidth Memory (HBM3)
      • Flash Memory
      • Model Requirements
      • Calculating GPU memory for serving LLMs
      • Transformer training costs
      • GPU Performance Optimisation
    • Libraries and Complements
      • NVIDIA Base Command
      • NVIDIA AI Enterprise
      • CUDA - NVIDIA GTC 2024 presentation
      • RAPIDs
      • RAFT
    • Vast Data Platform
      • Vast Datastore
      • Vast Database
      • Vast Data Engine
      • DASE (Disaggregated and Shared Everything)
      • Dremio and VAST Data
    • Storage
      • WEKA: A High-Performance Storage Solution for AI Workloads
      • Introduction to NVIDIA GPUDirect Storage (GDS)
        • GDS cuFile API
      • NVIDIA Magnum IO GPUDirect Storage (GDS)
      • Vectors in Memory
Powered by GitBook
LogoLogo

Continuum - Accelerated Artificial Intelligence

  • Continuum Website
  • Axolotl Platform

Copyright Continuum Labs - 2023

On this page
  • Traditional recommendation systems have a host of well known limitations
  • Current Recommendation Systems
  • The future of recommendation systems
  • The process typically involves two main components

Was this helpful?

  1. DISRUPTION

Recommendation Engines

There is major disruption coming to the recommendation engine industry

PreviousImproving Text Embeddings with Large Language ModelsNextOn Interpretation and Measurement of Soft Attributes for Recommendation

Last updated 11 months ago

Was this helpful?

Traditional recommendation systems have a host of well known limitations

Traditional recommendation systems, while widely used across various sectors, often face significant challenges that limit their effectiveness and user satisfaction.

These issues stem from the inherent complexity of human preferences, the limitations of available data, and the dynamic nature of user needs.

Let's explore these challenges in more detail.

Lack of standardised catalogues

One fundamental problem is the lack of standardised catalogues in many industries.

A catalogue in the context of recommendation systems refers to a comprehensive and structured collection of items or experiences that can be recommended to users.

It serves as a central repository containing all the relevant information about the available options, such as product details, descriptions, attributes, and metadata.

A well-defined catalogue is essential for building effective recommendation models, as it provides a clear set of items to suggest to users based on their preferences and behavior.

Without a well-defined set of items or experiences to recommend, systems struggle to determine what should be suggested to users.

This issue is particularly prevalent in sectors such as tourism, where the range of attractions, activities, and accommodations is vast and constantly evolving. The absence of a unified catalogue makes it difficult to build comprehensive recommendation models that cover all relevant options.

Subjectivity

Even when a catalogue exists, estimating the quality of products or experiences is a daunting task.

Many aspects of quality are subjective and depend on individual preferences, making it challenging to assess beforehand.

For example, the enjoyment derived from a movie, book, or vacation destination can vary greatly from person to person.

Traditional recommendation systems often rely on simplified metrics like ratings or popularity, which may not capture the nuances of personal taste. This limitation can lead to suboptimal recommendations that fail to meet users' expectations.

Not enough historical data

Data sparsity is a common problem in recommendation systems that arises when there is insufficient data available to make accurate predictions.

It occurs when users have interacted with only a small subset of the available items, leaving a significant portion of the catalogue unexplored.

For example, consider an online movie streaming platform with a vast library of films.

Each user typically watches only a fraction of the available movies, leaving a large number of films unrated or unwatched. This sparsity makes it challenging to infer user preferences and generate reliable recommendations, especially for less popular or newly added movies.

Collaborative filtering techniques, which rely on finding similar users or items based on their past interactions, can struggle in the presence of data sparsity. When there are limited overlapping ratings between users or items, it becomes difficult to identify meaningful patterns and make accurate recommendations.

Bias towards popular items

Traditional recommendation systems also tend to exhibit a bias toward popular items.

They may disproportionately suggest well-known or frequently consumed options, neglecting unique or niche preferences.

This bias can result in a homogenisation of recommendations, where users are presented with a narrow range of choices that align with the majority. Consequently, users with eclectic tastes may find the recommendations unsatisfying, as the system fails to surface lesser-known gems that match their interests.

Evaluation

Evaluating the effectiveness of recommendation systems is a complex challenge.

Traditional offline evaluation methods, such as measuring accuracy or precision, often fail to capture the true user experience. These metrics may not account for factors like serendipity, diversity, or the impact of recommendations on user behavior.

More reliable evaluation approaches, such as user studies or online experiments, are costly and logistically challenging to implement. The lack of comprehensive evaluation methods makes it difficult to assess and improve the performance of recommendation systems.

Context Sensitivity

Context sensitivity is another critical aspect often overlooked by traditional recommendation systems.

The relevance of recommendations can vary greatly depending on factors such as time, location, social context, and user mood.

For example, a restaurant recommendation that is suitable for a romantic dinner may not be appropriate for a quick lunch break. Capturing and incorporating contextual information into recommendation models is a complex task that requires advanced techniques and rich data sources.

Preferences evolve

Moreover, users have diverse and evolving preferences that are challenging to capture and adapt to. Individuals' tastes can change over time, influenced by personal experiences, social interactions, and external factors.

Traditional recommendation systems often struggle to keep pace with these dynamic preferences, as they rely on historical data that may become stale or irrelevant.

The ability to continuously learn and adapt to user preferences is crucial for delivering personalized and up-to-date recommendations.

Lack of personalisation

The lack of personalisation is a common pitfall of traditional recommendation systems.

By focusing on popular or generic options, these systems may fail to meet the specific needs and desires of individual users. Personalisation requires a deep understanding of user preferences, context, and behaviour.

Generic recommendations based on broad demographic segments or simplistic similarity measures often fall short of capturing the unique characteristics of each user.

Lack of human touch

Finally, there is a growing concern that AI-driven recommendation systems may lack the creativity and human touch required for crafting truly personalised and engaging experiences.

While algorithms can analyse vast amounts of data and identify patterns, they may struggle to replicate the serendipity, intuition, and emotional intelligence that human curators bring to the table.

The risk is that recommendations become formulaic and predictable, lacking the surprise and delight that make experiences memorable.

Current Recommendation Systems

The top five types of traditional recommendation systems commonly used in the industry are:

Collaborative Filtering

This approach relies on the idea that users with similar preferences in the past are likely to have similar preferences in the future.

It uses user-item interactions, such as ratings or purchases, to identify similar users or items and make recommendations based on their behavior.

Content-Based Filtering

This technique focuses on the characteristics and attributes of items to make recommendations.

It analyses the content or features of items that a user has previously liked or interacted with and recommends similar items based on their attributes.

Hybrid Approaches

Hybrid recommendation systems combine multiple techniques, such as collaborative filtering and content-based filtering, to overcome the limitations of individual methods.

By leveraging the strengths of different approaches, hybrid systems aim to provide more accurate and diverse recommendations.

Demographic-Based Filtering

This approach relies on demographic information about users, such as age, gender, location, or occupation, to make recommendations. It assumes that users with similar demographic profiles are likely to have similar preferences and recommends items based on these shared characteristics.

Knowledge-Based Filtering

Knowledge-based systems use explicit domain knowledge and rules to make recommendations.

They rely on a set of predefined rules, constraints, or user preferences to suggest items that match specific criteria. These systems often employ techniques like case-based reasoning or constraint-based reasoning to generate recommendations.

Primary mathematical techniques and algorithms used in recommendation systems

Matrix Factorization

Matrix factorization is a collaborative filtering technique that decomposes the user-item interaction matrix into lower-dimensional user and item latent factor matrices.

The goal is to find latent factors that capture the underlying preferences of users and the characteristics of items.

Example using PyTorch:

import torch

# User-item interaction matrix
interactions = torch.tensor([[4, 0, 0, 5, 1],
                             [0, 0, 0, 4, 0],
                             [0, 0, 0, 0, 2],
                             [2, 3, 0, 0, 0],
                             [0, 0, 5, 4, 0]])

# Number of latent factors
num_factors = 3

# Initialize user and item latent factor matrices
user_factors = torch.randn(interactions.shape[0], num_factors, requires_grad=True)
item_factors = torch.randn(interactions.shape[1], num_factors, requires_grad=True)

# Matrix factorization
predicted_ratings = torch.matmul(user_factors, item_factors.t())

# Loss function and optimization
loss_fn = torch.nn.MSELoss()
optimizer = torch.optim.SGD([user_factors, item_factors], lr=0.01)

# Training loop
for epoch in range(100):
    optimizer.zero_grad()
    loss = loss_fn(predicted_ratings[interactions > 0], interactions[interactions > 0])
    loss.backward()
    optimizer.step()

Singular Value Decomposition (SVD)

SVD is another matrix factorization technique used in collaborative filtering.

It decomposes the user-item interaction matrix into three matrices: U (user singular vectors), Σ (singular values), and V^T (item singular vectors).

Example using PyTorch:

import torch

# User-item interaction matrix
interactions = torch.tensor([[4, 0, 0, 5, 1],
                             [0, 0, 0, 4, 0],
                             [0, 0, 0, 0, 2],
                             [2, 3, 0, 0, 0],
                             [0, 0, 5, 4, 0]], dtype=torch.float)

# Perform SVD
U, S, V = torch.svd(interactions)

# Truncate singular values and vectors
num_factors = 3
U_truncated = U[:, :num_factors]
S_truncated = S[:num_factors]
V_truncated = V[:, :num_factors]

# Reconstruct the interaction matrix
reconstructed_interactions = torch.matmul(torch.matmul(U_truncated, torch.diag(S_truncated)), V_truncated.t())

Deep Learning

Deep learning techniques, such as neural networks, have gained popularity in recommendation systems. They can capture complex non-linear relationships between users and items and learn meaningful representations from raw data.

Example using PyTorch:

import torch
import torch.nn as nn

# User and item embeddings
num_users = 1000
num_items = 500
embedding_dim = 50

user_embeddings = nn.Embedding(num_users, embedding_dim)
item_embeddings = nn.Embedding(num_items, embedding_dim)

# Neural network model
class RecommenderNet(nn.Module):
    def __init__(self, user_embeddings, item_embeddings):
        super(RecommenderNet, self).__init__()
        self.user_embeddings = user_embeddings
        self.item_embeddings = item_embeddings
        self.fc1 = nn.Linear(embedding_dim * 2, 128)
        self.fc2 = nn.Linear(128, 1)
        self.activation = nn.ReLU()

    def forward(self, user_ids, item_ids):
        user_embedding = self.user_embeddings(user_ids)
        item_embedding = self.item_embeddings(item_ids)
        concatenated = torch.cat((user_embedding, item_embedding), dim=1)
        x = self.activation(self.fc1(concatenated))
        x = self.fc2(x)
        return x.squeeze()

model = RecommenderNet(user_embeddings, item_embeddings)

# Training loop
criterion = nn.MSELoss()
optimizer = torch.optim.Adam(model.parameters(), lr=0.001)

for epoch in range(10):
    # Forward pass
    user_ids = torch.tensor([...])  # User IDs
    item_ids = torch.tensor([...])  # Item IDs
    ratings = torch.tensor([...])  # Corresponding ratings
    
    predicted_ratings = model(user_ids, item_ids)
    loss = criterion(predicted_ratings, ratings)
    
    # Backward pass and optimization
    optimizer.zero_grad()
    loss.backward()
    optimizer.step()

Factorization Machines (FM)

Factorization Machines are a generalisation of matrix factorization that can handle both sparse and dense feature vectors.

They model the interactions between features using factorised parameters.

Example using PyTorch:

import torch
import torch.nn as nn

# Factorization Machine model
class FactorizationMachine(nn.Module):
    def __init__(self, num_features, embedding_dim):
        super(FactorizationMachine, self).__init__()
        self.embedding = nn.Embedding(num_features, embedding_dim)
        self.linear = nn.Linear(num_features, 1)
        
    def forward(self, x):
        square_of_sum = torch.sum(self.embedding(x), dim=1) ** 2
        sum_of_square = torch.sum(self.embedding(x) ** 2, dim=1)
        interaction_term = 0.5 * torch.sum(square_of_sum - sum_of_square, dim=1, keepdim=True)
        linear_term = self.linear(x)
        output = interaction_term + linear_term
        return output.squeeze()

num_features = 1000
embedding_dim = 50
model = FactorizationMachine(num_features, embedding_dim)

# Training loop
criterion = nn.MSELoss()
optimizer = torch.optim.SGD(model.parameters(), lr=0.01)

for epoch in range(10):
    # Forward pass
    x = torch.tensor([...])  # Input features
    y = torch.tensor([...])  # Target ratings
    
    predicted_ratings = model(x)
    loss = criterion(predicted_ratings, y)
    
    # Backward pass and optimization
    optimizer.zero_grad()
    loss.backward()
    optimizer.step()

These are just a few examples of the mathematical techniques and algorithms used in recommendation systems.

Other notable approaches include:

  • Bayesian Personalized Ranking (BPR)

  • Alternating Least Squares (ALS)

  • Gradient Boosting Machines (GBM)

  • Recurrent Neural Networks (RNNs) for sequential recommendations

  • Graph-based methods like GraphSAGE and LightGCN

The choice of technique depends on the specific requirements of the recommendation system, such as the type of data available, the scalability needs, and the desired level of personalisation.

Hybrid approaches that combine multiple techniques are also common to leverage the strengths of different methods.

The future of recommendation systems

Large Language Models (LLMs) have opened up new possibilities for developing more effective and user-centric recommendation systems.

By leveraging the power of LLMs and considering recommendation as an instruction following task, we can create models that better understand and cater to users' diverse preferences and needs.

The key idea behind LLM-based recommendation models is to express user preferences or needs in natural language descriptions, referred to as instructions.

By understanding and executing these instructions, LLMs can provide more accurate and personalised recommendations.

The process typically involves two main components

User Interaction with the LLM

  • The user engages in a friendly conversation with the LLM, which asks questions to gather information about the user's interests, preferences, and specific requirements.

  • The LLM uses its natural language understanding capabilities to capture the nuances and details of the user's needs, building a comprehensive user profile.

  • Through this interactive dialogue, the LLM gains a deep understanding of what the user is looking for, including their taste preferences, immediate demands, and contextual information.

Retrieval Augmented Generation with a Vector Database

  • Once the LLM has a clear understanding of the user's preferences, it leverages a technique called Retrieval Augmented Generation (RAG) to access a vector database and retrieve relevant recommendations.

  • The vector database is a crucial component of the system, as it contains embeddings of user preferences and relevant products or services.

  • These embeddings are created using a fine-tuned embedding engine that has been trained on hundreds of thousands of instruction sets, capturing the semantic relationships between user preferences and items.

  • When the LLM receives the user's instructions, it uses the vector database to find the most similar items based on the user's expressed preferences.

  • The LLM generates a query based on the user's instructions and performs a similarity search in the vector database to retrieve the most relevant recommendations.

By combining the power of LLMs in understanding user preferences and the ability to retrieve relevant items from a well-structured vector database, LLM-based recommendation models can address the traditional constraints of recommendation systems in the following ways:

Lack of standardised catalogues

  • The LLM's ability to understand and interpret natural language instructions allows it to handle diverse and unstructured item descriptions provided by users, even in the absence of a standardised catalogue

  • By engaging in a conversation with the user, the LLM can gather specific details about the desired items or experiences and map them to the most relevant options in the vector database.

Subjectivity

  • Through interactive questioning, the LLM can go deeper into the user's subjective preferences, going beyond simple ratings or reviews.

  • The LLM can ask follow-up questions to clarify the user's opinions, sentiments, and priorities, capturing a more nuanced understanding of their individual tastes.

  • This rich user profile can then be used to query the vector database and find items that align closely with the user's subjective preferences.

Not enough historical data

  • The conversational nature of the LLM-based recommendation system allows it to gather valuable information about the user's preferences, even in the absence of extensive historical data.

  • By asking targeted questions and leveraging its pre-trained knowledge, the LLM can infer the user's interests and match them with relevant items in the vector database.

  • The fine-tuned embeddings in the vector database, based on a large number of instruction sets, enable accurate recommendations even for new users or items with limited data.

Bias towards popular items

  • The LLM can be designed to ask questions that explore the user's interest in both popular and niche items, ensuring a balanced understanding of their preferences.

  • By leveraging the diverse and balanced datasets used to fine-tune the LLM and create the vector database, the recommendation system can provide exposure to a wide range of items, mitigating the bias towards only popular ones.

  • The LLM can also be trained to generate recommendations that consider fairness and diversity, promoting a mix of popular and lesser-known items that cater to the user's specific interests.

Evaluation

  • The LLM can engage in a dialogue with the user to gather feedback on the recommended items, allowing for a more interactive and user-centric evaluation process.

  • By asking the user to provide opinions, ratings, or specific feedback on the recommendations, the LLM can gain valuable insights into the quality and relevance of the suggestions.

  • This conversational evaluation approach enables a more comprehensive assessment of the recommendation system's performance, going beyond traditional metrics and incorporating user satisfaction and perceived value.

Context Sensitivity

  • During the conversation, the LLM can inquire about the user's current context, such as their location, time constraints, or specific needs at the moment.

  • By understanding the contextual factors, the LLM can tailor its queries to the vector database, retrieving recommendations that are not only relevant to the user's preferences but also appropriate for their current situation.

  • The LLM's ability to process and reason about context allows for dynamic and context-aware recommendations that adapt to the user's evolving needs.

Preferences evolve

  • The LLM-based recommendation system can regularly engage in conversations with the user to capture any changes in their preferences over time.

  • Through these interactive dialogues, the LLM can identify shifts in the user's interests, tastes, or priorities and update its understanding accordingly.

  • The LLM can then use this updated user profile to query the vector database and retrieve recommendations that reflect the user's evolving preferences, ensuring the suggestions remain relevant and personalised.

Lack of personalization

  • The conversational nature of the LLM allows for a highly personalised recommendation experience, as it can gather specific details about the user's individual preferences, past experiences, and unique needs.

  • By asking follow-up questions and seeking clarification, the LLM can build a comprehensive user profile that captures the nuances of their tastes and interests.

  • This rich user profile can be used to query the vector database and retrieve highly personalized recommendations that cater to the user's specific desires and requirements.

Lack of human touch

  • The LLM's ability to engage in natural, friendly conversations mimics the interaction with a human curator or salesperson, adding a human-like touch to the recommendation process.

  • Through its language generation capabilities, the LLM can provide engaging explanations, highlight unique selling points, and create compelling narratives around the recommended items, enhancing the user experience.

  • By simulating a human-like interaction, the LLM can build rapport with the user, fostering trust and increasing the likelihood of the user accepting and appreciating the recommendations.

The combination of a fine-tuned LLM for user interaction and a vector database mapped with user preferences and relevant products/services creates a powerful recommendation system that addresses the limitations of traditional approaches.

By leveraging the LLM's conversational abilities, natural language understanding, and access to the rich vector database, this system can provide highly personalised, context-aware, and engaging recommendations that cater to the unique needs and preferences of each user.

Page cover image