from jammi_cookbook import contracts, rails12 The bridge — one recipe, one equation, one canon line
The book’s thesis, made explicit: one Jammi recipe is one equation in the monograph and one line in the GNN/conformal canon. The verticals carried short bridge notes; this chapter writes the full bridge — four signature chapters that each take one operation and show it is the same object at three altitudes, then run it on the committed cache; the Neptune-contrast framing; and the verified citation map that pins every recipe to its sources.
Every measured claim below reads the committed cache and asserts via the measurement rail — no recomputation, no fabricated numbers.
12.1 Signature 1 — Propagation = low-pass graph filter = SGC/APPNP = vector-agg
The headline equivalence. One equation, three names, one call.
- Monograph (Stanković et al. Part II (Stanković et al. 2019b)). A graph signal is filtered in the graph-spectral domain; smoothing toward neighbours is a low-pass filter — it attenuates the high-frequency (idiosyncratic per-node) component and keeps the low-frequency (shared-cluster) component.
- GNN canon. That filter is a decoupled propagation layer. The
weightingargument is the choice of filter:weighting="uniform"= the random-walk operator \(\tilde{D}^{-1}\tilde{A}\) — SGC-flavoured (Wu et al. 2019);weighting="degree_normalized"+alpha= symmetric-normalized propagation with a teleport restart, \((1-\alpha)\hat{A}\,H + \alpha\,X^{(0)}\) — this is APPNP (Gasteiger, Bojchevski, and Günnemann 2019);output="jumping_knowledge"= stacking (concatenating) the filtered signal at every hop.
- Jammi call.
propagate_embeddings— and it is byte-identically deterministic by construction: a fixed(group, neighbour)f64 fold order, no seeding, identical across threads. The reproducible point on the construct→learn spectrum.
We demonstrate the equivalence, not assert it: the keystone ran the APPNP filter (degree_normalized + alpha) over the citation graph and froze the result. The honest test of a low-pass filter is a downstream measurement — same-subject retrieval recall must rise.
raw = contracts.golden("arxiv.tier01.recall_at_10").value
prop = contracts.golden("arxiv.tier02.recall_at_10").value
delta = contracts.golden("arxiv.tier02.recall_delta").value
print(f"recall@10 raw → APPNP-propagated: {raw:.3f} → {prop:.3f} (Δ {delta:+.3f})")
rails.measure("arxiv.tier02.recall_at_10", prop)
rails.measure("arxiv.tier02.recall_delta", delta)recall@10 raw → APPNP-propagated: 0.538 → 0.556 (Δ +0.018)
0.018
12.2 Signature 2 — An edge is a self-search; a context set is a search/walk
Retrieval is the substrate of both graphs and prediction.
- Monograph (Part I (Stanković et al. 2019a)). A kNN graph is built by, for every node, retrieving its nearest nodes — graph construction is retrieval.
- GNN canon / Neural Process. A prediction’s context set is the same retrieval: the rows a Neural Process conditions on are a
search/walk over the graph (Garnelo et al. 2018). The propagated embedding is that graph-conditioned context in vector form. - Jammi calls.
build_neighbor_graph(the self-kNN edge) andassemble_context(the retrieval-conditioned context set) are the same retrieval primitive at two altitudes.
The derived neighbor graph from tier 01 is exactly this self-search; its edges each carry their similarity and rank — the provenance rail showing an edge’s origin is a queryable fact.
ng = contracts.load_artifact("arxiv.neighbor_graph")
print(f"self-kNN edges: {ng.num_rows} columns: {ng.column_names}")
# every derived edge records the retrieval that produced it (similarity + rank)
assert {"src", "dst", "rank", "similarity"} <= set(ng.column_names)
print("each edge is an auditable self-search result (similarity + rank recorded)")self-kNN edges: 40000 columns: ['src', 'dst', 'rank', 'similarity']
each edge is an auditable self-search result (similarity + rank recorded)
12.3 Signature 3 — Graph-supervised metric learning = contrastive fine-tune over walks
- Monograph (Part III (Stanković et al. 2020)). Learning node representations from graph topology — the machine-learning-on-graphs part.
- GNN canon. node2vec / DeepWalk’s skip-gram over biased random walks (Grover and Leskovec 2016), and the inductive aggregate-over-neighbours of GraphSAGE (Hamilton, Ying, and Leskovec 2017). The walk sampler turns the graph into positive pairs; the contrastive loss is the objective. Citation-graph contrastive supervision is SPECTER (Cohan et al. 2020); nearest-neighbor-of-own-representations contrastive learning is NNCLR (Dwibedi et al. 2021), which works via homophily, not circularity; SciNCL (Ostendorff et al. 2022) augments citation embeddings with exactly this kind of k-NN self-similarity graph.
- Jammi call.
fine_tune_graph— theedge_provenanceknob names which graph supervises the metric:"declared"(who-cited-whom, external to the embedding metric) versus"similarity"(the k-NN-of-own-embeddings graph, drawn by the metric). The two are not equally informative, but neither is the similarity graph a no-op — see the measurement below.
We measure this empirically from the cached tier-03 results, over three graphs run with the identical recipe: the declared citation graph (trained to convergence), the similarity self-k-NN graph, and a random null.
base = contracts.golden("arxiv.tier01.recall_at_10").value
ft = contracts.golden("arxiv.tier03.recall_at_10").value
gain = contracts.golden("arxiv.tier03.recall_gain_vs_base").value
sim_gain = contracts.golden("arxiv.tier03.control_similarity_recall_gain_vs_base").value
rand_gain = contracts.golden("arxiv.tier03.control_random_recall_gain_vs_base").value
print(f"recall@10 base → declared-edge fine-tune: {base:.3f} → {ft:.3f} (Δ {gain:+.3f})")
print(f"control gains — similarity: {sim_gain:+.3f} random: {rand_gain:+.3f}")
rails.measure("arxiv.tier03.recall_at_10", ft)
rails.measure("arxiv.tier03.recall_gain_vs_base", gain)
rails.measure("arxiv.tier03.control_similarity_recall_gain_vs_base", sim_gain)
rails.measure("arxiv.tier03.control_random_recall_gain_vs_base", rand_gain)recall@10 base → declared-edge fine-tune: 0.538 → 0.594 (Δ +0.056)
control gains — similarity: +0.023 random: -0.014
-0.014
12.4 Signature 4 — A prediction is a context-conditioned posterior (the moat)
The tier with no monograph and no Neptune analogue — the non-redundant core.
- The Neural-Process family. The context predictor is a CNP/ANP (Garnelo et al. 2018; Kim et al. 2019) — and the amortized-tabular-prediction line (TabPFN (Hollmann et al. 2022)). It returns a posterior conditioned on a retrieved context set.
- Conformal under graph dependence. Conformal gives finite-sample coverage under exchangeability (Vovk et al. (Vovk, Gammerman, and Shafer 2005); Angelopoulos & Bates (Angelopoulos and Bates 2021)). Under graph dependence and a time-split that coverage breaks (Barber et al. (Barber et al. 2023)); the graph-aware remedies are CF-GNN (Huang et al. 2023) and NAPS (Clarkson 2023), and the covariate-shift remedy is weighted conformal (Tibshirani et al. (Tibshirani et al. 2019)).
- Jammi calls.
train_context_predictor/predict_with_context_predictor→conformalize/conformalize_interval.
This is the crux the tier-04 chapter works in full. The signature here is the moat’s worked example: the predictor fits a real posterior, and both the regression interval and the classification set under-cover under the time-split — the honest finding weighted conformal cannot repair (it moves the quantile only when the shift is score-aligned).
cal_mean = contracts.golden("arxiv.tier04.reg_cal_mean").value
reg_cov = contracts.golden("arxiv.tier04.reg_interval_coverage").value
marg_cov = contracts.golden("arxiv.tier04.marginal_coverage").value
nominal = contracts.golden("arxiv.tier04.nominal_coverage").value
print(f"context-predictor posterior mean (cal era): {cal_mean:.2f} (real fit, no collapse)")
print(f"regression interval coverage: {reg_cov:.3f} (nominal {nominal:.2f} — under-covers)")
print(f"classification APS coverage: {marg_cov:.3f} (nominal {nominal:.2f} — under-covers)")
rails.measure("arxiv.tier04.reg_cal_mean", cal_mean)
rails.measure("arxiv.tier04.reg_interval_coverage", reg_cov)
rails.measure("arxiv.tier04.marginal_coverage", marg_cov)context-predictor posterior mean (cal era): 2018.36 (real fit, no collapse)
regression interval coverage: 0.721 (nominal 0.90 — under-covers)
classification APS coverage: 0.867 (nominal 0.90 — under-covers)
0.867
12.5 The Neptune-contrast framing
The book’s organizing conceit. Amazon Neptune is Database / Analytics / ML; this cookbook is Construct / Analyze / Learn / Predict & Quantify — the same “unified yet separate” spine, re-expressed as runnable Jammi computation, plus a fourth tier Neptune structurally lacks: calibrated, provenance-stamped, context-conditioned prediction.
Stated plainly:
- Tiers 01–03 are roughly Neptune-parity (commodity). Neptune loads a graph and runs
CALL neptune.algo.*(pageRank / degree / wcc) over it; Jammi constructs the similarity graph from text and registers the declared graph beside it, then propagates and learns over it. Same operations, expressed as substrate computation. Neptune uses Air Routes for its queries/algorithms — so does this cookbook’s on-ramp. - Tier 04 + bring-your-own-graph is the non-redundant core. A graph-conditioned prediction with an honest, audited coverage guarantee has no Neptune analogue. Neptune switches datasets when it reaches ML — and so do we, to ogbn-arxiv, for a credible learn/predict tier; the Air Routes on-ramp stops at tier 02 (its label is near-deterministic from lat/lon, too thin for a learn tier).
(Neptune is a public product named here only as a contrast; it is a competitor’s product, not a Jammi consumer — the engine names no consumer.)
12.6 The verified citation map
Every citation below was independently verified (author / year / venue) against the primary source during this chapter’s pressure-test — not trusted from the hand-off spec. Each is backed by a references.bib entry, and a test (tests/test_citation_map.py) asserts that every row’s Jammi call is a verb that actually exists in the grounded API reference and that no @cite dangles. The table renders from the same citation_map data the test checks, so the rendered map and the asserted map cannot diverge.
| Recipe | Monograph (Stanković et al.) | GNN / conformal canon | Jammi call |
|---|---|---|---|
| 01 construct — kNN similarity graph | Part I — graph construction, the Laplacian, spectral clustering | (graph construction is the monograph’s own; the GNN canon assumes a given graph) | build_neighbor_graph |
| 02 analyze — propagation (low-pass graph filter) | Part II — low-pass graph filtering / the graph Fourier transform | SGC (Wu et al. 2019); APPNP (Gasteiger/Klicpera et al. 2019) | propagate_embeddings |
| 03 learn — graph-supervised metric learning (declared edges vs. self-similarity vs. a random null) | Part III — graph embeddings, machine learning on graphs | node2vec (Grover & Leskovec 2016); GraphSAGE (Hamilton et al. 2017); SPECTER (Cohan et al. 2020, declared-citation supervision); NNCLR (Dwibedi et al. 2021, nearest-neighbor-of-own-representations via homophily); SciNCL (Ostendorff et al. 2022, citation-embedding kNN) | fine_tune_graph |
| 02/03 retrieval — an edge is a self-search; a context set is a search/walk | Part I — kNN-graph construction as retrieval | the retrieval-conditioned context of a Neural Process (Garnelo et al. 2018) | assemble_context |
| 04 predict — context-conditioned posterior | (no monograph analogue — the tier the GSP series does not reach) | CNP (Garnelo et al. 2018); ANP (Kim et al. 2019); TabPFN (Hollmann et al. 2022) | train_context_predictor |
| 04 predict — graph-conditioned prediction (BYOG) | (no monograph analogue) | ANP attention over the context set (Kim et al. 2019) | predict_with_context_predictor |
| 04 quantify — marginal conformal + the graph break | (no monograph analogue) | Vovk et al. 2005; Angelopoulos & Bates 2021; Barber et al. 2023; CF-GNN (Huang et al. 2023); NAPS (Clarkson 2023) | conformalize |
| 04 quantify — regression interval + the inline repair | (no monograph analogue) | Tibshirani et al. 2019 (weighted conformal under covariate shift); Barber et al. 2023 (beyond exchangeability) | conformalize_interval |
citation map: 8 rows, every reference resolved, every Jammi call exists on the pinned engine ✓
12.6.1 Verification notes — what the pressure-test corrected
Researching each citation against the primary source surfaced three precision fixes the hand-off spec’s representative table got loose on; the references.bib entries carry the verified facts:
- APPNP authorship. The spec attributed it to “Klicpera 2019”. The author Johannes Klicpera later changed his name to Johannes Gasteiger; the canonical attribution is Gasteiger, Bojchevski & Günnemann, ICLR 2019 (“Predict then Propagate”, arXiv 2018). The bib cites Gasteiger with the name-change noted.
- Barber et al. 2023 is a journal paper, not a preprint. “Conformal prediction beyond exchangeability” appeared in The Annals of Statistics 51(2):816–845 (2023) — Barber, Candès, Ramdas & Tibshirani. Pinned to the journal.
- Angelopoulos & Bates 2021 and TabPFN 2022 are arXiv-year citations with later formal venues. Angelopoulos & Bates (arXiv 2021) was published in Foundations and Trends in ML 16(4), 2023; TabPFN (Hollmann et al., arXiv 2022) was published at ICLR 2023. Both are cited by their arXiv year (matching the spec) with the formal venue recorded in the bib
note.
The remaining canon held exactly as cited: SGC (Wu et al., ICML 2019), node2vec (Grover & Leskovec, KDD 2016), GraphSAGE (Hamilton et al., NeurIPS 2017), CNP (Garnelo et al., ICML 2018), ANP (Kim et al., ICLR 2019), Vovk et al. (Springer 2005), Tibshirani et al. (NeurIPS 2019), CF-GNN (Huang et al., NeurIPS 2023), NAPS (Clarkson, ICML 2023), and the three Stanković et al. monograph parts (arXiv 1907.03467 / 1909.10325 / 2001.00426, 2019–2020).