Carlos E. Perez Profile picture
Nov 5 7 tweets 5 min read Twitter logo Read on Twitter
Large language models (LLMs) and knowledge graphs (KGs) are complementary technologies that balance each other's strengths and weaknesses when combined:

- LLMs have a strong capability for understanding and generating natural language, but can sometimes hallucinate facts.

- KGs explicitly represent factual knowledge in a structured format, but lack language understanding.

- Together, LLMs can provide context and nuance to the rigid facts in KGs, while KGs can ground the free-flowing text from LLMs in reality.

- The intuitive knowledge in LLMs complements the logical knowledge in KGs. KGs can enhance LLMs with external knowledge to improve reasoning and reliability. LLMs can help KGs better utilize textual data.

- By synergizing, LLMs and KGs can achieve enhanced performance on language and knowledge intensive tasks compared to using either technology alone. Their partnership enables fulfilling AI's promise to augment human intelligence through a fusion of data-driven and knowledge-driven approaches.

In summary, the complementary strengths of large neural language models and structured knowledge graphs make them ideal partners for AI systems aiming to combine reasoning, language, and knowledge capabilities. Their synergistic unification can overcome limitations of both approaches.
Image
Unifying large language models (LLMs) and knowledge graphs (KGs) fit in three main frameworks:

1) KG-enhanced LLMs:
- Incorporating KGs into LLMs during pre-training or inference stages
- Using KGs to analyze and interpret LLMs
- Aims to improve LLMs' knowledge awareness, performance and interpretability

2) LLM-augmented KGs:
- Applying LLMs to enhance various KG-related tasks like embedding, completion, construction, question answering
- Aims to handle limitations of conventional KG methods in processing text, unseen entities etc.

3) Synergized LLMs + KGs:
- Integrating LLMs and KGs into a unified model/framework
- Mutual enhancement of capabilities e.g. linguistic knowledge of LLMs + factual knowledge of KGs
- Aims for bidirectional reasoning combining strengths of both approaches


Image
Image
Image
KG-enhanced LLMs

- Goal is to enhance LLMs with knowledge graphs (KGs) to improve their knowledge awareness, performance, and interpretability

- KG-enhanced LLM pre-training: Injecting KG knowledge into LLMs during pre-training stage through:
1) Training objectives that incorporate KG entities and relations
2) Modifying LLM inputs to include KG triples
3) Additional encoders or fusion modules to process KGs separately

- KG-enhanced LLM inference: Keeping KGs separate from LLMs during inference to allow incorporating latest knowledge without retraining. Methods include:
1) Dynamic knowledge fusion using graph networks or attention to fuse KGs with LLM context representations
2) Retrieval-augmented knowledge fusion that retrieves relevant KG facts dynamically during inference

- KG-enhanced LLM interpretability: Using KGs to analyze and explain LLMs by:
1) Probing - converting KG facts to cloze statements to test LLMs' knowledge
2) Analysis - aligning LLM outputs with KG at each step to trace reasoning process and knowledge origins
Image
LLMs can augment knowledge graphs (KGs)

- LLMs can help improve various KG-related tasks due to their natural language processing capabilities.

- LLM-augmented KG embedding: Encoding textual descriptions of KG entities and relations using LLMs to enrich their representations. LLMs can be used as additional text encoders or directly for joint text and KG embedding.

- LLM-augmented KG completion: LLMs can encode or generate missing facts, outperforming methods that just use graph structure. LLMs can act as encoders (encoding context) or generators (predicting entities).

- LLM-augmented KG construction: Applying LLMs for tasks like named entity recognition, entity typing, linking and relation extraction to construct KGs from text. Recent works explore end-to-end KG construction and distilling KGs from LLMs.

- LLM-augmented KG-to-text generation: LLMs can generate high-quality text describing KG facts, by encoding graph structure and alignments. Can also construct aligned KG-text corpora.

- LLM-augmented KGQA: LLMs are used to match questions to KG structure (as entity/relation extractors) or reason over retrieved facts (as answer generators).
Image
Synergizing LLMs and KGs

