MiniCPM-V-4.7-1B, weekly-analyst (LoRA lora3 and an earlier weight edit)

Which file to use: MiniCPM-V-4_7-1B-weekly-analyst-lora3-F16.gguf (2026-11-12, round 2). The official f16 GGUF plus a merged rank-8 LoRA delta on every down_proj (all other tensors identical), trained on many more instruction wordings, including ones that name no JSON field. Scored once on fresh synthetic seeds 400 to 439, greedy, no JSON grammar: plans 80/80, drafts 80/80, and 40/40 on each of six variants, including two held-out wordings (reword_b, no field names; reword_c). The unedited model scored 65/80, 0/80 and 0/40 on every variant. Wilson 95% lower bounds are about 0.95 for 80/80 and 0.91 for 40/40. A llama-cpp-python 0.3.36 check on other unspent seeds gave plans 24/24, drafts 24/24 and 8/8 under reword_b (official file: drafts 0/8). The merged delta is lora3_dw_fp16.pt (24 layers, fp16, scale 1). The Space runs this file.

Limits: every task comes from one synthetic generator, so the scores say little about other data. A first real-data test (the UCI Online Retail sheet, about 540,000 invoice rows, T4, model output unconstrained) gave a valid plan and draft each time. The pipeline halted on all three weeks until we fixed a bug in our own number check (it showed a segment's contribution while the check recomputes the segment's own change, and it refuses segments under 30 rows); after the fix it produced a full report for 3 of 3 weeks. A second real workbook (UCI Online Retail II, 525,461 invoice lines) produced a full report for 4 of 4 weeks after we fixed three more bugs in our own code (none in the model); the headline numbers of one report were recomputed from the CSV and matched. Two datasets, one run per week, not a quality score. The draft text is formulaic. No general-capability regression check has been run on the LoRA.

Earlier file (round 1, superseded): MiniCPM-V-4_7-1B-weekly-analyst-lora-F16.gguf. The same recipe with 2 epochs and fewer wordings. On seeds 300 to 339 it scored plans 80/80 and drafts 80/80 (unedited 65/80 and 0/80) but failed an instruction that does not name the JSON fields (0/40); round 2 fixed that. It stays in the repo, and the Space no longer runs it. model.safetensors and patch.npz carry the older, smaller 16,384-value plan edit described below, not either LoRA. Details are in the two updates at the end and under Limits.

A small rank-8 LoRA (lora3) that took a 1B on-device agent from 65 to 80 correct tool plans out of 80 and from 0 to 80 correct drafts out of 80 without a grammar, on held-out synthetic tasks. It is the official MiniCPM-V 4.7 1B f16 GGUF plus a merged LoRA delta on every down_proj; every other tensor is identical. It is one piece of Weekly Analyst, an agent that watches a weekly CSV and writes a stakeholder PDF only when something material changed (live demo: Space). It was made for that one job, the plan and draft steps. It is not a general-purpose improvement and has not been tested on anything else except the checks on this card.

Round 2 benchmark (scored once, 2026-11-12)

Greedy, no JSON grammar, 80 plan and draft tasks, 40 per variant. Wilson 95% lower bounds: about 0.95 for 80/80 and 0.91 for 40/40. reword_b and reword_c were never trained on.

Plans Drafts Renamed data Repair line One item Reword Reword b (no field names) Reword c
Base model (seeds 400-439) 65/80 0/80 0/40 0/40 0/40 0/40 0/40 0/40
First LoRA (2 epochs; seeds 300-339) 80/80 80/80 40/40 40/40 40/40 0/40 not scored not scored
lora3 (4 epochs, more wordings; seeds 400-439) 80/80 80/80 40/40 40/40 40/40 40/40 40/40 40/40

Earlier work, kept for the record (superseded by lora3)

The sections from here to "Files and use" describe the first model in this repo: a 66 KB, training-free edit of 16,384 values in two MLP layers that took plans from 64/80 to 80/80 (a random edit of the same size did nothing) but left drafts at 0/80 without a grammar. The LoRA above fixes both, and the Space no longer runs the edit. The Space can still apply it with WEEKLY_ANALYST_LORA=0.

What was changed (the first edit, superseded)

Only 16,384 values, in the MLP down projection (model.language_model.layers.{15,19}.mlp.down_proj): 8 columns per layer, 1,024 values each. Everything else is unchanged from the base model: the edit touches only those two tensors, and the patched official f16 GGUF was verified to equal this repo's converted GGUF exactly on both edited tensors (difference 0.0). The other tensors were not compared against the converted file.

