Upload PROOF_EMB_README.md with huggingface_hub
Browse files- PROOF_EMB_README.md +57 -0
PROOF_EMB_README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Proof embeddings — vector_behavior
|
| 2 |
+
|
| 3 |
+
Vectors for the proofs, made with the same models and the same pooling as the statement
|
| 4 |
+
spaces already in this repo, so the two are directly comparable.
|
| 5 |
+
|
| 6 |
+
| directory | what one row is | rows | dim |
|
| 7 |
+
|---|---|---|---|
|
| 8 |
+
| `proof_emb/e5-large-v2_theorem/` | one theorem's whole tactic script | 61,542 | 1024 |
|
| 9 |
+
| `proof_emb/e5-large-v2_step/` | one tactic invocation with its goal state | ~259,580 | 1024 |
|
| 10 |
+
| `proof_emb/e5-mistral-7b-instruct_theorem/` | one theorem's whole tactic script | 61,542 | 4096 |
|
| 11 |
+
|
| 12 |
+
Each directory holds `embeddings.npy`, `idx_to_name.json`, `meta.json`, and for the step
|
| 13 |
+
granularity `step_meta.json.gz` with the theorem, step index and premises per row.
|
| 14 |
+
|
| 15 |
+
## Lining a proof up with its statement
|
| 16 |
+
|
| 17 |
+
Row `i` of a proof space is the theorem named at `idx_to_name.json[i]`. The statement
|
| 18 |
+
spaces are keyed the same way, so going between them is a name lookup:
|
| 19 |
+
|
| 20 |
+
```python
|
| 21 |
+
import json, numpy as np
|
| 22 |
+
|
| 23 |
+
P = np.load("proof_emb/e5-large-v2_theorem/embeddings.npy")
|
| 24 |
+
pn = json.load(open("proof_emb/e5-large-v2_theorem/idx_to_name.json"))
|
| 25 |
+
S = np.load("embeddings/e5_large/embeddings.npy")
|
| 26 |
+
sn = json.load(open("embeddings/e5_large/idx_to_name.json"))
|
| 27 |
+
|
| 28 |
+
si = {n: i for i, n in enumerate(sn)}
|
| 29 |
+
both = [(i, si[n]) for i, n in enumerate(pn) if n in si] # 56,467 theorems
|
| 30 |
+
pi, sj = zip(*both)
|
| 31 |
+
proof_vecs, stmt_vecs = P[list(pi)], S[list(sj)]
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
56,467 of the 61,542 proved theorems are also in the 99,552-theorem statement pool. The
|
| 35 |
+
rest have proofs but no statement embedding.
|
| 36 |
+
|
| 37 |
+
For step rows, `idx_to_name.json[i]` is `"<theorem>#<step index>"`; split on `#` to get
|
| 38 |
+
back to the theorem.
|
| 39 |
+
|
| 40 |
+
## Truncation
|
| 41 |
+
|
| 42 |
+
Proofs are much longer than statements and everything is encoded at 512 tokens, so long
|
| 43 |
+
tactic scripts are cut off. The exact count is in each directory's `meta.json` as
|
| 44 |
+
`n_truncated` / `frac_truncated` — check it before drawing conclusions about long proofs.
|
| 45 |
+
|
| 46 |
+
## Please read this before using them
|
| 47 |
+
|
| 48 |
+
In the parent study proofs are **held back on purpose**. Every claim about discovered
|
| 49 |
+
structure is checked by asking whether the grouped theorems share proof premises, and
|
| 50 |
+
that check has force only because no encoder was ever shown a proof.
|
| 51 |
+
|
| 52 |
+
These vectors break that. Any structure found with them cannot then be validated against
|
| 53 |
+
proofs — that is confirming a finding with the thing that produced it. Validate with
|
| 54 |
+
something else: human judgement, a held-out corpus, or the source organisation.
|
| 55 |
+
|
| 56 |
+
The same applies to `real_pairs_verified.json.gz` in this repo, which is the answer key
|
| 57 |
+
for the pairing step rather than the discovery step.
|