Showing posts with label recommender system. Show all posts
Showing posts with label recommender system. Show all posts

Wednesday, 15 January 2025

Pattern Recognition: The Powerhouse Behind LLMs and all Real-Time AI

Real-time applications of Artificial Intelligence (AI) and Machine Learning (ML) are transforming industries, from finance to entertainment. One of the great benefits of this age of Generative AI (large language models and the likes), is that it has opened up people’s imagination. People can now see that many things, almost anything, is and are possible with today’s real-time AI capabilities.
In this article, I would like to show the similarities and therefore analogies between generative AI and two of the most popular applications for real-time AI: real-time fraud detection and real-time recommender systems. While these applications seem distinct, they share some fundamental aspects: recognizing patterns, and then acting on these patterns. Some would joke that fraud detection systems only “recommend that the fraudster is put in jail”. Therefore it is useful to reflect on what that fundamental shared core of these, and many other, use cases actually consists of. In this article, we will argue that pattern recognition is that core.

Pattern recognition is how AI and ML are used to identify trends in historical data, understand these patterns, and then utilize these insights to forecast future behavior. This approach is crucial in both fraud detection and recommender systems, enabling them to deliver real-time, insightful and actionable results. Sometimes the action may be to offer a new previously unknown product to a returning customer (in the case of a recommender system). And sometimes the action may be that all the alarms go off and authorities are notified to forcefully lead the bad guys to a safe place (in the case of a fraud detection system). 

Large language models use Pattern Recognition

Large language models (LLMs) leverage advanced pattern recognition to understand, learn, and generate language. Trained on vast amounts of text data, these models analyze patterns in word usage, sentence structure, context, and relationships between concepts. This training enables them to develop a probabilistic understanding of language, identifying how words and phrases typically interact. 
When faced with a question or prompt, an LLM uses this knowledge to predict the most contextually relevant and coherent response by evaluating patterns similar to those it has encountered during training. By iterating on this process across diverse contexts, LLMs excel at producing nuanced, human-like answers that align with the input’s meaning and intent. In effect, the recognised language pattern is used to predict the most qualitative and accurate responses.

Fighting Fraud with Pattern Recognition

Fraud detection aims to identify and prevent fraudulent transactions or activities. This requires analyzing large historical datasets to spot subtle but repetitive patterns that indicate fraudulent behavior. For instance, an e-commerce platform might analyze user behavior, transaction details, network activity - or even a combination of all of the above - to identify suspicious patterns.

Consider a sudden surge in purchases from a new account using multiple credit cards. This pattern deviates from normal user behavior and raises a red flag for potential fraud. Real-time fraud detection systems leverage pattern recognition to detect such patterns and make instantaneous decisions about blocking new incoming suspicious transactions that display similar patterns as the fraudulent ones that were seen before.



Building Robust Fraud Detection Models Requires:
  • Data Quality: High-quality data is essential for training accurate fraud detection models. This data should accurately reflect user preferences and behaviors.
  • Feature Engineering: Identifying and selecting relevant features that capture fraudulent patterns is crucial. For example, analyzing ratings and their positive/negative rating distributions can help identify suspicious users.
  • Robust Algorithms: Fraud detection models need to be robust to adversarial attacks, where fraudsters try to manipulate the system. Graph representations of the interactions between fraudsters and systems, like a Graph Convolutional Network (GCN) for example, offer a promising approach to learning robust user representations for fraud detection.

Recommending the Perfect Choice with Pattern Recognition

Recommender systems aim to predict user preferences and interests, and will suggest items they might enjoy. This would promote more and more profitable interactions with the provided systems - which could be shopping cart systems, media portals, or other systems that would benefit from a more intimate relationship between the provider and the user. These systems learn from past user interactions, such as purchases, ratings, or browsing history, to identify patterns that indicate user interests.

Imagine a user frequently purchases books in the kids reading book genre and leaves positive reviews for authors with a specific writing style. A simple recommender system can recognize this pattern and recommend other science kids reading books by similar authors. Real-time recommender systems utilize predictive pattern recognition to provide up-to-date suggestions based on the latest user interactions. A sophisticated pattern-based recommender system would learn how specific times and days of the week (eg. mornings just before going to kindergarten, or evenings just before bed), specific computers from which the system would be accessed (eg. home vs. work computers), and real-time stock keeping availability would matter in making the best possible decisions and recommendations.

Effective Recommender Systems Depend on:
  • Understanding User Behavior: Accurately modeling user preferences and interests from historical data is essential.
  • Capturing Contextual Information: Incorporating contextual data, such as time, location, and device, can improve recommendation relevance. For instance, a travel recommender system can use location and weather data to suggest suitable destinations.
  • Exploiting Multimodal Data: Utilizing multimodal data, like text reviews and images, provides a richer understanding of user preferences. Deep learning techniques, particularly Recurrent Neural Networks (RNNs) and Convolutional Neural Networks (CNNs), have proven effective in handling multimodal data.

The Similarities between LLMs, Fraud Detection and Recommender Systems


At the core of both LLMs, real-time fraud detection and recommender systems lies predictive pattern recognition. Both applications rely on analyzing past data, understanding patterns, and leveraging insights to predict future behavior and take action based on that prediction. This shared foundation highlights the versatility and power of this approach.

Consider the similarities:
  • Pattern Recognition: Both applications aim to detect and understand patterns in user behavior and data.
  • Predictive Modeling: Both utilize historical data to predict future actions, whether fraudulent transactions or preferred items.
  • Real-time Analysis: Both operate in real time, analyzing incoming data streams and generating immediate results.

