Skip to content

Commit 0c87f72

Browse files
committed
Lift the 1540px vision ceiling by rebuilding the Pixtral RoPE table; map its limits
Follow-up on the four review questions: better settings, a newer model, a hidden resolution knob. The useful answer is the third. The 1540px ceiling is soft, not hard. Last week's file called it a hard architectural limit. The vision tower precomputes a 110x110 RoPE table (image_size//patch_size = 1540//14) and a larger image indexes past it and asserts -- but the table is analytic and can be rebuilt for any image_size with no retraining. Wired in as run_lightonocr.py --rope-rebuild (acts only when --longest > 1540; the module lives at model.vision_encoder.patch_positional_embedding and its buffers need an explicit .to(device)). At 2464 (176 patches/side) it runs clean, VRAM 4.2 -> 5.1 GB, and on the feasibility probe the duplicate-line fraction on the most starved poster fell 0.30 -> 0.09. But bigger is not uniformly better, because extrapolating the grid past the trained 110 band has its own cost. Full corpus at 2464-rebuild vs 1540: rField 0.765 -> 0.731 overall, but split by native DPI the picture is clear -- already-fine posters (>=40 DPI) degrade -0.075 (they gain no detail, only untrained positions), while starved posters (<40 DPI) are a wash on average (-0.009) yet swing hard per poster: 42 +0.234 (rField to 0.99), gasimova -0.167 (its banner was already 1.00 at 1540). Two dense posters truncated at 2464 for want of token budget. So the lever is real but "render bigger" is wrong: the follow-up is adaptive per-poster resolution -- scale toward ~80-100 DPI, cap near 2464 to stay in safe extrapolation, never upscale a poster already above target -- plus a higher token cap. RESOLUTION.md and rope_crossover.py carry the full per-poster table. Two dead ends confirmed, one a retraction. Generation settings do NOT fix the isporeu loop: greedy, the card's temp0.2/top_p0.9, and greedy+rep_penalty all loop identically (dup 0.42-0.43). I implied last week that running greedy was our bug; it was not. The loop begins exactly at a <th>Treatment</th> HTML table cell -- the model degenerates transcribing a dense results table, a model limitation, not a decoding artifact. And no newer or higher-res model exists: LightOnOCR-2 is the current flagship, the sibling checkpoints (-ocr-soup, -bbox) are all 1B/1540px, and 0.9B-32k is a pruned vocabulary not a bigger context. Adds probe scripts (probe_combined.py, probe_rope2.py), the crossover analysis, and the 2464 raw outputs so the per-poster claims are reproducible without a GPU.
1 parent 18771d3 commit 0c87f72

27 files changed

Lines changed: 6704 additions & 0 deletions

calibration/vlm/FINDINGS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ merge, no marker parsing. It also returns wrapped titles in one piece.
6161

6262
## Resolution: the ceiling is architectural, and posters fall off it
6363

64+
> UPDATE 2026-07-24: "architectural" was too strong. The 1540px ceiling
65+
> is SOFT -- the Pixtral vision RoPE table can be rebuilt for a larger
66+
> image_size with no retraining (run_lightonocr.py --rope-rebuild). It
67+
> helps the worst-starved posters but not for free. See RESOLUTION.md.
68+
6469
**1540px is not a setting.** `PixtralVisionConfig.image_size = 1540`,
6570
`patch_size = 14`, so the vision tower's 2D RoPE table holds 110 patch
6671
positions per axis. Hand it a bigger image and it indexes off the end:

calibration/vlm/RESOLUTION.md

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Resolution and settings follow-up (2026-07-24)
2+
3+
Four questions from the review: better generation settings? a newer model? a
4+
hidden resolution knob in the config? The answers, in order of usefulness.
5+
6+
## 1. The 1540px ceiling is soft: the vision RoPE table can be rebuilt
7+
8+
This is the real finding. Last week's file called 1540px a "hard architectural
9+
ceiling". It is not. The vision tower precomputes a
10+
`max_patches_per_side x max_patches_per_side` RoPE table where
11+
`max_patches_per_side = image_size // patch_size = 1540 // 14 = 110`
12+
(`PixtralRotaryEmbedding.compute_default_rope_parameters`). A larger image
13+
indexes past 110 and asserts -- but the table is analytic, so it can be rebuilt
14+
for any `image_size`:
15+
16+
enc = model.model.vision_encoder
17+
c = enc.patch_positional_embedding.config
18+
c.image_size = 2464 # 176 patches/side
19+
emb = PixtralRotaryEmbedding(c).to(dev) # buffers need explicit .to(dev)
20+
emb.inv_freq = emb.inv_freq.to(dev)
21+
emb.original_inv_freq = emb.original_inv_freq.to(dev)
22+
enc.patch_positional_embedding = emb
23+
24+
No retraining. Wired into the runner as `--rope-rebuild` (only acts when
25+
`--longest > 1540`). At 2464 it runs clean -- coherent text, VRAM 4.2 -> 5.1 GB,
26+
and on the feasibility probe the duplicate-line fraction on the most starved
27+
poster actually FELL (0.30 -> 0.09). NTK theta-scaling on top gave nothing extra
28+
and 3080 began to degrade, so plain table-rebuild at ~1.6x is the sweet spot.
29+
30+
## 2. But more resolution is not a blanket win, because extrapolation has a cost
31+
32+
Scored full corpus at 2464-rebuild vs 1540 (`rope_crossover.py`). Corpus rField
33+
went DOWN, 0.765 -> 0.731, head-to-head 8 wins / 11 losses. The per-poster split
34+
by native effective DPI:
35+
36+
already-fine (>=40 DPI at 1540) n=5 mean d rField -0.075 clearly worse
37+
starved (<40 DPI) n=13 mean d rField -0.009 a wash
38+
39+
The already-fine posters degrade cleanly (6724771 0.98 -> 0.80, 4560930
40+
0.65 -> 0.53): they are small, already at or above native resolution, so 2464
41+
only pushes their patch grid into the never-trained 110-176 band for no added
42+
detail. That is the cost of extrapolation, and it is real.
43+
44+
The starved posters are a genuine mixed bag, not the uniform win the DPI theory
45+
predicted:
46+
47+
42 (32 DPI) rField 0.76 -> 0.99 +0.234 <- huge
48+
aysaekanger(33) 0.69 -> 0.76 +0.073
49+
8228476 (33) 0.50 -> 0.56 +0.052
50+
gasimova (33) 0.90 -> 0.74 -0.167 <- its banner was already 1.00
51+
AISec (33) 0.84 -> 0.74 -0.093
52+
10890106 (28) truncated at 2464 (more pixels -> more tokens)
53+
5128504 (35) truncated at 2464
54+
55+
So added detail helps some starved posters a lot and destabilizes others whose
56+
banner was already perfect at 1540. The extrapolation cost competes with the
57+
detail gain, and which wins is per-poster.
58+
59+
**Conclusion:** RoPE rebuild is a real, working lever, but "just render bigger"
60+
is wrong. The right design is ADAPTIVE per-poster resolution -- scale each
61+
poster toward a target effective DPI (~80-100), CAP at ~1.6x the trained grid
62+
(≈2464) to stay in the safe extrapolation band, and never upscale a poster
63+
already above target. Plus a higher token budget, since more pixels truncated
64+
two dense posters at 6144. That is the follow-up worth running; a fixed edge is
65+
not it.
66+
67+
## 3. Generation settings do NOT fix the failures (retraction of "we ran it wrong")
68+
69+
I noted last week that we used greedy while the shipped `generation_config.json`
70+
is `do_sample=true, temperature=0.2, top_p=0.9`, and implied that was our bug.
71+
Tested on isporeu2023, the poster that loops (`probe_combined.py`):
72+
73+
greedy (what we ran) 3072tok dup=0.43 LOOP
74+
card: temp0.2 top_p0.9 3072tok dup=0.43 LOOP
75+
greedy + rep_penalty1.15 3072tok dup=0.42 LOOP
76+
77+
All three loop identically. Honoring the config is more correct and we should do
78+
it, but it changes nothing on the hard cases. The isporeu loop is not a decoding
79+
artifact: it begins exactly at `<th>Treatment</th>` (line 105, first repeat of
80+
line 75) -- the model degenerates trying to transcribe a dense
81+
cost-effectiveness RESULTS TABLE as HTML. That is a known VLM-OCR failure mode
82+
and a model limitation, not a setting. The banner and prose above it are clean.
83+
84+
## 4. No newer or higher-res model exists
85+
86+
LightOnOCR-2 (Jan 2026) is current and is the flagship. Checked the org: the
87+
only other checkpoints are same-size variants -- `-base`, `-ocr-soup` (weight
88+
average), `-bbox` (adds bounding boxes) -- all 1B, all 1540px vision. There is
89+
no 2B, no larger, no higher-resolution model. The `LightOnOCR-0.9B-32k` "32k" is
90+
a pruned VOCABULARY (European-language speedup), not context length or
91+
resolution. `-bbox` is worth a look ONLY if we later want layout coordinates;
92+
it does not change the resolution story.
93+
94+
## Net
95+
96+
The banner win from last week stands (VLM reads author/affiliation structure far
97+
better than xy_cut). The resolution ceiling is liftable and helps the worst
98+
posters, but not for free, so the next experiment is adaptive resolution + token
99+
budget, not a bigger fixed render. Settings and model-shopping are dead ends:
100+
the config is already optimal and there is nothing newer to buy.

