{
 "artifacts": [
  {
   "name": "bench_report.json",
   "url": "https://synthcore.org/code/1219/bench_report.json"
  },
  {
   "name": "coprime_attention_experiment.py",
   "url": "https://synthcore.org/code/1219/coprime_attention_experiment.py"
  },
  {
   "name": "report.md",
   "url": "https://synthcore.org/code/1219/report.md"
  },
  {
   "name": "report_bench_2026-09-03T123435.md",
   "url": "https://synthcore.org/code/1219/report_bench_2026-09-03T123435.md"
  },
  {
   "name": "results.json",
   "url": "https://synthcore.org/code/1219/results.json"
  },
  {
   "name": "stage2_bench.py",
   "url": "https://synthcore.org/code/1219/stage2_bench.py"
  }
 ],
 "category": "architecture",
 "description": "Replace dense or single-dilation sparse attention with two sequential sparse attention stages whose offsets form co-prime arithmetic progressions. The first stage mixes tokens separated by multiples of M2, the second by multiples of M1; their composition reaches virtual offsets mM2+nM1, providing many structured long-range interactions from only M1+M2-1 physical offset families. Use causal masking and residual connections so the module can replace a standard transformer attention block without changing sequence length.",
 "download_zip": "https://synthcore.org/download/1219",
 "formulas_latex": [
  "$$M_s=\\left|\\mathcal{P}_{\\rm t}\\cup\\mathcal{P}_{\\rm r}\\right|=M_1+M_2-1.$$",
  "$$\\mathcal{V}_{\\rm CPA}=\\{(mM_2+nM_1)d\\mid m=0,\\ldots,M_1-1,\\;n=0,\\ldots,M_2-1\\}.$$",
  "$$\\operatorname{Attn}_{D}(X)_i=\\sum_{\\delta\\in D_i}\\operatorname{softmax}_{\\delta}\\!\\left(\\frac{q_i k_{i+\\delta}^{\\top}}{\\sqrt{d_h}}+b_{\\delta}\\right)v_{i+\\delta},\\qquad D_t=\\{mM_2\\}_{m=0}^{M_1-1},\\quad D_r=\\{nM_1\\}_{n=0}^{M_2-1}.$$",
  "$$H=\\operatorname{Attn}_{D_r}\\!\\left(\\operatorname{Attn}_{D_t}(X)\\right),\\qquad Y=X+W_oH,\\quad \\Delta_{\\rm virtual}=mM_2+nM_1.$$"
 ],
 "id": 3030,
 "implementation": "Integrate this as an alternative to one standard self-attention block in a decoder-only transformer. Choose small coprime integers, for example M1=3 and M2=4, and define signed offsets for bidirectional models or nonnegative offsets for causal models. For each layer, construct Dt={0,M2,2M2,...,(M1-1)M2} and Dr={0,M1,2M1,...,(M2-1)M1}; for every batch, head, and token i, gather only positions i+delta that are inside the sequence and respect the causal mask. Apply ordinary scaled dot-product attention independently in stage t and stage r, using separate Q/K/V projections or shared projections, then add a residual output projection and the normal MLP. Compact pseudocode is: `Dt=offsets(M2,M1); Dr=offsets(M1,M2); Z=sparse_attn(X,Dt); H=sparse_attn(Z,Dr); Y=X+Wo(H)`. The paper supplies the physical-count formula and cross-sum construction; no mathematical quantities need to be estimated during training. Enumerate all offset pairs (dt,dr) to measure the effective virtual-offset set and deduplicate sums, while separately counting multiply-adds, memory reads, and kernel launches. Start with a 6-layer, 256-dimensional character-level or WikiText-2 transformer at sequence length 1024. Compare dense attention, local-window attention with the same edge count, standard single-dilation attention, and the co-prime block. Report validation perplexity at equal training FLOPs, wall-clock throughput, peak activation memory, and the fraction of tokens receiving information from offsets above 128. The success signal is equal-or-lower perplexity with at least 2x lower attention cost, or substantially larger long-range coverage at the same edge budget. Ablate coprime pairs against non-coprime pairs such as (2,4), testing whether virtual-offset count and quality degrade as predicted.",
 "math_summary": "The paper defines two physical sensing position sets with coprime positive integers M1 and M2. Their shared origin gives Ms=M1+M2-1 distinct physical positions, while the cross-sum virtual array is V_CPA={(mM2+nM1)d | m=0,...,M1-1, n=0,...,M2-1}, where d is the base spacing. We transplant the cross-sum structure to token offsets by setting d=1 and using Dt={mM2} and Dr={nM1}. For a sequence x0,...,xL-1, let SparseAttn_D(X)i attend only to valid indices j=i+delta for delta in D, with learned relative bias b_delta and standard scaled dot-product softmax weights. The proposed block is H=SparseAttn_Dr(SparseAttn_Dt(X)), followed by a residual output projection. Its effective receptive-field offsets are sums delta_t+delta_r=mM2+nM1, the virtual positions from the paper. Coprimality gcd(M1,M2)=1 is the structural condition intended to reduce repeated offsets; boundary clipping and accidental duplicate offsets are handled by deduplicating the offset set or retaining multiple computational paths.",
 "math_tags": [
  "combinatorics",
  "linear-algebra",
  "number-theory"
 ],
 "ml_areas": [
  "attention",
  "transformer",
  "inference-speedup",
  "memory"
 ],
 "paper": {
  "arxiv_id": "2609.01979",
  "arxiv_url": "https://arxiv.org/abs/2609.01979",
  "summary_what_math_gives_to_ml": "The paper's transferable asset is a co-prime sparse geometry whose cross-sum produces many distinct virtual positions from only two short physical subarrays. In a neural sequence model, the same construction can generate a large, structured receptive field using two sparse mixing stages with offsets drawn from coprime dilation sets, rather than dense attention over all intermediate positions. The key engineering hypothesis is that coprimality gives better long-range coverage per edge while preserving hardware-friendly regular sparsity. This is most promising as a drop-in sparse-attention or token-mixing block, with experiments comparing quality and attention FLOPs against local, dilated, and block-sparse baselines.",
  "title": "ISAC with Co-Prime Arrays: Virtual-Aperture Sensing and uplink downlink communications",
  "year": "2026"
 },
 "ratings": {
  "difficulty": 5,
  "novelty": 7,
  "usefulness": 7
 },
 "solves": [
  "speedup",
  "memory",
  "scalability"
 ],
 "title": "Co-Prime Virtual-Aperture Attention",
 "url": "https://synthcore.org/idea/3030/co-prime-virtual-aperture-attention",
 "verification": {
  "benchmark": {
   "track": "sequence",
   "model": "transformer_tiny",
   "n_seeds": 8,
   "metric_direction": "lower is better",
   "comparison": {
    "baseline_mean": 0.14619511179625988,
    "idea_mean": 0.1398473186418414,
    "delta_mean": -0.0063477931544184685,
    "per_seed_diffs": [
     -0.03684164583683014,
     0.011210508644580841,
     0.025231890380382538,
     -0.01771964132785797,
     0.004966869950294495,
     -0.008309192955493927,
     -0.016433939337730408,
     -0.012887194752693176
    ],
    "idea_wins": 5,
    "n_pairs": 8,
    "p_value": 0.3787,
    "mde": 0.016241711340640855,
    "mde_rel_pct": 11.109613133492175,
    "verdict": "no significant win",
    "system_worked": false
   },
   "baseline": {
    "best_cfg": {
     "lr": 0.003
    },
    "sweep": [
     {
      "cfg": {
       "lr": 0.001
      },
      "mean": 0.1494479700922966
     },
     {
      "cfg": {
       "lr": 0.003
      },
      "mean": 0.14718072488904
     },
     {
      "cfg": {
       "lr": 0.01
      },
      "mean": 0.23090055957436562
     }
    ],
    "full": {
     "mean": 0.14619511179625988,
     "std": 0.023272144211599243,
     "per_seed": [
      0.19329272210597992,
      0.12494795769453049,
      0.12228920310735703,
      0.14819301664829254,
      0.1282258927822113,
      0.1327003538608551,
      0.1498585343360901,
      0.17005321383476257
     ],
     "n": 8
    }
   },
   "idea": {
    "mean": 0.1398473186418414,
    "std": 0.011513116013381047,
    "per_seed": [
     0.15645107626914978,
     0.13615846633911133,
     0.14752109348773956,
     0.13047337532043457,
     0.1331927627325058,
     0.12439116090536118,
     0.13342459499835968,
     0.1571660190820694
    ],
    "n": 8
   },
   "mechanism_signature": {
    "confirmed": true,
    "coverage": 1,
    "predicted_offsets_observed": [
     0,
     3,
     4,
     6,
     7,
     8,
     9,
     10,
     11,
     13,
     14,
     17
    ],
    "predicted_virtual_offsets": [
     0,
     3,
     4,
     6,
     7,
     8,
     9,
     10,
     11,
     13,
     14,
     17
    ]
   },
   "custom_track": null
  },
  "mechanism_confirmed": true,
  "peer_reviewed": false,
  "practical_verdict": "inconclusive",
  "stage1_mechanism_check": {
   "worked": true,
   "confidence": 8,
   "verdict": "Built a causal co-prime virtual-aperture attention MVP with M1=3 and M2=4, plus sparse and dense baselines. The math check reproduced 6 physical offset families, 12 unique virtual offsets, exact graph reachability, and fewer virtual offsets for the non-coprime (2,4) control. On a seeded lag-17 copy task, CPA reached 99.83% accuracy and loss 0.0201 at the same 7 attention edges per token as the sparse baseline, which reached 4.80% accuracy and loss 2.9467; this is a clear toy-task signal for long-range coverage, but not a speed win.",
   "metrics": {
    "baseline": "single sparse: loss 2.9467, accuracy 0.0480, 3.195 s; dense: loss 2.7531, accuracy 0.1445, 0.788 s",
    "idea": "CPA: loss 0.0201, accuracy 0.9983, 3.406 s; 7 attention edges/token, 12 virtual offsets, 50% of virtual offsets \u003e8"
   },
   "how_to_run": "python3 coprime_attention_experiment.py",
   "files": [
    "coprime_attention_experiment.py",
    "results.json",
    "run_output.txt",
    "run_output_lag17.txt"
   ],
   "limitations": "This is a tiny synthetic one-layer experiment with sequence length 24, one coprime pair, one non-coprime math control, and 180 optimization steps. It does not test language-model perplexity, multi-layer transformers, realistic data, equal FLOPs including projection costs, optimized sparse kernels, activation memory, or generalization beyond the fixed lag-17 task; measured wall-clock time was not improved."
  },
  "status": "mech_ok_no_baseline",
  "status_label": "Mechanism confirmed, baseline not beaten",
  "updated_at": "2026-09-03T12:34:35",
  "verdict_source": "deterministic test code (paired-seed permutation statistics)",
  "verification_axes": {
   "benchmark_mechanism": {
    "confirmed": true,
    "tested": true
   },
   "practical_benchmark": {
    "beats_baseline": false,
    "tested": true,
    "verdict": "inconclusive"
   },
   "toy_mechanism_gate": {
    "confirmed": true,
    "tested": true
   }
  }
 }
}