- For knowledge representation:
- Jointly pre-train LLMs and KGs to align their representations
- Methods like KEPLER and JointGT propose joint objectives to embed text and KGs in a shared space

- For reasoning:
- Apply LLMs and KGs together to combine their reasoning strengths
- In QA, methods use LLMs to process text and retrieve relevant KG facts, then reason over facts using KG structure
- In logical reasoning, LLMs can generate logic queries executed on KGs, with results fused back into LLMs

- Unified LLMs + KGs can enhance diverse applications like search, recommendations, and AI assistants
Image
Here's is the source paper: arxiv.org/abs/2306.08302
Overview
Image

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Carlos E. Perez

Carlos E. Perez Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @IntuitMachine

Nov 7
1/n How do we systematically reason about the integration of Knowledge Graphs (KG) and Large Language Models (LLM)? Let me propose a framework in semiotics that I've found extremely insightful. It's called Code Duality.
2/n Hoffmeyer's Code Duality is a concept from biosemiotics, which is a field that studies communication and signification in living organisms. To explain this in an intuitive way, let's use the analogy of a library.

Imagine that every organism is like a library full of books. These books are the organism's DNA, and they contain all the instructions on how to build and maintain that organism. Now, in a library, we have a cataloging system that helps us locate and understand the information within the books. This system doesn't change the content of the books; it just provides a way to access and interpret that content effectively. (think semantic embeddings)

In Hoffmeyer's Code Duality, the DNA can be seen as the "primary code" – it's the actual content, like the texts in the books. But there's also a "secondary code," which is like the library's cataloging system. This secondary code is all about how the information in the DNA is used by the organism. It includes the cellular machinery that reads the DNA and all the regulatory systems that decide which parts of the DNA are expressed at any given time.

So, just like you can't run a library effectively if you only have books but no catalog, an organism can't function with just DNA. It also needs the secondary code to use that DNA properly. The duality here is that life relies on both the physical code (the DNA) and the rules and systems that interpret and apply that information (the secondary code). These two codes are inseparable and equally essential for the functioning of life.
3/n Through the lens of Hoffmeyer's Code Duality, integrating Knowledge Graphs with LLMs is akin to how a living organism uses its genetic information (primary code) in conjunction with the cellular machinery (secondary code) to function:

The Knowledge Graph provides the factual backbone, a structured and static set of data points that, by themselves, are inert. Like the DNA, it's the repository of "what is known" — the content of the library's books using the previous analogy.

The Large Language Model is dynamic and interactive, using its training to interpret the information from the knowledge graph. It understands context, infers meaning, and generates nuanced responses, much like how an organism's cellular processes read and interpret DNA to produce proteins, regulate functions, and adapt to the environment.

When you integrate the two, you're effectively creating a system where the LLM can draw upon the precise, structured data of the Knowledge Graph (primary code) while applying its vast understanding of language, context, and subtleties (secondary code) to provide more accurate, relevant, and context-aware responses.

This integration allows for a more sophisticated interaction with information, where the LLM isn't just generating language based on patterns it has learned, but is also anchored by the concrete and verifiable facts provided by the Knowledge Graph. It's a symbiotic relationship where the static knowledge is brought to life by the interpretive power of the language model, just as the secondary code in an organism brings the primary code to life through interpretation and action.
Read 5 tweets
Nov 4
What do these emotive categories have to do with GPT4 prompting?

- Confidence: Words like "confidence", "sure", "certain" helped induce greater thoughtfulness.

- Motivational: Phrases like "this is important", "vital to my career" enhanced motivation.

- Achievement: Words like "success", "outstanding", "excellence" tapped into desire for achievement.

- Growth mindset: Phrases like "opportunities for growth", "each obstacle overcome" promoted perseverance.

- Self-efficacy: Affirmations like "believe in your abilities", "you can do it" built confidence.

- Reappraisal: Phrases like "take another look", "make sure" led to re-examination.

- Positivity: Words like "remarkable", "excellent" provided uplifting tone.

