Trace2

Computation Graph

Understanding how Trace2 builds and uses computation graphs

Computation Graph

Trace2 automatically builds a computation graph of your AI system's execution, similar to how PyTorch builds graphs for neural networks.

What is a Computation Graph?

How Trace2 Builds Graphs

[Add explanation]

Visualizing Graphs

Trace2 provides built-in visualization:

z.backward("maximize z", visualize=True, print_limit=25)

Graph Propagation

Comparison to AutoDiff

FeatureAutoDiff (PyTorch)Trace2
InputTensorsAny Python objects
OperationsMath operationsAny function calls
GradientNumericalNatural language feedback
OutputUpdated weightsUpdated code/prompts

Next Steps