ARC Lens

Real-time PyTorch training visualization and anomaly detection inside VS Code.

Overview & Ecosystem

ARC Lens is a self-contained Visual Studio Code extension for real-time PyTorch training visualization. Install the extension, point it at your training script, and get a live dashboard showing losses, gradients, and training health directly inside VS Code. No external dependencies required.

Under the hood, ARC Lens ships with a bundled monitoring agent that runs entirely offline on your machine. If a training anomaly is detected (NaN loss, exploding gradients, etc.), the agent automatically evaluates the failure and suggests a recovery action without any network calls.

Main Objectives

  • Interactive Visualization: Live dashboard rendering losses, learning rates, gradient L2 norms, GPU memory, weight update ratios, and layer effective rank.
  • Anomaly Detection: Real-time identification of training issues including NaN/Inf losses, gradient explosions, and representation collapse.
  • Automated Recovery: A bundled offline reasoning agent evaluates detected failures and returns recovery actions (checkpoint rollback, learning rate reduction) without any network or API calls.

Architecture & Execution Flow

When you run ARC Lens, the extension spawns a Python process that hooks into your training script via AST injection. It monkey-patches backward() to intercept every training step and streams metrics back to the VS Code dashboard in real time via stdout.

If an anomaly is detected, the extension's bundled agent runs a local deterministic ReAct loop to evaluate the failure and return a recovery action. Everything runs on your machine, nothing leaves your system.

sequenceDiagram participant VSCode as VS Code participant Panel as Dashboard Panel participant Runner as runner.py participant Script as Training Script participant Agent as arc_agent_llm.py VSCode->>Panel: Create Webview VSCode->>Runner: Spawn Python process Runner->>Script: Inject AST hooks Runner->>Script: Execute training loop Every training step Script->>Runner: Intercept backward() call Runner->>VSCode: Emit metrics via stdout VSCode->>Panel: Post metric update Panel->>Panel: Render charts (Chart.js) end alt Anomaly detected Runner->>Agent: Trigger ReAct loop Agent->>Agent: Evaluate failure mode Agent->>Runner: Return recovery action Runner->>VSCode: Stream intervention event VSCode->>Panel: Display alert and action log end

Settings Configuration

Users can configure ARC Lens behavior via VS Code Settings:

SettingTypeDefaultDescription
arcAgent.pythonPathstring"python"Path to the Python interpreter
arcAgent.stepDelaynumber0.02Delay in seconds after each step for visualization pacing