arXiv:2610.11716cs.LGOct 2026

Manuscript Offprint

arXiv:2610.11716

4-Tensor Attention Model for Semantic Physical Reality

Jongwook Kim, Sangheon Yun

Abstract

We describe a 4-tensor attention model that predicts the next semantic state of a scene, for video generation and robot planning. A window of states has positions (x,t)(x,t) and two fibers, a semantic fiber and a temporal-context fiber, and one softmax normalizes attention jointly over the window. Frames and an agent's situation are written as those states; the encoder, the renderer, and the planner remain outside the update. To test the update on its own, we train on ROCStories, where each window poses the same next-sentence task at the semantic layer. On the validation split, with one seed per setting, the last-sentence cross-entropy on the three matched settings is lower for the 4-tensor model than for a free-running one-dimensional transformer by 5.3% at H=2H=2, L=2L=2, by 2.6% at H=4H=4, L=2L=2, and by 2.4% at H=4H=4, L=3L=3. At H=4H=4, L=2L=2 the parameter counts are nearly the same, 172.5M and 175.9M. On the same two GPUs that 4-tensor run finished in 2.4 hours and the baseline run in 45.2 hours; the baseline is trained by free-running decoding, one sequential forward pass per target token.

Code is available at https://github.com/indigowave511/semantic-world.

Keywords: 4-tensor attention, semantic representation

Contents

1 Introduction 4
1.1 Implementation Scheme 4
1.2 Scope of This Paper 4
1.3 The Semantic State Sequence 5
1.4 Rank-4 Representation 5
1.5 Score Tensor and Joint Softmax 6
1.6 Attention Output 6
1.7 Prediction Targets and the Learning Objective 7
1.8 Autoregressive Inference 7

2 4-Tensor Transformer Design 8
2.1 Overview of the Tensor Pipeline 8
2.2 Stage-by-Stage Logic 8
2.3 Joint-Phase Temporal Embedding 9
2.4 Final Assembly of the Input Tensor 10

3 Forward Pass and Pipeline Overview 10
3.1 Pipeline Overview 10
3.2 Residual After Attention 11
3.3 Event Position MLP Block 11
3.4 Residual After MLP and Readout-Boundary Normalization 11
3.5 Vocabulary Readout and Structured Factorization 12
3.5.1 Sequence-Independent Matrix Pre-computation 12
3.6 Structural Constraints Imposed by the Loss Objective 13
3.7 Mapping to the Vocabulary Simplex 13
3.8 From Embedding-Level Loss to Cross-Entropy Loss 13

4 Enabling Construction of the Forward Pipeline 14
4.1 Index convention and storage 14
4.2 Parameters, buffers, and initialization 15
4.3 Step 1: construction of the input tensor 15
4.4 Steps 2–5: one attention head 16
4.5 Multi-head sum and the Pre-LN layer 17
4.6 Readout and the training loss 18
4.7 End-to-end training procedure 19
4.8 Faithfulness checks 20

5 Reference Implementation 20
5.1 Input construction 21
5.2 Rank-4 attention head 21
5.3 Multi-head sum, Pre-LN, and the MLP 22
5.4 Tied readout, shifted loss, and the model step 22

6 4-Tensor Attention Backward Pass and Weight Update Rules 23
6.1 Joint Softmax Jacobian and Score Tensor Gradient 23
6.2 Gradients with Respect to Q, K, and V 24
6.3 Chain Rule to the Projection Weights 25
6.4 Gradient-Descent Update Rule 25

7 Comparative Baseline: Standard 1-Dimensional Autoregressive Attention 25
7.1 1-D Sequence Packing and Standard QKV Architecture 26
7.2 Informational Parity via Free-Running Autoregressive Decoding 27
7.3 Architectural Alignment and Capacity Matching 27
7.4 Baseline design pipeline 28
7.5 Code for the fair comparison 30

8 Experimental Setup 30
8.1 Corpus and windows 31
8.2 Optimization and checkpoint rule 31
9 Experiment Data 31
10 Discussion 33