LLMS Love Graphs
Large language models require your data in a graph; let me try to explain why. Behind the power of large language models is an architecture known as the transformer. The key innovation within this architecture is the so-called attention mechanism. So, what exactly is the transformer paying attention to? The answer is the relationships between words in a sentence. It is the relationship between the words that holds all of the power and the meaning. Here, the key focus is on the relationships; so, what is a relationship?
Let's take the sentence “The cat sat on the mat”. Each word here can be seen as a ‘thing’; we have a ‘cat’, the act of ‘sitting’, and a ‘mat’. The relationships, then, are the connections between these things. Nothing exists in isolation; every ‘thing’ exists in relation to other ‘things’. Thus, we can divide the world into ‘things’ and ‘connections between things’. It is these connections that are the relationships. So, what does this have to do with getting your data into a graph structure?
Currently, most of us think of data in terms of tables. Consider an Excel spreadsheet, where each row represents a ‘thing’. For instance, in a spreadsheet of customers, each row is a customer, and each column records some fact about that customer. This format is great for documenting things but says nothing explicitly about the relationships between them.
Graphs, on the other hand, treat relationships as first-class citizens. Within a graph, things are modelled as nodes, and relationships are modelled as edges. Taking our example from before, we could have a cat with the relationship of sitting on a mat. This simple but radical shift transforms boxy tables into complex networks, making our data more realistic. Graphs are the only data structure that treats relationships as first-class citizens.
This is why large language models will need your data in a graph. As we move into the next phase of AI adoption, where organisations must feed their own data into large language models to realise their benefits, it's crucial to model the relationships explicitly. Large language models thrive on these relationships; that's where the power lies. Therefore, you must incorporate these relationships into your data, and to do this effectively, you need your data in a graph!