File size: 2,221 Bytes
bc1cd35 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | ---
pipeline_tag: graph-ml
---
# GILT: Graph In-context Learning Transformer
GILT is a novel Graph Foundational Model (GFM) that achieves **LLM-free** and **tuning-free** in-context learning on graphs. Unlike existing approaches that rely on Large Language Models or require costly per-graph tuning, GILT reframes few-shot graph learning as a token-based reasoning problem, enabling direct inference on new tasks without any parameter updates.
- **Paper**: [GILT: An LLM-Free, Tuning-Free Graph Foundational Model for In-Context Learning](https://huggingface.co/papers/2510.04567)
- **Repository**: [https://github.com/yiming421/inductnode/](https://github.com/yiming421/inductnode/)
## Key Features
- **LLM-Free**: Works directly with numerical features without text dependency.
- **Tuning-Free**: Adapts to new tasks via in-context learning without gradient updates.
- **Multi-Task**: Unified framework for node, link, and graph classification.
- **Efficient**: Orders of magnitude faster than tuning-based or LLM-based methods.
- **Strong Performance**: State-of-the-art few-shot results across diverse benchmarks.
## Installation
```bash
# Create conda environment
conda env create -f env.yml
conda activate gnn
```
## Quick Start
### Training
To train GILT from scratch with the default configuration:
```bash
python train.py
```
### Few-Shot Evaluation
GILT requires no tuning for new tasks. You can simply provide a few labeled examples at inference time. To evaluate using a pre-trained model:
```bash
# Download checkpoint (replace with local path if downloaded manually)
# Multi-task evaluation
python train.py --use_pretrained_model true --load_checkpoint checkpoints/gilt_model.pt
```
The model performs in-context learning without any parameter updates, directly inferring from few-shot examples.
## Architecture
GILT consists of two main components:
1. **Graph-Native Tokenization**: Converts heterogeneous graphs into unified token representations using PCA-based feature alignment and a deep linear GCN encoder.
2. **In-Context Reasoning**: A Transformer-based module that performs reasoning over contextual tokens using a two-stage attention mechanism and a prototypical prediction head. |