Skip to content

docs(fine_tuning): compare gliclass-v4-edge and laya-multilingual - #38

Merged
rparundekar merged 2 commits into
mainfrom
docs/decision-model-v4-laya-comparison
Nov 15, 2026
Merged

rparundekar merged 2 commits into
mainfrom
docs/decision-model-v4-laya-comparison

Conversation

@rparundekar

Copy link
Copy Markdown
Collaborator

What

README-only change to fine_tuning/fine_tune_a_decision_model:

  • Why few-shot gave all 60 parser rows the same label. It's the instruct model, not the examples or SIE. With no examples it already gives 50 of 60 rows "clean readable text", and the label it favors follows label order: reversed labels send 54 of 60 rows to "document cut off mid-sentence", and with the first label renamed it still wins 59 of 60.
  • The segment-tag fix matches training. gliclass changed the tags on 2026-02-08, and the instruct model came out on 2026-02-17. With the older tags, the instruct model's Banking77 zero-shot drops from 63.3% to 23.3%, so the model learned the current tags and the argmax fix is right.
  • "Try another model" gains two newer decision models, run on the same rows, labels and prompts.

Results (15 November 2026, Apple M-series laptop)

Model Banking77: zero / few / fine-tuned Parser checks: zero / few / fine-tuned Through SIE Local v0.11.1
gliclass-edge-v3.0 (recipe) 67.3 / 57.3* / 93.3 30.0 / 16.7* / 86.7 Same decisions, scores within 0.0001
gliclass-v4-edge 98.0 / 96.7 / 98.0 51.7 / 23.3 / 96.7 Loads only after a tokenizer fix; same decisions, scores up to 0.26 apart
laya-multilingual 82.0 / n/a / 94.7 36.7 / n/a / 85.0 Same decisions, scores within 0.0001

* few-shot uses gliclass-instruct-edge-v1.0.

SIE v0.11.1 has two problems with v4-edge:

  • The model doesn't load as shipped. Its tokenizer stores extra_special_tokens as a list, and the image's transformers 4.57.6 expects a dict.
  • SIE skips v4's calibration step, because the image's gliclass 0.1.17 predates it, so SIE returns uncalibrated scores.

Both are reported to the SIE team with the evidence.

Tested

I ran every number myself. v4-edge used recipe.py's own fine_tune() and decide() with model: swapped and the same rules.yaml settings. Laya used laya.train.finetune() (laya 0.4.33) with the same rows, epochs, batch size and seed. Both fine-tuned models were served from SIE Local v0.11.1-cpu-default with their own weights mounted, and compared row by row with the local run. check_tree.py and pre-commit pass.

🤖 Generated with Claude Code

Explain why few-shot gave every parser row the same label (the instruct
model does it zero-shot too, and the favored label follows label order),
record that the segment-tag fix matches how the instruct model was
trained, and add two newer decision models to "Try another model":
zero-shot, few-shot and fine-tuned on the same rows, and what happened
when SIE Local v0.11.1 served each one's fine-tuned weights.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rparundekar
rparundekar requested a review from a team as a code owner November 15, 2026 17:21
@rparundekar

Copy link
Copy Markdown
Collaborator Author

Self-Review

Diff is one README file, 44 lines, so I reviewed it inline without agents and ran the security pass myself. Every number was checked against the run outputs.

Important (3)

  • [inline] fine_tuning/fine_tune_a_decision_model/README.md:345: the recipe's row in the new table says "Same decisions, scores within 0.0001" through SIE, but its few-shot column doesn't match through SIE (the segment-tag bug, described above). The cell should scope that to zero-shot and fine-tuned.
  • [inline] fine_tuning/fine_tune_a_decision_model/README.md:346: the v4-edge SIE cell reads as covering every mode, but only the fine-tuned weights were served. Zero-shot v4-edge through SIE wasn't run.
  • [inline] fine_tuning/fine_tune_a_decision_model/README.md:353: "Set model: and model_revision: ... and run the recipe as it is" doesn't reproduce the v4-edge few-shot number, which used v4-edge itself as the few-shot model. The reader also needs few_shot.model and few_shot.model_revision.

Suggestions (2)

  • [inline] fine_tuning/fine_tune_a_decision_model/README.md:359: scoring range says 260 to 650 ms; v4-edge zero-shot measured 234 ms a row, so 230 to 650 ms.
  • [inline] fine_tuning/fine_tune_a_decision_model/README.md:376: the Laya serve config swapped weights_path for both hf_id and hf_revision, as the recipe's own configs describe it.

Strengths

  • Every figure traces to a run: the segment-tag experiment, the label-order runs, v4-edge and Laya fine-tunes, and both SIE Local comparisons.
  • Limits are stated where they apply: Laya's 92 training rows and calibration warning, v4-edge's size and speed, and the SIE score gap.
  • Security: README only, no credentials, hosts or personal data. NO FINDINGS.

Generated using wayfare.

- Scope the recipe row's SIE cell to zero-shot and fine-tuned
- Say only the fine-tuned v4-edge weights were served through SIE
- Tell readers to set few_shot.model too for v4-edge's few-shot number
- Correct the v4-edge scoring range and the Laya config keys swapped

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rparundekar

Copy link
Copy Markdown
Collaborator Author

Self-Review: Improvements

Important (3 / 3 fixed):

  • fine_tuning/fine_tune_a_decision_model/README.md:345: recipe row's SIE cell covered few-shot too. Fixed: scoped to zero-shot and fine-tuned, with a pointer to the few-shot mismatch above.
  • fine_tuning/fine_tune_a_decision_model/README.md:346: v4-edge SIE cell read as every mode. Fixed: "Fine-tuned only".
  • fine_tuning/fine_tune_a_decision_model/README.md:353: reproduction steps missed the few-shot model. Fixed: added few_shot.model and few_shot.model_revision.

Suggestions (2 / 2 fixed):

  • fine_tuning/fine_tune_a_decision_model/README.md:360: scoring range. Fixed: 230 to 650 ms.
  • fine_tuning/fine_tune_a_decision_model/README.md:377: Laya config keys. Fixed: hf_id and hf_revision.

Commits: 5f47a9b


Generated using wayfare.

@rparundekar
rparundekar merged commit cff8cd9 into main Nov 15, 2026
50 checks passed
@rparundekar
rparundekar deleted the docs/decision-model-v4-laya-comparison branch November 15, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant