How knowledge graphs improve generative AI

knowledge graph

 

The initial buzz and trepidation surrounding ChatGPT have begun to subside. However, this raises important questions for enterprises: Is this just a passing trend to be overlooked, or a potent tool that demands adoption? If it’s the latter, what’s the most secure approach to embracing it? ChatGPT, a form of generative AI, represents one facet of the broader concept of large language models (LLMs). While LLMs are here to stay and offer significant potential, they are not a one-size-fits-all solution for business processes. Leveraging the benefits of LLMs requires effort and consideration due to several associated challenges. Let’s understand how knowledge graphs improve generative AI in this article.

These challenges include issues like hallucinations, the high costs linked to training and scaling, the complexity of updates and maintenance, inherent inconsistencies, audit difficulties, and the predominance of English language content. Furthermore, LLMs may struggle with reasoning and often require precise prompts for accurate responses. To address these challenges, integrating a knowledge graph can be a powerful solution.

A knowledge graph is an information-rich structure that represents entities and their relationships, offering a transparent view of data. It allows users to query data patterns, apply graph algorithms, and unlock valuable insights. When combined with LLMs, four emerging patterns become evident:

1. Using an LLM to create a knowledge graph: LLMs process extensive text data and generate a knowledge graph, which can be curated and inspected for reliability and compliance, especially in regulated industries.

2. Training LLMs with a knowledge graph: LLMs can be exclusively trained on a specific knowledge graph, resulting in chatbots and AI models tailored to a company’s products and services.

3. Enriching LLM interactions with a knowledge graph: Messages sent to and received from LLMs can be enhanced with data from the knowledge graph, enabling deeper insights and more accurate responses.

4. Improving AI with knowledge graphs: Research shows that enhancing LLMs with a “critic” AI can create a knowledge graph for better downstream AI training, leading to smaller and more accurate models.

This approach of integrating LLMs with knowledge graphs holds promise for making complex content more accessible and understandable, addressing challenges related to generative AI, and delivering trusted and precise solutions. Organizations in various domains, from biotech to energy and publishing, are exploring the synergy of LLMs and knowledge graphs to realize the full potential of generative AI. This partnership offers a path toward high accuracy and correctness, as emphasized in a Gartner report on AI design patterns for knowledge graphs and generative AI.

The integration of LLMs and knowledge graphs seems like a powerful and harmonious alliance, promising a future where generative AI is not only innovative but also highly reliable.

The initial surge of excitement and apprehension surrounding ChatGPT is waning. The problem is, where does that leave the enterprise? Is this a passing trend that can safely be ignored or a powerful tool that needs to be embraced? And if the latter, what’s the most secure approach to its adoption?

ChatGPT, a form of generative AI, represents just a single manifestation of the broader concept of large language models (LLMs). LLMs are an important technology that’s here to stay, but they’re not a plug-and-play solution for your business processes. Achieving benefits from them requires some work on your part.

This is because, despite the immense potential of LLMs, they come with a range of challenges. These challenges include issues such as hallucinations, the high costs associated with training and scaling, the complexity of addressing and updating them, their inherent inconsistency, the difficulty of conducting audits and providing explanations, and the predominance of English language content.

There are also other factors like the fact that LLMs are poor at reasoning and need careful prompting for correct answers. All of these issues can be minimized by supporting your new internal corpus-based LLM by a knowledge graph.

