CSV to Transformer, via Bayesian Networks

(github.com)

3 points | by asgeralstrup 4 hours ago

1 comments

  • asgeralstrup 4 hours ago
    Built a project that goes from CSV or BIF to transformer using Claude Code.

    It can learn a Bayesian network from data, compile it into transformer weights so the forward pass performs belief propagation, and export the result to ONNX. The fastest batched ONNX path hits 3 to 6M rows/sec with OpenVINO on consumer GPU.

    The BN transformer handles missing data naturally. Since inference is just belief propagation, you can omit any feature from the evidence and the model marginalizes over it automatically — no imputation needed. In benchmarks, it retains 90% of its accuracy when 50% of test features are randomly dropped, compared to 77–80% for XGBoost and Random Forest with median imputation.

    On a 30-feature dataset, accuracy barely budged (0.956 → 0.956) while Random Forest fell from 0.974 to 0.798.

    Inspired by the amazing paper “Transformers are Bayesian Networks”: https://arxiv.org/abs/2603.17063