{
 "artifacts": [
  {
   "name": "bench_report.json",
   "url": "https://synthcore.org/code/1146/bench_report.json"
  },
  {
   "name": "cycle_bench.py",
   "url": "https://synthcore.org/code/1146/cycle_bench.py"
  },
  {
   "name": "cycle_experiment.py",
   "url": "https://synthcore.org/code/1146/cycle_experiment.py"
  },
  {
   "name": "report.md",
   "url": "https://synthcore.org/code/1146/report.md"
  },
  {
   "name": "results.json",
   "url": "https://synthcore.org/code/1146/results.json"
  }
 ],
 "category": "regularization",
 "description": "Train two neural conditionals, q_theta(x|y) and r_phi(y|x), with an additional loss penalizing violations of the paper's four-variable compatibility identity. Evaluating the constraint in log space turns multiplicative probability inconsistencies into additive residuals and avoids underflow. The method applies to discrete latent-variable models, bidirectional imputers, and systems with separate neural models for both conditional directions.",
 "download_zip": "https://synthcore.org/download/1146",
 "formulas_latex": [
  "$$p(x_{1}|y_{1})p(y_{1}|x_{2})p(x_{2}|y_{2})p(y_{2}|x_{1})=p(y_{1}|x_{1})p(x_{1}|y_{2})p(y_{2}|x_{2})p(x_{2}|y_{1})$$",
  "$$\\Delta=\\log q_\\theta(x_1|y_1)+\\log r_\\phi(y_1|x_2)+\\log q_\\theta(x_2|y_2)+\\log r_\\phi(y_2|x_1)-\\log r_\\phi(y_1|x_1)-\\log q_\\theta(x_1|y_2)-\\log r_\\phi(y_2|x_2)-\\log q_\\theta(x_2|y_1)$$",
  "$$L=L_{\\mathrm{task}}+\\lambda\\,\\mathbb{E}_{x_1,x_2,y_1,y_2}[\\rho(\\Delta)]$$",
  "$$\\rho(z)=\\begin{cases}\\frac{1}{2}z^2,\u0026|z|\\leq\\delta\\\\\\delta\\left(|z|-\\frac{1}{2}\\delta\\right),\u0026|z|\u003e\\delta\\end{cases}$$"
 ],
 "id": 2953,
 "implementation": "Integrate the method at the loss level in a model exposing both conditional directions, such as a discrete latent-variable model, a bidirectional imputer, or two transformer heads sharing an encoder. For each minibatch, compute logits and log-softmax outputs for q_theta(x|y) and r_phi(y|x). Sample two distinct X values and two distinct Y values per training example, either from observed values, the model's marginal samples, or uniformly from the categorical support. Gather the eight log-probability entries and compute Delta exactly from the displayed equation. Add lambda times the mean squared or Huber Delta to the ordinary task loss. Pseudocode: `log_q = model_q(y); log_r = model_r(x); sample x1,x2,y1,y2; Delta = log_q[x1,y1] + log_r[y1,x2] + log_q[x2,y2] + log_r[y2,x1] - log_r[y1,x1] - log_q[x1,y2] - log_r[y2,x2] - log_q[x2,y1]; loss = task_loss + lambda * huber(Delta); loss.backward()`. Use log-softmax directly, and restrict the first experiment to full-support categorical outputs. The network estimates probabilities; no mathematical quantities need to be estimated externally. Test first on synthetic data sampled from a known joint over X and Y, comparing independently trained conditionals against the same architecture with the cycle loss at equal parameters, steps, and FLOPs. Then test discrete latent codes on MNIST. Pre-register that the held-out 95th-percentile absolute cycle residual must decrease by at least 10x, while conditional calibration or recovered-joint error improves at fixed task loss. Measure residuals on 10,000 unseen quadruples. Ablate only lambda by setting lambda to zero, plus a shuffled-quadruple control. The transfer is falsified if training residuals decrease but held-out residuals do not, or if compatibility improves without any improvement in joint recovery, calibration, or sampling consistency.",
 "math_summary": "The paper gives the following necessary condition for compatibility of strictly positive conditionals: p(x_1|y_1)p(y_1|x_2)p(x_2|y_2)p(y_2|x_1) = p(y_1|x_1)p(x_1|y_2)p(y_2|x_2)p(x_2|y_1). Here x_1 and x_2 are values of X, y_1 and y_2 are values of Y, and p denotes the two conditional distributions. Define q_theta(x|y) and r_phi(y|x) as the neural approximations. Taking logarithms gives the residual Delta = log q_theta(x_1|y_1) + log r_phi(y_1|x_2) + log q_theta(x_2|y_2) + log r_phi(y_2|x_1) - log r_phi(y_1|x_1) - log q_theta(x_1|y_2) - log r_phi(y_2|x_2) - log q_theta(x_2|y_1). Exact positive-support compatibility implies Delta = 0 for every quadruple. The regularizer is L_cycle = E[rho(Delta)], where rho(z) can be z^2 or the Huber penalty with threshold delta. This uses the paper's incompatibility certificate as a differentiable training constraint.",
 "math_tags": [
  "probability",
  "algebra",
  "graph-theory"
 ],
 "ml_areas": [
  "loss",
  "regularization",
  "vae"
 ],
 "paper": {
  "arxiv_id": "2608.31120",
  "arxiv_url": "https://arxiv.org/abs/2608.31120",
  "summary_what_math_gives_to_ml": "The paper identifies compatibility of two conditional distributions as multiplicative constraints around cycles in their bipartite support graph. For strictly positive discrete conditionals, a four-variable cross-product identity detects incompatibility, while log transformation converts each multiplicative constraint into an additive cycle-sum constraint. This suggests training paired neural conditional models with explicit compatibility regularization rather than assuming independently trained conditionals define a valid joint distribution. The most practical transfers are a log-domain four-cycle loss and a graph-theoretic fundamental-cycle basis that avoids enumerating all cycles.",
  "title": "On the Complexity of the Compatibility Problem for Succinctly Encoded Conditional Distributions",
  "year": "2026"
 },
 "ratings": {
  "difficulty": 3,
  "novelty": 6,
  "usefulness": 7
 },
 "solves": [
  "accuracy",
  "stability",
  "generalization"
 ],
 "title": "Bidirectional Conditional Cycle Loss",
 "url": "https://synthcore.org/idea/2953/bidirectional-conditional-cycle-loss",
 "verification": {
  "peer_reviewed": false,
  "stage1_mechanism_check": {
   "worked": true,
   "confidence": 8,
   "verdict": "Built a small PyTorch implementation of bidirectional conditional cycle loss using log-softmax probabilities and the paper’s eight-term compatibility residual. The exact-conditionals sanity check gave maximum absolute residual 6.7e-16, while random incompatible conditionals had mean absolute residual 4.27. On a fixed positive synthetic joint, lambda=0.5 reduced held-out 95th-percentile residual from 0.180 to 0.0724 (about 2.5x) and held-out mean residual from 0.0770 to 0.0285, with nearly unchanged task NLL and a tiny joint-L1 improvement from 0.1266 to 0.1257. This is a real compatibility signal, but it does not meet the proposed 10x threshold and is not evidence of a large accuracy gain.",
   "metrics": {
    "baseline": "heldout p95 |Delta|=0.1798533; heldout mean |Delta|=0.0769958; joint L1=0.1265701; task NLL=1.3049408",
    "idea": "lambda=0.5: heldout p95 |Delta|=0.0723756; heldout mean |Delta|=0.0284948; joint L1=0.1257352; task NLL=1.3050591; exact math check max |Delta|=6.66e-16"
   },
   "how_to_run": "python3 cycle_experiment.py",
   "files": [
    "cycle_experiment.py",
    "results.json"
   ],
   "limitations": "Only a 4x4 synthetic categorical joint and one random seed/lambda were tested. The experiment did not test MNIST, larger neural architectures, calibration, sampling consistency, FLOPs/speed, shuffled-quadruple controls, or robustness across multiple datasets and seeds."
  },
  "status": "unverified",
  "status_label": "Unverified",
  "updated_at": "2026-09-02T12:51:46",
  "verdict_source": "deterministic test code (paired-seed permutation statistics)",
  "verification_axes": {
   "benchmark_mechanism": {
    "confirmed": null,
    "tested": false
   },
   "practical_benchmark": {
    "beats_baseline": null,
    "tested": false
   },
   "toy_mechanism_gate": {
    "confirmed": true,
    "tested": true
   }
  }
 }
}