Generative AI is a fascinating field, but it’s often surrounded by jargon and technical terminology that can be challenging to navigate. To help demystify this language, let’s explore some of the key terms and concepts commonly associated with generative AI:

  1. Generative AI: Generative AI refers to systems or models that can generate new content, such as text, images, or even music, based on patterns and examples in the data they have been trained on.
  2. GANs (Generative Adversarial Networks): GANs are a class of generative models that consist of two neural networks, a generator, and a discriminator, which compete with each other. The generator creates data, and the discriminator evaluates its authenticity. This adversarial process helps the generator produce increasingly realistic content.
  3. Language Models: Language models, like GPT-3 (Generative Pre-trained Transformer 3), are neural networks trained to understand and generate human-like text. They are used for tasks like language translation, text generation, and chatbots.
  4. Chatbots: Chatbots are AI programs that can engage in human-like conversations. Generative chatbots use language models to generate text-based responses.
  5. Fine-tuning: Fine-tuning is the process of taking a pre-trained model and adapting it to perform specific tasks or generate content in a particular style. It involves training the model on a narrower dataset.
  6. Inference: Inference refers to the process of using a trained AI model to generate predictions or generate content based on input data.
  7. Prompt Engineering: Prompt engineering involves crafting specific input prompts to elicit desired responses from a generative model. It’s a critical skill when using language models like GPT-3.
  8. Transfer Learning: Transfer learning is a machine learning technique where a model trained for one task is adapted for a different but related task. Pre-trained language models often use transfer learning to perform various natural language processing tasks.
  9. Natural Language Processing (NLP): NLP is a subfield of AI that focuses on the interaction between computers and human language. Generative AI often utilizes NLP techniques to understand and generate human-like text.
  10. Overfitting: Overfitting occurs when a model becomes too specialized in its training data and performs poorly on new, unseen data. It’s essential to prevent overfitting when training generative models.
  11. Bias: Generative AI models can inherit biases present in their training data, which can lead to biased or politically incorrect outputs. Addressing bias in AI is an ongoing challenge.
  12. Hyperparameters: Hyperparameters are parameters set before training a model. They influence the model’s architecture and learning process.
  13. Transformer Architecture: The Transformer architecture is a deep learning model architecture used in many state-of-the-art language models. It’s known for its parallelism and scalability, making it suitable for large-scale generative tasks.
  14. Inference Time: Inference time refers to the time it takes for an AI model to generate a response or make predictions once it’s trained. Faster inference is crucial for real-time applications.
  15. Decoding Strategies: Decoding strategies involve different methods for generating content from AI models, such as greedy decoding, beam search, and nucleus sampling.
  16. Zero-shot Learning: Zero-shot learning is a capability where a model can provide responses or perform tasks it hasn’t been explicitly trained for. Some generative models, like GPT-3, exhibit zero-shot learning.

Generative AI is a dynamic field with ongoing advancements, and understanding the associated jargon is essential for harnessing the full potential of these models while being aware of their limitations and ethical considerations.

A knowledge graph is a powerful data structure and representation model used in the field of artificial intelligence and data management. It serves as a way to organize and connect information in a structured and semantically meaningful manner. Here’s a breakdown of what a knowledge graph is and why it’s essential:

  1. Graph Structure: At its core, a knowledge graph is structured as a graph, which consists of nodes and edges. Nodes represent entities or concepts, while edges define relationships between these entities. This structure makes it easy to represent and understand complex relationships in data.
  2. Entities and Relationships: In a knowledge graph, entities can represent anything from people, places, and things to abstract concepts, such as events or ideas. Relationships define how these entities are connected. For example, in a knowledge graph about movies, an entity might be “Tom Hanks,” and a relationship could be “acted in” connecting him to the movie “Forrest Gump.”
  3. Semantic Meaning: Unlike traditional databases that store data in tables, a knowledge graph adds semantic meaning to data. This means that the relationships between entities are not just arbitrary connections but have specific meanings. For instance, the relationship “directed” between a director and a movie has a clear semantic interpretation.
  4. Linked Data: Knowledge graphs often embrace linked data principles, which promote connecting data across the internet. This allows knowledge graphs to extend beyond a single dataset and incorporate data from various sources, making them more comprehensive and valuable.
  5. Interoperability: Knowledge graphs are designed for interoperability. This means that they can be easily integrated with other systems, databases, and applications. This feature is crucial for sharing and using knowledge effectively.
  6. Query and Exploration: Users can query a knowledge graph to retrieve specific information or explore relationships between entities. This makes it a valuable tool for search, recommendation systems, and data exploration.
  7. Machine Learning and AI: Knowledge graphs are often used in conjunction with machine learning and AI algorithms to make sense of data, extract insights, and provide intelligent responses. This integration enhances the capabilities of AI systems.
  8. Applications: Knowledge graphs find applications in various domains, including healthcare, finance, e-commerce, and content recommendation. They power chatbots, recommendation engines, data integration, and more.
  9. Semantic Web: Knowledge graphs are closely related to the concept of the Semantic Web, where data is not only machine-readable but also semantically meaningful. The goal is to enable machines to understand and process data in a way that mimics human understanding.
  10. Example: A practical example of a knowledge graph is Wikidata, which serves as a central knowledge base for structured data. It connects a vast amount of information about the world, including people, places, scientific concepts, and historical events.

In a nutshell, a knowledge graph is a structured and interconnected model for representing and leveraging knowledge. It enhances data understanding, supports AI applications, and fosters interoperability between systems and datasets, making it a valuable tool in the era of data-driven decision-making and artificial intelligence.

The power of knowledge graphs

A knowledge graph is an information-rich structure that provides a view of entities and how they interrelate. For example, Rishi Sunak holds the office of prime minister of the UK. Rishi Sunak and the UK are entities, and holding the office of prime minister is how they relate. We can express these identities and relationships as a network of assertable facts with a graph of what we know.