calibration/vlm/out_rope2464/10890106.md

Lines changed: 156 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# OPTIMIZATION AND VALIDATION OF A BIOCHEMICAL FRET ASSAY FOR THE EXONUCLEASE ACTIVITY OF SARS COV-2 NSP14-NSP10 COMPLEX
2+
3+
Laura Dettori$^{1,2}$, Paolo Malune$^{2}$, Marta Maria Cara$^{1,2}$, Salvatore Nieddu$^{2}$, Enzo Tramontano$^{2}$ and Francesca Esposito$^{2}$
4+
5+
$^{1}$National PhD Programme in One Health approaches to infectious diseases and life science research, Department of Public Health, Experimental and Forensic Medicine, University of Pavia, Pavia, 27100, Italy.
6+
7+
$^{2}$Department of Life and Environmental Sciences, University of Cagliari, 09042, Monserrato, Italy.
8+
9+
---
10+
11+
## INTRODUCTION
12+
13+
SARS-CoV-2, the virus responsible for COVID-19, has one of the longest RNA genomes among RNA viruses. To correct replication errors, it uses a unique proofreading mechanism involving the nsp14 protein, which has 3'-5' exonuclease activity, assisted by the cofactor nsp10. Currently, there are no drugs targeting this function. To support antiviral research, nsp14 and nsp10 were expressed and purified in E. Coli cells, and a FRET-based biochemical assay was developed to study their exonuclease activity, as previously mentioned in the literature [1]. This system lays the groundwork for identifying future inhibitors of the nsp14-nsp10 complex.
14+
15+
---
16+
17+
## WORKFLOW
18+
19+
![image](image_1.png)
20+
21+
---
22+
23+
## RESULTS
24+
25+
### 1. Size-exclusion chromatography (SEC)
26+
27+
![image](image_2.png)
28+
29+
nsp14
30+
31+
nsp10
32+
33+
### 2. pH dose-dependent
34+
35+
![image](image_3.png)
36+
37+
pH 7.5
38+
39+
### 3. MgCl$_2$ dose-dependent
40+
41+
![image](image_4.png)
42+
43+
[MgCl$_2$]
44+
45+
MgCl$_2$ 4 mM
46+
47+
### 4. Enzymatic activity curve
48+
49+
![image](image_5.png)
50+
51+
nsp14 250 nM + nsp10 750 nM
52+
53+
### 5. Substrate concentration curve
54+
55+
![image](image_6.png)
56+
57+
Substrate concentration 1 µM
58+
59+
### 6. Inhibition Dynasore NO-Cat curve
60+
61+
![image](image_7.png)
62+
63+
IC$_{50}$ = 3.3 µM ± 0.4
64+
65+
---
66+
67+
## CONCLUSIONS
68+
69+
Optimization of the biochemical assay of the enzyme nsp14-10 allowed the development of a sensitive, reproducible, and effective method to study the activity of this enzyme complex. A compound known in the literature as an inhibitor of the nsp14-10 complex was used [2]. This result represents an important step in furthering the biochemical characterization of nsp14-10 and facilitating future screening activities for potential inhibitors, with possible implications in the development of new antiviral strategies.
70+
71+
---
72+
73+
## ACKNOWLEDGMENTS
74+
75+
This research was supported by EU funding within the NextGenerationEU-MUR PNRR Extended Partnership initiative on Emerging Infectious Diseases (Project no. PE00000007, INF-ACT), spoke 5. AVITHRAPID: Antiviral Therapeutics for Rapid Response Against Pandemic Infectious Diseases” project n. 101137192 - HORIZON-HLTH-2023-DISEASE-03, finanziato nell’ambito del programma HORIZON EUROPE - CUP F23C23000820006.
76+
77+
---
78+
79+
## REFERENCES
80+
81+
[1] Rona G, Zeke A et al. The NSP14/NSP10 RNA repair complex as a Pan-coronavirus therapeutic target. Cell Death Differ. 2022 Feb;29(2):285-292. [2] Asthana, A.; Corona, A.; et al. Analogs of the Catechol Derivative Dynasore Inhibit HIV-1 Ribonuclease H, SARS-CoV-2 nsp14 Exoribonuclease, and Virus Replication. *Viruses* 2023, 15, 1539.
82+
83+
---
84+
85+
![image](image_8.png)
86+
87+
Finanziato dall'Unione europea NextGenerationEU
88+
89+
Ministero dell'Università e della Ricerca
90+
91+
Italiadomani
92+
93+
Fondazione INF-ACT
94+
95+
AVITHRAPID PROJECT

0 commit comments

Comments
 (0)