How the edit was found, with no gradient training:

  1. Direction: for each layer, the variance-scaled mean over 48 pairs of (mean residual activation of the model's failing output minus that of a correct output built by code), on the agent's own plan and draft prompts. Calibration seeds 0 to 19.
  2. Columns: MLP columns ranked by how much they push along that direction (direction dot column, times mean activation); the top 8 per layer with positive attribution were edited.
  3. Edit: for each selected column w, w <- w - alpha * d * (d . w) with alpha = 6 (this flips the component along the direction instead of removing it).
  4. Layers 15 and 19, 8 columns and alpha 6 were chosen on separate dev seeds (20 to 39) from about 15 configurations, by the rule "fewest changed values among the configs that reach the best dev score". The method follows SWEET (arXiv 2611.10974) and the loop-direction edit of Takehi et al., "Sparks of Weight-Space Programming".

The edit is stored as a sparse patch in patch.npz (keys L{layer}_cols, L{layer}_vals) and described in edit.json.

Measured results (the first edit)

Held-out set: 80 synthetic plan tasks (and the matching drafts) from seeds 100 to 139, never used to choose the edit. The prompts are the agent's real plan and draft prompts. Greedy decoding, no grammar.

Model Plans passing Drafts passing
Base 64/80 0/80
This edit 80/80 0/80
Random direction, same size 64/80 0/80

A plan passes when it is valid JSON, matches the schema, uses only metrics, columns and periods that exist, and has a step for every item. All 16 base failures were missing items. The random-direction control shows that the specific direction matters, not just any edit of this size. Raw numbers: results/wsp-holdout-final.json and results/wsp-dev-sweep.json in the GitHub repo.

A narrative check on 100 InsightBench cases (write a summary from the planted insights, ROUGE-L against the reference summary) did not move: 0.1305 base, 0.1309 edited. ROUGE-L is a weak measure; read it only as "no sign of damage".

Second edit, for drafts (measured 2026-11-11, not in this repo's weights)

The edit above fixes plans, not drafts. Drafts scored 0/80 without a grammar because the draft prompt never shows the schema. Adding a residual direction or flipping one (the method above) stayed at 0/40 dev drafts in every setting. A closed-form MEMIT-style update of down_proj in layers 16, 17, 18, 20, 21, 22 (chosen from one WeightWatcher run with alpha above 9; its documentation calls alpha above 8 spurious, so this layer choice is not validated), fitted at the structural JSON positions where the model's top token is wrong, changed that:

Model (80 tasks, no grammar) Plans Drafts
Base, seeds 100-139 64/80 0/80
Second edit alone, seeds 100-139 66/80 80/80
Base, fresh seeds 200-239 62/80 0/80
Second edit plus the first edit, fresh seeds 200-239 80/80 75/80
Random shift targets, same norm, fresh seeds 62/80 0/80

It changes about 2.6% of those matrices' norm (dense; a rank-8 version, about 221,000 values, scored 73/80 drafts on the fresh seeds). The seed 100-139 numbers are optimistic because variants were compared there. These weights are not applied to the GGUF the Space runs. Writing the schema into the prompt makes the unedited model pass dev drafts 40/40, so this edit matters only without a grammar. Out-of-distribution check (fresh seeds, 40 tasks each, drafts): original prompt 40/40, one item 40/40, renamed metrics 40/40, re-request line appended 32/40, instruction reworded 0/40. The edit overfits the instruction wording and is not a general fix; refitting on the model's own samples (on-policy) failed. No GGUF of this edit is in this repo. Full account: results/wsp-draft-edit.md in the GitHub repo.

Problems we hit, and what fixed them

Problem What we did
A plain edit (alpha 1) did nothing: plans stayed at 36/40 on dev Searched strength and width on dev seeds. Alpha 3 to 6 on a few columns worked, matching the sparse-edit literature.
Wide or strong edits broke the model (all layers, 64 columns, alpha 2: 0/40 valid plans) Kept the edit narrow (2 layers, 8 columns) and picked the smallest config that reached the best dev score.
Dev scores were chosen from about 15 configs, so they are optimistic One run on 80 held-out tasks, with the unedited model and a same-size random-direction edit as controls.
Without a grammar the model writes the wrong draft structure (0/80) Found the cause by printing raw outputs: the draft prompt never contains the schema, so the base model invents keys. The 16,384-value edit above does not fix this. A separate MEMIT-style edit (see "Second edit") does on synthetic tasks. Production decodes under a JSON grammar, where drafts already passed 80/80.
The converted edited GGUF would not load in llama-cpp-python 0.3.36 (newer converter than runtime) Applied the patch to the official f16 GGUF instead and checked it equals the converted file on both edited tensors.
Colab VMs died during long runs and lost results twice Detached jobs that push every result to a private Hugging Face dataset.

Limits

  • The tasks are synthetic and come from the same generator as the dev tasks (different seeds). One greedy run each.
  • The agent normally decodes under a JSON grammar with retries, so the gain there is probably smaller. Drafts were already valid under the grammar. The first (16,384-value) edit does not make drafts valid without a grammar; the LoRA does (80/80 on held-out seeds).
  • Each LoRA was scored once on 80 tasks (40 per variant), one run, synthetic data only. The first LoRA failed an instruction that does not name the JSON fields (0/40): the model copied the direction key from the evidence instead of writing so_what and metric_refs. Round 2 (lora3) fixed it by training on more wordings (40/40 on two held-out wordings). A larger closed-form edit fixed that wording on a dev set but dropped the plan step to 12/40, so it was not used.
  • The free-SQL score (21 of 30 under a grammar, bar 24) was measured on the unedited model and not re-measured with the LoRA.
  • Real-data and capability checks are thin: one real dataset (above), no general-capability regression check of the LoRA.
  • Stronger or wider edits broke the model (for example all 24 layers, 64 columns, alpha 2 gave 0/40 valid plans). The working window is narrow.
  • Edits can unmask an ability but not add one. Do not expect gains on tasks unlike the agent's. Out-of-distribution results for the second edit are listed above: it fails on a reworded instruction.
  • Not evaluated: general benchmarks (IFEval, MMLU and so on), vision inputs, long contexts.

Files and use

  • MiniCPM-V-4_7-1B-weekly-analyst-lora3-F16.gguf (2.02 GB, recommended) with lora3_dw_fp16.pt (its delta, same layout as below, scale 1.0): round 2, see the top of this card.
  • MiniCPM-V-4_7-1B-weekly-analyst-lora-F16.gguf (2.02 GB, round 1, superseded): the official f16 GGUF with the merged LoRA delta added to blk.N.ffn_down.weight for all 24 layers; every other tensor equals the official file (checked). Loads in llama-cpp-python 0.3.36. On Colab the CUDA wheel of llama-cpp-python needs libcudart.so.12; installing nvidia-cuda-runtime-cu12 and nvidia-cublas-cu12 and preloading them with ctypes fixed it.
  • lora_dw_fp16.pt: the round 1 merged LoRA delta alone, a dict {layer index: tensor [1024, 3584] fp16} for model.language_model.layers.N.mlp.down_proj.weight, scale 1.0 (add it to the official weights).
  • model.safetensors (float16) with config and tokenizer: the older 16,384-value plan edit, not the LoRA. Load with transformers 5.x, AutoModelForImageTextToText, and the tokenizer's chat template.
  • patch.npz and edit.json: the edit alone. To get an edited GGUF, apply the patch to the official f16 GGUF (openbmb/MiniCPM-V-4.7-1B-gguf, MiniCPM-V-4_7-1B-F16.gguf) with apply_patch from src/weekly_analyst/analysis/weight_patch.py in the GitHub repo. This was verified to equal the converted edited file exactly, and the real agent ran on it end to end in llama.cpp.
  • MiniCPM-V-4_7-1B-edited-F16.gguf: converted with a recent llama.cpp. It did not load in llama-cpp-python 0.3.36 (the version used by the agent). Use it only with a newer llama.cpp, or use the patch route above.
import torch
from transformers import AutoModelForImageTextToText, AutoTokenizer
repo = "ewin-reg/MiniCPM-V-4.7-1B-weekly-analyst-edit"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForImageTextToText.from_pretrained(repo, dtype=torch.float16, device_map="auto")

No quantized variants are provided on purpose (full precision only).

Update 2026-11-11: LoRA GGUF, held-out protocol and results

MiniCPM-V-4_7-1B-weekly-analyst-lora-F16.gguf is the official f16 GGUF plus a merged LoRA delta (rank 8 on every down_proj, 2 epochs; lora_dw_fp16.pt is the delta). Scored once on never-touched synthetic seeds (safetensors, no grammar): plans 80/80 (base 65/80), drafts 80/80 (base 0/80), and 40/40 on renamed data, an appended repair line and a one-item prompt. That LoRA failed an instruction that omits the JSON field names (0/40): the model copied the direction key from the evidence; round 2 fixed it. Checked in llama.cpp 0.3.36 on a T4 (24 tuning-data tasks, so it shows the GGUF matches the safetensors result): LoRA GGUF 24/24 plans and 24/24 drafts, official GGUF 4/8 and 0/8. The Space ran this file until 2026-11-12, when it switched to lora3. A gradient-free closed-form edit at a larger scale fixes the no-field-name wording on dev but drops plans to 12/40, so it is not used. The older MiniCPM-V-4_7-1B-edited-F16.gguf and patch.npz remain. Details: results/tune-score-lora.md in https://github.com/GPA-N/weekly-analyst.

Update 2026-11-12: round 2 (lora3) and a real-data test

Same recipe (rank 8, alpha 8, every down_proj, lr 2e-4), more data: 12 composed training wordings that name no JSON field, then 8 synonym wordings for the action field after a raw-output check showed the model writing recommended_step under a wording that said "a recommended step". 4 epochs, resumed from the previous adapter each time, epoch chosen on dev (dev wordings written in the same session as the training ones, so dev is optimistic). Scored once on seeds 400 to 439: see the top of this card. A gradient-free LP edit and a sparse-rewiring stage were written but not run, because the LoRA already passed. Full numbers, protocol and the real-data bug fix: results/tune-score-lora.md in https://github.com/GPA-N/weekly-analyst.

Downloads last month
557
Safetensors
Model size
2B params
Tensor type
F16
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for ewin-reg/MiniCPM-V-4.7-1B-weekly-analyst-edit

Adapter
(6)
this model

Space using ewin-reg/MiniCPM-V-4.7-1B-weekly-analyst-edit 1