Having built a knowledge graph, you not only can query it for patterns, such as “Who are the members of Rishi Sunak’s cabinet,” but you can also compute over the graph using graph algorithms and graph data science. With this additional tooling, you can ask sophisticated questions about the nature of the whole graph of many billions of elements, not just a subgraph. Now you can ask questions like “Who are the members of the Sunak government not in the cabinet who wield the most influence?”

Expressing these relationships as a graph can uncover facts that were previously obscured and lead to valuable insights. You can even generate embeddings from this graph (encompassing both its data and its structure) that can be used in machine learning pipelines or as an integration point to LLMs.

Using knowledge graphs with large language models

But a knowledge graph is only half the story. LLMs are the other half, and we need to understand how to make these work together. We see four patterns emerging:

  1. Use an LLM to create a knowledge graph.
  2. Use a knowledge graph to train an LLM.
  3. Use a knowledge graph on the interaction path with an LLM to enrich queries and responses.
  4. Use knowledge graphs to create better models.

In the first pattern we use the natural language processing features of LLMs to process a huge corpus of text data (e.g. from the web or journals). We then ask the LLM (which is opaque) to produce a knowledge graph (which is transparent). The knowledge graph can be inspected, QA’d, and curated. Importantly for regulated industries like pharmaceuticals, the knowledge graph is explicit and deterministic about its answers in a way that LLMs are not.

In the second pattern we do the opposite. Instead of training LLMs on a large general corpus, we train them exclusively on our existing knowledge graph. Now we can build chatbots that are very skilled with respect to our products and services and that answer without hallucination.

In the third pattern we intercept messages going to and from the LLM and enrich them with data from our knowledge graph. For example, “Show me the latest five films with actors I like” cannot be answered by the LLM alone, but it can be enriched by exploring a movie knowledge graph for popular films and their actors that can then be used to enrich the prompt given to the LLM. Similarly, on the way back from the LLM, we can take embeddings and resolve them against the knowledge graph to provide deeper insight to the caller.

The fourth pattern is about making better AIs with knowledge graphs. Here interesting research from Yejen Choi at the University of Washington shows the best way forward. In her team’s work, an LLM is enriched by a secondary, smaller AI called a “critic.” This AI looks for reasoning errors in the responses of the LLM, and in doing so creates a knowledge graph for downstream consumption by another training process that creates a “student” model. The student model is smaller and more accurate than the original LLM on many benchmarks because it never learns factual inaccuracies or inconsistent answers to questions.

Understanding Earth’s biodiversity using knowledge graphs

It’s important to remind ourselves of why we are doing this work with ChatGPT-like tools. Using generative AI can help knowledge workers and specialists to execute natural language queries they want answered without having to understand and interpret a query language or build multi-layered APIs. This has the potential to increase efficiency and allow employees to focus their time and energy on more pertinent tasks.

Take Basecamp Research, a UK-based biotech firm that is mapping Earth’s biodiversity and trying to ethically support bringing new solutions from nature into the market. To do so it has built the planet’s largest natural biodiversity knowledge graph, BaseGraph, which has more than four billion relationships.

The dataset is feeding a lot of other innovative projects. One is protein design, where the team is utilizing a large language model fronted by a ChatGPT-style model for enzyme sequence generation called ZymCtrl. Purpose-built for generative AI, Basecamp is now wrapping increasingly more LLMs around its entire knowledge graph. The firm is upgrading BaseGraph to a fully LLM-augmented knowledge graph in just the way I’ve been describing.

Making complex content more findable, accessible, and explainable

Pioneering as Basecamp Research’s work is, it’s not alone in exploring the LLM-knowledge graph combination. A household-name global energy company is using knowledge graphs with ChatGPT in the cloud for its enterprise knowledge hub. The next step is to deliver generative AI-powered cognitive services to thousands of employees across its legal, engineering, and other departments.

To take one more example, a global publisher is readying a generative AI tool trained on knowledge graphs that will make a huge wealth of complex academic content more findable, accessible, and explainable to research customers using pure natural language.

What’s noteworthy about this latter project is that it aligns perfectly with our earlier discussion: translating hugely complex ideas into accessible, intuitive, real-world language, enabling interactions and collaborations. In doing so, it empowers us to tackle substantial challenges with precision, and in ways that people trust.

It’s becoming increasingly clear that by training an LLM on a knowledge graph’s curated, high-quality, structured data, the gamut of challenges associated with ChatGPT will be addressed, and the prizes you are seeking from generative AI will be easier to realize. A June Gartner report, AI Design Patterns for Knowledge Graphs and Generative AI, underscores this notion, emphasizing that knowledge graphs offer an ideal partner to an LLM, where high levels of accuracy and correctness are a requirement.

[ad_2]

Read more:

Louis Jones

Louis Jones

Leave a Reply

Your email address will not be published. Required fields are marked *