Actions Speak Louder than Prompts: A Large-Scale Study of LLMs for Graph Inference
Ben Finkelshtein (Microsoft Research), Silviu Cucerzan (Microsoft Research), Sujay Kumar Jauhar (Microsoft Research), Ryen White (Microsoft Research)
International Conference on Learning Representations 2026 · Oral
Overview
This talk, presented by Ben Finkelshtein of Microsoft Research, delves into a comprehensive study exploring the efficacy of Large Language Models (LLMs) for inference tasks on text-attributed graphs (TAGs). Mentored by Silviu Cucerzan, Sujay Kumar Jauhar, and Ryen White, Finkelshtein’s work addresses a critical challenge in the machine learning landscape: how to effectively leverage the powerful textual reasoning capabilities of LLMs within the intricate structural context of graphs, especially when traditional Graph Neural Networks (GNNs) face significant limitations.

Key moments
- 0:00 Introduction to text-attributed graphs and LLM relevance
- 2:00 Challenges with GNNs; LLMs generalize well for graphs
- 4:00 Three LLM-graph interaction paradigms: Prompting, Tools, Code
- 7:00 Finding 1: LLMs perform well on heterophilic graph datasets
- 7:50 Finding 2: Flexible LLM interaction boosts performance, especially long text
- 9:00 Key takeaway: Drop prompting, use code generation for reasoning
- 10:30 Q&A: Comparing LLMs with GNNs for graph tasks
- 12:40 Q&A: Addressing data leakage in LLM pre-training
Actions Speak Louder than Prompts: A Large-Scale Study of LLMs for Graph Inference
Speakers: Ben Finkelshtein (Microsoft Research), Silviu Cucerzan (Microsoft Research), Sujay Kumar Jauhar (Microsoft Research), Ryen White (Microsoft Research)
Conference: ICLR 2026
YouTube: https://slideslive.com/39062176
Overview
This talk, presented by Ben Finkelshtein of Microsoft Research, delves into a comprehensive study exploring the efficacy of Large Language Models (LLMs) for inference tasks on text-attributed graphs (TAGs). Mentored by Silviu Cucerzan, Sujay Kumar Jauhar, and Ryen White, Finkelshtein’s work addresses a critical challenge in the machine learning landscape: how to effectively leverage the powerful textual reasoning capabilities of LLMs within the intricate structural context of graphs, especially when traditional Graph Neural Networks (GNNs) face significant limitations.
The core premise of this research is to move beyond conventional prompting methods and establish a principled understanding of the most effective paradigms for LLM-graph interaction. The study investigates multiple axes of variability, including the interaction mode between LLMs and graphs, dataset characteristics, text length, LLM capacity, and structural properties of the graphs themselves. By doing so, the authors aim to identify robust strategies that unlock LLMs' full potential for graph inference, particularly in scenarios where node features are rich textual descriptions, a common occurrence in real-world applications like recommendation systems.
Ultimately, this work advocates for a paradigm shift from simple, monolithic prompting to more interactive and flexible methods, such as Tool Calling and GraphAsCode. The findings demonstrate that these advanced interaction modes not only overcome the inherent limitations of prompting but also enable LLMs to reason more effectively over complex graph structures, adapt to missing data, and generalize across diverse graph datasets. The study provides crucial insights for practitioners looking to deploy LLMs for graph-based tasks, highlighting the importance of flexible interaction mechanisms over static prompt engineering.
Background
▶ Watch: Introduction to text-attributed graphs and LLM relevance (0:00)
Graphs are fundamental data structures, ubiquitous in various domains from social networks to biological systems. In many real-world applications, these graphs are not merely collections of nodes and edges but are enriched with descriptive textual information associated with each node. These are known as text-attributed graphs (TAGs). A prime example is an e-commerce platform like Amazon, where users and products form nodes, connections represent interactions, and each product or user can be uniquely identified and described by text (e.g., product descriptions, user reviews). The ability to leverage this rich textual context for tasks like recommendation or classification is paramount in modern data-driven systems.
Traditionally, Graph Neural Networks (GNNs) have been the workhorse for machine learning on graphs. GNNs are designed to learn node representations by aggregating information from a node's local neighborhood. However, a significant caveat arises when dealing with TAGs, especially across different graph instances or when textual features are processed differently. If the textual embedding (e.g., using TF-IDF versus an LLM-generated embedding) results in a different number of features for nodes, a pre-trained GNN becomes incompatible. This lack of generalization across varying feature dimensions necessitates re-training or fine-tuning, which is often impractical in dynamic environments. This limitation makes GNNs less adaptable to the evolving nature of textual data and diverse graph sources.
The emergence of Large Language Models (LLMs), with their remarkable ability to understand, generate, and reason over text, presents a compelling alternative or complement to GNNs for TAGs. LLMs are known for their strong generalization capabilities, which could bypass the feature dimension incompatibility issue faced by GNNs. However, the optimal way to integrate LLMs with graph structures for inference tasks remains an open question. Previous research has explored various combinations of GNNs and LLMs, or proposed novel interaction paradigms, but a principled, large-scale study examining the effectiveness of different LLM-graph interaction modes across multiple axes of variability has been largely missing. This work aims to fill that gap, focusing on understanding the best ways for LLMs to "speak" or "communicate" with graph data.
Key Findings
▶ Watch: Three LLM-graph interaction paradigms: Prompting, Tools, Code (4:00)
The large-scale study conducted by Finkelshtein and his team yielded three primary findings that challenge existing assumptions and offer clear guidance for leveraging LLMs in graph inference:
First, the research successfully debunks the myth that LLMs perform poorly on heterophilic datasets. Unlike homophilic graphs where connected nodes tend to share the same class or attributes, heterophilic graphs exhibit a mix-and-match pattern where connected nodes can belong to different classes, making inference inherently more challenging. Prior works often avoided these datasets due to perceived LLM limitations. This study, however, demonstrates that LLMs, regardless of the interaction paradigm, dataset size, textual embedding, or their inherent reasoning capabilities, manage to perform surprisingly well on heterophilic data. This finding opens up new avenues for applying LLMs to a broader range of complex graph structures.
Second, a clear correlation was established between the flexibility of the LLM-graph interaction mode and inference performance. The study categorizes interaction modes by their degree of flexibility: Prompting is the least flexible, followed by Tool Calling, with GraphAsCode being the most flexible. The findings unequivocally show that as flexibility increases, so does performance. This improvement is particularly pronounced when dealing with datasets where nodes have long textual descriptions. Prompting quickly hits token limits and leads to hallucination or information loss. More flexible paradigms, by allowing the LLM to selectively query and process information, can effectively navigate large amounts of text, avoiding these limitations and leading to superior results.
Finally, the study reveals a crucial difference in how flexible LLM interaction paradigms handle missing or incomplete data. When specific data types—such as graph structure, node features, or known labels—are partially or entirely absent, more flexible methods like GraphAsCode demonstrate a remarkable ability to compensate for the missing information. They can dynamically shift their reliance to other available data types, maintaining robust performance. In stark contrast, less flexible methods like Prompting are heavily reliant on the presence of all data types (e.g., edges, known labels). When one type is missing, prompting struggles to adapt, leading to a significant drop in performance. This highlights the adaptive reasoning capabilities enabled by flexible interaction, making LLMs more resilient to real-world data imperfections.
Technical Deep Dive
▶ Watch: Finding 2: Flexible LLM interaction boosts performance, especially long text (7:50)
The technical core of this research revolves around analyzing different LLM-graph interaction paradigms and their effectiveness on text-attributed graphs (TAGs). The study emphasizes that TAGs are graphs where each node is defined or enriched by specific textual information, crucial for domains like recommendation systems where product or user descriptions are key.
A fundamental motivation for this work is to address the limitations of Graph Neural Networks (GNNs) when confronted with the variability inherent in textual data. GNNs typically require fixed-dimension feature vectors for nodes. If the method of textual embedding changes (e.g., from TF-IDF to an LLM embedding), or if different graphs inherently have varying textual feature dimensions, a pre-trained GNN often becomes incompatible, necessitating re-training. LLMs, with their robust generalization abilities, offer a potential way to bypass this rigid requirement.
The study systematically explores three distinct LLM-graph interaction paradigms, ordered by increasing flexibility:
- Prompting: This is the most straightforward and, historically, the most common approach. The graph structure, node features, and any known labels are all serialized into a lengthy textual prompt. For example, the prompt might describe "node zero is connected to node one, node one is connected to node two," followed by detailed features and labels. The LLM then processes this entire prompt to perform inference.
- Technical Caveat: This method is highly susceptible to token limits. For dense or large graphs, or nodes with extensive textual descriptions, the prompt can quickly exceed the LLM's context window, leading to truncation, loss of information, or hallucination. The speaker explicitly states this is a "no-go" for complex scenarios.
- Tool Calling: This paradigm introduces an iterative and interactive approach. Instead of a single, monolithic prompt, the LLM acts as an agent that can choose from a predefined set of actions or "tools." These tools allow the LLM to selectively query specific information from the graph. Examples of such actions include "show me the features of this node," or "show me the local neighborhood of this node."
- Technical Advantage: By allowing the LLM to dynamically request only the necessary information, Tool Calling mitigates the token limit issue and provides more focused context, making it more flexible and efficient than direct prompting.
- GraphAsCode: Representing the pinnacle of flexibility in this study, GraphAsCode leverages the LLM's code generation capabilities. The graph data is presented not as raw text, but as a queryable data structure, specifically a dataframe. The LLM is then empowered to generate code (e.g., Python queries over the dataframe) to extract, manipulate, and reason about the graph data. It receives the results of these code executions, enabling highly sophisticated and composable queries.
- Technical Advantage: This method offers unparalleled flexibility. The LLM can construct complex reasoning paths, iteratively refine its queries, and efficiently access precisely the information it needs, overcoming the limitations of both prompting and even predefined toolsets. It also provides an observable "reasoning path" through the generated code, which can be invaluable for debugging and understanding the LLM's decision-making process.
Beyond these interaction paradigms, the study also delves into the structural regime of graphs, differentiating between homophilic and heterophilic datasets. Homophilic graphs typically have nodes of the same class connected, making neighborhood aggregation effective. Heterophilic graphs, where connected nodes can belong to different classes, pose a greater challenge as local information might be misleading. The research specifically examines how LLMs perform across this axis.
A crucial part of the technical deep dive involves understanding the LLM's reliance on different data types (features, structure, labels). To dissect this, the researchers conducted ablation studies by systematically:
- Truncating features: Reducing the amount of textual information available.
- Removing edges: Perturbing or eliminating the graph structure.
- Removing labels: Simulating scenarios with limited known labels, transitioning from transductive to inductive setups.
By observing performance changes across these ablations, particularly using heatmaps, the study revealed that flexible paradigms like GraphAsCode can dynamically shift their reliance (e.g., from structure to features if edges are removed), a capability severely lacking in static prompting.
Experimental Setup & Results
▶ Watch: Key takeaway: Drop prompting, use code generation for reasoning (9:00)
The study is characterized as a "large-scale study" due to its comprehensive exploration across multiple axes of variability. This rigorous approach ensures statistically significant conclusions regarding the interaction of LLMs with graphs. The primary axes investigated include:
- LLM-Graph Interaction Mode: Prompting, Tool Calling, and GraphAsCode.
- Dataset Domain: The types of graphs and their real-world origins (though specific dataset names beyond "Amazon" and "Cora" were not detailed in the transcript, the implication is a diverse set).
- Text Length: Varying the length of textual descriptions associated with nodes, which directly impacts token limits and the efficacy of different paradigms.
- LLM Capacity: The "power for it to reason," implying different sizes or capabilities of the underlying LLMs used.
- Structural Regime: Examining both homophilic and heterophilic graphs. This is a critical distinction, as heterophilic graphs are generally considered more challenging for graph-based inference due to diverse connections between different classes.
Experimental Procedures:
To understand the specific reliance of LLMs on different data types (features, structure, known labels), the researchers performed targeted ablation studies. This involved systematically:
- Truncating node features: Reducing the textual information provided.
- Deleting edges: Modifying or removing the graph structure.
- Deleting labels: Varying the amount of known label information. This approach allowed the study to explore a spectrum from transductive (some labels known) to fully inductive (no labels known) inference setups, addressing a key question from the audience.
Headline Results:
- Heterophilic Dataset Performance: Contrary to common belief, LLMs demonstrated strong performance on heterophilic datasets. The study found that "regardless of the paradigm that you use, regardless of the size of the data set, the textual embedding, and the model reasoning capabilities, they manage to work pretty well." This is a significant finding that broadens the applicability of LLMs for complex graph structures.
- Impact of Flexibility: A clear trend emerged: increased flexibility in LLM-graph interaction directly correlates with improved performance.
- Prompting consistently showed the lowest performance, especially on graphs with long textual descriptions or high density, due to hitting token limits and subsequent hallucination.
- Tool Calling offered an improvement by allowing selective information retrieval.
- GraphAsCode achieved the highest performance, particularly when text was long, as it could precisely query and compose complex information requests over the dataframe representation of the graph.
- Adaptability to Missing Data: The ablation studies, visualized through heatmaps (though specific numbers were not presented, the qualitative findings were strong), highlighted a critical difference:
- GraphAsCode proved highly adaptable. When one data type was missing (e.g., edges were deleted), it could "compensate for it" by shifting its reliance to other available data, such as textual features or known labels.
- Prompting, conversely, showed heavy reliance on specific data types (e.g., edges for structure, known labels for propagation-like inference). When these were absent, its performance suffered significantly, demonstrating its inability to dynamically adapt its reasoning strategy.
Comparison to GNNs: While the paper includes comparisons to GNNs (as mentioned in the Q&A), the primary goal was not to "beat GNNs." Instead, the focus was on demonstrating the ability of LLMs to perform one-shot inference without the need for pre-training or fine-tuning, a capability GNNs currently lack for varied feature sets. This emphasizes the LLMs' strong generalization for immediate application.
Practical Implications
▶ Watch: Q&A: Addressing data leakage in LLM pre-training (12:40)
The findings of this large-scale study carry significant practical implications for anyone working with graph data and LLMs, from individual practitioners to large infrastructure teams.
For Practitioners and Model Builders:
- Abandon Monolithic Prompting: The most immediate and impactful takeaway is to drop prompting as the primary mode of LLM-graph interaction for inference. Its severe limitations regarding token limits, hallucination, and inability to adapt to missing data make it inefficient and unreliable for real-world graph problems, especially those involving dense graphs or long textual descriptions.
- Embrace Code Generation and Iterative Interaction: Instead, practitioners should prioritize and invest in developing systems that enable more flexible LLM-graph interaction. Tool Calling offers a good intermediate step, providing predefined actions. However, GraphAsCode, by allowing LLMs to generate and execute queries over a dataframe representation of the graph, represents the most powerful paradigm. This not only yields superior performance but also provides a transparent "reasoning path" through the generated code, which can be invaluable for debugging and understanding the LLM's decision-making.
- Leverage LLMs for Heterophilic Graphs: The debunking of the myth about LLMs' poor performance on heterophilic datasets means that practitioners should confidently apply LLMs to more complex, real-world graphs where connections between different classes are common. This significantly expands the range of problems where LLMs can be effectively deployed.
- Dynamic Data Utilization: The ability of flexible LLM paradigms to compensate for missing data types is a crucial advantage. This implies that models built on GraphAsCode or Tool Calling will be more robust to data imperfections, partial information, or scenarios where certain data types (e.g., graph structure) might not always be available or beneficial.
For Infrastructure Teams and Deployers:
- Data Representation Matters: Infrastructure teams should consider representing graph data in formats that are easily queryable by LLMs, such as dataframes. This facilitates the implementation of GraphAsCode paradigms, enabling LLMs to interact with the graph programmatically rather than just through descriptive text.
- Generalization Advantage: LLMs offer a significant advantage over GNNs in their ability to generalize across different graph instances with varying node feature dimensions (e.g., different textual embedding methods). This means fewer re-training cycles and a more adaptable deployment process, especially in dynamic environments where feature representations might evolve.
- Tradeoffs in System Design: While more flexible paradigms offer superior performance, they also imply a more complex system design. Implementing Tool Calling requires defining and managing a set of executable tools, while GraphAsCode necessitates a secure and efficient environment for LLM-generated code execution. These architectural considerations must be weighed against the performance benefits.
- Understanding Data Type Importance: The finding that the utility of graph structure or features can vary (sometimes they are less important) suggests that deployers should monitor the LLM's reliance on different data types. This insight can inform data collection strategies and potentially simplify models by focusing on the most informative data sources.
Limitations and Open Questions:
Despite the clear advantages, the talk acknowledges limitations. The exact mechanisms by which LLMs reason over different data types, especially in complex heterophilic scenarios, remain an open research question. Furthermore, the potential for "data leakage" from the LLM's pre-training data (e.g., if popular datasets like Cora were part of the pre-training corpus) is an important consideration, though the speaker noted the difficulty in verifying this due to lack of access to LLM weights.
Key Takeaways
- Drop Prompting: Monolithic textual prompting for LLM-graph interaction is inefficient and unreliable due to token limits, hallucination, and poor adaptability.
- Embrace Code Generation: Flexible paradigms like GraphAsCode, where LLMs generate code to query graph data represented as dataframes, offer superior performance and transparency.
- LLMs Excel on Heterophilic Graphs: Contrary to prior assumptions, LLMs demonstrate robust reasoning capabilities on complex heterophilic datasets, expanding their applicability.
- Flexibility Enables Adaptability: More flexible interaction modes allow LLMs to dynamically compensate for missing data types (structure, features, labels) by shifting reliance, making them more resilient.
- Varying Data Utility: The importance of graph structure, features, or labels can differ across tasks and graphs; LLMs can adapt to this, suggesting flexible models can identify and leverage the most salient information.
- Generalization Over GNNs: LLMs offer a significant advantage in generalizing across graphs with varying feature dimensions without requiring re-training, a key limitation for traditional GNNs.
About the Speaker(s)
The lead presenter for this work is Ben Finkelshtein, who conducted this research during a short but impactful three-month stay at Microsoft Research. He explicitly acknowledged and thanked his mentors for the project: Silviu Cucerzan, Sujay Kumar Jauhar, and Ryen White, all affiliated with Microsoft Research. Their collective expertise contributed to this large-scale study on LLMs for graph inference.
Reviews
→ Top-rated talks at International Conference on Learning Representations 2026
All talks from International Conference on Learning Representations 2026