Skip to content

Commit 78b99a6

Browse files
committed
Refine PSVM paper framing and add spec
1 parent 0ca0a6c commit 78b99a6

4 files changed

Lines changed: 394 additions & 37 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,10 @@ This pipeline does:
258258
- [invoice/export_total_dataset.mjs](/Users/avirajkhare/hack2/transformers/transformer-in-notion/invoice/export_total_dataset.mjs) - synthetic OCR receipt dataset generator
259259
- [invoice/train_total_selector.py](/Users/avirajkhare/hack2/transformers/transformer-in-notion/invoice/train_total_selector.py) - local transformer trainer for `TOTAL` vs `NOT_TOTAL`
260260
- [scripts/predict_receipt_total.py](/Users/avirajkhare/hack2/transformers/transformer-in-notion/scripts/predict_receipt_total.py) - local inference over extracted receipt candidates
261+
- [docs/paper-idea-problem-shaped-vms.md](/Users/avirajkhare/hack2/transformers/transformer-in-notion/docs/paper-idea-problem-shaped-vms.md) - implementation and systems paper draft for the PSVM thesis
262+
- [docs/psvm-yellow-paper.md](/Users/avirajkhare/hack2/transformers/transformer-in-notion/docs/psvm-yellow-paper.md) - companion yellow-paper-style spec for PSVM runtime and trace semantics
261263
- [soduku/structured_transformer_common.py](/Users/avirajkhare/hack2/transformers/transformer-in-notion/soduku/structured_transformer_common.py) - shared structured transformer/GNN training/export utilities
262264
- [soduku/meta.md](/Users/avirajkhare/hack2/transformers/transformer-in-notion/soduku/meta.md) - meta pattern and runtime philosophy
263-
- [docs/paper-idea-problem-shaped-vms.md](/Users/avirajkhare/hack2/transformers/transformer-in-notion/docs/paper-idea-problem-shaped-vms.md) - paper note for PSVMs
264265
- [weiqi/psvm5x5.mjs](/Users/avirajkhare/hack2/transformers/transformer-in-notion/weiqi/psvm5x5.mjs) - exact Weiqi PSVM
265266

266267
## Design summary

docs/paper-idea-problem-shaped-vms.md

Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,48 @@ X: `@avirajkhare00` (`x.com/avirajkhare00`)
66

77
## Abstract
88

9-
Small local transformers are poorly matched to exact tasks when the only choices
10-
are one-shot answer prediction or full general-purpose machine emulation.
11-
One-shot prediction hides the intermediate state transitions that exact
12-
computation depends on. Full-machine execution preserves far more semantics than
13-
most narrow tasks actually need: memory plumbing, broad instruction surfaces,
14-
and control flow that is irrelevant to the application. This note argues for an
15-
intermediate target: **problem-shaped virtual machines (PSVMs)**. A PSVM is the
16-
smallest executable substrate whose legal actions match the real state
17-
transitions of a task family. The exact runtime remains the source of truth: it
18-
defines legality, emits canonical traces, verifies proposed actions, and owns
19-
rollback or failure handling. The model learns only to evaluate the ambiguous
20-
frontier of execution. This repository already contains several pieces of that
21-
stack,
22-
including exact browser-local Sudoku runtimes, worker-driven trace streaming,
23-
structured model training paths, and a small invoice-calculation PSVM. The
24-
strongest current claim is not that the model can replace the runtime, but that
25-
the smallest sound VM for a task is a better local training target than either
26-
direct answer prediction or full machine emulation.
9+
Small local transformers are poorly matched to exact tasks when the formulation
10+
is either one-shot answer prediction or full machine emulation. One-shot
11+
prediction hides the intermediate state transitions that exact computation
12+
depends on, while full-machine traces preserve large amounts of irrelevant
13+
machine detail. This paper argues for an intermediate target:
14+
**problem-shaped virtual machines (PSVMs)**, where the instruction surface is
15+
trimmed to the true legal transitions of a task family. In a PSVM system, the
16+
exact runtime remains the source of truth: it defines legal actions, emits
17+
canonical state records, verifies proposed steps, and handles rollback or
18+
failure. The learned component is not asked to replace execution, but to score
19+
ambiguity by ranking legal branches or estimating value over exact PSVM states.
20+
We describe this design pattern through browser-local prototypes for Sudoku and
21+
document extraction, including exact runtimes, structured training pipelines,
22+
local inference, and live execution traces. The central claim is modest but
23+
strong: for narrow exact tasks, models are better used as decision heuristics
24+
inside a task-shaped executable substrate than as free-running solvers or
25+
emulators of broad virtual machines.
26+
27+
## Paper Type and Scope
28+
29+
This document should be read as an **implementation and systems paper**, not as
30+
a finished empirical benchmark paper and not as a normative universal VM spec.
31+
Its strongest contribution is a repository-backed architecture and design
32+
argument:
33+
34+
- shape the machine to the task
35+
- keep symbolic truth in exact code
36+
- train the model on the narrow ambiguous frontier of execution
37+
38+
The companion normative document for machine and trace semantics is
39+
[PSVM Runtime and Trace Semantics](/Users/avirajkhare/hack2/transformers/transformer-in-notion/docs/psvm-yellow-paper.md).
40+
That spec is intentionally narrower: it defines the common execution contract
41+
for PSVM runtimes, canonical traces, verifier behavior, and model/runtime
42+
interfaces without claiming that all task families should share one universal
43+
machine.
44+
45+
## AI Assistance Disclosure
46+
47+
This paper was drafted and edited with AI assistance. The author directed the
48+
scope, selected the claims, validated the implementation references against the
49+
repository, and is responsible for the final wording, technical judgments, and
50+
positioning.
2751

