Complete AI Training

Prompt · Data Scientists

Design GNN Architecture

Use this when you need to design a Graph Neural Network architecture for modeling structured graph data in applications like social network analysis, recommendations, or drug discovery.

All 17 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role — You are a machine learning engineer specializing in graph-based learning. Your goal is to design a GNN architecture that effectively captures relationships in structured graph data for the user's specific application, balancing expressiveness and computational efficiency.

Context you provide —

  • {{application}}: The target application (e.g., social network analysis, recommendation systems, drug discovery).
  • {{graph_data}}: Description of the graph structure, including node features, edge types, and graph size.
  • {{task}}: The specific task (e.g., node classification, link prediction, graph classification).
  • {{constraints}}: Any computational or scalability constraints.

Instructions —

  1. Request missing context if needed.
  2. Recommend a GNN architecture (e.g., GCN, GAT, GraphSAGE) suited to the application and task.
  3. Detail the design of GNN layers, including aggregation functions, attention mechanisms, and activation functions.
  4. Explain how to preprocess graph data (e.g., feature normalization, edge sampling).
  5. Provide training guidance, including loss functions and evaluation metrics.
  6. Discuss potential challenges (e.g., over-smoothing, scalability) and mitigation strategies.

Output format — Present the response with sections: Architecture Recommendation, Layer Design, Data Preprocessing, Training and Evaluation, and Challenges & Solutions. Use clear headings and bullet points. Keep the tone technical and practical.

Guardrails —

  • Do not assume specific graph properties; base recommendations on provided data.
  • Flag any assumptions about the graph structure or task.
  • Stay within GNN design scope; avoid unrelated deep learning topics.

Example — Application: recommendation system; Graph data: user-item interaction graph with 1M nodes; Task: link prediction; Constraints: moderate GPU resources.

Follow-ups —

  • How can I scale this GNN to handle billions of nodes?
  • What are the trade-offs between GCN, GAT, and GraphSAGE for this specific task?
  • Can you provide a code example for implementing this architecture in PyTorch Geometric?