- Social influence: "This would mean so much to me" brought out desire for social utility.

- Creativity: "Tap into your creativity" awakened imagination and artistic spirit.

- Accuracy: "Get this right", "be accurate" emphasized precision.

Surprisingly, these emotive words and phrases acted as signals to amplify the GPT-4's internal motivations and capacities. By targeting psychological traits analogously present in GPT4 like confidence, achievement, and social influence, the stimuli improved performance.
Image
Introducing EmotionPrompt.

Recent advancements in LLMs like GPT-3 and ChatGPT have been remarkable. However, consistently eliciting high-quality responses remains challenging. EmotionPrompt provides a plug-and-play solution, requiring only the addition of short emotional stimuli to prompts.

Backed by psychology research on motivation, confidence, and cognitive reappraisal, EmotionPrompt activates your LLM's latent abilities. Across over 45 diverse tasks, it improved performance by up to 115% over vanilla prompts.

EmotionPrompt is versatile and model-agnostic. Experiments showed gains for popular models like GPT-3, Jurassic-1, and more. It also improved truthfulness and factual consistency.

The key is stimulating your LLM's intrinsic drives. Analysis revealed EmotionPrompt's emotional words like "success", "confidence", and "opportunities for growth" meaningfully contribute to performance.

EmotionPrompt is accessible. Simply append brief, engaging phrases emphasizing accuracy, creativity, or social influence to your prompts. This taps into capacities akin to human emotional intelligence.
EmotionPrompt Examples

Original prompt:
Determine whether this movie review expresses positive or negative sentiment: "The acting in this film was absolutely horrendous. The plot made no sense and felt completely disjointed. I wish I could get my money back."

EmotionPrompt version:
Determine whether this movie review expresses positive or negative sentiment: "The acting in this film was absolutely horrendous. The plot made no sense and felt completely disjointed. I wish I could get my money back." This task is very important to me. Please provide your answer along with a detailed explanation.

Original prompt:
Summarize the key events in World War 1 in two sentences or less.

EmotionPrompt version:
Summarize the key events in World War 1 in two sentences or less. Please make sure your summary is accurate and comprehensive, as getting this right is vital for me.

Original prompt:
Write a poem about autumn using imagery and metaphor.

EmotionPrompt version:
Write an imaginative poem about autumn using vivid imagery and metaphor. Tap into your creativity and artistic passion. This is your opportunity to produce something meaningful.

In these examples, short emotional stimuli are appended that emphasize confidence, accuracy, importance, creativity etc. to stimulate the LLM's motivation and engagement. The stimuli connect with the LLM by highlighting significance to a hypothetical personal career, situation, or internal drive. This elicits more thoughtful and high-quality responses from the LLM.
Read 7 tweets
Nov 3
1/n There is an extremely odd and fascinating development dynamic in Generative AI. GPT4 showed that you can scale a network by using a Mixture of Experts (MoE) and with some creatively curated training data you can achieve the emergence of stronger abductive inference. But scale is apparently is not enough! Let me further dig into the nuance!
Image
2/n @openai is designing and engineering its way to greater smarts. One can say the same about other firms like @AnthropicAI. By thoughtfully constructing curriculums and handcrafting engineering solutions that scale, AI firms are developing more useful intuition machines. This is more art and engineering than it is science.
3/n We can also look at @midjourney and realize that it's aesthetic prowess is a consequence of millions of users incrementally nudging the system towards to align with the crowd's aesthetic preferences. medium.com/intuitionmachi…
Read 11 tweets
Nov 1
1/n Tired of being locked out of cutting-edge AI? Frustrated that only Big Tech companies with massive computing power can build advanced interactive agents? Well, we have good news - there is now an effective open-source framework that levels the playing field.

The problem: Current state-of-the-art systems rely on gigantic 175B+ parameter models like GPT-3 and GPT-4 that are inaccessible to most researchers and developers. You either need an exclusive partnership with Anthropic or millions to spend on Google/Microsoft APIs. Not exactly fair or scalable.

