TorchLean:在Lean中形式化神经网络
TorchLean: Formalizing Neural Networks in Lean

原始链接: https://leandojo.org/torchlean.html

## TorchLean:神经网络形式化验证 当前的神经网络验证常常存在执行方式与分析方式脱节的问题,依赖于对其行为的未明确假设。**TorchLean** 通过在 Lean 4 定理证明器中构建框架来解决这个问题,该框架将神经网络视为精确的数学对象。 TorchLean 提供经过验证的 PyTorch 风格 API,确保在执行(即时或编译)和验证之间定义一致。 重要的是,它结合了使用 IEEE-754 的明确、可证明的浮点语义,消除了歧义。 该框架支持诸如区间边界传播 (IBP) 和 CROWN/LiRPA 等验证技术,生成经过认证的保证。 通过诸如鲁棒性认证、物理信息神经网络和神经控制器验证之类的应用进行验证,TorchLean 为学习系统提供了一个完整的、形式化验证的流程——弥合语义差距并实现真正可信赖的 AI。

Hacker News 新闻 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 TorchLean:在Lean中形式化神经网络 (leandojo.org) 7点 由 matt_d 1小时前 | 隐藏 | 过去 | 收藏 | 1评论 帮助 measurablefunc 5分钟前 [–] 我想下一步应该是添加对量化算术的支持。回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请YC | 联系 搜索:
相关文章

原文

Neural networks are increasingly deployed in safety- and mission-critical pipelines, yet many verification and analysis results are produced outside the programming environment that defines and runs the model. This separation creates a semantic gap between the executed network and the analyzed artifact, so guarantees can hinge on implicit conventions such as operator semantics, tensor layouts, preprocessing, and floating-point corner cases. We introduce TorchLean, a framework in the Lean 4 theorem prover that treats learned models as first-class mathematical objects with a single, precise semantics shared by execution and verification. TorchLean unifies (1) a PyTorch-style verified API with eager and compiled modes that lower to a shared op-tagged SSA/DAG computation-graph IR, (2) explicit Float32 semantics via an executable IEEE-754 binary32 kernel and proof-relevant rounding models, and (3) verification via IBP and CROWN/LiRPA-style bound propagation with certificate checking. We validate TorchLean end-to-end on certified robustness, physics-informed residual bounds for PINNs, and Lyapunov-style neural controller verification, alongside mechanized theoretical results including a universal approximation theorem. These results demonstrate a semantics-first infrastructure for fully formal, end-to-end verification of learning-enabled systems.


TorchLean overview
联系我们 contact @ memedata.com