Text Generation
Transformers
qwen2
LLM Agent
Knowledge Graph
Question Answering
Reasoning
conversational
Instructions to use xushuwen23/GraphWalker-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use xushuwen23/GraphWalker-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="xushuwen23/GraphWalker-7B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("xushuwen23/GraphWalker-7B") model = AutoModelForCausalLM.from_pretrained("xushuwen23/GraphWalker-7B", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use xushuwen23/GraphWalker-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "xushuwen23/GraphWalker-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "xushuwen23/GraphWalker-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/xushuwen23/GraphWalker-7B
- SGLang
How to use xushuwen23/GraphWalker-7B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "xushuwen23/GraphWalker-7B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "xushuwen23/GraphWalker-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "xushuwen23/GraphWalker-7B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "xushuwen23/GraphWalker-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use xushuwen23/GraphWalker-7B with Docker Model Runner:
docker model run hf.co/xushuwen23/GraphWalker-7B
Update README.md
Browse files
README.md
CHANGED
|
@@ -14,31 +14,16 @@ tags:
|
|
| 14 |
|
| 15 |
[**π Paper (arXiv:2603.28533)**](https://arxiv.org/abs/2603.28533) | [**π» GitHub**](https://github.com/XuShuwenn/GraphWalker) | [**π€ Model**](https://huggingface.co/xushuwen23/GraphWalker-7B)
|
| 16 |
|
| 17 |
-
**GraphWalker-7B** is a specialized large language model fine-tuned from [Qwen2.5-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-7B-Instruct) for **Agentic Knowledge Graph Question Answering (KGQA)**. GraphWalker
|
| 18 |
|
| 19 |
---
|
| 20 |
|
| 21 |
## π Overview
|
| 22 |
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
1. **Agentic Graph Walking:** The model acts as an agent that iteratively traverses a KG, selecting which edges to follow at each step based on the question and accumulated context β effectively decomposing multi-hop questions into a series of local, grounded decisions.
|
| 26 |
-
|
| 27 |
-
2. **Synthetic Trajectory Curriculum (STC):** Instead of relying on expensive human-annotated reasoning chains, GraphWalker is trained on *synthetically generated* graph-walking trajectories. The curriculum is structured to progressively increase trajectory complexity, enabling the model to internalize robust multi-hop strategies.
|
| 28 |
-
|
| 29 |
-
Together, these designs allow GraphWalker-7B to outperform much larger models and complex multi-agent systems on standard KGQA benchmarks, while remaining efficient at inference time.
|
| 30 |
|
| 31 |
---
|
| 32 |
|
| 33 |
-
## π Key Features
|
| 34 |
-
|
| 35 |
-
- **Agentic KG Navigation:** Frames KGQA as an iterative, step-by-step graph traversal rather than a single-shot retrieval-and-generate task.
|
| 36 |
-
- **Synthetic Trajectory Curriculum:** Trains on automatically constructed walking trajectories with progressively increasing difficulty, eliminating the need for costly human annotation.
|
| 37 |
-
- **Lazy Greedy Search with Frontier Expansion:** An efficient beam-search-style graph traversal algorithm that maximizes information gain while keeping context size tractable.
|
| 38 |
-
- **Single-Model Efficiency:** Achieves competitive performance with a single 7B model, without multi-agent overhead.
|
| 39 |
-
- **Broad KG Compatibility:** Designed to generalize across standard KGQA benchmarks (e.g., WebQSP, CWQ, GrailQA).
|
| 40 |
-
|
| 41 |
-
---
|
| 42 |
|
| 43 |
## π οΈ Usage
|
| 44 |
|
|
@@ -67,7 +52,7 @@ vllm serve "./GraphWalker-7B" \
|
|
| 67 |
--dtype auto \
|
| 68 |
--chat-template "./GraphWalker-7B/chat_template.jinja"
|
| 69 |
```
|
| 70 |
-
|
| 71 |
|
| 72 |
|
| 73 |
---
|
|
|
|
| 14 |
|
| 15 |
[**π Paper (arXiv:2603.28533)**](https://arxiv.org/abs/2603.28533) | [**π» GitHub**](https://github.com/XuShuwenn/GraphWalker) | [**π€ Model**](https://huggingface.co/xushuwen23/GraphWalker-7B)
|
| 16 |
|
| 17 |
+
**GraphWalker-7B** is a specialized large language model fine-tuned from [Qwen2.5-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-7B-Instruct) for **Agentic Knowledge Graph Question Answering (KGQA)**. GraphWalker learns to navigate knowledge graphs via synthetic trajectory curriculum β achieving strong generalization with a single, compact 7B model.
|
| 18 |
|
| 19 |
---
|
| 20 |
|
| 21 |
## π Overview
|
| 22 |
|
| 23 |
+
**GraphWalker** is an agentic framework for multi-turn Knowledge Graph Question Answering (KGQA) over **Global Knowledge Graphs** (e.g., Freebase). It transforms LLMs into reasoning agents that autonomously navigate massive KGs through a "Think-Query-Observe" loop, optimized via a synthetic curriculum.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
---
|
| 26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
## π οΈ Usage
|
| 29 |
|
|
|
|
| 52 |
--dtype auto \
|
| 53 |
--chat-template "./GraphWalker-7B/chat_template.jinja"
|
| 54 |
```
|
| 55 |
+
For training and evaluation, see [**π» GitHub**](https://github.com/XuShuwenn/GraphWalker) for details.
|
| 56 |
|
| 57 |
|
| 58 |
---
|