vision-sft
Fungsinya
Tool ini melatih model AI agar bisa memahami gambar dan teks sekaligus. Tool ini melakukan fine-tuning pada model sehingga model bisa menjalankan tugas tertentu yang melibatkan keduanya, seperti mendeskripsikan gambar atau menjawab pertanyaan tentang gambar tersebut.
Kapan dipakai
- βSaat Anda ingin AI mendeskripsikan gambar dengan lebih detail.
- βSaat Anda ingin AI menjawab pertanyaan tentang isi sebuah gambar.
- βSaat Anda ingin menyesuaikan AI agar memahami jenis gambar tertentu (misalnya hasil scan medis, diagram).
Link skill
https://github.com/wshobson/agents/blob/main/plugins/llm-finetuning/skills/vision-sft/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βFine-tune model ini agar bisa memahami gambar X-ray dan menjawab pertanyaan tentang gambar tersebut.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Tool ini menyesuaikan bagian-bagian tertentu dari model AI yang memproses gambar dan teks. Tool ini memakai metode bernama LoRA untuk melakukan perubahan tersebut secara efisien, sehingga sebagian besar model asli tetap utuh.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Vision-Language SFT
This skill assumes finetuning-method-selection
already routed here: the data shape is
image+text demonstrations, not preference pairs
or a verifiable reward signal, and the base is a
vision-language model rather than a text-only
one. lora-qlora-recipes covers the text-only
LoRA/QLoRA recipe this skill specializes for the
vision tower and projector; read that skill first
if the LoRA fundamentals (rank, alpha, target
modules) aren't already familiar.
Input: an image+text dataset and a VLM base
model already picked from the model catalog.
Output format: a validated adapter config β
which components are frozen, LoRA target modules,
and a min_pixels/max_pixels budget β that
llm-finetuning-training-engineer consumes
directly when it generates a runnable script.
Quick Reference
| Situation | Default |
|---|---|
| Adapting behavior on familiar images | Frozen tower+projector, LoRA r=8β16, Ξ±=16β32 |
| Visual domain shift | Unfreeze last-6 ViT layers, vision LR 5β10x lower |
| Doesn't fit in bf16 at target rank | QLoRA β frozen vision tower only |
fast_inference=True |
finetune_vision_layers=False |
| Loss normal, eval not improving | Check the Two Silent Killers below first |
The Consensus Recipe
Freeze the vision tower and the projector. Put
LoRA on the LLM only, all-linear (the same
attention + MLP target list as text-only SFT β
see lora-qlora-recipes), at r=8β16,
Ξ±=16β32. This is the settled default for
adapting a VLM's behavior without disturbing how
it sees.
- The vision tower and projector stay frozen by default. They already encode a general visual representation; retraining them is rarely necessary and adds risk without adding capability for most tasks.
- LoRA rank runs lower than the text-only general default (r=8β16 here vs r=16β32 for text-only SFT) because the LLM-only adapter is adapting behavior, not injecting new visual knowledge.
- QLoRA is permitted only with a frozen vision tower. Quantizing the base while also unfreezing and training vision layers is unsupported and unstable β treat this as a hard pairing rule, not a tunable. If the vision tower needs to unfreeze, drop QLoRA and use bf16 LoRA instead.
# freeze tower + projector; LoRA on LLM only
for name, param in model.named_parameters():
if "vision_tower" in name or "projector" in name:
param.requires_grad = False
target_modules = [
"q_proj", "k_proj", "v_proj", "o_proj",
"gate_proj", "up_proj", "down_proj",
] # LLM-only, all-linear β r=8-16, alpha=16-32
When to Unfreeze
Unfreezing vision layers is a deliberate escalation, not a default decision β reach for it only when the domain shift is visual, not textual.
- Unfreeze only for visual domain shift. If the task is teaching new behavior on images the tower already understands (charts, everyday photos), the frozen-tower recipe above is sufficient. Unfreeze when the visual domain itself is unfamiliar to the tower β satellite imagery, medical scans, dense technical diagrams β and the frozen-tower recipe plateaus.
- Last-6 ViT layers is the sweet spot. Unfreezing the final six vision-transformer layers (not the whole tower) measured +1.7pt DocVQA at ~1.75x training cost over the frozen baseline. Treat six layers as the ceiling worth paying for; going further spends compute without a matched result.
- Vision LR must run 5β10x lower than the LLM LR when unfrozen. The vision tower's pretrained representation is more fragile than the LLM's adapter; the same LR for both risks overwriting the visual representation faster than the LLM adapter can compensate.
- High LoRA rank on the patch- embedding layer risks NaN. If patch embedding is in the unfrozen set, keep its rank low and watch early-step loss closely β one of the most fragile places to apply LoRA in a VLM.
The Two Silent Killers
Both produce a run that trains without error and without learning: the loss curve looks normal, the model doesn't improve, and neither throws an exception β both need an explicit pre-training check, not just a clean training log.
- Image-tag/count mismatch. Every image placeholder token in the templated text must map 1:1 to a media item actually passed to the collator. A mismatch (one placeholder, zero or two images attached; or an image with no placeholder) doesn't error in most collators β
β¦
Pertanyaan umum
Apa artinya 'membekukan' (freeze) bagian model?
Membekukan berarti bagian tersebut tidak akan diubah selama pelatihan. Ibaratnya, pengetahuan AI tentang cara 'melihat' tetap utuh.
Apa itu LoRA?
LoRA adalah teknik yang memungkinkan fine-tuning model AI tanpa melatih ulang seluruhnya. Teknik ini lebih cepat dan memakai sumber daya lebih sedikit karena hanya berfokus pada 'adaptasi' kecil.
Mengapa ukuran gambar (min_pixels/max_pixels) penting?
Pengaturan ini menentukan resolusi gambar yang bisa diproses model. Pengaturan yang tepat sangat penting agar model bisa melihat detail penting tanpa memakai memori berlebihan atau gagal berjalan.
Detail
Deskripsi asli dari pembuat
Fine-tune vision-language models (VLMs) with supervised learning on image+text data. Use when adapting a VLM to a visual domain or task, configuring frozen-vision-tower LoRA, or debugging a VLM fine-tune that trains without learning.
repo: wshobson/agents
Popularitas
- Bintang GitHub
- 41k
- Peringkat
- #6737
- Lisensi
- MIT
- Diperbarui
- 15/10/2026
Komentar
- β¦
Skill lain dari repositori ini
screen-reader-testing
41kMeminta agent Anda menguji website menggunakan screen reader untuk memastikan website dapat diakses.
wcag-audit-patterns
41kMembantu agent Anda mengaudit aksesibilitas website dan memperbaiki masalah sesuai panduan WCAG.
multi-reviewer-patterns
41kMemungkinkan agent Anda mengoordinasikan code review paralel, menghapus temuan ganda, dan menggabungkan laporan.
parallel-debugging
41kMemungkinkan agent Anda men-debug masalah rumit dengan investigasi paralel dan analisis akar masalah.
Skill serupa
add-model-provider
394kMemungkinkan agent Anda menghubungkan penyedia model AI baru ke OpenClaw dengan perintah pengaturan yang aman, menjaga kunci API tetap di luar teks biasa, dan menjalankan uji langsung.
acp-router
394kMembantu agent Anda mengirim tugas ke asisten pemrograman seperti Claude Code atau Cursor lewat OpenClaw, sehingga pekerjaan dijalankan di alat tersebut.
browser-automation
394kMengajari agent Anda mengendalikan halaman web langkah demi langkah, termasuk login, tab, dan pemulihan saat halaman berhenti merespons.