by magicalhippo · 1y ago · 0 comments
Words in sentences kinda forms graphs, referencing other words or are leafs being referenced, both inside sentences and between sentences.
Given the success of the attention mechanism in modern LLMs, how well would they do if you trained a LLM to process an actual graph?
I guess you'd need some alternate tokenizer for optimal performance.
Imagine you discretize a cube into 1000 gridpoints in each direction, that's 1000^3 = 1 billion nodes/"tokens". Plus you typically time-march some sort of equation so you need the solutions previous 3-5 timesteps as well so that's 3-5 billion tokens. If you are gonna do that in the first place, you may as well just use the traditional solver. Traditional solvers usually set up and solve a matrix equation like Ax=b with an iterative method like multigrid which is O(n) as opposed to transformer's O(n^2). It'll give you a much more accurate answer much quicker than it'll take a transformer to do attention on a sequence of length 3 billion.
The entire point of using GNNs/CNNs in this field is that people rely on their ability to make inference using local information. That means the value at each gridpoint/node can be inferred from neighbouring nodes only, which is O(n) like multigrid. Idea in most papers is that the GNN can do this faster than multigrid. Results so far are mixed, however [1].
There are also graph tokenizers for using more standard transformers on graphs for doing things like classification, generation, and community detection.
For (a), any imperfections in the graphification make the problem super hard and researchy.