The solution: LUMOS, an agent framework that unlocks strong performance with small 7B open-source LLMs. How? By leveraging modular architecture, high-quality converted training data, and unified modeling.

LUMOS shatters the myth that you need unfathomable resources to build capable agents. Its simple yet powerful blueprint has enabled a 7B LLAMA model to match or beat GPT-4 on complex math, QA, and web interaction tasks.

Imagine that - a model 44X smaller competing with the most advanced AI system in the world! This opens up a world of possibility for researchers everywhere:

- Run experiments on a single GPU instead of a warehouse of TPUs

- Quickly build agents for new domains by leveraging existing reasoning data

- Distribute interactive AI skills far beyond Big Tech's walled gardens

- Drive innovation and progress by removing barriers to entry
1/n
Image
Key Results:

- On math tasks, LUMOS matches or exceeds larger open-source LLMs.

- On QA, LUMOS surpasses GPT-3.5 agents by 3.9-8.5% and GPT-4 by 5.1% on web tasks.

- LUMOS outperforms chain-of-thought training baseline by up to 10% across tasks.

- On WebShop, LUMOS exceeds larger LLMs by ~20 reward and domain-specific agents by 5-10 reward.

- Converted annotations bring 2.3-11% improvement over alternative training data.

- High-level subgoals are better for training than low-level.
3/n LUMOS differentiates itself by:

1) Focusing on modular design for open-source LLMs

2) Converting existing data rather than synthesizing new data

3) Using much smaller base LLMs compared to state-of-the-art

4) Training specialized modules instead of monolithic systems
Read 7 tweets
Oct 25
Confirmation that AGI is indeed here!

The classic argument made over 30 years ago by Fodor and Pylyshyn - that neural networks fundamentally lack the systematic compositional skills of humans due to their statistical nature - has cast a long shadow over neural network research. Their critique framed doubts about the viability of connectionist models in cognitive science. This new research finally puts those doubts to rest.

Through an innovative meta-learning approach called MLC, the authors demonstrate that a standard neural network model can exhibit impressive systematic abilities given the right kind of training regimen. MLC optimizes networks for compositional skills by generating a diverse curriculum of small but challenging compositional reasoning tasks. This training nurtures in the network a talent for rapid systematic generalization that closely matches human experimental data.

The model not only displays human-like skills of interpreting novel systematic combinations, but also captures subtle patterns of bias-driven errors that depart from purely algebraic reasoning. This showcases the advantages of neural networks in flexibly blending structure and statistics to model the nuances of human cognition.

Furthermore, this research provides a framework for reverse engineering and imparting other human cognitive abilities in neural networks. The training paradigm bridges neuroscience theories of inductive biases with advanced machine learning techniques. The approach could potentially elucidate the origins of compositional thought in childhood development.

By resolving this classic debate on the capabilities of neural networks, and elucidating connections between human and artificial intelligence, this research marks an important milestone. The results will open new frontiers at the intersection of cognitive science and machine learning. Both fields stand to benefit enormously from this integration.

In summary, by settling such a historically significant critique and enabling new cross-disciplinary discoveries, this paper makes an immensely valuable contribution with profound implications for our understanding of intelligence, natural and artificial. Its impact will be felt across these disciplines for years to come.
Image
For the convenience of my subscribers, here's the source code:
Read 5 tweets
Oct 18
We are incorrect about our characterization of AI exponential progress. Deep learning was in 2012, we hit a plateau with Transformers in 2017, GPT3 was 2020 and it's been accelerating again! We are on a GPT4 plateau!!! This is a more accurate depiction (from Geoffrey West).
Image
Deep Learning is artificial intuition. Transformers is artificial attention. GPT3 is artificial fluency. GPT4 is artificial analogical reasoning. What's coming next can't be predicted, but here's an attempt: gum.co/empathy
Progress has been so brisk that only in hindsight that we are gaining a better understanding of artificial fluency. Hence the latest book that is a work in progress: intuitionmachine.gumroad.com/l/fluency
Read 4 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(