Bidirectional Conditional Cycle Loss
Implementation & benchmark of arXiv:2608.31120 — On the Complexity of the Compatibility Problem for Succinctly Encoded Conditional Distributions
Source paper: On the Complexity of the Compatibility Problem for Succinctly Encoded Conditional Distributions arXiv:2608.31120 ⓘ · analyzed Sep 2, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea 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.
Formulas
Mathematical statement
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.
Implementation notes
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.
Verification
Stage 1 · Toy mechanism gate: Passed ✓
Stage 2 · Mechanism transferred to benchmark: Confirmed ✓
Stage 2 · Practical benchmark result: No measurable effect
Methodology: 8 paired seeds, permutation test (p<0.05) against a learning-rate-tuned baseline. How verification works
Stage 1 — Mechanism check agent confidence 8/10
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.
- Agent confidence
- 8/10
- 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
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.
How to run: python3 cycle_experiment.py
Stage 2 — Benchmark vs. tuned baseline (arXiv:2608.31120)
No significant difference vs. the tuned baseline (+0.0%, p=0.768, wins 4 / 8 paired seeds).
- Benchmark
- Bidirectional_conditional_joint
- Model
- bidirectional_mlp
- Paired seeds
- 8
- Baseline mean
- 1.757
- Idea mean
- 1.7574
- Effect (Δ)
- 0.0004 (+0.0%; negative = idea better)
- Wins
- 4 / 8 paired seeds
- p-value
- 0.768 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- n/a
- Mechanism
- Confirmed ✓
- Practical effect
- No effect
- Baseline tuning
- swept over 3 configs
Only the custom categorical conditional-compatibility track was tested; no MNIST, larger models, calibration, sampling consistency, or external bidirectional-imputation dataset was evaluated. The benchmark used 400 training and 400 test samples, a fixed 6x6 synthetic joint, 45 epochs, and three learning rates crossed with three cycle-loss strengths.
How to run: python3 bench_cycle.py
Verdict computed by deterministic test code from paired-seed statistics — not by the language model.
Stage 2 — Benchmark latest Failed ✗
Agent confidence: 9/10
Implemented a structurally matched custom categorical-joint track and trained identical bidirectional neural conditional systems with and without the log-space four-variable cycle penalty. The mechanism signature was confirmed: mean absolute residual decreased from 0.09545 to 0.05557, but held-out bidirectional NLL was marginally worse (1.75742 vs 1.75698), with paired delta +0.000447 and permutation p=0.76795. The idea therefore did not produce a significant task-metric win.
- Baseline
- 8-seed test bidirectional NLL mean=1.756976, std=0.027960; best lr=0.01; lr sweep {0.01, 0.03, 0.08}
- Idea
- 8-seed test bidirectional NLL mean=1.757423, std=0.026287; selected lr=0.03, lambda=1.0; paired delta=+0.000447, p=0.76795; mean |Delta| baseline=0.095445 vs idea=0.055569; p95 |Delta| baseline=0.248574 vs idea=0.138366
Benchmark result
No significant difference vs. the tuned baseline (+0.0%, p=0.768, wins 4 / 8 paired seeds).
- Benchmark
- Bidirectional_conditional_joint
- Model
- bidirectional_mlp
- Paired seeds
- 8
- Baseline mean
- 1.757
- Idea mean
- 1.7574
- Effect (Δ)
- 0.0004 (+0.0%; negative = idea better)
- Wins
- 4 / 8 paired seeds
- p-value
- 0.768 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- n/a
- Mechanism
- Confirmed ✓
- Practical effect
- No effect
- Baseline tuning
- swept over 3 configs
Only the custom categorical conditional-compatibility track was tested; no MNIST, larger models, calibration, sampling consistency, or external bidirectional-imputation dataset was evaluated. The benchmark used 400 training and 400 test samples, a fixed 6x6 synthetic joint, 45 epochs, and three learning rates crossed with three cycle-loss strengths.
How to run: python3 bench_cycle.py
Artifacts
- bench_cycle.py 4.8 KB View Raw
- bench_report.json 3.4 KB View Raw
- cycle_bench.py 7.0 KB View Raw
- cycle_experiment.py 6.0 KB View Raw
- cycle_track.py 1.0 KB View Raw
- report.md 1.5 KB View
- report_bench_2026-09-03T004610.md 3.7 KB View
- results.json 0.7 KB View Raw