Colorful Talks with Graphs: Human-Interpretable Graph Encodings for Large Language Models

Angelo Zangari, Peyman Baghershahi, Sourav Medya
2/11/2026
cs.LG

No confident code implementation found for this paper.

Abstract

Graph problems are fundamentally challenging for large language models (LLMs). While LLMs excel at processing unstructured text, graph tasks require reasoning over explicit structure, permutation invariance, and computationally complex relationships, creating a mismatch with the representations of text-based models.

Show full abstract

Our work investigates how LLMs can be effectively applied to graph problems despite these barriers. We introduce a human-interpretable structural encoding strategy for graph-to-text translation that injects graph structure directly into natural language prompts. Our method involves computing a variant of Weisfeiler-Lehman (WL) similarity classes and maps them to human-like color tokens rather than numeric labels. The key insight is that semantically meaningful and human-interpretable cues may be more effectively processed by LLMs than opaque symbolic encoding. Experimental results on multiple algorithmic and predictive graph tasks show the considerable improvements by our method on both synthetic and real-world datasets. By capturing both local and global-range dependencies, our method enhances LLM performance especially on graph tasks that require reasoning over global graph structure.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{zangari2026colorful,
  title  = {Colorful Talks with Graphs: Human-Interpretable Graph Encodings for Large Language Models},
  author = {Angelo Zangari and Peyman Baghershahi and Sourav Medya},
  year   = {2026},
  eprint = {2602.10386},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2602.10386v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2602.10386.svg)](https://codeofpaper.com/paper/2602.10386)

Discussion