The Hopsworks AI Lakehouse: The Foundation for Real-time Pattern Recognition Systems

Real-time AI pattern recognition applications, like LLMs, fraud detection and recommender systems, thrive on high-quality, readily accessible data. The Hopsworks AI Lakehouse emerges as a powerful solution, enabling organizations to build and deploy these applications efficiently. The Hopsworks AI Lakehouse is the centralized repository for storing, managing, and analyzing data from diverse sources. It integrates the capabilities of a data lake and a machine learning operations (MLOps) platform , providing a unified platform for data-driven AI initiatives.

It seems obvious at this point, but the Hopsworks AI Lakehouse offers significant benefits for Predictive Pattern Recognition applications of all kinds. It offers:
  • Feature Engineering and Model Training: the AI Lakehouse facilitates feature engineering and model training by providing tools for data transformation, feature extraction, and model development.
  • Centralized Data Management: the AI Lakehouse provides a single source of truth for all data, simplifying data access and management for all teams that are developing predictive models
  • Scalability and Performance: the AI Lakehouse is engineered to handle massive data volumes and supports real-time data processing, essential for real-time AI applications.
  • Unified governance: the AI Lakehouse will allow for governance on source data, and provide the required explainability and transparency on the end-result, the predictive pattern recognition system.

Wrapping up

Predictive pattern recognition is a transformative force driving real-time AI applications like LLMs, fraud detection and recommender systems. The Hopsworks AI Lakehouse solution empowers organizations to leverage this power effectively, providing a robust foundation for building and deploying real-time AI solutions.

Hopsworks simplifies the process of:
  • Data Ingestion and Management: Streamline the process of ingesting data from multiple sources and managing it centrally.
  • Feature Engineering: Provide tools for efficient feature extraction and transformation, enabling the creation of powerful predictive models.
  • Model Training and Deployment: Facilitate model training and deployment, making it easier to build and operationalize real-time AI applications.
With the combination of powerful AI algorithms and robust infrastructure, businesses can unlock the full potential of predictive pattern recognition, leading to enhanced security, less fraud, improved user experiences, and increased business value.

I hope this was a useful clarification of how different AI use cases share specific characteristics that are all facilitated by the AI Lakehouse.

Let me know if you would like to discuss!

Cheers

Rik

Friday, 12 June 2020

What Recommender Systems and Contact Tracing have in common

With the Covid-19 pandemic raging in the past few months, I have had a lot of interesting conversations about the use of graph technology and how it could help the world be a better, safer, healthier place. At Neo4j, we even put in place a specific Graphs4Good program, helping out where we can. There's splendid research going on at Covidgraph.org, companies like Elsevier chipping in (and using Neo4j) as well, and I have tried to write up my humble thoughts on how Contact Tracing could really benefit from using graphs as well. See some of my recent posts published on this blog.

Looking at that work, however, I always had a the feeling that I was looking at an excellent example of something else: an excellent example of a great "graph problem". The contact tracing example is a great fit for a tool like Neo4j, and the reason why that is the case is basically because the problem that we are trying to solve with contact tracing (understanding the pandemic spread in our societies, predicting potential evolutions of the pandemic based on contacts between healthy and sick individuals, protecting the healthcare systems by managing the rate of spreading this way) is very much suited for analysis with graph technology. It is a domain where the links between people, the links between people and places, their visits, their meetings are the main important data entities that we need to look at. It's the connections that matter. It's the connections that are becoming the "equal citizens" in the dataset - and therefore we need to spend time and resources analysing it.

But of course I know one thing for sure: there are plenty of other cases that are like that, that are true "graph problems" and that could really benefit from a graph approach to solving it. We know that from all the Neo4j project that we have been running for years. So how do I demonstrate that? How do I show that Contact Tracing is essentially the same thing like a recommendation engine? Or another graph application that we have come to know and love. Let's explore that.

Friday, 17 October 2014

Using graphs for recommendations

Last month the wonderful people of Data Science Brussels invited me to do a talk about HR Analytics and how graphs fit into that. The material is over here. It was a great night, so when Philippe told me that the next meeting was going to be about Data Science in Marketing - I just had to invite myself. So yesterday, I had a the pleasure - again :) - to do a talk at the  about how you could use graphs in Marketing.

The thing that I focussed on was the topic of recommendations and recommender systems. In a world where content is king, and consumers are always looking for specific deals that would fit their profile best, these systems are going to become critically important.

In my mind, these systems always consist of two parts:

  • a Pattern discovery system, where you - somehow - figure out what the patterns are that you are looking for. Could be by asking a domain expert, but could just as well be through some advanced machine learning algorithm. 
  • a Pattern application system, where you start operationalising the patterns that you have found and applying them in real world applications, either in batch, or in near-real-time.

I believe that graphs and graph databases offer tremendous potential for this domain, and have tried to illustrate that in this talk. The key points being that

  • Graphs excel at making these recommendations in real time. No more batch precalculations - just deliver the patterns you uncover as they develop.
  • Graphs benefit from some of the most fascinating data analytics techniques out there: triadic closures, centrality measures, betweenness measures, PageRank scoring - all of which help you determine what parts of the graph really matter, or not.
  • Graphs benefit from some operational advantages (among which: graph locality in your queries) to make them operationally very efficient.
I am sure I am missing stuff here, but these seem to be the most important pieces, to me.

The slides are on SlideShare, and included below:



The demonstration that goes with this was also recorded below. It's a little long, but I hope it's still interesting:

I hope this was a useful illustration for you of this fascinating use case. Any feedback - as always - greatly appreciated.

Cheers

Rik