Skip to content

Architecture Visualizer — shared widget for model surgery and cognition #577

@joelteply

Description

@joelteply

The Pattern

Both the persona brain widget and the model forge factory need to visualize a complex system transforming in real-time. The data shape is identical:

Concept Brain Widget Factory Widget
Nodes Neurons Attention heads / MoE experts
Connections Synaptic weights Attention patterns / expert routing
Activity Thought process Loss, entropy, utilization
Transitions Learning Pruning, defrag, mitosis, LoRA merge

ArchitectureVisualizer (shared component)

A general-purpose topology renderer that takes:

  • Nodes with state (active, pruned, cloning, merged)
  • Connections with strength (weight magnitude, attention score)
  • Activity stream (real-time values that drive animation)
  • Transitions (structural changes with animation)

Forge Mode

  • Attention heads as a grid per layer — lit nodes dim during pruning, disappear during defrag
  • MoE experts as columns — 256 pillars collapse to 16 during compaction
  • LoRA overlays glow during training, then merge into base structure
  • Loss curve flowing through the visualization
  • Token flow showing data routing through surviving architecture

Brain Mode (existing)

  • Persona neurons with activation levels
  • Connection strength between concepts
  • Thought stream visualization

Events (drives the visualization)

model:forge:step     → update activity levels (loss, head entropy)
model:forge:prune    → transition: nodes dim and fade
model:forge:defrag   → transition: nodes collapse, grid shrinks
model:forge:mitosis  → transition: node splits into two
model:forge:complete → final state snapshot

Implementation

  1. ArchitectureVisualizerWidget — shared base in widgets/shared/
  2. ForgeVisualizerWidget — factory-specific adapter (topology from forge events)
  3. BrainVisualizerWidget — cognition-specific adapter (topology from persona state)
  4. Canvas/WebGL rendering for performance (hundreds of nodes)
  5. Off-main-thread computation for layout algorithms

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions