Skip to main content

Module infer

Module infer 

Source
Expand description

TabPFN-3 inference engine — classification only, single pass (no ensembling). NON-COMMERCIAL WEIGHTS LICENSE (TabPFN-3 Non-Commercial License v1.0): research/internal/benchmarking use only — no production, commercial, or hosted-service use without a separate license from Prior Labs GmbH. See the crate’s Cargo.toml description.

Architecture (three stacked transformers, closely related to TabICL’s but with real differences — RMSNorm throughout instead of LayerNorm, unbiased separate Q/K/V projections instead of a packed in_proj, no-bias MLPs, and a very different final decoder):

  1. Feature distribution embedder: each (grouped, NaN-indicator-augmented) feature column is embedded independently by a shared 3-block Set Transformer (InducedSelfAttentionBlock: learned inducing points cross-attend to the training rows only — with a learned query-aware elementwise attention scale (“SoftmaxScalingMLP”, identical in spirit to TabICL’s SSMax) — then the full column cross-attends back to the refined inducing points), with the training targets folded in beforehand via an orthogonal class-embedding lookup.
  2. Column aggregator: per row, the (grouped) feature-column embeddings plus 4 learned CLS tokens attend to each other (non-interleaved RoPE, frequencies stored in the checkpoint); the final block reads out via CLS-tokens-as-query cross-attention, concatenated into one embed_dim * 4 row representation.
  3. ICL transformer: training targets are folded into their rows’ representations (again via an orthogonal embedding lookup), then a 24-block transformer (SoftmaxScalingMLP on every block) lets query rows attend to training rows only — with a GQA-style quirk: query (test) rows attend using only the first of the 8 K/V heads (broadcast to all 8 query heads), while training rows use the full 8 K/V heads. A ManyClassDecoder then reads out a probability-like distribution per class via one more attention pass — Q/K project the row embeddings, V is the (per-head-broadcast) one-hot training-label encoding, so the attention output is literally an attention-weighted average of one-hot labels; the result is log-transformed into logits.

Regression (the bar-distribution/quantile head) is out of scope — see the crate’s Cargo.toml description. NaN/Inf indicator features are always computed (the checkpoint’s x_embed expects them) but real missing-value handling is not exercised: this port assumes clean (non-NaN) input, matching the scope decision already established for every other model in this workspace.

Structs§

TabPfnModel