GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - JoeStrout/miniscript-code-helper: a project to fine-tune (via SFT and RL) an LLM to help with the MiniScript programming language

BranchesTags
Open more actions menu

Latest commit

 

History

15 Commits
15 Commits

Folders and files

NameName
Last commit message
Last commit date
RAG_sources
RAG_sources
 
 
.gitignore
.gitignore
 
 
DEV_LOG.md
DEV_LOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
inference_rag.py
inference_rag.py
 
 
inference_sft.py
inference_sft.py
 
 
prepare_data.py
prepare_data.py
 
 
qa_corpus.md
qa_corpus.md
 
 
test_model.py
test_model.py
 
 
train_data.jsonl
train_data.jsonl
 
 
train_sft.py
train_sft.py
 
 

Repository files navigation

miniscript-code-helper

a project to fine-tune (via SFT and RL) and RAG-ify an LLM to help with the MiniScript programming language

Quick Start (without RAG)

  1. Run prepare_data.py to convert the Q&A data in qa_corpus.md into train_data.jsonl.
  2. Run train_sft.py to train a QLoRA adapter. It will be saved to ./sft_output/final/.
  3. Run inference using the adapter via inference_sft.py.

Adding RAG

I find the fine-tuning helps, but only so much; the model does much better with the addition of RAG (retrieval-augmented generation). For that these additional steps are needed:

  1. Run prepare_data.py to prepare the Chroma vector DB.
  2. Run inference with inference_rag.py (instead of inference_sft).

Training Setup

Key details about the training setup:

  ┌────────────────────────┬───────────────────────────────┬───────────────────────────────────────────────────┐
  │        Setting         │             Value             │                        Why                        │
  ├────────────────────────┼───────────────────────────────┼───────────────────────────────────────────────────┤
  │ Quantization           │ 4-bit NF4 (QLoRA)             │ Base model uses ~4 GB VRAM instead of ~14 GB      │
  ├────────────────────────┼───────────────────────────────┼───────────────────────────────────────────────────┤
  │ LoRA rank              │ 16                            │ Good balance of capacity vs. efficiency           │
  ├────────────────────────┼───────────────────────────────┼───────────────────────────────────────────────────┤
  │ LoRA targets           │ q/k/v/o attention projections │ Where most task-specific learning happens         │
  ├────────────────────────┼───────────────────────────────┼───────────────────────────────────────────────────┤
  │ Effective batch size   │ 4 (1 × 4 accumulation)        │ Small dataset, don't need large batches           │
  ├────────────────────────┼───────────────────────────────┼───────────────────────────────────────────────────┤
  │ Learning rate          │ 2e-4 with cosine decay        │ Standard for QLoRA                                │
  ├────────────────────────┼───────────────────────────────┼───────────────────────────────────────────────────┤
  │ Epochs                 │ 3                             │ Conservative — increase if loss is still dropping │
  ├────────────────────────┼───────────────────────────────┼───────────────────────────────────────────────────┤
  │ Gradient checkpointing │ On                            │ Saves VRAM during training                        │
  └────────────────────────┴───────────────────────────────┴───────────────────────────────────────────────────┘

About

a project to fine-tune (via SFT and RL) an LLM to help with the MiniScript programming language

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.