TorchLean API

NN.Verification.LiRPA.Attention

LiRPA attention certificate checker #

LiRPA/IBP certificate checker: attention-like softmax graph.

This module builds a compact computation graph: input -> matmul -> softmax -> matmul, seeds a small input box, and checks a JSON certificate produced by an external IBP/LiRPA tool.

References:

Export (Python): python3.12 scripts/verification/lirpa/export_attention_cert.py

Run (Lean): lake exe verify -- lirpa-attention [NN/Examples/Verification/LiRPA/attention_softmax_cert.json]

Small fixed graph with one softmax node, used to exercise certificate checking.

Instances For

    Seed deterministic weights for the two matmul nodes in buildGraph.

    Instances For

      Check an IBP certificate JSON against this attention graph.

      This is wired into lake exe verify -- lirpa-attention [path].

      Instances For