Using Large Language Models to Apply Graph Layout Algorithms

Using Large Language Models to Apply Graph Layout Algorithms

Hello, my name is Saidi Bartramello. Today, I will talk about using large language models, specifically GPT, to apply graph layout algorithms. Last year, I came across a blog post by Jacobrazio, where he described an experiment using GPT to do pathfinding on a graph. The results were impressive, with the majority of solutions being valid and optimal. This sparked my interest in applying language models to my field of graph drawing.

Graph layout algorithms are used to position nodes in a graph on a plane, optimizing criteria such as readability and structure. I wanted to see if I could explain a graph layout algorithm to GPT and have it apply the steps on its own. My objective was to explain the algorithm in natural language and have GPT apply it to a given graph problem.

To test this, we used different methods of prompt engineering, including direct requests, step-by-step instructions, and in-context learning. We selected four tasks: counting crossings, calculating total edge length, rank assignment, and sorting nodes between ranks.

The results showed that GPT was able to correctly solve the tasks, with in-context learning performing the best. However, there are limitations to this approach. GPT is a probabilistic model, so it may not always provide the correct solution. The prompts used to describe the tasks also play a significant role in obtaining accurate results. Additionally, there is a limit to the number of words GPT can process, which restricts the size of the graphs that can be handled.

Despite these limitations, the capabilities of language models are improving rapidly. With advancements in the field, we can expect better results in the future. While GPT may not outperform hand-written code, it can still provide a viable graph drawing solution.

In conclusion, using large language models to apply graph layout algorithms shows promise. Although the results may not be perfect, they are a step towards harnessing the power of AI in graph drawing. As technology continues to advance, we can look forward to even more impressive applications.

Thank you for listening to my talk. If you’re interested, you can find more details and experiments on our website. And now, I leave you with a poem about Sugiyama, one of the most famous graph layout algorithms.

Many thanks, and goodbye.

Introducing the Exciting Features of Stack Post 8.0.6
Older post

Introducing the Exciting Features of Stack Post 8.0.6

Newer post

How to Fix Access Denied Issue on ChatGPT

How to Fix Access Denied Issue on ChatGPT