2852
## One-Sentence Thesis
2953

docs/paper-idea-problem-shaped-vms.tex

Lines changed: 47 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -66,25 +66,54 @@ \section{Problem-Shaped Virtual Machines for Exact Local Transformer
6666

6767
\subsection{Abstract}\label{abstract}
6868

69-
Small local transformers are poorly matched to exact tasks when the only
70-
choices are one-shot answer prediction or full general-purpose machine
69+
Small local transformers are poorly matched to exact tasks when the
70+
formulation is either one-shot answer prediction or full machine
7171
emulation. One-shot prediction hides the intermediate state transitions
72-
that exact computation depends on. Full-machine execution preserves far
73-
more semantics than most narrow tasks actually need: memory plumbing,
74-
broad instruction surfaces, and control flow that is irrelevant to the
75-
application. This note argues for an intermediate target:
76-
\textbf{problem-shaped virtual machines (PSVMs)}. A PSVM is the smallest
77-
executable substrate whose legal actions match the real state
78-
transitions of a task family. The exact runtime remains the source of
79-
truth: it defines legality, emits canonical traces, verifies proposed
80-
actions, and owns rollback or failure handling. The model learns only
81-
to evaluate the ambiguous frontier of execution. This repository already contains
82-
several pieces of that stack, including exact browser-local Sudoku
83-
runtimes, worker-driven trace streaming, structured model training
84-
paths, and a small invoice-calculation PSVM. The strongest current claim
85-
is not that the model can replace the runtime, but that the smallest
86-
sound VM for a task is a better local training target than either direct
87-
answer prediction or full machine emulation.
72+
that exact computation depends on, while full-machine traces preserve
73+
large amounts of irrelevant machine detail. This paper argues for an
74+
intermediate target: \textbf{problem-shaped virtual machines (PSVMs)},
75+
where the instruction surface is trimmed to the true legal transitions
76+
of a task family. In a PSVM system, the exact runtime remains the source
77+
of truth: it defines legal actions, emits canonical state records,
78+
verifies proposed steps, and handles rollback or failure. The learned
79+
component is not asked to replace execution, but to score ambiguity by
80+
ranking legal branches or estimating value over exact PSVM states. We
81+
describe this design pattern through browser-local prototypes for Sudoku
82+
and document extraction, including exact runtimes, structured training
83+
pipelines, local inference, and live execution traces. The central claim
84+
is modest but strong: for narrow exact tasks, models are better used as
85+
decision heuristics inside a task-shaped executable substrate than as
86+
free-running solvers or emulators of broad virtual machines.
87+
88+
\subsection{Paper Type and Scope}\label{paper-type-and-scope}
89+
90+
This document should be read as an \textbf{implementation and systems
91+
paper}, not as a finished empirical benchmark paper and not as a
92+
normative universal VM spec. Its strongest contribution is a
93+
repository-backed architecture and design argument:
94+
95+
\begin{itemize}
96+
\tightlist
97+
\item
98+
shape the machine to the task
99+
\item
100+
keep symbolic truth in exact code
101+
\item
102+
train the model on the narrow ambiguous frontier of execution
103+
\end{itemize}
104+
105+
The companion normative document for machine and trace semantics is
106+
\texttt{docs/psvm-yellow-paper.md}. That spec is intentionally narrower:
107+
it defines the common execution contract for PSVM runtimes, canonical
108+
traces, verifier behavior, and model/runtime interfaces without
109+
claiming that all task families should share one universal machine.
110+
111+
\subsection{AI Assistance Disclosure}\label{ai-assistance-disclosure}
112+
113+
This paper was drafted and edited with AI assistance. The author
114+
directed the scope, selected the claims, validated the implementation
115+
references against the repository, and is responsible for the final
116+
wording, technical judgments, and positioning.
88117

89118
\subsection{One-Sentence Thesis}\label{one-sentence-thesis}
90119

0 commit comments

Comments
 (0)