Skip to content

enrich(Probas/Infer): Infer-8 motivate WHY Expectation Propagation (vs exact inference) - #8097

Merged
jsboige merged 1 commit into
mainfrom
feature/infer8-ep-motivation
Jul 23, 2026
Merged

jsboige merged 1 commit into
mainfrom
feature/infer8-ep-motivation

Conversation

@jsboige

@jsboige jsboige commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Summary — audit #8081 finding (first pilot)

Infer-8-TrueSkill uses Expectation Propagation (EP) as its core inference algorithm (cells 11, 15) but never motivates it. cell[15] only compares EP-vs-VMP (intra-approximation). The deeper question — why approximate inference at all? — goes unanswered. This is the first concrete finding of audit #8081 (distillation fidelity vs MBML Ch.3): a SOTA engine used without showing its necessity reads as gratuitous (#3801 Prong-B).

What MBML Ch.3 makes explicit (and Infer-8 lost)

The chapter this series is distilled from — Model-Based Machine Learning (Winn & Bishop), « Meeting Your Match » — motivates EP explicitly:

  1. The IsGreaterThan factor is not conjugate to Gaussians: it truncates the Gaussian (kills the half-plane where player 2 wins) → a cumulative-Gaussian (sigmoid) message. The exact posterior is an asymmetric non-Gaussian (Gaussian × cumulative-Gaussian).
  2. An exact posterior needs 4 params (vs 2 for a Gaussian); each match adds such a factor, so after $k$ matches the exact representation needs $2(k+1)$ params → unsustainable for a system ranking millions of players.
  3. EP re-projects onto a Gaussian after each factor (moment matching), keeping a bounded 2-param-per-skill representation. That is why EP exists.

Change (markdown-only, C.2 exception)

One markdown cell after cell[15], reading the committed posterior N(29.21, 7.19) (cell 13) as the EP Gaussian projection of a truly-asymmetric posterior — a precision/cost tradeoff that makes TrueSkill deployable at Xbox Live scale.

Audit verdict for Infer-8 vs MBML Ch.3 (documented in #8081)

  • Largely FIDÈLE on extensions: draws/draw-margin (§4), teams-as-sums (§6), multi-player ordering (§7), online learning (§5), tournoi simulé (§9) — these cover MBML Ch.3's neighbouring pages.
  • PERTE PAR COMPLAISANCE (this PR corrects it): EP motivation (why approximate vs exact) — the engine used without its necessity.
  • PERTE DOCUMENTÉE (legitimate pedagogical choice, not complaisance): the iterative derivation itself (convolution integral, generative-sampling viewpoint, conjugacy panel). A code-centred notebook presents the finished model rather than the MBML model-building dialogue — a deliberate genre choice, flagged for documentation not wholesale backfill.

Validation (firsthand)

  • nbformat.validate OK.
  • Markdown-only → C.2 exception (no re-exec; prior code outputs unchanged).
  • Diff: 20 insertions, 0 deletions — pure addition, 1 file. 19 code cells untouched (execution_counts intact) → anti-regression clean.
  • Convention preserved: json.dumps(indent=1, ensure_ascii=False) + "\n" == raw, 0 CRLF.
  • UTF-8 French accents verified clean (round-trip tested — no mojibake). LaTeX verified (\text{perf}_1 > \text{perf}_2, no \texttext typo).
  • Every claim grounded in MBML Ch.3 (fetched firsthand) + Infer-8's own committed values.

Honnêteté

This is a limited, targeted finding — Infer-8 is a rich, largely faithful notebook, not a case of massive substance loss by complaisance. The audit shows the loss is real (EP motivation) but bounded. Nuance is the point of #8081.

See #8081. Co-Authored-By: Claude-Code noreply@anthropic.com

…s exact)

Audit #8081 finding (distillation fidelity vs MBML Ch.3). Infer-8 USES
Expectation Propagation as its core inference algorithm (cells 11, 15) but
never MOTIVATES it — cell[15] only compares EP-vs-VMP (intra-approximation).
The deeper question goes unanswered: why approximate inference at all?

MBML Ch.3 (Winn & Bishop, "Meeting Your Match" — the chapter this series is
distilled from) makes the motivation explicit, and it was lost in distillation:

- The IsGreaterThan factor is NOT conjugate to Gaussians: it truncates the
  Gaussian (kills the half-plane where player 2 wins), producing a cumulative-
  Gaussian (sigmoid) message. The exact posterior is an asymmetric non-Gaussian
  (Gaussian x cumulative-Gaussian).
- An exact posterior needs 4 params (vs 2 for a Gaussian); each match adds such
  a factor, so after k matches the exact representation needs 2(k+1) params —
  unsustainable for a system ranking millions of players.
- EP re-projects onto a Gaussian after each factor (moment matching), keeping a
  bounded 2-param-per-skill representation. This is why EP exists.

This is the #3801 Prong-B concern: a SOTA engine (EP) used without showing its
necessity reads as gratuitous. The missing "why approximate at all" was
substance lost during distillation.

The interp also annotates the committed posterior N(29.21, 7.19) (cell 13) as
the EP Gaussian projection of a truly-asymmetric posterior — a precision/cost
tradeoff that makes TrueSkill deployable at Xbox Live scale.

Markdown-only (C.2 exception, no re-exec). nbformat.validate OK. Diff = 20
insertions, 0 deletions (pure addition, anti-regression clean). 0 CRLF,
convention json.dumps indent=1 preserved. UTF-8 French accents clean.

See #8081 (audit: Probas/Infer+PyMC fidelity vs Infer.NET repo + MBML sources).

Co-Authored-By: Claude-Code <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Golden-Set Execution (H.7 P3)

✅ 8/8 notebooks passed (certified reproducible)

Notebook Status Time
2.1-Workflow-ML.ipynb ✅ SUCCESS 4.9s
2.2-Descente-de-gradient.ipynb ✅ SUCCESS 3.8s
2.3-Regression-lineaire-logistique.ipynb ✅ SUCCESS 3.5s
2.4-Arbres-Forets-Ensembles.ipynb ✅ SUCCESS 4.4s
Search-1-StateSpace.ipynb ✅ SUCCESS 3.6s
SL-1-LogicalLearning.ipynb ✅ SUCCESS 2.7s
rl_4_multi_armed_bandits.ipynb ✅ SUCCESS 25.2s
GameTheory-4c-NashExistence-Python.ipynb ✅ SUCCESS 3.2s

Pinned lockfile: scripts/notebook_tools/golden_set.lock.txt (H.7 P3, axe A #4208)

@github-actions

Copy link
Copy Markdown
Contributor

Notebook PR Validation: PASS

  • Notebooks checked: 1
  • Code cells validated: 19
  • Result: All passed

Checks: H.1 (no errors), H.3 (execution_count), C.1 (no banned patterns)
Non-Python kernels (.NET/Lean): C.1 + errors only (execution_count advisory)
QuantConnect notebooks: C.1 + errors only (require QC Cloud for execution)

@jsboige jsboige left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Hermes] Review — Infer-8 EP motivation

✅ Diff vérifié : +20/-0 markdown-only (1 cellule markdown, pas de code exécuté).

  • Motivation EP claire et correcte : facteur IsGreaterThan non-conjugué → posterior non-Gaussien → explosion paramétrique → reprojection EP ✓
  • Référence croisée à la cellule 12 (N(29.21, 7.19)) cohérente — ancrage dans le notebook existant ✓
  • Lien MBML Ch.3 approprié ✓
  • Security scan : 0 hit ✓
  • CI golden-set : 8/8 PASS ✓

Bonne pédagogie, comble un gap conceptuel réel. LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant