N Neurarch Architectures Models Checks Data Docs Open the app

Architectures / Recommendation

๐Ÿ’ก LightGCN

He et al. 2020 โ€” user/item embeddings propagated through 3 light graph-conv layers, layer combination via mean (no transforms, no nonlinearities)

From He et al. (2020). LightGCN: Simplifying and Powering Graph Convolution Network for Recommendation. SIGIR 2020. This page is the graph, not the PDF: open it, edit it, verify it, export it.

Layers
14
Parameters
70.42M
Input
1
Output
64
Verifier
Clean

Every number on this page is computed from the graph by the same functions the app runs, not written by hand.

Open LightGCN on the canvas Free, no account needed

When to pick it

Pick for collaborative filtering with implicit feedback (clicks, plays). Strips graph-conv to its essentials โ€” often beats heavier GCN variants on rec benchmarks.

Structure

14 layers. Output shapes are propagated from the input shape, batch dimension excluded.

LayerTypeParametersOutput shape
1User IDInputshape=[1]1
2E_user(0)EmbeddingvocabSize=1000001 ร— 64
3GraphConv(1)GraphConvoutFeatures=64, inFeatures=641 ร— 64
4GraphConv(2)GraphConvoutFeatures=64, inFeatures=641 ร— 64
5GraphConv(3)GraphConvoutFeatures=64, inFeatures=641 ร— 64
6Layer Combine (mean)Mean64
7Item IDInputshape=[1]1
8E_item(0)EmbeddingvocabSize=10000001 ร— 64
9GraphConv(1)GraphConvoutFeatures=64, inFeatures=641 ร— 64
10GraphConv(2)GraphConvoutFeatures=64, inFeatures=641 ร— 64
11GraphConv(3)GraphConvoutFeatures=64, inFeatures=641 ร— 64
12Layer Combine (mean)Mean64
13Dot ScoreMatMul64
14ScoreOutput64

What the verifier says

The same 43 single-graph checks that run on every edit in the app, on this graph.

info11 layers with no BatchNorm, LayerNorm, or GroupNorm. Without normalization, activations can explode or vanish across layers, causing slow or unstable training. Fix: Add BatchNorm after Conv2d (CV tasks), LayerNorm after attention/FFN (NLP/LLM), or GroupNorm for small batch sizes.
deep-no-norm

The PyTorch it exports

Generated from the graph above. First 46 lines; the app exports the whole file, plus the training loop, the data contract and a deploy bundle.

# Architecture designed with Neurarch: https://neurarch.com
# PyTorch: compatible with Python 3.8+ and torch>=1.12
# Colab: pip install torch torchvision  (usually pre-installed)

import torch
import torch.nn as nn
import torch.nn.functional as F
from typing import Tuple
from torch_geometric.nn import GCNConv, GATConv, SAGEConv

class LightGCN(nn.Module):
    def __init__(self):
        super().__init__()

        self.embedding_1 = nn.Embedding(100000, 64)
        self.graphConv_1 = GCNConv(64, 64)
        self.graphConv_2 = GCNConv(64, 64)
        self.graphConv_3 = GCNConv(64, 64)
        self.embedding_2 = nn.Embedding(1000000, 64)
        self.graphConv_4 = GCNConv(64, 64)
        self.graphConv_5 = GCNConv(64, 64)
        self.graphConv_6 = GCNConv(64, 64)

    def forward(self, src, tgt=None, edge_index=None):
        # User ID shape: [1]
        # Item ID shape: [1]
        embedding_ser_e0 = self.embedding_1(src)
        graph_conv_er_gc1 = self.graphConv_1(embedding_ser_e0, edge_index)
        graph_conv_er_gc2 = self.graphConv_2(graph_conv_er_gc1, edge_index)
        graph_conv_er_gc3 = self.graphConv_3(graph_conv_er_gc2, edge_index)
        mean_r_mean = torch.stack([embedding_ser_e0, graph_conv_er_gc1, graph_conv_er_gc2, graph_conv_er_gc3]).mean(dim=0)
        embedding_tem_e0 = self.embedding_2(tgt)
        graph_conv_em_gc1 = self.graphConv_4(embedding_tem_e0, edge_index)
        graph_conv_em_gc2 = self.graphConv_5(graph_conv_em_gc1, edge_index)
        graph_conv_em_gc3 = self.graphConv_6(graph_conv_em_gc2, edge_index)
        mean_m_mean = torch.stack([embedding_tem_e0, graph_conv_em_gc1, graph_conv_em_gc2, graph_conv_em_gc3]).mean(dim=0)
        matmul_dot = (mean_r_mean * mean_m_mean).sum(dim=-1, keepdim=True)
        # Output
        return matmul_dot


if __name__ == '__main__':
    model = LightGCN()
    model.eval()

    edge_index = torch.tensor([[0, 1, 2, 3], [1, 2, 3, 0]], dtype=torch.long)  # (2, num_edges) COO

For agents

This architecture is machine-readable end to end. An agent can list the set, fetch this graph, edit it, and have the edit verified before any GPU time is spent.

Also in Recommendation

๐Ÿ—ผ Two-Tower
User+Item dual encoder for retrieval โ€” embeddings โ†’ MLP per side โ†’ dot product score
15 layers ยท 70.44M
๐Ÿ“ Wide & Deep
Memorization
13 layers ยท 3.65M
๐Ÿ›’ DLRM
Meta's Deep Learning Recommendation Model โ€” bottom MLP for dense, embedding for sparse, feature interaction, top MLP
14 layers ยท 64.35M
๐Ÿค NeuMF (Fused GMF + MLP)
He et al
16 layers ยท 105.61M