complexedleo commited on
Commit
33b7380
·
verified ·
1 Parent(s): f9fbb3a

Upload PCR + complex screening hybrid, Path-X test acc 0.9350

Browse files
Files changed (3) hide show
  1. README.md +103 -0
  2. config.json +40 -0
  3. pytorch_model.pt +3 -0
README.md ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ tags:
4
+ - pytorch
5
+ - long-range-arena
6
+ - path-x
7
+ - state-space-model
8
+ - linear-recurrence
9
+ - complex-valued-neural-network
10
+ - sequence-classification
11
+ datasets:
12
+ - long-range-arena
13
+ metrics:
14
+ - accuracy
15
+ ---
16
+
17
+ # PCR + Complex Screening Hybrid — Path-X (Long Range Arena)
18
+
19
+ A **phase-coherent linear recurrence (PCR)** model — a complex-diagonal
20
+ LRU/S4D-style recurrence — combined with a **non-competing complex
21
+ screening attention** module, trained on **Path-X** (Long Range Arena),
22
+ the 16,384-token binary sequence-connectivity task.
23
+
24
+ - **Task**: raw 1D token sequence in, single binary label out. No 2D
25
+ structure, no auxiliary supervision, no handcrafted features — the same
26
+ rule-compliant setting as S4/S5/LRU/MEGA on the LRA leaderboard.
27
+ - **Test accuracy**: **0.9350** (n=20,000, full deterministic sweep)
28
+ - **PCR-only ablation** (no screening attention): 0.9254 ± 0.0028 (N=2 seeds)
29
+
30
+ | Model | Path-X (test) |
31
+ |---|---|
32
+ | S4D-Real (θ=0, no phase) | chance |
33
+ | S4D-LegS | 91.9 |
34
+ | **PCR (this repo, screening ablated)** | **92.54 ± 0.28** |
35
+ | LRU | 94.2 |
36
+ | MEGA-chunk | 93.81 |
37
+ | **PCR + screening hybrid (this repo)** | **93.50** |
38
+ | S4 | 96.35 |
39
+ | MEGA | 97.98 |
40
+ | S5 | 98.58 |
41
+
42
+ ## Architecture
43
+
44
+ ```
45
+ tokens (B, 16384)
46
+ -> linear encoder (scalar pixel -> d_model)
47
+ -> 6 x PCRBlock:
48
+ [BatchNorm -> PCRLayer (complex diagonal LTI, bidirectional, FFT-conv)
49
+ -> half-GLU -> residual]
50
+ with ComplexScreenBlock inserted after layers 2 and 4:
51
+ [chunked (1024) non-competing complex screening attention:
52
+ L2-normalized complex q,k -> trim-and-square gate
53
+ (no softmax, no row-normalization) -> TanhNorm -> modReLU gate
54
+ -> complex Hadamard -> residual]
55
+ -> LayerNorm -> mean-pool -> linear head -> 2-class logits
56
+ ```
57
+
58
+ **Design principle (Phase-Coherent Transformer / PCT)**: complex
59
+ eigenvalues implement input-independent phase rotation as coherent
60
+ long-range transport (a continuous analogue of RoPE); all input-dependent
61
+ gating, normalization, and readout stay real-valued. ~94% of parameters
62
+ are complex-valued (100% within the recurrence and attention score/value
63
+ paths; the ~6% real-valued mass is the input-dependent gates, norms, and
64
+ readout — kept real by design, not by omission).
65
+
66
+ Full experimental record, ablations (phase-necessity via a real-eigenvalue
67
+ control, phase-bandwidth-vs-generalization sweep), and the training/eval
68
+ harness are described in the source repository (see below).
69
+
70
+ ## Files
71
+
72
+ - `pytorch_model.pt` — `state_dict` only (2,013,716 tensor elements across
73
+ 116 parameter tensors)
74
+ - `config.json` — architecture + optimizer config used for this run
75
+
76
+ ## Usage
77
+
78
+ Load with the `PCRClassifier` / `PCRBlock` / `ComplexScreenBlock` definitions
79
+ from the source training script (`train_with_checkpoint.py`, `cell="pcr"`
80
+ with `pcr_config` matching `config.json`'s `pcr_config` field). This repo
81
+ ships raw weights, not a packaged Python module — see the config for exact
82
+ hyperparameters to reconstruct the module before calling
83
+ `model.load_state_dict(torch.load("pytorch_model.pt"))`.
84
+
85
+ ## Training details
86
+
87
+ - Optimizer: AdamW, base lr 4.5e-4, recurrence/B/C params at 1/3 lr with no
88
+ weight decay, cosine-hold-then-linear-decay schedule (decay starts at
89
+ step 200,000), 250,000 steps total, batch size 32.
90
+ - Eigenvalue init: ring `|λ| ∈ [0.999, 0.9999]`, phase restricted to
91
+ `θ ∈ [0, π/10]` — the phase bandwidth was found necessary for
92
+ generalization (a narrower `[0, π/50]` band memorizes train perfectly
93
+ but fails to generalize; a real-only ablation, θ=0, fails to learn at
94
+ all).
95
+ - No dropout, weight decay 0.05, gradient clip 1.0.
96
+
97
+ ## Caveats
98
+
99
+ - Single seed for the hybrid checkpoint in this repo (N=1); the PCR-only
100
+ ablation number (92.54 ± 0.28) is averaged over 2 seeds.
101
+ - Not benchmarked beyond Path-X, LRA Text, and LRA Image; no
102
+ task-specific hyperparameter tuning was performed for those two
103
+ auxiliary benchmarks.
config.json ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architecture": "PCRClassifier (phase-coherent linear recurrence + non-competing complex screening attention hybrid)",
3
+ "task": "pathx",
4
+ "seq_len": 16384,
5
+ "vocab_size": 256,
6
+ "n_params": 2011660,
7
+ "training_steps": 250000,
8
+ "pcr_config": {
9
+ "d_model": 128,
10
+ "n_layers": 6,
11
+ "d_state": 256,
12
+ "norm": "batch",
13
+ "block": "s5",
14
+ "encoder": "linear",
15
+ "dropout": 0.0,
16
+ "r_min": 0.999,
17
+ "r_max": 0.9999,
18
+ "max_phase": 0.31416,
19
+ "lr_rec_factor": 0.3333,
20
+ "lr_bc_factor": 0.3333,
21
+ "screen_layers": [
22
+ 2,
23
+ 4
24
+ ],
25
+ "screen_heads": 4,
26
+ "screen_dim_head": 32,
27
+ "screen_chunk": 1024
28
+ },
29
+ "optimizer": {
30
+ "lr": 0.00045,
31
+ "weight_decay": 0.05,
32
+ "warmup": 2500,
33
+ "lr_scheduler": "hold_then_linear",
34
+ "lr_decay_start": 200000,
35
+ "lr_final_ratio": 0.1,
36
+ "clip_grad": 1.0,
37
+ "batch_size": 32
38
+ },
39
+ "seed": 0
40
+ }
pytorch_model.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f3ab75e7aad52d1d20a8f06def2bf6c4a7b4b8b3425966b68781a722cd0a80b0
3
+ size 8092339